LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Square wave with variable on and off times

I am trying to set up a square wave to turn a device under test on and off.  I can take a TTL output and use a Darlington output to operate a relay.  

 

BUT  How do I program the ON and OFF times, from the screen?  It would also help if I can turn the entire process on and off.

 

I have attached the VI I am using, with the numeric boxes to input the ON / OFF times, as well as to enable the output.

 

I know this should be simple, but I cannot figure it out.  I have been able to set up one of counters to create a square wave, but I cannot find a way to change it through the VI.

 

I am using a USB-6351, LabView 2010 SP1, Lenovo SL510 laptop running Win 7.

 

An additional note:  I get an error from the DAQ Assistant 2 (the one reading the pulses to determine frequency if there are no pulses coming in.  Since I am trying to read the RPM, once the motor stops (or I turn it off), the VI stops.  Once pulses are present, and I click on the continue, it comes back. But it would be really helpful if it would continue to run but just give me zero for the RPM.

0 Kudos
Message 1 of 4
(2,527 Views)

First: How strickt is your timing?

Will software timing (delay of maybe up to 20ms) be good enough?

Or do you need hardware clock based timing using the hardware timer of your 6251?

 

 

I add a event structure based version, timing will lag the executiontime of the write to output 😉

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 2 of 4
(2,522 Views)

 Guten Morgen Henrik,

 

Danke for answering.  (Sorry, my German is not good.)

 

Timing is not critical.  Initially 10 seconds off, 30 seconds on.  Since I will be recording the parameters anyway, there can be variability from software timing.

 

I will try the program when I return to the laboratory.

0 Kudos
Message 3 of 4
(2,520 Views)

Thank you Henrik

That program works like a champ.  Perfect.  Thank you SO MUCH for your help.

Message 4 of 4
(2,499 Views)