JMG Geschrieben December 1, 2021 at 14:04 Geschrieben December 1, 2021 at 14:04 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 Zitieren
photron Geschrieben December 1, 2021 at 14:41 Geschrieben December 1, 2021 at 14:41 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 Zitieren
JMG Geschrieben December 1, 2021 at 14:50 Autor Geschrieben December 1, 2021 at 14:50 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 :) Zitieren
photron Geschrieben December 1, 2021 at 15:16 Geschrieben December 1, 2021 at 15:16 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. Zitieren
JMG Geschrieben December 1, 2021 at 15:21 Autor Geschrieben December 1, 2021 at 15:21 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. Zitieren
photron Geschrieben December 1, 2021 at 15:37 Geschrieben December 1, 2021 at 15:37 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 Zitieren
JMG Geschrieben December 1, 2021 at 15:47 Autor Geschrieben December 1, 2021 at 15:47 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? Zitieren
JMG Geschrieben December 1, 2021 at 15:52 Autor Geschrieben December 1, 2021 at 15:52 I found it out. I had o restart the brick daemon.... Zitieren
JMG Geschrieben December 1, 2021 at 15:57 Autor Geschrieben December 1, 2021 at 15:57 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... Zitieren
photron Geschrieben December 1, 2021 at 16:09 Geschrieben December 1, 2021 at 16:09 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? Zitieren
JMG Geschrieben December 1, 2021 at 16:13 Autor Geschrieben December 1, 2021 at 16:13 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 Zitieren
JMG Geschrieben December 2, 2021 at 14:43 Autor Geschrieben December 2, 2021 at 14:43 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 Zitieren
photron Geschrieben December 2, 2021 at 15:11 Geschrieben December 2, 2021 at 15:11 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. Zitieren
JMG Geschrieben December 2, 2021 at 15:33 Autor Geschrieben December 2, 2021 at 15:33 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 Zitieren
photron Geschrieben December 6, 2021 at 12:56 Geschrieben December 6, 2021 at 12:56 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. Zitieren
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.