Working with Control Property Bindings
Control Property bindings define the mapping or relationship between a Property from a Data Source such as Excel and a Property or parameter in the target Control system Template type. Control system Template types contain properties (parameters) that define its class.
Primary Key Attribute
You must specify a single Control Binding with the Primary Key attribute. This is the Control Binding that defines the unique Entity name for the Control Entity that is being updated/created. For the Honeywell platforms this would be the Target Property named "NAME" for LCN types and for PKS CEE Control Modules this would be the "BlockName" Target Property. Click the
button target to add the Primary Key attribute to the selected Control Binding.
Using the Rounding Options
Target properties that are typed as float or double can optionally be rounded using either a constant value or specifying a rounding function based on a source Property value.
The selected item below indicates that the rounding expression uses the SubString(...) function that is recognized by Control Architect. This function uses the following parameters to extract the decimal rounding value from a source property value retrieved from the source Property name _PVFORMAT.
SubString(sourcePropertyName, startingPosition, count, defaultValue)
sourcePropertyName: Specify the source Property name that will contain the expected format value. Honeywell Control types use the parameter PVFORMAT to specify an enumeration value in the enumeration set of { D0, D1, D2, D3 }. You must prefix the Property name with the '_' character to indicate it is referencing a source Property.
startingPosition: Specify the one based character starting position where you expect to parse the decimal value from the enumeration value string. If the PVFORMAT value contained the enumeration value "D1", the decimal value of "1" begins in character position 2.
count: Specify the number of characters to parse that defines the decimal value in the enumeration value string. If the PVFORMAT value contained the enumeration value "D1", we would only need to parse one character to retrieve the full decimal value that defines the rounding expression.
defaultValue: Specify the default rounding expression value to use if the evaluation of the SubString(...) function fails to parse a valid decimal value or if the source Property value is an empty string.
Copy this example: SubString(_PVFORMAT, 2, 1, 1) to use as a rounding expression. The Property PVFORMAT must exist as a Source Property.
You can also specify a constant value such as "2" for the rounding expression, which would round the real value to 2 places to the right of the decimal point.
| Rounding can be disabled or enabled by checking the Check Box in the column labeled EnableRounding.
|
Common Errors
Control Binding Expressions
-
When a Control Binding Property Snippet has been generated, changes made to the target Control Property in the Control Property Template can result in the Control Binding not being evaluated properly. For example, if the defined target Control Property is an Integer type and already used in a Control Binding, then it's script has already been generated based on an Integer type. Subsequently changing this Control Property type to a Double will not result in the Control Binding script being updated to reflect a Double type resulting in truncating floating values to an Integer type when executed in a Control Conversion task. When a Control Binding Template view is opened, it will check the Target Control property types referenced in existing Control Bindings and show an error image if the current target Control Property type does not match the Control Binding scripted Property type.
-
If the target Property attribute
IsCMType is changed after a Property Snippet has been generated for a Control Binding, you will have to manually change the Property Binding attribute that exists in the Property Snippet expression. The IsCMType binding attribute
[IsCMPropertyAttribute(true)] has a logical parameter
true or
false that indicates if the target Property resides in the Control Module container itself and not within an embedded Function Block.
-
When manually adding a Property such as
AssignedTo to a PKS Property set, you must be sure to define it as a CM (Control Module) type property.
Tips & Tricks
-
Use the
F9 Function Key on selected Control Property bindings to set its
DefaultValueIfEmpty value to the value stored in the Target Control Property reference.
-
If you want to specify the Control Execution assignment for a generated Control Module, you may need to manually add the Property name
AssignedTo to the PKS Property set as a CM String type with a default length of 50 characters. This will allow you to assign the CEE node when generating new Control modules.
Function Block Name Change
You can use the following expression as an example of how to change the name of a Block such as an I/O Channel Block:
_NewBlockName + '.' + _NewFBName
Where NewBlockName is the Control Module name Property in the Excel DataSource and NewFBName is the name of the I/O Channel Block Property in the Excel DataSource. The leading '_' underscore character allows you to reference the source properties by their Property name when developing binding expressions.