15
« on: April 15, 2021, 07:50:48 AM »
Hi all - I'm using AHMI for a great dashboard reading our CLX PLC's along with other things, and hit a problem I can't seem to solve yet (experienced in VB6, new to .NET)
I pull a string tag into a BevelButtonDisplay to show a production run code, so when the machine is running the production ID is entered by them on the local HMI at the console, and appears in my AHMI dashboard as it should.
When the machine is not running, no code is entered so I want to change the text in the BBD to "PLANNED DOWNTIME" lets say, however I seem to have issues finding the right property to check if the PLC is returning a blank string tag. I have tried the TextChanged property of the BBD so that as it changes to blank, I try to check if the .text = "" and initially that is true when no string is displayed (the PLC returned an empty string from that tag) - so I set the .text value of the BBD to "PLANNED DOWNTIME" but it gets over-written a second later as the tag refreshes - this time the TextChanged property never fires again??
I need a straightforward way to detect the PLC tag returning a blank string and then substitute my string into the control. I tried the DataSubscriber control but double clicking it does not take me to its events.
I have AHMI V3.99 and VS 2019. The data I am reading from the PLC works flawlessly, just need a method or property that is only true when the returned tag data matches a value. Seems like it should be easy, maybe I'm not seeing the solution.
EDIT I had to reboot VS as it had stopped letting me double click into a controls' code - weird. Anyway, I am using a timer to check the .text values and that works, so of course the EthernetIPforCLX overwrites the .text with the blank tag value every 500ms, and the timer puts the string back, so I guess I will have to read the tag value into an intermediate variable, check if it's blank and then write the default string to the DBB control if it is, and the proper data if not. I think the timer will be best for that function. This is instead of using the direct tag link in the DBB properties.
I think I answered my own question........!
Is there a standard VB style label control in VS? I can only seem to find ones that can't be resized at design time...