Using Extended Properties in logic

You can access limit extended properties defined on tags using the .@Min and .@Max syntax. However, you cannot write to extended properties values in logic.
For example:
In the Ladder Editor, you can use limit extended properties on an instruction’s source operand.
LogDesMDNProgAccRLL_v31
In the Function Block Editor, you can access extended properties in logic by wiring an Input Reference to a block’s input pins.
LogDesMDNProgAccFBD_v31
In the Structured Text Editor, you can access limit extended properties in logic on the right hand side of an assignment operation or in a comparison statement. You can also access limit extended properties in logic when you embed structured text in the Sequential Function Chart Editor.
LogDesMDNProgAccST_v31
You need to know which tags have limit extended properties associated with them as there is no indication in the Tag Browser that extended properties are defined for a tag. If however, you try to use extended properties that have not been defined for a tag, the editors show a visual indication (that is: a rung error in Ladder Logic, a verification error X in Function Block Diagrams, and the error underlined in Structured Text) and the routine does not verify.
Restrictions to adding extended properties in logic
These restrictions apply when you use extended properties in logic.
  • Extended properties must be used as an input operand
    Extended properties can be used on an instruction as long as the input (source) operand is a non-boolean atomic data type. That is, if an instruction has operands whose data type is non-atomic or BOOL, limit extended properties can not be used. For example, the ALMD instruction in Ladder Logic does not support extended properties because its configurable operands are of type BOOL.
    In the Ladder Editor, when limit extended properties is used in logic, the value field associated with the source operand is unavailable. You can change the tag's extended properties only in the Tag Properties Pane.
  • Alias Tags with Extended Properties cannot be accessed in Logic
    If alias tag extended properties are used in logic, the routine does not verify.
  • Array Tags are constrained
    A constraint on array tags apply if the array tag uses indirect addressing to access limit extended properties. If an array tag is using indirect addressing to access limit extended properties in logic, the following conditions apply.
    • If the Array Tag has limit extended properties configured, the extended properties are applied to any array element that does not explicitly have that particular extended property configured. For example, if the MyArray has Max configured to 100, then any element of the array that does not have Max configured inherits the value of 100 when being used in logic. However, it will not be visible to you that the value inherited from MyArray is configured in the tag properties.
    • At least one array element must have specific limit extended property configured for indirectly referenced array logic to verify. For example, if MyArray[x].@Max is being used in logic, at least one array element of MyArray[] must have Max extended property configured if Max is not configured by MyArray. If this is not done, if you attempt to access Max in logic on MyArray in logic, the routine does not verify.
    • Under these circumstances a data type default value is going to be used:
      - Array is accessed programmatically with indirect reference.
      - Array tag does not have the extended property configured.
      - Member of array does not have the extended property configured.
      For example for Array of SINT type, when max limit is called in logic for a member, the value 127 will be used.
  • Add-On Instruction In/Out Parameters
    Limits can be configured for input and output parameters. However, limit extended properties should not be defined on an InOut parameter of an Add-On Instruction and should not be used in Add-On Instruction definition logic or the logic does not verify.
    Limits cannot be accessed inside Add-On Instruction logic.
Removing Extended Properties
You cannot remove extended properties that are accessed in logic when the project is online with the controller. The Max and Min check boxes in the Extended Properties box in the Tag Editor are unavailable. You have to go offline in order to remove the extended properties.
Removing extended properties in logic on structure tags is unavailable at the tag level. For example, if MyUDTTag has 2 members, Mem1 being a DINT and the Mem2 being a SINT, if you define limit extended properties in Logic on both members, but are only accessing Max extended properties on Mem1, the Max check box is unavailable in the Extended Properties box in the Tag Properties Pane for both members. You are not able to remove the Max extended properties for MyUDTTag .Mem2 online.
The same applies for Array tags. If limit extended properties is define on an array element and that element is accessed in logic, then limit extended properties cannot be removed from any of the array elements.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal