08-05-2011 12:26 PM
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.
Solved! Go to Solution.
08-08-2011 04:46 AM
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
08-08-2011 03:48 PM
08-08-2011 03:49 PM