Good morning
I am a newbie, this is my first AdvancedHMI project, I am using two Omron PLC with OmronEthernetFINSCom connector and AdvancedHMIV399xPatched3
I have a couple of RadioButton and a label, my objective is as follows:
- If the user press RadioButton "PLC1", the program should connect OmronEthernetFINSCom with PLC1 Address (192.168.1.80) and show the value at PLCAddressValue D4082 using basic label 36.
- If the user press RadioButton "PLC2", the program should connect OmronEthernetFINSCom with PLC2 Address (192.168.1.81) and show the value at PLCAddressValue D4120 always using basic label 36.
Reading various post on the forum, I'm doing the following:
Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton1.CheckedChanged
If RadioButton1.Checked Then
OmronEthernetFINSCom1.BeginInit()
OmronEthernetFINSCom1.IPAddress = "192.168.1.80"
OmronEthernetFINSCom1.EndInit()
Dim value As New Drivers.PLCAddressItem("D4082")
BasicLabel36.PLCAddressValue = value.PLCAddress
Label23.Text = BasicLabel36.PLCAddressValue
End sub
Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton2.CheckedChanged
If RadioButton2.Checked Then
OmronEthernetFINSCom1.BeginInit()
OmronEthernetFINSCom1.IPAddress = "192.168.1.81"
OmronEthernetFINSCom1.EndInit()
Dim value As New Drivers.PLCAddressItem("D4120")
BasicLabel36.PLCAddressValue = value.PLCAddress
Label23.Text = BasicLabel36.PLCAddressValue
End sub
Default values at Design time are the same as Button1, and Label23 is there for test purpose, it display the right PLC Address as soon as I press one of the two buttons.
When the programs start, BasicLabel36 correctly displays the value from the first Omron PLC address D4082 (as per Design Time settings), but BasicLabel36 change it's value only the first time Button2 is pressed, then it remains immutable...
Thanks in advance if someone could help, I'm really stuck here...
Steve