01-24-2009 06:35 PM
I'm trying to acquire data at 4000 samples per second from an NI 9201 in which I set a trigger level and "arm" it (similar to a scope) and when a threshold is reached I want to end up with 4000 data points (1 second worth of data), with some pretrigger information.
I only need one analog channel.
My thought was to set up an array of 4000 points and just keep "FIFO"ing the data until the user selects "arm" at which point I wait for the threshold to be reached.Once the trigger threshold is reached, I would save one full set of 4000 points (of course with the pretrigger data, maybe 200 points or whatever)
The 9201 cannot be hardware triggered so I must do it in software.
Is there a simple way to do this? I've got some code but not sure if I need to keep the data acq task running all the time (to get my pretrigger data) or if I can just start it when the operator "arms" the software.
Looking for any advice.
Thanks,
Jeff
01-25-2009 07:26 PM
Hi Jeff,
I did the same thing for the same type of application you're doing.
Anyway, you need to start the task before trigger is armed, and keep pre-trigger data in an array.
Regards, Kate
01-26-2009 04:19 PM
Jeff, it sounds like you are trying to do Finite or continuous acquisition with a software trigger and some pre-sampled data to ensure that you do not miss any information due to the indeterminancy of software triggers. If this is correct, Kate is correct, however I would just like to refer you to one of our shipping examples which does, I believe, exactly what you are trying to do. To find this example navigate to the following:
1. In LabVIEW --> help --> Find Examples
2. Under the browse ta: Hardware Input and Output --> DAQmx--> Voltage -->"Cont Acq&Graph Voltage-Analog SW Trigger.vi"
This is a great shiping example that will likely do exactly what you are looking to do accomplish.