From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

shutoff a toggle switch by a second switch

Solved!
Go to solution

Hello, I am trying to develop a programm for wich I want to be able to open and close valves by means of toggle switches. So I want to be able to open and close valves individually. However, it should also be possible to close all valves (and switch the toggles down) by pressing a one shot button. I insist on using  toggle switches, which visualy also toggle to the close position when pressing this "close all" one shot button. My reason for insisting on this, is because I am trying to develop an exact copy of a programm which is written in Labwindows. In this original program it works like this, and I am convinced it should be possible. Having spend already 3 days, trying numerous options, like "create local variable" and "Create property node" I still didn't find out how to.

 

 

Sincere Regards, Theo de Groot

0 Kudos
Message 1 of 24
(3,323 Views)

Please post the vi you have so far (not just a screen shot).

The we'll be able to help fix your code.

0 Kudos
Message 2 of 24
(3,305 Views)

Hi Theo,

 

as you're working with boolean controls to control boolean actuators you should use boolean functions to incorporate your boolean "toggle shutoff" logic!

 

Either use AND or OR function (depending on the active SHUTOFF state)…

 

to develop an exact copy of a programm which is written in Labwindows. … Having spend already 3 days

Don't you have access to the source code to look there for a solution? Otherwise the programming language used to create that "original program" is irrelevant…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 24
(3,294 Views)
In those three days, did you take any of the free tutorials? It's a pretty simple task and using locals is one way. As mentioned, you need to attach your code or a snippet.
0 Kudos
Message 4 of 24
(3,276 Views)

Hi,

This simple example think can help You. use Functions-->Booleans for creating Your logic.

With best Regards

Hrachya

Certified LabVIEW Architect (CLA)
0 Kudos
Message 5 of 24
(3,261 Views)

Where's your terminal?  If you're trying to make changes to a control, but it's outside a loop, local variable and property node changes are not going to effect your program inside the loop.

0 Kudos
Message 6 of 24
(3,241 Views)

Dear Florian,

 

 

In the attachment you will find what I have come up to until now. In the finall program, more valves should be closed by this one button, but since this does not add anything to the discussion, I only send this piece of code.

So, I insist on using these toggle switches, which will also switch to the closed position when I press "close all".

This "create local variable" is one of the options I found on the tutorials , and does something. But as you can see, the proplem is, the switch will not be bistable anymore, and will only work momentary. So this is not the solution for me.

 

"My goal of this post: using several toggle switches, to open and close valves, and one "close all" reset button to close them all at once, and also the toggle switches should switch to the closed position".

 

 

Sincere Regards, Theo de Groot

0 Kudos
Message 7 of 24
(3,194 Views)

Dear GerdW,

 

 

The original code is written in C (Labwindows), a language which I do not understand. I only have a frontpanel which we want to recreate (copy), and I know what the machine should do.

 

"And" and "Or"buttons are an option of course, but the core of this problem, in my opinion, is that a toggle switch is only a control (without an input to have influence to it,  from a second place). In the tutorials I read, a "local variable" and/or "property node" should do the trick. But spending much time to find a program which uses this, I did not succeed to find out how exactly.

 

"My goal of this post: using several toggle switches, to open and close valves, and one "close all" reset button to close them all at once, and also the toggle switches should switch to the closed position".

 

 

Sincere Regards, Theo de Groot

0 Kudos
Message 8 of 24
(3,187 Views)

Dear Hrachya,

 

 

Thanks for this input, but you are using buttons, I want to use toggle switches.

 

"My goal of this post: using several toggle switches, to open and close valves, and one "close all" reset button to close them all at once, and also the toggle switches should switch to the closed position".

 

 

 

Sincere Regards, Theo de Groot

0 Kudos
Message 9 of 24
(3,178 Views)
There is absolutely no difference on the block diagram between a toggle switch and any of the other Boolean controls. Silly to even bring it up.
0 Kudos
Message 10 of 24
(3,167 Views)