02-14-2013 11:35 AM - edited 02-14-2013 11:40 AM
Hi, I just wrote a simple code for generating two pulses; the first pulse is to output 5V for 200ms and then shut off and wait for 4 secs. After that, another 5V pulse is on for 200ms an then shut off. This is basically what I need to control relay. The relay is toggle on and toggle off type.The code looks akward, is there any better approach? I am using USB-6008, thank you
Solved! Go to Solution.
02-14-2013 11:54 AM - edited 02-14-2013 11:58 AM
just a few minor Tweaks:
See revised code:
This is still not very scaleable. For adaptabiity this should be converted to state machine or QMH with "Init(Task), Wait (Time to wait), Write (Bool), and Exit" States.
02-14-2013 12:18 PM - edited 02-14-2013 12:19 PM
Thank you Jeff. By the way, some people mention counter output which is a option in the 'create virtual channel vi', is this helpful for usb-6008?
02-14-2013 12:27 PM
@godpaul wrote:
Thank you Jeff. By the way, some people mention counter output which is a option in the 'create virtual channel vi', is this helpful for usb-6008?
Not really- the 6008 does not have the hardware required to use a counter DAQmx Task. A counter output would be usefull on a more capable device though.