Author Topic: Enhancing Existing Controls (version 3.80)  (Read 3258 times)

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Enhancing Existing Controls (version 3.80)
« on: November 01, 2014, 06:02:59 PM »
One of the new features in Version 3.80 is a control architecture change that allows very easy addition of PLCAdress**** properties.

The way the PLCAddress properties work is by subscribing to the PLC Address specified, then using the returned value to put in the controlled property. The controlled property is the name following PLCAddress name. For example, in a DigitalPanelMeter, the Value property specifies what to display on the meter. Therefore the PLCAddressValue property can be used to specify a PLC Address of where to get the value to put in the Value property.

So now let's say you want to control the decimal on the DigitalPanelMeter using a value in the PLC. The decimal is controlled with the DecimalPosition property. The key to this is to get a value from the PLC to go into that property. Version 3.80 has drastically simplified this The way to do this is to create a property named PLCAddressDecimalPosition. The new controls will parse the property name to see if it starts with PLCAddress and followed by the name of an existing property. If so, it will automatically subscribe to the PLC.

To create this property it takes one line of code.

- Open the DigitalPanelMeter.vb found in the AdvancedHMIControls project.
- Go to the Region of "PLC Related Properties and add this code as the first line in the Region:
Code: [Select]
    Public Property PLCAddressDecimalPosition As String
-Build the Solution
-Add a DigitalPanelMeter and you should see the new property of PLCAddressDecimalPosition