AdvancedHMI Software

General Category => Support Questions => Topic started by: The Forever Intern on September 27, 2023, 09:05:36 AM

Title: How to show text based off boolean value
Post by: The Forever Intern 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?
Title: Re: How to show text based off boolean value
Post by: Archie 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.
Title: Re: How to show text based off boolean value
Post by: The Forever Intern 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.
Title: Re: How to show text based off boolean value
Post by: The Forever Intern 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!