LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pretrigger samples

Solved!
Go to solution

Hi,

 

I know there are already a lot of posts about pretrigger samples but I couldn't figure out this problem.

I have this attached vi that is measuring across 3 analog input channels of a PXI-6133 cards in a PXI-1042Q.

I want to acquire the pretrigger and posttrigger signals when I see a rise on the channel labeled current. The VI runs without error but I don't see any pretrigger signals on the waveform graphs. There seems to be no change when I change the pretrigger sample input into the reference trigger DAQmx VI.

 

Thank you!

0 Kudos
Message 1 of 9
(3,519 Views)

Hi pulsed_power,

 

I have attached a VI that you should attempt to use as a standalone VI while you send an analog signal to the card. There is also a screenshot of what you should be seeing with pretriggered samples. Let me know if this works for you.

 

Best,

Jason M.
Applications Engineer
National Instruments
Download All
0 Kudos
Message 2 of 9
(3,487 Views)

Thanks Jason.

Your Vi works for one channel. I can see the pretrigger samples as shown in your diagram.docx.

 

But when I modify your vi slightly to sample 2 channels the pretrigger samples are not there.

Is it possible to sample 2 or more channels with a trigger on one of them and collect some pretrigger samples?

 

I attached my modification.

 

 

 

Download All
0 Kudos
Message 3 of 9
(3,478 Views)

Hi pulsed_power,

 

In the initial question, you mentioned that you were attempting to read multiple channels from the same device. In the supplied code, there are two devices present. The protocol for analog triggering on multiple cards is different than that for multiple channels. I have attached a VI that will look at the first channel of your device and show you the pretriggered samples. Let me know if this is what you are looking for and if this works for you.

 

Best,

Jason M.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 9
(3,462 Views)

Hi Jason,

 

Yes I wasn’t clear in my first post. I would like to be able to get pretrigger samples from analog Input channels on 2 NI-6133 cards in a PXI-1042Q.

From your attached example I learned that it is easy to do it for channels in the same device.

 

I searched a bit in the Labview examples and I found this vi I could try to adapt to my situation.

The vi is in Examples->Daqmx->Multi-Device.llb->Multi-Device Synch-Analog Input-Ref Trig-Multi Rate-Trig Skew Correction.vi

Do you think it is a good starting point? Why is a sequence structure needed to have one "startdaqmx.vi" start after the other?

I don't really understand the sync tasks-Trig Skew Correction.vi block diagram. What is done there? Is it necessary?

 

I also searched for references and I found this http://www.ni.com/white-paper/11549/en. Do you know of any other references for multi device pretrigger sampling or synchronization? 

 

Thanks!

0 Kudos
Message 5 of 9
(3,454 Views)

Hi pulsed_power,

 

While those are definitely good starting points, and understanding synchronization will ultimately make you a much better LabVIEW programmer, our DAQmx driver makes it easy to synch multiple devices, and in some cases, channel expansion is the better way to go. The reason you may be running into trouble with the example is the "Multi Rate-Trig Skew Correction" aspect of the example. If you try the code that I supplied a screenshot of in the below diagram, are you able to get the results you would like to see?

 

Best,

Jason M.
Applications Engineer
National Instruments
0 Kudos
Message 6 of 9
(3,441 Views)

Hi Jason,

 

I attached this 2 page document that shows my problem. When the AI channels are on the same device I get the pretrigger samples. When I select two AI channels on two different cards I don't get the pretrigger samples.

 

0 Kudos
Message 7 of 9
(3,432 Views)
Solution
Accepted by topic author pulsed_power

Hi pulsed_power,

 

It turns out that this is a known bug that was solved in the newest few versions of DAQmx (must be later than DAQmx 9.5). If you do not have the newest version of DAQmx, please upgrade to the newest version compatible with your system. If you are still seeing this issue, please let me know, as we will have to update R&D. The Corrective Action Report Number is 332364, for your reference.

 

Best,

Jason M.
Applications Engineer
National Instruments
0 Kudos
Message 8 of 9
(3,427 Views)

Thanks Jason.

 

Over the weekend I updated DAQmx and all other Labview packages to the newest version. Now the pretrigger samples are correctly displayed and saved. 

 

Thank you very much for your time!

 

0 Kudos
Message 9 of 9
(3,407 Views)