Program Optimization
ABB Control - AC 31 Page 6-5
1SBC 260400 R1001-b 06.99
1.3. Passing parameters
The following syntax is used when parameters are to be exchanged between a sub-program
and a program:
- Values -> parameters
- The sub-program call
- Parameters -> result
In the example below:
SUB1
EN
VALID1
SUB1
EN
VALID2
VAL1
VAL2
PARAMETER0
RESULT1
RESULT2
PARAMETER1
PARAMETER0
PARAMETER1
VAL1 and VAL2 should be transmitted to the SUB1 sub-program and the results RESULT1
and RESULT2 received. VAL1 and VAL2 are transferred to the variable PARAMETER0 for
processing in the sub-program. The result of this process, PARAMETER1, is transferred to the
variables RESULT1 and RESULT2 for use later in the program.
1.4. Limits
A sub-program may not be called from a sub-program.
The total number of historical values in a sub-program is limited to 128. The timer functions are
not included in this limit.
The total is obtained by multiplying the number of historical values in the sub-programs by the
number of calls.
Should this number be exceeded a class 4 code 145 error will appear and the central unit will
not be able to pass to RUN.
The maximum number of sub-programs is 12.
Should this number be exceeded a class 4 code 144 error will appear and the central unit will
not be able to pass to RUN.