Controlling a SFC child program
Controlling a child program may be simply achieved by specifying the name of the child program as an action block in a step of its parent program. Below are possible qualifiers that can be applied to an action block for handling a child program:
Qualifier |
Description |
Child (N); |
Starts the child program when the step is activated and stops (kills) it when the step is de-activated. |
Child (S); |
Starts the child program when the step is activated. |
Child (R); |
Stops (kills) the child program when the step is activated. |
Alternatively, you can use the following statements in an action block programmed in ST language. In the following table, prog represents the name of the child program:
Statement |
Description |
GSTART (prog); |
Starts the child program when the step is activated. |
GKILL (prog); |
Stops (kills) the child program when the step is activated. |
GFREEZE (prog); |
Suspends the execution of a child program. |
GRST (prog); |
Restarts a program suspended by a GFREEZE command. |
You can also use the "GSTATUS" function in expressions. This function returns the current state of a child SFC program:
Statement |
Description |
GSTATIS (prog); |
Returns the current state of a child SFC program: |
|
When a child program is started by its parent program, it keeps the inactive status until it is executed (further in the cycle). If you start a child program in a SFC chart, GSTATUS will return 1 (active) on the next cycle. |
Controlling a SFC child program |
IEC 61131-3 Automation platform > Programming - Reference guide > Programming languages - Overview > Sequential Function Chart (SFC) > Controlling a SFC child program |
Created with the Personal Edition of HelpNDoc: Easy Qt Help documentation editor