Program Instruction Types - Emerson Control Techniques FM-4 Reference Manual

Programming module
Table of Contents

Advertisement

FM-4 Programming Module Reference Manual
Control Loop
Real Time Program
Cyclic Program
User Program
Update Rate
Figure 142:
Diagram of User Programs on Three Tasks, a Real Time Program and a Cyclic Program

Program Instruction Types

Program Flow Instructions
Break
For Switch instruction, break stops the instruction execution flow and continues execution after the EndSwitch instruction.
A break is required to prevent the Case instruction flow continuing the executing through to the next case or default
instructions.
For "Do While" instruction, break stops the instruction execution flow and continues execution after the Loop instruction.
For the "For Count" instruction, break stops the instruction execution flow and continues execution after the Next instruction.
Call Program
This program flow instruction is used to call another program. When the called program finishes the controller picks up where
it left off in the program that called it. This is often used when a section of code is used in multiple places in a program. By
moving the code to another program and calling that program the total number of program lines can be reduced. This can also
make the program easier to understand. Care should be taken not to "nest" more than four program calls due to processor
stack overflow. Therefore, no more than four different programs should be called without returning to the original program.
In the diagram below, => Represents a Call Program instruction
Program0=>Program1=>Program2=>Program3=>Program4 => NO MORE THAN 4!
Example:
Call Program.10
Example:
Call Program.100
154
Cyclic Update = 4x Update Rate
'Program 10 contains a complex home
'routine.
'Program 100 contains a "teach position"
'routine.
Control Loop + Real Time + User Programs on three Tasks.
Cyclic Program fUpdate Rate set to 4x Trajectory Update Rate and
Utilization set to 80%.

Advertisement

Table of Contents
loading

Table of Contents