It is currently Mon Sep 15, 2014 4:54 pm

Post new topic Reply to topic  [ 2 posts ] 
 2 State Toggle Button 
Author Message

Joined: Mon Aug 01, 2011 10:27 am
Posts: 27
Post 2 State Toggle Button
What is the prefered method to tie 2 or more boolean tags that must all be true in order for the 2 State Toggle Button to be true

Tue May 15, 2012 9:37 am

Joined: Sun Apr 02, 2006 2:46 pm
Posts: 1982
Location: Sacramento, CA
Post Re: 2 State Toggle Button
In that case, don't bind the "Control Value" property and bind the "Indicator Value" property to an expression like this:
{Path/To/Boolean1} && {Path/To/Boolean2} && {Path/To/Boolean3}
So the expression will return 1 when all are true and 0 otherwise.

If you want to write to tags when the button is pressed you either:

1) Bind the "Control Value" property to a single tag if you only need to write to one tag or
2) For multiple tags you can put an event of the actionPerformed:
value = not event.source.controlValue
system.tag.writeToTag("Path/To/Boolean1", value)
system.tag.writeToTag("Path/To/Boolean2", value)
system.tag.writeToTag("Path/To/Boolean3", value)

Travis Cox
Inductive Automation
Technical Support Rep.

Tue May 15, 2012 9:53 am
Profile WWW
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

Who is online

Users browsing this forum: Google [Bot] and 4 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: