LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx USB 6009 trigger

Hello,

I am new to LabView. I am using USB-6009 to recieve signal from two channels (ai0 and ai1) and want to show and read data once the external trigger pulse (PFI0) is on the rising edge. The trigger pulse is a periodic pulse. My old program works well in the old version of LabView (See attached figure). However, in my new program (See attached file), once triggered at the first pulse, the data acquisition process is on and data are scanned since then. I want the data to be scanned every time the external trigger pulse (PFI0) is on the rising edge. It seems to be an easy question, but I cannot figure it out. Any help is appreciated. Thank you.

Download All
0 Kudos
Message 1 of 8
(3,660 Views)

You are configuring the DAQ to acquire data continuously when triggered -- and that is just what its doing. You need to tell it to collect a finite number of samples (100, 1000, 42 - whatever you want) when triggered.

 

Mike...

 

PS: Lose the express VI, it takes up more room than the LV code to do the same thing.


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 8
(3,631 Views)

Hi, Mike,

 

I was trying to use that to acquire 1 sample when triggered. It said:

 

Possible reason(s):

Attempted to read a sample beyond the final sample acquired. The acquisition has stopped, therefore the sample specified by the combination of position and offset will never be available.

Specify a position and offset which selects a sample up to, but not beyond, the final sample acquired. The final sample acquired can be determined by querying the total samples acquired after an acquisition has stopped.

Attempted to Read Sample: 100
Property: RelativeTo
Corresponding Value: Current Read Position
Property: Offset
Corresponding Value: 0

Task Name: _unnamedTask<5>

0 Kudos
Message 3 of 8
(3,581 Views)
Please show your new code. The old program is taking multiple samples. Why are you now taking only one?
0 Kudos
Message 4 of 8
(3,570 Views)

Hi, thanks for your reply.

 

My old program is to acquire one data every time when triggered (the trigger pulse is a periodic one). Yeah, it would acqure 1000 data when the pulse goes on for 1000 times. I just don't know how to achieve that in this new version of LabView. My new code is still in a try. I just want to make a loop over the whole diagram to make it read one data when triggered (looping 1000 times maybe). Is that possible to do that in USB-6009?

0 Kudos
Message 5 of 8
(3,565 Views)
The correct way to do it is set the read to n samples and specify a sample count. I'm assuming you already got rid of the continuous sampling setting.
0 Kudos
Message 6 of 8
(3,561 Views)

Hi,

 

Do I have to make a loop over something? I mean, I need the software to read 1000 samples. But I want those 1000 samples to be read when the hardware gets the corresponding 1000 pulse (rising edge) from the PFI0. It is important and we can adjust the delay of the pulse (we have that box).

0 Kudos
Message 7 of 8
(3,555 Views)

Hi,

 

Maybe it is clear to say that I want 1000 samples based on 1000 trigger pulses (one each pulse) instead of 1000 samples after the first trigger.

0 Kudos
Message 8 of 8
(3,552 Views)