Author Topic: PLC tags expressions  (Read 535 times)

Phrog30

  • Guest
PLC tags expressions
« on: March 07, 2017, 04:09:25 PM »
What's the best practice for using expressions in objects?  For example, the basic label has a PLC visible item.  If I wanted to do tag > 1 what would be the best way to do that without creating another tag in the PLC?

Thanks,
James

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5276
    • View Profile
    • AdvancedHMI
Re: PLC tags expressions
« Reply #1 on: March 08, 2017, 11:44:39 AM »
The AnalogValueDisplay offers this through the use of the VisibleControl property. For other controls there is no "clean" way of doing it. A few options:

1) A new Boolean tag I the PLC to do the comparison
2) A Datasubscriber that compares the value and set the Visible property of the target control
3) Copy the VisibleControl and associated code from the AnalogValueDisplay into the control you want to have the same capability

I once made a component called a VisibilityController that would do this and you set the target control. It was essentially encapsulating the code that you would do in option 2. Unfortunately I have yet to find that component. If I do, I will post it.