LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data streaming from 2 x cDAQ modules into TDMS file

Good morning,

 

I do apologize if this post is noob but I just recently started using Labview and got some issues. Tried to find the solution myself but stuck for a while now.

 

The application I am trying to build is very simple:

  • 2 x NI9221 modules with individual USB chassis cDAQ-9171
  • I need to read 16 voltage reading at the same time at 20Hz rate (every 50ms)
  • Result should be presented on Waveform chart (with simple zoom, pause function).
  • Measurement result should be recorded to the file for future review with e.g. DAQExpress software (one file every 24h).
  • All HW settings/input names are read from config file.

I have attached my Labview VI and example of the config code.

 

In general the code seems reading all the values, representing them as I want but I am struggling with saving data to file. I can easily save to LVM file but I want to be able to open measurement result with DAQExpress therefore I am trying to use TDMS.

 

Problems / Questions I have:

  • As I am using 2 separate chassis I found that I cannot use one DAQ task to read all 16 inputs, is there any way to synchronize them and put all 16 inputs under one DAQ task?
  • My TDMS file is growing fast, I believe it is because I am writing to it every 50ms, however I am not sure is there is any way to enable buffering with Write Meas File.VI or I need to use simple TDMS streaming VIs?
  • When data is recorded to TDMS, I can open on DAQExpress but scan rate is recognised as 1Hz rather 20Hz. I am not able to find solution how to set the scanrate when data is recorded to TDMS.
  • Currently I am reading the data as Waveform, is there any more efficient way, e.g. read the data as RAW data and then form array in the code?

Thank you for looking and I would really appreciate any comments.

 

Best regards,

 

Darijus

 

0 Kudos
Message 1 of 4
(2,372 Views)

Sorry, unable to attach cfg file, file content is here:

 

[General]
SystemID=TEST
Title=Monitoring system
[Mod1_Ch0]
Address=cDAQ1Mod1/ai0
Name=Imp1
[Mod1_Ch1]
Address=cDAQ1Mod1/ai1
Name=Imp2
[Mod1_Ch2]
Address=cDAQ1Mod1/ai2
Name=Imp3
[Mod1_Ch3]
Address=cDAQ1Mod1/ai3
Name=Imp4
[Mod1_Ch4]
Address=cDAQ1Mod1/ai4
Name=Imp5
[Mod1_Ch5]
Address=cDAQ1Mod1/ai5
Name=Imp6
[Mod1_Ch6]
Address=cDAQ1Mod1/ai6
Name=Imp7
[Mod1_Ch7]
Address=cDAQ1Mod1/ai7
Name=Imp8
[Mod2_Ch0]
Address=cDAQ2Mod1/ai0
Name=Imp9
[Mod2_Ch1]
Address=cDAQ2Mod1/ai1
Name=Imp10
[Mod2_Ch2]
Address=cDAQ2Mod1/ai2
Name=Imp11
[Mod2_Ch3]
Address=cDAQ2Mod1/ai3
Name=Imp12
[Mod2_Ch4]
Address=cDAQ2Mod1/ai4
Name=Imp13
[Mod2_Ch5]
Address=cDAQ2Mod1/ai5
Name=Imp14
[Mod2_Ch6]
Address=cDAQ2Mod1/ai6
Name=Imp15
[Mod2_Ch7]
Address=cDAQ2Mod1/ai7
Name=Imp16

 

 

0 Kudos
Message 2 of 4
(2,370 Views)

Hey Darijus, 

 

There isn't an option for synchronising across 2 cDAQ-9171 chassis. Chassis are normally synched through sharing the clock and trigger signals:

  • BNC/SMB connectors (not available on the cDAQ-9171)
  • Use a time aware chassis (only on chassis like cDAQ-9185/9) 
  • Using the NI 9469 or digital module (but we only have one slot) 

Check Synchronizing Analog Input C Series Modules with NI-DAQmx in LabVIEW: MultiChassis Tasks

 

If you need synchronised measurements you'd probably be best looking into getting a 4 or 8 slot chassis. Is synchronisation critical? 

 

0 Kudos
Message 3 of 4
(2,324 Views)

Hi Rebecca,

 

I do not necessarily need synchronisation. Software timestamp when data is being recorded on the file is more than sufficient for my needs.

 

Regards,

 

Darijus 

0 Kudos
Message 4 of 4
(2,313 Views)