126
Gemini GV6K/GT6K Command Reference
EXE
Execute a Program From a Compiled Program
Type
PLC Scan Program
Syntax
i%EXEt
Units
i = Task Number
t = Program Name (6 characters or less)
Range
i = 1-10
Default
n/a
Response
n/a
See Also
INSELP, PCOMP, PEXE, PLCP, SCANP
Product Rev
GT6K 6.0
GV6K 6.0
Use the
EXE
command to start a standard (non-compiled) program from within a compiled
PLCP
program. The
EXE
command specifies the name of the program, and the task in which it will be launched. The program
named in the
EXE
command need not be defined at the time the
PLCP
program is compiled; however, the
program must be defined before the
SCANP
or
PRUN
is issued. If no task number is assigned with a
%
prefix,
then the task in which the
PLCP
program is compiled (
PCOMP
) will be the task that runs the program. Note,
however, that the
EXE
program cannot be executed in the Task Supervisor (task 0).
When a
PLCP
program performs an
EXE
command,
SS
bit 28 (
“PROGRAM PENDING”
) will be set in the task
specified by
EXE
command. When background task swapping allows the program to actually start running,
SS.28
will be cleared and
SS
bit 3 (
“PROGRAM EXECUTING”
) will be set. If a
PLCP
program performs an
EXE
command with either of these bits set, the new program will not run, and
SS
bit 32 (
“EXE FAILED”
) will be set.
SS.32
will be cleared upon the next successful
EXE
directed to that task. Because the
PLCP
program ignores the
EXE
command if a currently running program is detected within the specified task, the
EXE
command can only
be used to initiate a new program if the task is not already running a program.
Like the
INSELP
command, the program launched by the
EXE
command will not interrupt a currently running
program, nor will it interrupt a
WAIT
or
T
command.
CAUTION
: Using the
SCANP
command to run a
PLCP
program in Scan mode will cause the
PLCP
program
to execute as often as every system update period (2 ms). An
EXE
command used within a
PLCP
program
running in Scan mode could therefore attempt to launch a program in the specified task as often as every
2 ms. This may not allow enough time for the program launched in the specified task by the
EXE
command
to complete before the same
EXE
command is issued again. As stated, the
PLCP
program will ignore the
EXE
command if a currently running program is detected, so timing must be considered when launching
programs with the
EXE
command.
To execute a compiled program from within a compiled
PLCP
program, use the
PEXE
command.
Example:
DEF PLCP1
; Define PLC program PLCP1
IF(IN.1=b1)
; If input 1 is active
3%EXE PROG1
; Launch program PROG1 in Task 3
ELSE
2%EXE PROG2
; Otherwise launch program PROG2 in Task 2
NIF
END
PCOMP PLCP1
; Compile PLCP1
SCANP PLCP1
; Scan with program PLCP1
www.comoso.com
Summary of Contents for Gemini GV6K
Page 24: ...www comoso com...
Page 40: ...www comoso com...
Page 344: ...www comoso com...
Page 350: ...www comoso com...