LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

random delay between WHILE loop during acquisition from DAQ

I am working with the NI DAQ USB 6259.

My purpose is to acquire data from an analog voltage input. My problem is showed in the attached image and consists in a RANDOM time delay between the execution of two consecutive while loop that contains the acquisition and the writing operations.

If you observe the image attached, you can notice that samples are taken at regular interval (which I can specify) only within one loop, then between the instant of the last sample of one  cycle and the one of the first sample of the next cycle, a random delay occurrs.

I attach also my block diagram which is very simple.

I am forced to use the option "N samples" in the daq assistant because if I use continuous acquisition an error is returned, I guess because my acquisition can last minutes.


It's like I were blind for a random duration between consecutive iterations of the while!

Do you know an alternative solution to avoid this problem or its solution?

Best regard,
Roberto Rodio
Download All
0 Kudos
Message 1 of 5
(3,305 Views)
Have you tried to execute this without the writing to the TDM file?  I suspect that is where your delay is happening... So I propose you delete that from your block diagram... and execute your loop... if that works, you will need to move your file write to somewhere else in the process... possibly a parrallel loop... If not, consider stripping down the express VI you use for your data acquisition... The delay could be in that express... setting up, starting, acquiring and stopping the daq task... In which case, you can right click on it, say open diagram... or open vi or something similiar... LabVIEW will tell you that it must convert the VI, so OK (you can alway undo)... I am not sure what else you have going on... so you may already be doing that... but that is the first two places I would look.

Paul
0 Kudos
Message 2 of 5
(3,290 Views)
 I am quite sure that the problem does not  reside in the writing on file operation, because I put the reading from channel and writing on file into the same loop.

I would be pleased if you could have a look at the block diagram I attach here, which is the one that give exactly the output I showed.

Thanks,
Roberto Rodio
0 Kudos
Message 3 of 5
(3,282 Views)
I think if you wire a boolean constant (False) to the stop input of the DAQ assistant express VI.  It may fix your problem.  Give it a try and let me know.

Message Edited by Stradis on 07-10-2007 08:19 AM


Paul
0 Kudos
Message 4 of 5
(3,274 Views)
Hi Roberto,

"no problem ... because I put the reading from channel and writing on file into the same loop"
Indeed this could be the problem! The file writing may take a while, depending on the function you use... And from your attached pictures we're talking about delays in the 100ms range!

Message Edited by GerdW on 07-10-2007 02:26 PM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 5
(3,267 Views)