I was trying to come up with an easy way to do this, but one I came up involves a lot of code and the other involves modifying the MessageDisplayByValue which can seem complicated if you are new to .NET, so I will explain both methods.
This is a method using the DataSubscriber:
- From the All Windows Forms group in the ToolBox, add a Label to the form (in my expample, the name for it is Label2)
- Add a DataSubscriber to the form
- Set PLCAddressValue property
- Double click the DataSubscriber to get to the ValueChanged event handler
- Add this code:
Private Sub DataSubscriber1_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber1.DataChanged
Select Case e.Values(0)
Case "0"
Label2.Text = textoutput01 & "auto off"
Case "1"
Label2.Text = textoutput01 & "auto on"
Case "2"
Label2.Text = textoutput01 & "off"
Case "3"
Label2.Text = textoutput01 & "hand"
Case Else
Label2.Text = "Unknown Message " & e.Values(0)
End Select
End Sub
I know this won't get you completely where you wanted to go, but I wanted to keep it simple enough to be able to understand the concept. If you want to pursue this technique, I can elaborate further.
I will make another post explaining another technique.