Author Topic: How to show text based off boolean value  (Read 405 times)

The Forever Intern

  • Newbie
  • *
  • Posts: 5
    • View Profile
How to show text based off boolean value
« on: September 27, 2023, 09:05:36 AM »
I am new to advanced hmi, I am using a click PLC and have it working with a c-more hmi, I am now looking to move over to using ahmi for ease of use and convenience, just trying to transfer over the same application but on a different program. I am trying to show if I valve is on or off, I already have 2 bits in my PLC that are called air valve open and air valve close, whichever one is on shows what position the valve is in. I want to show if the valve is on or off in the ahmi.
Is all I need to do is place a basic label, type in ON (or open) and color it green, then scroll down to address visible, enter the Modbus address of  air_valve_open. Is this all I need to do to get it working?

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: How to show text based off boolean value
« Reply #1 on: September 27, 2023, 10:12:59 AM »
That is one technique, or you could use a single bit with a BasicLabel and the BooleanDisplay property to set it to what you want to display. If the word selection does not offer what you want, you can go into BasicLabel.vb and edit the code to give the text you want.

The Forever Intern

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: How to show text based off boolean value
« Reply #2 on: September 27, 2023, 10:51:15 AM »
So the BooleanDisplay property only works with one bit at a time. I will have to change my coding in the PLC so I just have one bit to represent the valve, after that all I do is enter in the PLCaddress and it should turn on/off with my PLC input. I will try and test it out.

The Forever Intern

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: How to show text based off boolean value
« Reply #3 on: September 27, 2023, 11:18:29 AM »
That is one technique, or you could use a single bit with a BasicLabel and the BooleanDisplay property to set it to what you want to display. If the word selection does not offer what you want, you can go into BasicLabel.vb and edit the code to give the text you want.
I just edited the code and tried to add an open closed Boolean Display, it is not showing up in the dropdown menu in the properties. Is there anywhere else I need to change the code?

EDIT: Got it all working now, forgot to build it.......... Thanks for the help!
« Last Edit: September 27, 2023, 11:33:12 AM by The Forever Intern »