Author Topic: Make components invisible when bit is true?  (Read 2006 times)

astroman

  • Newbie
  • *
  • Posts: 21
    • View Profile
Make components invisible when bit is true?
« on: December 16, 2014, 01:45:42 PM »
Hello,
I'm just about done with my first HMI, and I'm wondering if there's a method to make components invisible when the bit in the PLCAddressVisible property is true. I have several buttons, BasicLabels and GraphicIndicators for which this would be useful. Thank you very much.
« Last Edit: December 16, 2014, 01:51:47 PM by astroman »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5311
    • View Profile
    • AdvancedHMI
Re: Make components invisible when bit is true?
« Reply #1 on: December 16, 2014, 02:00:45 PM »
If you precede the address in the property with "NOT", it will invert it's function. For example:

NOT B3/0
NOT MyTag
NOT 100001

astroman

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Make components invisible when bit is true?
« Reply #2 on: December 16, 2014, 05:30:17 PM »
Thank you Archie! This works very well.

astroman

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Make components invisible when bit is true?
« Reply #3 on: December 17, 2014, 03:12:13 PM »
I'm curious, is there a similar method for the 'And' operator? i.e if one bit is true but another is not, make graphic indicator visible.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5311
    • View Profile
    • AdvancedHMI
Re: Make components invisible when bit is true?
« Reply #4 on: December 17, 2014, 03:34:58 PM »
I'm curious, is there a similar method for the 'And' operator? i.e if one bit is true but another is not, make graphic indicator visible.
Unfortunately there are no combining operations. You would have to use a DataSubscriber and keep the values in local variables, then perform the operation and put into the Value property of the control.

astroman

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Make components invisible when bit is true?
« Reply #5 on: December 17, 2014, 03:36:49 PM »
I see. Thank you very much for clarifying that.

MrPike

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Re: Make components invisible when bit is true?
« Reply #6 on: December 18, 2014, 12:20:07 AM »
Hi astroman.  there may be a way to use the bit level addressing of the controls and not have to use a datsubscriber to avoid writting code.  Try to use a basiclabel and remove the text.  Set Autosize to False and position over top of your graphic indicator. Adjust your color to your desires. You will need to set this to "Bring to front".  Set the PLCvisible to your NOT PLC address.  This will keep the graphic indicator hidden while the NOT bit is high. Hope that helps