Command Descriptions
231
PEXE
Execute a Compiled Program
Type
PLC Mode Compiled Program Execution
Syntax
i%PEXEt
Units
i = Task Number
t = Program Name (6 characters or less)
Range
i = 1-10
Default
n/a
Response
n/a
See Also
EXE, GOBUF, PCOMP, PLCP, SCANP
Product Rev
GT6K 6.0
GV6K 6.0
Use the
PEXE
command to start a compiled
PLCP
program, or compiled
GOBUF
profile from within a
compiled
PLCP
program. The
PEXE
command specifies the name of the compiled program, and the task in
which it will be launched. The program named in the
PEXE
command need not be defined or compiled at
the time the
PLCP
program is compiled; however, the program must be defined and compiled 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 compiled program. Note, however, that the
PEXE
program cannot be executed in the Task Supervisor (task 0).
The
PLCP
program will ignore the
PEXE
command if a currently running program is detected within the
specified task; therefore, the
PEXE
command can essentially only be used to initiate a new task with the
program it is launching. Like the
INSELP
command, the program launched by the
PEXE
command will not
interrupt a currently running program, nor will it interrupt a
WAIT
or
T
command. Also, if launching a
GOBUF
profile, the
PEXE
will not interrupt motion already in progress.
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). A
PEXE
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
PEXE
command to complete before the same
PEXE
command is issued again. As stated, the
PLCP
program will
ignore the
PEXE
command if a currently running program is detected or motion is in progress, so timing
must be considered when launching programs with the
PEXE
command.
To execute a non-compiled program from within a compiled
PLCP
program, use the
EXE
command.
Example:
DEF PLCP1
; Define PLC program PLCP1
1%PEXE PLCP2
; Launch compiled program PLCP2 in task 1
END
DEF PLCP2
; Define PLC program PLCP2
OUT(VARB1)
; Modify outputs
END
PCOMP PLCP1
; Compile PLCP1
PCOMP PLCP2
; Compile PLCP2
SCANP PLCP1
; Scan with program PLCP1
VARB1=h0000
; Set VARB1
TOUT
; Check outputs (response is *TOUT0000_000)
VARB1=b1010
; Reassign VARB1
TOUT
; Check outputs again (response is *TOUT1010_000)
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...