LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I create a square wave of boolean type for the conditional terminal of the while loop since i want to toggle it on and off

hi guys
i am trying to run a peristaltic pump with the help of labview.
my requirement is such that i can toggle a while loop on and off. so i need to form a square wave or find some other way..
the square wave given doesnt work since the while loop conditional requires a boolean type..
please help me

0 Kudos
Message 1 of 5
(3,789 Views)
Not quite sure why you would want to turn the while loop onand off, but why dont you just create a state machine and have it go to state 1, wait for a time, output a true, and then go to state 2, wait a certain time, and output a false.  That will not stop the loop, but will give you a true/false toggleing.

If this wont work for you, please give us a little more infomation on what you are trying to accomplish/control with the pump.  Are your turning on and off a digital output to turn the pump on and off??
Kenny

0 Kudos
Message 2 of 5
(3,781 Views)
I agree with Kenny that starting and stopping a while loop seems overly complicated for your stated task. A continuous while loop with a shift register sounds like it is all that you need.
0 Kudos
Message 3 of 5
(3,768 Views)
hey thanks,
the thing is the vi is provided with the pump as a driver so making changes to the internal of it is a bit complicated ..
however the vi provided by the manufacturer cannot run the pump automatically but requires a command by the user each time..
i need to make it automated and runn continuously and i found that the simplest way to do that is just to toggle the condition of the while loop.
so i am looking for that square wave..
well thanks for the reply i will surelly try out what u said in the message..

0 Kudos
Message 4 of 5
(3,763 Views)

Something like the image below is as simple as it gets.The rate is determined by the wait statement. You could also use a timed loop if you want more precise control over the timing. The state machine as mentioned by Kenny is a slightly more involved but much more powerful architecture. There are shipping examples of that.

You might want to check into some of the resources for leaning the basics of LabVIEW here.

Message Edited by Dennis Knutson on 12-21-2006 09:09 AM

0 Kudos
Message 5 of 5
(3,748 Views)