08-25-2020 10:39 AM
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.
Thanks for the help!
08-25-2020 11:32 AM
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?
08-25-2020 11:41 AM
@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?
08-25-2020 11:56 AM
08-25-2020 12:07 PM
@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
08-25-2020 12:28 PM
08-25-2020 12:47 PM
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
08-25-2020 01:09 PM
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
08-25-2020 02:39 PM
@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
08-25-2020 04:09 PM
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