From Thursday, May 23rd (05:00 PM CDT) through Friday, April 24th (1:30 AM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I trigger on both the rising and falling edge of a digital signal with a cDAQ chassis and NI9421?

I have a cDAQ 9172 with a NI 9421 DI and NI 9205 AI. I need to sample a signal at both transitions of a digital input. I have been trying to get the DAQmx property node to trigger on both edges but it onlt selects one edge at a time. I am using the DAQmx Create Timing Source into a timed loop and it also only seems to detect the last edge I selected. I think I can use the analog window and then check the DI channel to see if it is high or low but I would like to use a digital trigger.

0 Kudos
Message 1 of 2
(3,487 Views)
Hello Tom,

Thank you for visiting the discussion forums.  You are quite correct that you can only select a single edge to trigger from.  I do have one suggestion that may work for you, depending on how fast your digital pulse is occurring. 

1)Start by connecting the digital pulse to one of your digital lines and set up a digital change detection task to sample the digital line on both rising and falling events.  There is an example located in the LabVIEW Example Finder under the title Read Dig Chan-Change Detection.vi.

2)Set up your analog task for external timing, and specify the change detection event as the clock.  This should enable you to capture your analog signal each time there is a change (i.e. rising and falling edges) on your digital line.

Hopefully this helps,

Jennifer O.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(3,464 Views)