LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pretrigger with NI-USB 6216

Hi all,

I am trying to use the following example to acquire data using a start trigger and reference trigger such that I can save a fixed amount of sample before the reference trigger and the rest of the data (total number of samples-data before pretrigger) after the reference trigger happens. I am using NI-USB 6216. The manual says that "Port 1 and port 2 can be used as static digital I/O lines or PFI lines". I checked in NI device-monitor that the digital I/O lines are working when the trigger signal is sent. However, when I run the code, it does not wait for the start trigger before acquiring the data. Does it mean that NI -USB 6216 can not be used with digital triggering? 

Thanks

SB

SBH2018_0-1627606334912.png

 

0 Kudos
Message 1 of 7
(491 Views)

Either use Start Digital Edge OR Reference Digitial Edge but not both, not sure how DAQmx reacts to this.

 

According to the section External Digital Triggers of the manual USB-6216 can work with both kind of triggers.

 

Regards, Jens

Kudos are welcome...
Message 2 of 7
(460 Views)

Hi Jens,

Thanks for your reply. I did check separately with Start Digital Edge and Reference Digitial Edge. I found that 6216 does not react to any of the triggers at all. However, the digital channels showed the change in voltages when I checked in NI device monitor (digital channel/port 1/line 0-7). PFI1 stands for line 1 and PFI2 stands for line 2.

Hence my doubt was whether 6216 can work with digital triggers at all.

SBH2018

0 Kudos
Message 3 of 7
(450 Views)

Hi,

 

I can only tell you that the manual states that PFI 0..15 can be used as triggers Analog input (Start Trigger, Reference Trigger, and others).

 

Regards, Jens

Kudos are welcome...
Message 4 of 7
(419 Views)

Hi,

Thanks for your prompt reply. I am a little confused here. Does that mean that the "start digital edge" trigger function and the "reference digital edge" function need to be replaced by something else? I am sure I am missing something but it would help to know a bit more. Please see attached. Also the manual says the PFI channels functionality includes static digital input. Does it mean it can not detect a changing digital level ( like a pulse signal)? 

SB

0 Kudos
Message 5 of 7
(411 Views)

@SBH2018 wrote:

Hi,

Thanks for your prompt reply. I am a little confused here. Does that mean that the "start digital edge" trigger function and the "reference digital edge" function need to be replaced by something else? I am sure I am missing something but it would help to know a bit more. Please see attached.


No, those are the correct functions, but as already stated do NOT use both at the same time. Have a look at the examples from the NI example finder (ie. Voltage - finite input.vi). Also keep in mind, that the DAQmx read will currently time-out after a max of 10 sec.

 


Also the manual says the PFI channels functionality includes static digital input. Does it mean it can not detect a changing digital level ( like a pulse signal)?

It means, that all DIO of that card can only be written or read with software tact (not with a HW timed clock like the AI).

 

Regards, Jens

Kudos are welcome...
0 Kudos
Message 6 of 7
(402 Views)

I don't think I've ever tried setting up a task for both a start trigger AND a reference trigger.  I'm not sure which (if any) devices support both simultaneously.

 

Your OP posting sounds like you *primarily* need a reference trigger so you can define both a # of pre-trigger samples and a total # samples.   Have your tried this out without any attempt to configure a start trigger?

 

If you need both and your device doesn't support both in the same task, there's a likely workaround using a counter task.  You'd set up a counter pulse train task that the AI task uses as its sample clock.  The counter task would be configured to react to a start trigger, the AI task would continue to use (only) a reference trigger while also using the counter output as its sample clock.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW?

(Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).



0 Kudos
Message 7 of 7
(371 Views)