JMG Posted December 1, 2021 at 02:04 PM Share Posted December 1, 2021 at 02:04 PM Hello everyone I recently bought a IMU brick and now I am trieing to run the IMU example (example_all_data.c). I am using VS2010 and when I compile the project I get this error: ip_connection.h(25): fatal error C1083: Cannot open include file: 'stdbool.h': No such file or directory I have renamed the .c extention to .cpp and under advance properties of the project I cahnged the compiler to C++. (Which seemed to be a problem in other threads. However, it is still not compiling). Do you have any suggestion on how to fix my problem? Thanks a lot. Cheers, Jeremy Quote Link to comment Share on other sites More sharing options...
photron Posted December 1, 2021 at 02:41 PM Share Posted December 1, 2021 at 02:41 PM VS2010 doesn't support modern C/C++ standards. It just lacks stdbool.h support. Please add the attached stdbool.h file to the same directory that contains ip_connection.h. stdbool.h Quote Link to comment Share on other sites More sharing options...
JMG Posted December 1, 2021 at 02:50 PM Author Share Posted December 1, 2021 at 02:50 PM Thank you for your reply. I have added this file.. now I am getting these errors: stdbool.h(31): error C2059: syntax error : 'constant' stdbool.h(31): error C3805: 'constant': unexpected token, expected either '}' or a ',' ip_connection.cpp(545): error C2440: 'return' : cannot convert from 'int' to '_Bool' 1> Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast) at different lines in ip_connection.cpp and brick_imu_v2.cpp Can you help here as well? Thank you :) Quote Link to comment Share on other sites More sharing options...
photron Posted December 1, 2021 at 03:16 PM Share Posted December 1, 2021 at 03:16 PM Sorry, I didn't think this through. You're compiling the code as C++. The problem is including stdbool.h there. It should not be included at all for C++ because its a C header. Please remove the stdbool.h file again and change line 24 in ip_connection.h from this #if (!defined __cplusplus && defined __GNUC__) || (defined _MSC_VER && _MSC_VER >= 1600) to this #if !defined __cplusplus && (defined __GNUC__ || (defined _MSC_VER && _MSC_VER >= 1600)) then try again. Quote Link to comment Share on other sites More sharing options...
JMG Posted December 1, 2021 at 03:21 PM Author Share Posted December 1, 2021 at 03:21 PM Thanks I think we are getting closer. Now I recive this error: ip_connection.cpp(2052): error C3861: 'snprintf': identifier not found Is there a dependency missing? Sorry I am not native in C. Quote Link to comment Share on other sites More sharing options...
photron Posted December 1, 2021 at 03:37 PM Share Posted December 1, 2021 at 03:37 PM 10 minutes ago, JMG said: Sorry I am not native in C. Don't worry, the problem is just that MSVC2010 is quite old and has some quirks that you run into now. The C/C++ bindings don't handles those correctly right now. Please add these 3 lines in ip_connection.c at line 55: #if defined _MSC_VER && _MSC_VER < 1900 #define snprintf _snprintf #endif Quote Link to comment Share on other sites More sharing options...
JMG Posted December 1, 2021 at 03:47 PM Author Share Posted December 1, 2021 at 03:47 PM Cool. It compiles now. However, it does not output the data from the cb_all_data function. It only prompts "Press key to exit enter" Do you have any suggestions? Quote Link to comment Share on other sites More sharing options...
JMG Posted December 1, 2021 at 03:52 PM Author Share Posted December 1, 2021 at 03:52 PM I found it out. I had o restart the brick daemon.... Quote Link to comment Share on other sites More sharing options...
JMG Posted December 1, 2021 at 03:57 PM Author Share Posted December 1, 2021 at 03:57 PM I have an additional question. not sure If I should start a new thread. I want to use this IMU on a real time controller from NI. So I am using a Labview Realtime, which does not support .net assambly dlls. This is why I am trying to make it work with c++ and then create a dll out of it. Now I relized I need the daemon and viewer too on the target. Is there a way to make the IMU run independetly from the Daemon executable? I don't think I can install them on the RT controller since it has Pharlap as OS... Quote Link to comment Share on other sites More sharing options...
photron Posted December 1, 2021 at 04:09 PM Share Posted December 1, 2021 at 04:09 PM Brick Viewer is always optional. It is not necessary for using the different API bindings. The different API bindings use a TCP/IP network connection to talk to the Tinkerforge hardware. If the hardware is connected to USB then Brick Daemon is required for the TCP/IP to USB translation. You can replace the USB connection with a Ethernet or WIFI connection by adding a Ethernet or WIFI Master Extension to the stack. Then the API bindings can connect directly to the hardware over Ethernet or WIFI without the need for Brick Daemon. What does you current hardware setup look like? Quote Link to comment Share on other sites More sharing options...
JMG Posted December 1, 2021 at 04:13 PM Author Share Posted December 1, 2021 at 04:13 PM The Controller is this one: https://www.ni.com/de-ch/support/model.pxie-8133.html It has two Ethernet slot of which one is free to use And the IMU Brick 2.0 https://www.tinkerforge.com/en/doc/Hardware/Bricks/IMU_V2_Brick.html#imu-v2-brick Quote Link to comment Share on other sites More sharing options...
JMG Posted December 2, 2021 at 02:43 PM Author Share Posted December 2, 2021 at 02:43 PM Is it possible with my setup to use this: https://www.tinkerforge.com/de/doc/Hardware/Master_Extensions/Ethernet_Extension.html together with the IMU Brick 2.0 and use it directly on my embedded Controller? Thanks for your reply Cheers, Jeremy Quote Link to comment Share on other sites More sharing options...
photron Posted December 2, 2021 at 03:11 PM Share Posted December 2, 2021 at 03:11 PM The IMU Brick 2.0 cannot use an Ethernet Extension directly. You'd need to build a stack (bottom to top) of Master Brick, IMU Brick 2.0 and Ethernet Extension. Then you can connect to this stack over Ethernet. Quote Link to comment Share on other sites More sharing options...
JMG Posted December 2, 2021 at 03:33 PM Author Share Posted December 2, 2021 at 03:33 PM Oke thanks. Just double checking. I need these 3 things in order to make it work, right? https://www.tinkerforge.com/de/shop/master-brick.html https://www.tinkerforge.com/de/doc/Hardware/Master_Extensions/Ethernet_Extension.html https://www.tinkerforge.com/en/doc/Hardware/Bricks/IMU_V2_Brick.html#imu-v2-brick Quote Link to comment Share on other sites More sharing options...
photron Posted December 6, 2021 at 12:56 PM Share Posted December 6, 2021 at 12:56 PM Yes. There are two versions of the Ethernet Master Extension, with and without PoE (Power over Ethernet). The Ethernet Master Extension with PoE allows you to power the stack over the Ethernet cable using a PoE ready switch or a dedicated PoE injector. Resulting in a single cable connecting to the stack. For the Ethernet Master Extension without PoE, you have to power the stack separately for example with a USB power supply connected to the Master Brick. Resulting in two cables running to the stack. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.