LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

toggle boolean switch

Hi,
I am doing a project where i should move the pusher with different pressure.the pusher goes in and out of the a certain material. When the pusher goes in it should be pushed inside with a low pressure. when the pusher goes out it should be pull out with a high pressure, so i want to control this with a boolean switch to switch between different states, this should happen automatically without manually having to switch the pusher pressure. so i want to know how do i toggle a switch programmatically.See the attached picture.
 
Thanks!!
0 Kudos
Message 1 of 10
(4,293 Views)
variable
________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
0 Kudos
Message 2 of 10
(4,284 Views)

Hai,

Try using a flat sequence structure with specified time delay and give true and false constants to the boolean switch accordingly.

Mathan

Message 3 of 10
(4,281 Views)
right click on the control in your block diagram, select create->reference.  wire a property node to this, right click the property node, select "change to write" and choose "value," then just wire a true or false to it.
0 Kudos
Message 4 of 10
(4,271 Views)
Hi Jeff,

instead of "value" property nodes simple local variables will do the same, but faster Smiley Wink
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 10
(4,261 Views)
Ah, but locals also introduce race conditions
0 Kudos
Message 6 of 10
(4,248 Views)
So do propery nodes...
________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
0 Kudos
Message 7 of 10
(4,245 Views)
Property nodes have control outputs that can enforce data flow.  Locals do not.
0 Kudos
Message 8 of 10
(4,233 Views)
Granted, but if you can wire something into the property node that truely stops a race condition (other than a semaphore of some type) then you can wire the data directly to an indicated and have no purpose to the property node. The property node itself only ensures dataflow (as you said) and does nothing to stop any actual race condition.
In such cases the best bet would be to use a functional global anyways...but none of that has to do with the question that was asked...
________________________________________________________

Use the rating system, otherwise its useless; and please don't forget to tip your waiters!
using LV 2010 SP 1, Windows 7
________________________________________________________
0 Kudos
Message 9 of 10
(4,228 Views)

That's a valid point.

And more to the point of the question, why not just use the output of the button to control the pressure?  Why do you need a switch?

0 Kudos
Message 10 of 10
(4,219 Views)