LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I acquire data before the trigger signal?

when I use read/search position (from trigger) and a negative (or positive) number (AI Read function), the trigger no longer works. the program just sits there waiting for the trigger. I am using an anolog start trigger.
0 Kudos
Message 1 of 6
(3,744 Views)
Hi,

There are two ways you do trigger:
1, you can specify trigger parameters at AI Start vi, or
2, you can specify the reading condition at AI read vi

I suggest you use AI start vi to config the trigger, and do not mix them up.
0 Kudos
Message 2 of 6
(3,744 Views)
I have tried only configuring with the AI start vi, but I have not been able to find a way to collect data prior to the start trigger. The only thing that looked like it was the right thing was the "read/search position" terminal on the AI Read vi, but I couldn't get that to work.
0 Kudos
Message 3 of 6
(3,744 Views)
There is a parameter named "pretrigger scans" of the AI start vi, just specify that, and read all the data in the buffer.

Hope this time it will work for you.
0 Kudos
Message 4 of 6
(3,744 Views)
I have tried using this parameter. When I do, any data prior to the trigger is written to file as NaN (not a number). It begins writing this from the time I click the start arrow, and switches to actual data when the trigger occurs. No pretrigger data is collected.
0 Kudos
Message 5 of 6
(3,744 Views)
I thought that my problem may have been that I was running continuous acquisition, so I changed the number of scans to acquire. When I had a finite value for this, and I had a value greater than zero for pretrigger scans, I got an error saying that "The specified trigger signal cannot be assigned to the trigger resource". (10621). I never had this problem when I didn't have any pretrigger scans. Any suggestions?
0 Kudos
Message 6 of 6
(3,744 Views)