Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I most easily generate a digital output pulse of finite length?

Solved!
Go to solution

Hi,

 

I need to open and close two pneumatic valves using a TTL output (no current or power load on the output) using a PCI-6280 and/or PCI-6601. The valves need to open pretty much simultaneously, and close after different amounts of time have passed (millisecond-level timing, maybe 100-microsecond-level timing at worst). My current plan is this:

 

-Create a task with two digital outputs (waveform type), and another task with a counter which generates a user-defined frequency (I know I can use the frequency generator on either of these cards but I'd prefer a counter--better frequency selection).

-Wire the counter output to the clock input of both digital outputs.

-The counter's output is digitally triggered by another digital channel which I'm using to control when the pulses go off. Via it's counter node, it is programmed to be retriggerable.

-Two digital waveforms are written which both consist of single active-high pulses (ie the signals go 'low-high (for user-defined amount of time)-low'.

-These waveforms are written to their respective ports and their tasks started, as is the counter task.

-Whenever the user wants the valves to be opened, the digital trigger is sent high and then back to low (this can be done with software timing, as it's not important exactly when the valves fire). Whenever the user wants the valves open for a different amount of time, different digital waveforms are generated and written into the buffers of the digital output channels.

 

My problem is that this seems like a lot of effort for me to go to and I'm wondering if there's a way easier solution I just don't know about. Can you program a counter to output a pulse of finite length? Is there a quicker way to program a digital output channel to do this?

 

Thanks to anyone who responds for their help.

0 Kudos
Message 1 of 4
(4,395 Views)

Hi,

 

there are some quite well examples at the NI developer zone, which discribe how to programm what you want to do...

I attached some links for you:


Generate Finite Digital Pulse Train
https://decibel.ni.com/content/docs/DOC-12165

Generate Finite Digital Pulse Train from Counter Output
https://decibel.ni.com/content/docs/DOC-11729

Generate Retriggerable Finite Digital Pulse Train from Counter Output
https://decibel.ni.com/content/docs/DOC-12104

 

Is this stuff helping you?

 

Regards,

Toby

Kind regards
Tobias S.
Message 2 of 4
(4,370 Views)
Solution
Accepted by topic author andrewc
It's certainly informative. Thank you.

The thing is, I only have six counters total to work with and I've got a lot of timing things to do. To use these solutions, I'd need to use either 4 or 6 counters given my needs.also I'd need to synchronize their starts.

Overall I'm sticking with my method for now--fewer system resources and the synchronization can be don by using the same finite output counter clock, and not using a trigger at all.

Again, thanks for your help so far.
0 Kudos
Message 3 of 4
(4,361 Views)
Also, I've implemented the code at this point so this is no longer an issue. I'm accepting your soln to shut down this thread.
0 Kudos
Message 4 of 4
(4,360 Views)