
Designing Add-On Instructions Chapter 1
Aspect Main Routine Subroutine Add-On Instruction
Accessibility N/A
Within program (multiple copies, one for
each program)
Anywhere in controller (single copy for the
entire project)
Parameters N/A Pass by value
Pass by value with Input and Output
parameters
Numeric parameters N/A No conversion, user must manage
Automatic data type conversion for Input
and Output parameters
Parameters data types N/A Atomic, arrays, structures
Atomic for any parameter
Arrays and structures must be InOut
parameters
Parameter checking N/A None, user must manage
Verification checks that correct type of
argument has been provided for a
parameter
Data encapsulation N/A
All data at program or controller scope
(accessible to anything)
Local data is isolated (only accessible
within instruction)
Monitor/debug In-line code with its data
Mixed data from multiple calls, which
complicates debugging
Single calling instance data, which
simplifies debugging
Supported programming languages FBD, LD, SFC, ST FBD, LD, SFC, ST FBD, LD, ST
Callable from N/A FBD, LD, SFC, ST FBD, LD, SFC through ST, ST
Protection Locked and view only Locked and view only Locked and view only
Documentation Routine, rung, textbox, line Routine, rung, textbox, line
Instruction, revision information, vendor,
rung, textbox, line, extended help
Execution performance Fastest
JSR/SBR/RTN instructions add overhead
All data is copied
Indexed reference impact
Call is more efficient
InOut parameters are passed by reference,
which is faster than copying data for many
types
Parameter references are automatically
offset from passed-in instruction tag
location
Memory use Most used Very compact
Compact call requires more memory than a
subroutine call
All references need an additional word
Edit Online/offline Online/offline Offline only
Import/export
Entire routine, including tags and
instruction definitions to L5X
Entire routine, including tags and
instruction definitions to L5X
Full instruction definition including
routines and tags to L5X
Instruction signature N/A N/A
32-bit signature value seals the instruction
to prevent modification and provide high
integrity
Rock well Automati on Publication 1756- PM010F-EN-P - Oct ober 2014 27
Komentáře k této Příručce