Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger DI acquisition on rising edge of one of the signals being acquired

Solved!
Go to solution

Hello,

Is it possible to trigger a digital acquisition on a transition of one of the channels being acquired? I am using an NI PXOe-6537.

Please see attached screenshot.

6537 How to trigger on digital input being acquired.PNG

Thank you.

 

0 Kudos
Message 1 of 5
(2,072 Views)

According to what I see in the specifications, you can't trigger off p0.0

 

But sometimes people use the word trigger for what DAQmx considers a "sample clock".  In case you're looking to capture a lot of digital lines *every* time there's a rising edge on p0.0, you *can* do that by setting up sample timing based on "change detection" and specify sensitivity to rising edges of p0.0

 

Alternately, if you have another PXI device you *can* trigger, there's a way to trigger your 6537 from the other device, by way of the PXI trigger lines on the backplane.   You'd need to parallel wire to a PFI input on the other device.

 

 

-Kevin P

 

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 2 of 5
(2,037 Views)

Kevin,

Thank you so much for reaching out.

To simplify this problem, as you suggested, I an now using one of the dedicated trigger inputs "PFI0". I am able to trigger(Start Digital Edge(PFI0) and get my acquired data: So no problem here.

 

Where I have an issue, is when I trigger(Reference Digital Edge(PFI0)), I can see that DAQmx has accepted my rising edge on PFI0 because "DAQmx Wait Until Done.vi" completes after I issue my trigger and it acquires my specified 100 samples, but I am not able (don't know how) to retrieve my 100 data points (please see attached code screenshot).

 

If I remove the "DAQmx Wait Until Done.vi" I get similar behavior. Can you see what I am doing wrong?

 

 

0 Kudos
Message 3 of 5
(1,992 Views)

I don't notice anything wrong.  I opened a shipping example (named "Digital - Finite Input.vi") to compare, and it sure looked like the screencap you posted.

 

Can you try running that example, after configuring it to do reference triggering?  It worked for me, though I was only using a simulated device.

 

Another thing I suppose you could at least *try* is to explicitly define the # samples to read like the reference triggering illustration over here shows.  I don't expect that to make a difference, but it's at least something to try.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 4 of 5
(1,985 Views)
Solution
Accepted by _Rollin_

(*) The solution when triggering on PFIx is:

DAQmx Timing.vi_PIPELINED SAMPLE CLOCK.vi. // by default it is set to "Sample clock".

Now when I do DAQmx read(), there is data available. // See attached screenshot.

 

(*) A solution when triggering on one of the input signals is:

DAQmx Timing.vi(Sample Clock).

DAQmx Trigger.vi_ReferenceDigitalPattern.vi(oneOfTheInputsLinesBeingAcquired).

DAQmx Buffer.Input.BufSize(Pretrigger+PostTrigger_samples)

DAQmx Read.RelativeTo(Most Recent Sample)

DAQmx Start Task()

Wait for task Complete()

DAQmx Read.Offset(-PostTrigger_samples) //add also your pretrigger sample if you want those also.

DAQmx Read() // there is my data.

 

 

Message 5 of 5
(1,944 Views)