I try to make it simple so I directly drag the controls in the form, but when I change the controls' PLCaddress, the value not changed, it sticks to the one from the address in the form designer.
Dim addr1 as integer = 40001
Dim addr2 as integer = 40011
If DeviceID=1 then
Odometer1.PLCAddressValue.PLCAddress = addr1.ToString
Odometer2.PLCAddressValue.PLCAddress = (addr1+1).ToString
Else
Odometer1.PLCAddressValue.PLCAddress = addr2.ToString
Odometer2.PLCAddressValue.PLCAddress = (addr2+1.ToString
End If