LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pulsed TTL output VI

I'm working with a VI that outputs a 5V pulse and I need to implement it into my code. (See attached) What I'm trying to do is trigger this code to turn on it's 5V output, hold on while a measurement is taken, then turn off until triggered again. I was thinking I could watch the output of a shift register in the main loop and as a new value exits the register, it would trigger the gate VI. I'm not sure how to control when the gate VI goes low. It seems this VI stays high until an event tells it to go low.

 

Below is a snip of the code I'm trying to implement the gate VI into.

THD_GATE.PNG

 

Thanks for the help!

 

 

0 Kudos
Message 1 of 12
(1,932 Views)

Hi Jay,

 


@JayWW wrote:

What I'm trying to do is trigger this code to turn on it's 5V output, hold on while a measurement is taken, then turn off until triggered again. I was thinking I could watch the output of a shift register in the main loop and as a new value exits the register, it would trigger the gate VI.


Wouldn't it be easier to use a simple DO task instead of the CTR task when you want to switch a digital output between LOW and HIGH?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 12
(1,907 Views)

@GerdW wrote:

Hi Jay,

 


@JayWW wrote:

What I'm trying to do is trigger this code to turn on it's 5V output, hold on while a measurement is taken, then turn off until triggered again. I was thinking I could watch the output of a shift register in the main loop and as a new value exits the register, it would trigger the gate VI.


Wouldn't it be easier to use a simple DO task instead of the CTR task when you want to switch a digital output between LOW and HIGH?


Hmm, I'm not familiar with the DO task. Would I be able to output the 5V signal to the same location?

0 Kudos
Message 3 of 12
(1,902 Views)

Hi Jay,

 

when your DAQ device supports TTL outputs it will switch between ~0.4V and ~4.6V on a DO pin (with low output current)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 12
(1,895 Views)

@GerdW wrote:

Hi Jay,

 

when your DAQ device supports TTL outputs it will switch between ~0.4V and ~4.6V on a DO pin (with low output current)…

 

Hi GerdW,

 

   By chance do you have an example of how that would be implemented? Thanks!

 

Jay

 

0 Kudos
Message 5 of 12
(1,886 Views)

Hi Jay,

 

open the example finder and look for DAQmx digital output examples...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 12
(1,870 Views)

After looking at the hardware setup, I'm unable to use the digital outputs in a DAQmx task. For the gate output, I'm hardwired to use the CTR task.

 

Thanks,

Jay

0 Kudos
Message 7 of 12
(1,865 Views)

On many common boards, the default pins that counters want to use for their input and output signals are dual-function and shared with DIO.  You can produce an output signal with *either* a counter output task *or* a digital output task.  (Not both at once, due to the obvious conflict.) 

 

What's your device and what pin is hardwired?

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 8 of 12
(1,859 Views)

@Kevin_Price wrote:

On many common boards, the default pins that counters want to use for their input and output signals are dual-function and shared with DIO.  You can produce an output signal with *either* a counter output task *or* a digital output task.  (Not both at once, due to the obvious conflict.) 

 

What's your device and what pin is hardwired?

 

 

-Kevin P


It's wired into a TB-2605 (I believe ch11+) which is connected to a PXI-2503 relay board.

 

Thanks,

Jay

 

0 Kudos
Message 9 of 12
(1,848 Views)

I've never used (or even seen) a PXI-2503, but the online docs refer to it as a "matrix switch" device.  As far as I understood, such devices wouldn't have counters, might not have "regular" DIO, and might require the NI-SWITCH API rather than DAQmx.

 

Having no direct experience, I can't offer much more than that.   What led you to the understanding that you could operate it with a DAQmx counter task?

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 10 of 12
(1,821 Views)