05-22-2014 11:31 AM
Hi Everyone
I'm currently trying to create a program in C++ which reads data from two NI9222 DAQ cards. So far I've programmed the FPGA in LabView, got my .lvbitx file and C library and managed to create a basic program which reads the data from the FIFO and does absolutely nothing with it.
Currently, at high sample rates one core on the cRio 9068 is maxed out so I'll need to create a program on two separate threads. One thread reads the FIFO and puts data into some buffer array and the other thread removes data from the buffer and performs whatever operation(s) I require- in this case all I'm trying to do is write data to a .wav file on an external drive.
Can anyone give me some advice on how to multi thread on the cRio with C++? I'm currently new to C++ programming, having done most of my work on Java so this is unfamiliar territory. Currently the very basic program I have put together to test threading gets the following error:
c:\program files\national instruments\eclipse\toolchain\gcc-4.4-arm\i386\bin\../lib/gcc/arm-none-linux-gnueabi/4.4.1/../../../../arm-none-linux-gnueabi/include/c++/4.4.1/c++0x_warning.h:31: error: #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.
I don’t know how to or even if I can enable support for C++11? Anyone got advice on what I should be doing here?
Attached is a first unsuccessful stab at running the FIFO read function on a different thread.
Thanks for the help
Solved! Go to Solution.
05-22-2014 11:38 AM
This forum thread should give you what you need: http://www.eclipse.org/forums/index.php/mv/msg/282618/787571/
05-22-2014 11:40 AM
Also, you may want to investigate using pthreads directly instead.
05-23-2014 06:21 AM
Thanks Brad
For future reference here's a copy of the solution to get threads working with a minor alteration:
05-23-2014 06:38 AM