I am new to Labview but I am working on a relatively simple project. I am using a PCI-4462 board to capture signals from an array of accelerometers. I wish to trigger off of an analog chanel and capure some pretrigger and post trigger data. So far I have located an example vi within the article:
NI-DAQmx: Acquire Analog Input Data Using an Analog Trigger - Multiple Times
I downoaded the 200007.vi file and made the following modifications: I changed the voltage input channel to an accelerometer and added controls for sensitivity, excitiation source, excitation value, and sensitivity units and the appropriate values were entered. I then changed the trigger to analog channel 0. I have enabled pretrigger, and set it to make 500 of the 2000 samples pretrigger. Upon running the VI and giving the accelerometers a tap from the table, a nice waveform appears on the front panel graph with the appropriate amount of data before the yellow trigger marker. The problem is that it is very obvious by looking at waveform that all of the data displayed is post trigger data. I will post a screen capture of the front panel to illustrate. You can see that the trigger is set to 0.5, and the waveform starts with a value at exactly 0.5, and the yellow marker showing the trigger point is in an area with a max amplitude of about 0.2. I am new to this so I think I am missing something obvious, but since this is an example vi file I would expect it to work. Maybe the problem is trying to make it work with the 4462 board without setting something correctly. I also don't quite understand bundles and how to determine what a existing bundle is set up to do.
Any help would be greatly appreciated, I am attaching the vi file and the screen capture. Thanks in advance.
DAQmx ignores the value of Ref.PretrigSamples unless you configure a reference trigger. To do so, click on the DAQmx Trigger polymorphic type selector and select "Reference Analog Edge". Note that this version of the VI has an additional input for pretrigger samples, so you can delete the DAQmx Trigger property node. If you look at the diagrams of the DAQmx Trigger VIs, you'll see that they are property node wrappers that exist to make it easier to set the right properties.
Thanks a lot for the quick reply, I selected "Reference Analog Edge", and deleted the Trigger property node and it now collects pretrigger data. I was a bit confused why an example script wouldn't work right out of the box. Now I have to hook up the other two accelerometers and see if I can collect all three channels in the same manner, all triggered off the first channel. Again thanks for the help.