AdvancedHMI Software
General Category => Open Discussion => Topic started by: fermin6032 on November 03, 2021, 08:39:00 PM
-
I am working with AdvancedHMI but I am having trouble making the label "label3" take the value of basicLabel2.PLCAddressValue = "Channel1.PLC.DPS" which gets a Boolean value, I have tried various ways and have not succeeded.
I would also like to know how to assign to a c # variable the value of PLCAddressValue = "Channel1.PLC.DPS" instead of assigning it to a basicLabel.
basicLabel2.PLCAddressValue = "Canal1.PLC.DPS";
var valor = basicLabel2.Value;
label3.Text = ""+valor;
-
It sounds like you want to use a DataSubscriber instead of a BasicLabel. The DataSubcriber is essentially a BasicLabel without the visual part.
The code would look something like this:
Private Sub DataSubscriber1_DataChanged_2(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber1.DataChanged
Label1.Text = e.Values(0)
End Sub
-
something like that, but how would I apply it in c#.
since I want to assign the value to a variable to perform an if condition.
-
First principle is do some basic reading.
There are plenty examples of DataSubscribe and how to.