Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Pb continuous acquisition with external timing

Hello,

I have a problem with continuous data acquisition with DAQ PXI 6281.
I am using an external timing with a clock coming from a moving cart. When the cart is moving, I recover a TTL signal from it which gives the timing to the data acquisition. Acquisition continues as the cart moves forward. I take 1000 samples at each round of the while loop. At each turn of the while loop, I ask the cart if it is moving forward (while (itc4.query('1TS?')=='Q\r\n'):). If it is still progressing, I continue acquiring 1000 additional samples. If not, I stop the acquisition.
The problem is that the engine can stop when the 1000 samples are not yet acquired. And when the engine stops, there is no more clock. I then receive the following message: "SamplesNotYetAvailableError: Some or all of the samples requested have not yet been acquired.
To wait for the samples to become available use a longer read timeout or read later in your program. To make the samples available sooner, increase the sample rate. If your task uses a start trigger, make sure that your start trigger is configured correctly. It is also possible that you configured the task for external timing, and no clock was supplied. If this is the case, supply an external clock."

"
How to get out of the loop when the buffer is not filled?

Thanks in advance

renaud

PS photo of the program attached

 

0 Kudos
Message 1 of 7
(1,267 Views)

Could you please explain more about this "cart" and the significance of "(while (itc4.query('1TS?')=='Q\r\n'):)"?

 

BTW, the image was not attached and please attach the actual VI and not the image. (VI preferred in LV2016 version).

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 7
(1,247 Views)

Thank you for your reply.
Let me explain, I work in photonics. I have an optical interferometer with which I analyze telecom components. One of the mirrors is mobile and placed on an air bearing stage (which I called a cart in my first email) which is driven by newport esp301 driver with USB connection. To make measurements, I need to know the position of this mirror very precisely. So I insert this mobile mirror into another positioning interferometer. When the mirror is translated, the interference fringes of this interferometer vary in front of a detector. And I know that between two shiny fringes, the mirror has moved by lambda/4 or 0.15 micrometer precisely.
I use this interferometric signal as an external clock for my first signal and then know that between each sample, I have a mirror displacement of lambda/4.
So by doing (while (itc4.query('1TS?')=='Q\r\n'):)"?, I ask NewportESP301 if the mirror is moving or not(write(1TS?)) and the device responds Q= moving or P= stopped.
As long as the mirror moves, the measurement continues with the external clock from the interferometer. When the mirror stops, ESP301 responds P but the clock signal also stops.

 

But my program is in python.
In what form do you want a copy?

0 Kudos
Message 3 of 7
(1,242 Views)

Your description now starts to make sense, please attach the py file to your reply.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 4 of 7
(1,236 Views)

Here is

0 Kudos
Message 5 of 7
(1,234 Views)

I'm no real help with the Python syntax, but here's a general approach you could take:

 

When you first get that error, query the DAQmx task for the # samples available.  Then ask to read *that* amount instead of the normal 1000.

 

 

-Kevin P

 

 

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 6 of 7
(1,228 Views)

Thank you very much,

I will try tomorrow

Best regards

Renaud

0 Kudos
Message 7 of 7
(1,209 Views)