Author Topic: Set, Change and Reset digital panel meter property PLCAddressValue through code  (Read 3008 times)

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Software v3.94 / Ethernet driver / MicroLogix 1000 PLC

Not sure if this is a bug in the software or if I am doing something wrong.

Just doing simple test to see if PLCAddressValue can be set-changed-reset through VB code. It appears to work fine since the label I placed above the meter shows correct address values every time I click on any button.

The control itself starts by getting values from PLC for the 1st set address, then it still keeps on getting the same values from the PLC along with new values for the 2nd changed address (and is flipping between the two). Even after I reset the address to " " (Nothing) the control is still getting the mentioned values.

Attached pictures might help as well.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Try this:

- Open SubscriptionHandler.vb and go to line 59
- Change the code to this:
Code: [Select]
While index < SubscriptionList.Count AndAlso (SubscriptionList(index).CallBack <> callBack Or SubscriptionList(index).PropertyNameToSet <> propertyName)
     index += 1
End While

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Thank you for the response.

It appears to be working correctly now with one exception which is when I remove the address, ie. set it to " ", the display doesn't reset to show 0 (or possibly default value whatever it might be) but still shows the last value it obtained for the previous address. It's not a big deal for me to have it working that way since the label still indicates that there is no address set for the property.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Since the control stops receiving updated data from the PLC when you clear the PLCAddress, it will remain at the last value. If you wanted it to go to a certain value, you will have to do that in your code. For example:

DigitalPanelMeter1.PLCAddressValue=""
DigitalPanelMeter1.Value=0

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Thank you again.

Your suggestions, as could be read in all other posts, provide solution and are just logical.