From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
03-16-2017 05:42 PM
I need to acquire data from 5 ni pxi-e 6368 cards (ni pxie-1078 chassis), each set at different sampling rates and each card in one task. Is it best to acquire data from each card in the same while loop, 1 while loop per card, or any other way?
is there any examples or info that talks directly about this? ( haven't found any. maybe not searching the correct keywords)
I'll appreciate any help.
03-16-2017 07:01 PM
What all are you doing with the data?
My initial reaction would be to have them in separate loops. But if you get the same time's worth of data from all of the tasks, it might be easier to keep it in a single loop. But it really depends on what you are doing with the data.
03-16-2017 08:20 PM
I do something similar, except with only two cards (6281). I tried a single loop, but it was a mess and inflexible (limited to cross card sample rate compatibility etc..). So I went to a re-entrant generic acquisition loop vi that I call for each card from a JKI state machine (modified for use on labview RT). The reentrant vi is its own logger. Reads the card buffer when data is available and stores to separate tdms files (one for each card).
the design really cleaned things up for me. I use a common notifier passed into the vi instances to control them (stop mostly) and a status notifier so I can see what they are doing.
For my needs, the card tasks are synchronized to a common pxi trigger to kick them off, a common refclk (the pxi backplane 10mhz), but they use their own sample clocks. That way, if I want synchronous sampling (ex.. 1khz on card 1, 10khz on card 2) it's guaranteed to be locked at 1:10 exactly.
I generate a separate index tdms file which records channels, sample start and stop, data type, and tdms file names since my loop can span tdms files for essentially infinite record times (labview RT limits to 2Gb file sizes). I don't use the built in daqmx spanning because I needed more control over the format and when to record or pause sampling. I wanted to sample continuously to preview the data, but only record samples after a second trigger. A pain to be sure, but it's working well now. The index is a godsend for post processing since it allows me to quickly dive into the hundreds of files in a random access approach.
Hope that helps?
03-17-2017 10:01 AM - edited 03-17-2017 10:07 AM
To answer the first question:
the data will be saved is a TDMS File and viewed in DIAdem.
I have a feeling that the Reentrant VI will be the solution so I am going to look into that.
03-17-2017 10:05 AM
@A.Ramirez wrote:
the data will be saved is a TDMS File and viewed in DIAdem.
I single TDMS file or one per task?
My recommendation here is you have a loop for each task and then another loop for the logging. Then each task uses the same queue to send the data to the logging loop. Part of the data type of the queue should be what group to put the data into. So the final result will be a single TDMS file with as many groups as you do tasks. DIAdem can do all kinds of analysis from there.
03-17-2017 10:08 AM
In a single file.
03-17-2017 10:10 AM - edited 03-17-2017 10:23 AM
To merge multiple sample rate data streams into a single TDMS file will require writing your own logging vi (Like crossrulz mentioned). I avoided merging during data acquisition because I do not perform analysis on the data I collect. I post-process the data into useable data (Apply functions and polynomial derivations based on a configuration file). The post processed data (A single merged file) then goes to DiaDem or some exporter gizmo.
03-17-2017 10:14 AM
I see. I will implement this advice and let you know if it works next week.
thanks for the advice.