Selecting a data type for a parameter, Creating an alias parameter for a local tag – Rockwell Automation Logix5000 Controllers Add-on Instructions Programming Manual User Manual
Page 31
Designing Add-On Instructions
Chapter 1
Selecting a data type for a parameter
The Logix5000 controllers perform DINT (32 bit) and REAL (32 bit) math
operations, which causes DINT data types to execute faster than other integer data
types. Data conversion rules of SINT to INT to DINT are applied automatically,
and can add overhead. Whenever possible, use DINT data types for the Add-On
Instruction Input and Output parameters.
Creating an alias parameter for a local tag
Alias parameters simplify connecting local tags to an Input or Output tag that is
commonly used in the Add-On Instruction’s application without requiring that
manual code be created to make the association. Aliases can be used to define an
Input or Output parameter with direct access to a local tag or its member.
Changing the value of an alias parameter changes the data of the local tag or local
tag member it represents and vice versa.
Alias parameters are subject to these restrictions:
• Alias parameters must be either Input or Output parameters.
• You can only create an alias parameter for a local tag or its member.
• Only one Input and one Output parameter may be mapped to the same
local tag or the same member of a local tag.
• Only BOOL, SINT, INT, DINT, and REAL data types may be used.
• Alias parameters may not be constants.
• The External Access type of an alias parameter matches the External Access
type of the local tag to which it is mapped.
For information on constants and External Access, see
Using a single dimension array as an InOut parameter
The InOut parameter can be defined to be a single dimension array. When
specifying the size of this array, consider that the user of your array can either:
• Pass an array tag that is the same size as your definition.
• Pass an array tag that is larger than your definition.
When developing your logic, use the Size instruction to determine the actual size
of the referenced array to accommodate this flexibility.
Rock well Automati on Publication 1756- PM010F-EN-P - Oct ober 2014
31