LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronous AI, AO and DI - Trying again!

Solved!
Go to solution

Hi there,

 

Im using labview 2011, Ni cdaq 9172,  and the modules  9203(A) 9201(V) 9211(temperature) 9263(outputs) 9212(A) 9401(freq). i updated my code but im having a problem the trigger configuration.

0 Kudos
Message 11 of 15
(1,027 Views)

Hello asnaev, 

 

Are you running into an error? If so, please post a screenshot. 

 

Are you trying to synchronize your counter and current tasks? Or are you looking for a reference trigger with pre-trigger samples? Currently, you are using a reference trigger, but not asking for any pre-trigger samples, so it is effectively a start trigger. What is your goal? 

 

If you are just starting with triggers, I would recommend looking at the DAQmx Example vis found in the NI Example Finder under Hardware Input and Output>> DAQmx. 

 

Maggie
National Instruments
Applications Engineer
ni.com/support
0 Kudos
Message 12 of 15
(1,016 Views)

Hello, 

 

I am trying to do synchronous acquisition of several AIs and same number of DIs. AIs are gauge readings, DIs are flags indicating whether the gauge has low or high amplification. (The gauges are switching their range following the actual value, which is changing quite rapidly).

 

I prepared the code below; diagrams show 1) start of acquisition, 2) checking number of samples in buffers, 3) reading samples, 4) stopping the acquisition. However, it does not work: indicated number of samples in buffers remains zero (both for AIs and DIs).

 

The hardware is USB-6341.

 

What is wrong?

 

Thank you.

 

START acquisitionSTART acquisition

 

CHECK number of samplesCHECK number of samples

 

READ samplesREAD samples

 

STOP acquisitionSTOP acquisition

 

0 Kudos
Message 13 of 15
(827 Views)

Nothing jumped out at me in the individual segments.  Are you getting an error, and if so what is the error code and description?

 

I'm inclined to think that your higher level code doesn't call these routines in the right order, or doesn't iterate the check-read pair soon enough after start or frequently enough while running.   That could lead to a buffer overflow error in the tasks, after which the "available samples" for the errored-out tasks will show 0.   But if this theory is right, you should be able to catch that error.

 

But again, the screenshots have the appearance of code that *could* work when called appropriately.  What's your sample rate?  How often do you iterate your check-read cycle? Are you getting task errors?

 

 

-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 14 of 15
(820 Views)

Now, I tried once more. The code runs perfectly on a real device, but not on simulated device... So I just cannot debug on my notebook as I did up to now (I did not have DIs indicating range up to now)...

 

Thank you very much for reviewing the code!

 

 

0 Kudos
Message 15 of 15
(814 Views)