English (United States)
Call us! 512-349-0334 or (877) INDUSOFT

InduSoft Web Studio Forums

Find additional forum posts in in the Forum Archives. For assistance view the Forum Frequently Asked Questions.

Pushbutton switch, color change on state change?
Last Post 14 Apr 2016 10:01 AM by Richard Clark. 1 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
Brandon_KUser is Offline
New Member
New Member
Posts:3


--
13 Apr 2016 07:36 PM

    Hey guys.  New user, so far I've built a small touch screen interface to do most everything I need it to do.  It's pretty intuitive software (minus getting connected to my AD Productivity2k PAC, that was a little more difficult to figure out).  

    Is it possible to change the color of a pushbutton switch based on a tag state?  IE Symbols library > Pushbuttons > Button_Square_Blue01

    Really I guess I'm looking for a combo button \ indicator.  I would want to setup the switch something like;

    TagCmd > Mapped to "DI 01"

    TagState > Mapped to "SET_Bit_01"

    I need the color of the button to change based on that bit.  I've done it without issue using the pilot lights, but they aren't buttons.  And vice versa.  Any thoughts?

    Richard ClarkUser is Offline
    Forum Moderator
    Forum Moderator
    Posts:677


    --
    14 Apr 2016 10:01 AM
    Hi @Brandon_K,

    This is pretty easy to do. In effect what you need to do is create 2 buttons.  Create your first button with whatever functionality of the appropriate color, then add a Visibility Animation to it. Copy this button by [Ctrl]+[c] then [Ctrl]+[v] or while holding down the [Ctrl] key, left-click and hold on it and pull the copy off the original button. Change the color of the copy to the opposite state color. In the Visibility field expression, add your Boolean tag and in the other button visibility field expression add "Not" and the Boolean Tag. You can also put in any expression that evaluates to a 1 or 0. Test the operation of the buttons in runtime, then when they are working correctly select both of them and in the "Format" tab, "Arrange" section, choose "Align" and align them both horizontally and vertically. With both buttons still selected, you can then right-click on them and group them. You do not need to ungroup them to edit the properties of each button, each property is available in the pull-down on the group object properties, and you can copy this new grouped object and paste it again and again. The animations applied to each button "stick" to that object after being grouped, and any animations applied to the group override any identical animations that were applied individually.

    Richard Clark
    InduSoft TMS
    You are not authorized to post a reply.