LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

array (Y) is empty when dt = 1 for waveform type

When I acquire data using DAQmx Read (Analog 1D Wfm NChan NSamp version) get short bursts of time where the Y portion of the data type is empty and dt=1.  My DAQmx Read is in a For Loop since multiple tasks are created.  This occurs across all channels for a single task.  Does anyone have an explaination why?

0 Kudos
Message 1 of 7
(2,977 Views)

without seeing any code its tough to tell what may be wrong.  probably a timeout or some other error you are ignoring.


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 7
(2,973 Views)

there are no timeout errors in the DAQmx Read call

0 Kudos
Message 3 of 7
(2,923 Views)

I don't think it throws an error when it times out.  Isn't there another boolean output for timed out?

 

Running DAQmx reads in a parallel for loop strikes me as an awful idea.  What if you remove the parallel?

 

How many samples are you asking the read to return?  If it is set to run as fast as possible there may not be any data for it to return in consecutive loops.

 

If you don't want to fix architecture stuff like that, then you could just filter out the bad data later on.

0 Kudos
Message 4 of 7
(2,915 Views)

Reading multiple tasks in parallel.  And asking for all of the available data (default if not wired in DAQmx Read).  Are you sure all of the tasks triggered?  What do you output if you are in the FALSE case?  How are all of the tasks setup?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 7
(2,909 Views)

Please don't attach poswerpoint images of heavily cropped front panels and indicators without labeling where they are on the diagram. Attach the actual VI!!! Thanks.

 

If the inner FOR loop iterates zero times, you'll get the an empty 2D array containing the default waveform (empty array, dt=1, to=0) at the autoindexing output tunnel. Autoindexing on the outer for loop will turn it into a 3D array of waveforms, all the one's from empty arrays will be dt=1.

What are the sizes of the input arrays on the left? Do you have enough parallel instances configured? What LabVIEW version is this?

Message 6 of 7
(2,898 Views)

I was finally able to enclose some code.

 

The main VI starts a Queue using subVI 'Data IO Module - Obtain Data Queue.vi'  Two other VIs started later also obtain this Queue.  Notice in the subVI it will not be recreated since the main VI has already created it.  One VI (DAQ VI) writes data to the Queue using subVI 'Data IO - Enqueue Data.vi'  (It's the 'Queue for viewing input reference.)  The other VIs (main VI and Window1.vi) read data from the Queue. (.png came from the main VI).  Data is continueously feed to the Queue from the DAQ VI.  If the update rate is fast enough (20 Hz instead of default 10 hz) Window1.vi also shows continueously fed data.  However, the main VI shows data coming in bursts when it should be updating every 100msec.  When there is no data, the array component of Analog waveforms (1D Analog Waveforms.ctl) for the Analog Channel is empty.  What could be causing this?

0 Kudos
Message 7 of 7
(2,832 Views)