LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I generate boolean pulses?

I want to generate a boolean state that toggles from true to false with a given time duration and for a given number of times. What is the best way to do this?
0 Kudos
Message 1 of 6
(3,606 Views)
Is this just for display purposes? If it is, you can use a boolean indicator on your front panel, and then develop a sequence or while loop with the wait statements to set your boolean to the correct state.

Mark
0 Kudos
Message 2 of 6
(3,606 Views)
I want to feed the boolean result into an element of a cluster. I am new to LabVIEW and wrote a for loop to generate the pulse, but when I tried to wire the result to the cluster, LabVIEW changed the boolean value to an array. I couldn't figure out how to take the array values and convert them to the pulse train with the right duration.
0 Kudos
Message 3 of 6
(3,606 Views)
Without knowing exactly what you are trying to accomplish, why don't you just put the cluster (or subVI) inside the for loop? If you want, you could also bundle the Boolean state with the time duration and create a cluster array that could be passed. If the time duration is constant, pass the array of booleans and the time duration to the cluster.
0 Kudos
Message 4 of 6
(3,606 Views)
Now I understand. Does your for loop just contain the values, or the durations as well? If it contains the durations as well, then your problem is that you're taking the output of your for loop and wiring it to your cluster, and the for loop is indexing the output, creating an array. You need to wire your indicator inside the for loop. Use the "bundle by name" vi and connect that to your indicator, and that will do it.

Mark
0 Kudos
Message 5 of 6
(3,606 Views)
The backbone to my algorithm is the Quotient and Remainder function. In my example attached, the program rolls over every 10 counts. Each count is defined by "milliseconds to wait". The boolean state changes from TRUE to FALSE and waits 3 seconds. I did this so you can watch the boolean state change. Edit the file to your liking...

Stop Condition specifies when to change the boolean state from true to false.

My Indicator displays the boolean state.

Note: I originally created this application on LabVIEW 6i and saved it for 5.0. That's why the controls look funky.

I hope that helps.

Shan Pin Koh
Systems Engineer
Oakriver Technology
0 Kudos
Message 6 of 6
(3,606 Views)