Parker Automation Gemini GV6K Command Reference Manual page 257

Servo drive/controller
Table of Contents

Advertisement

in which the scan takes place should be considered when creating PLCP programs to minimize the effects
of such a lag. One way to avoid the lag is to create a binary variable as a temporary holding place for the
desired output states. The last commands before the
according to the final status of the variable, such that all output states are written at the same time, just as
the scan completes. This method is demonstrated in the example program below.
For more information on defining a PLC program, refer to the
Example:
DEF PLCP3
; Binary states of outputs 1-6 are represented by VARB1 bit 1-6.
; Outputs 1-6 are set at the end of the program.
VARB1=b000000
IF(IN.1=b1)
VARB1=VARB1 | b100000
NIF
IF(IN.2=b1)
VARB1=VARB1 | b010000
NIF
IF(IN.3=b1)
VARB1=VARB1 | b001000
NIF
IF(IN.4=b1)
VARB1=VARB1 | b000100
NIF
IF(IN.5=b1)
VARB1=VARB1 | b000010
NIF
IF(IN.6=b1)
VARB1=VARB1 | b000001
NIF
OUT(VARB1)
END
PCOMP PLCP3
SCANP PLCP3
DEF PLCP3
VARB1=b000000
IF(IN.1=b1)
VARB1=VARB1 | b100000
NIF
IF(IN.2=b1)
VARB1=VARB1 | b010000
NIF
IF(IN.3=b1)
VARB1=VARB1 | b001000
NIF
IF(IN.4=b1)
VARB1=VARB1 | b000100
NIF
IF(IN.5=b1)
VARB1=VARB1 | b000010
NIF
IF(IN.6=b1)
VARB1=VARB1 | b000001
NIF
OUT(VARB1)
END
2 System Update Periods are needed to complete the scan
for compiled program PLCP3, for a total of 4 msec.
The response to a TSCAN command would be: *TSCAN4.
statement of the PLCP program can set the outputs
END
; Initialize binary variable 1
; If Input 1 is ON, turn Output 1 ON
; Set binary bit for output 1 only to ON
; If Input 2 is ON, turn Output 2 ON
; Set binary bit for output 2 only to ON
; If Input 3 is ON, turn Output 3 ON
; Set binary bit for output 3 only to ON
; If Input 4 is ON, turn Output 4 ON
; Set binary bit for output 4 only to ON
; If Input 5 is ON, turn Output 5 ON
; Set binary bit for output 5 only to ON
; If Input 6 is ON, turn Output 6 ON
; Set binary bit for output 6 only to ON
; Turn on appropriate outputs
; Compile program PLCP3
; Run compiled program PLCP3 in Scan mode
; The diagram below illustrates the scan.
Time (msec)
Scanning
Pause Scan
Scan
Scanning
Complete
Scanning
Begin New
Scan
Scanning
www.comoso.com
command description.
PLCP
0
2 msec
4 msec
6 msec
Command Descriptions
255

Advertisement

Table of Contents
loading

This manual is also suitable for:

Gemini gt6k

Table of Contents