LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem with on demand AI read on cDAQ 9189

Solved!
Go to solution

Hello All.

My hardware consists off:

cDAQ 9189

NI 9025

NI 9026

NI 9212

I an experiment in which I need to read 500 AI samples when a user clicks on a button.

my daq setting consist off init for the channels and then reading them with in a loop.

If I continuously read the channels there is no problem.

Then, I placed the AI read vi within a case. so that the channels are read when the user hits the read button.

this where the problems start.

After reading 3-4 times there is a problem and I get the following error:

 

error code: -200279

gil_wizard_test1.vi<append>
<B>Property: </B>RelativeTo
<B>Corresponding Value: </B>Current Read Position
<B>Property: </B>Offset
<B>Corresponding Value: </B>0

<B>Task Name: </B>_unnamedTask<20>

 

I've also tried to use the "finite sample" option, but I get the error -200278.

Thanks for your help!

I have attached my file in  labview 19

Thanks!

 

0 Kudos
Message 1 of 3
(588 Views)
Solution
Accepted by topic author Gil_Maor

1. Place DAQmx Start, DAQmx Read and DAQmx Stop inside the loop.

2. For Finite Sampling, the number of samples input to the DAQmx Timing VI is the total number of samples you want to read.

 

Please note that the approach using finite sampling will have a slight delay (probably around 100ms) between the time user presses the button and the data is acquired, as it takes some time for the cDAQ to start the acquisition. You can minimize the delay by using continuous sampling, then polling the data repeatedly. This might need a different slightly more complicated coding.

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 2 of 3
(550 Views)

Thanks!

0 Kudos
Message 3 of 3
(485 Views)