LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sync data acquisition for Arduino and cDAQ

Hello,

 

I am using the Labview cDAQ, thermocouple (NI 9214) and digital input (NI 9411) modules, as well as an arduino uno

to read a few signals and do some data processing.  I would like a 0.2-0.5 Hz sampling frequency such that all the data collected is synched to the same timestamp.  I have about 30 thermocouples (2 NI9214 units), 2 TTL signal (approx 1Hz frequency), and the arduino

is acquiring an analog voltage signal.

 

Any examples or guidance would be appreciated.

 

Kind Regards,

 

Anna

0 Kudos
Message 1 of 4
(3,766 Views)

Hello Anna,

 

Just to make sure I understand correctly, you wish you acquire all data (analog, digital, thermocouple) at 0.2-0.5 Hz and have each data point taken along with a timestamp at the same point in time?  In other words, at 0.5 Hz, you will read 30 TC measuremnts, 1 point of each TTL signal, and one point of the analog signal ever 2 seconds, and the associated timestamp for that acquisition?

 

Since the timing is relatively slow, you would likely be able to do this fairly well in software alone.  The following Community Example...

 

https://decibel.ni.com/content/docs/DOC-9543

 

...uses the producer/consumer architecture to collect Analog Waveform data in one loop (you would acquire analog and digital), and then break it out in the consumer loop to write a timestamp (from the waveform) to the first column of a 2D array, and the corresponding data points to the subsequent columns, which you could then write to a file, display in a table, etc.

 

Regards,

National Instruments
Message 2 of 4
(3,744 Views)

Hi Chris,

 

Thanks for the response.  In addition, how do I synch to analog signals that I'm reading in Arduino?

I have the Labview interface for Arduino, but have not used it yet... I downloaded it hoping I can sync

data collection for my cDAQ and Arduino.

 

Thanks,

Anna

0 Kudos
Message 3 of 4
(3,736 Views)

The Arduino toolkit should be formatted similarly to DAQmx in that you will create>>set parameters>>write/read>>close.  For implementing software timing you could read data from both the DAQmx task and the Arduino task at the same time (in the same loop) and pair that with the same timestamp when creating your data array (as in the example I mentioned previously).  I haven't worked extensively with the Arduino toolkit, and don't have one on hand to test, but this should work, I believe.  Bear in mind that this will not be extremely accurate because it is software timing, but will give you a decent synchronization between the acquisition tasks.

 

Regards,

National Instruments
0 Kudos
Message 4 of 4
(3,724 Views)