Download SCADAPack E Target 5 Technical Reference

Transcript
SCADAPack E Target 5 Technical Reference
35
END_FOR;
Array access example:
MyDintArray [1,2] := 100;
CAUTION
Like many other Programming Languages, access of an IEC 61131-3 array
variable in a program using an index number beyond the configured
dimension can lead to serious unpredictable results including overwriting of
data, reset of the RTU, etc.
The Resource Compiler Options property, Check Array Index can be enabled to check the bounds on
array accesses at run-time (see below). If an out-of-bounds access is found, System Error 4033, "Kernel
TIC: Boundary check error" is set and the offending Resource is stopped.
'Check Array Index' Property
CAUTION
Enabling the Check Array Index Compiler Option should not be relied upon
to detect all array access errors. If enabled, this option is likely to have a
performance impact on the application's cycle time.
Once an array is defined in a resource's Local or Global Variables Window, the IEC notation ArrayName
[ index ] may be used in any program or I/O Device connection.
When using IEC 61131-3 arrays, keep in mind:
Functions and Function Blocks cannot have parameters of array type, but can have an element of the
exact element ( e.g. using notation ArrayName [7] )
Array elements starts from element index 0 or 1, depending on how it was declared in the resource's
Dictionary.
Array elements can be initialized individually in the resource's Dictionary. Or, write initial values using
a FOR loop in a startup program.