Topic: DMD0152 RUN - Run Program |
|
The Run Program (RUN) instruction is used to initiate the execution of a user-defined Program or a system-defined Program. This instruction does NOT cause the CPU to immediately begin execution of the Program, rather it configures the Program to run when the CPU gets to it as part of the normal scan. For example: if the Program exists later in the execution order the Program will begin execution on the same PLC scan. If the Program exists earlier in the execution order the Program will begin execution on the subsequent scan. If the specified Program contains any Stage instructions the Initial Stage will be enabled.
|
|
Parameters:Note: Use the F9 key or click the 'three dot box' at the right edge of the parameter field to open the Default Element Selection Tool (the Element Picker or the Element Browser) or use the Down-Arrow key (Auto-Complete) on any parameter field to see a complete list of the memory locations that are valid for that parameter of the instruction.
Program - the name of the Program to run. This can be a Program that already exists, or follow the steps below to create a new Program code-block:
Note: choosing to create a new heap item will change the System Configuration which can only be saved to the Do-more CPU when it is in PROGRAM mode. Additional Run mode updates can not be performed until these System Configuration changes have been saved to the CPU.
If a name was entered that is NOT an existing Program, this Create Program message box will be displayed. This could have happened because the Program name was misspelled, or because the programmer wants to create a new Program.
Click Yes to create a new Program using the name provided in the Program field. Note: this does NOT create the code-block, this is only the heap item. The code-block can be created in the next step.
Click No to return to the Editor for the RUN instruction so that a different name can be entered.
If Yes was selected in the previous message box, the programmer will also be given the chance to create the code-block associated with the Program that was just created.
Click Yes to create the code-block at this time. The associated code-block will be created and the Code-block Configuration dialog will then be displayed where the user can configure the runtime settings and the code-block protection.
Click No to create the code-block later. Note: the code-block for this Program must be created before the project can be downloaded to the CPU.
If an existing RUN instruction is being edited and the Program name is changed to Program that does not exist, a different Create Program message box will be displayed. Again, this could have happened because the Program name was misspelled, or because the programmer wants to create a new Program.
Click Yes to create a new Program using the name provided in the Program field. Note: this does NOT create the code-block, this is only the heap item. The code-block can be created in the next step.
Click No to return to the Editor for the RUN instruction so that a different name can be entered.
|
|
Status Display:
The gray triangle at the right end of an input leg indicates the input is edge triggered Each time the input logic transitions from OFF to ON this instruction will execute. With each execution, this instruction will run to completion even if the input logic transitions to OFF before the instruction completes..
The following fields will be displayed in the status display:
.RanThisScan - will be ON if the Program ran on the current scan and OFF if the Program did not run on the current scan.
.Done - will be ON if the Program has run to completion at least once and the stopped. It will be OFF if the Program is currently running or has not yet been run.
|
|
See Also:
RUN - Run Program
RESTART - Restart Program or Task
SUSPEND - Suspend Program or Task
|
|
Related Topics:
Overview of Code Blocks (Programs, Tasks, Subroutines and Interrupt Service Routines)
Using Interrupt Subroutines on BRX PLCs
Modifying the Execution Order of Programs and Tasks
|
|
Rung Example:
|
|