Beruflich Dokumente
Kultur Dokumente
Section Page
1 PL7-1 Language 3
1.1 Presentation 3
1.2 I/O Addressing 4
1.3 Operands 5
1.4 Operation Codes 7
1.5 PC Scan Cycles 9
2.1 Characteristics 11
2.2 Timer 12
2.3 Counter 13
2.4 Shift Register 14
2.5 Step Counter 15
2.6 Fast Counter/Timer (TSX 17-20 only) 16
3.1 Characteristics 17
3.2 Program Structure 18
4 Program Utilities 19
1
X
Section Page
5 Appendix 25
Index 27
2
2 PL7-1 Language: Structure and functions 2
2.1 Characteristics
Instructions
A PL7-1 language instruction occupies one memory address and is composed of:
A memory address An operation code + An operand
Example : S 0004 A I0,03
Program memory
The number of lines (i.e. instructions) that can be used is limited by the size of the
memory, as follows :
(*) If the Fast task is used, the number of lines of the Master task is reduced by the number of lines
of the Fast task.
Example : With an 8 K memory : Master task = from S0000 to S0918
Fast task = from F0000 to F0006
Program scan
The processor reads and executes the instructions in the ascending order of their
addresses, up to the instruction EP (end of program).
Program jump : JMPi and LABi
The execution of the operation code JMPi immediately jumps the program scan to
the line containing the operation code LABi and the part of the program between
JMPi and LABi is not executed. JMPi and LABi must have the same number; this
number has no relation to the line number.
"IM” function
This function simplifies the logic operations A, AN, O, ON, XO between two series
of instructions.
Principle: Before the execution of each L or LN instruction, the logical result is
memorized in IM until the next L or LN instruction.
I0,03 I0,04
11
2 PL7-1 Language: Structure and functions
2.2 Timer
Presentation
The Timer function permits the time-delayed control of specific actions. The value of
the time-delay is programmable and can be modified by the TSX T317 terminal in the
Adjust mode (ADJ).
Characteristics
Number 32 (from T00 to T31)
Time bases (Ti,B) 4 (10ms, 100ms, 1s, 1mn)
Preset value (Ti,P) 0000 to 9999
Time delay
Remarks : . A program jump over a timer, or the stopping of the PC, does not halt the
running of a timer.
. In the Adjust mode, the current value Ti,V is at 0 if the timer has timed out, has
not been started, or has been initialized by the operation code R.
. On a cold restart, the current value is reset to 0 and the preset value Ti,P is the
value that was defined in the Configuration mode (the adjustment value is lost).
12
2 PL7-1 Language: Structure and functions 2
2.3 Counter
Presentation
The counter function permits the upcounting or downcounting of external or internal
events. The preset value can be modified by the TSX T317 terminal in the Adjust
mode.
Characteristics
Number 15 (from C00 to C14)
Preset value (Ci,P) 0000 to 9999.
Examples
L C00 K00123 LN C00 K00123
A SY17
Counter C00 different from 123 Counter C00 more than or equal to 123
Counter C00 more than 123 Counter C00 less than or equal to 123
Remarks : . The system bit SY17 can be used several times in the program for one or
more counters. It always affects the counter Ci immediately upstream of the
operand SY17.
. When the counter reaches its preset value (Ci,P) it is automatically reset to
0000.
. On a cold restart, the current value is reset to 0000 and the preset value
(Ci,P) is the value that was defined in the Configuration mode (the adjust
ment value is lost).
13
2 PL7-1 Language: Structure and functions
Characteristics
Number of registers 8 (from SR0 to SR7)
Number of bits in a register 16 (from SRi,00 to SRi,15)
Operation
Initial state :
Similarly, CD SRi shifts all the biits of the register one place to the right, in this case
the bit shifted out is bit 00.
If more than 16 bits have to be shifted, several registers can be cascaded in the
program.
Example
Shift the register one place to the left every second. Bit 00 must take the inverse state
of bit 15.
Program
14
2 PL7-1 Language: Structure and functions 2
Presentation
A step counter is a series of steps which can be associated with actions. The progress
from one step to another can be controlled by internal or external events.
Only one step of a step counter can be at state 1.
Characteristics
Number of step counters 8 (from SC0 to SC7)
Number of steps of a step counter 256 (from SCi,000 to SCi,255).
Operation
Input CU
Output CD
No. of step at 1
Example
Program step counter 0 to be incremented by input I0,02 and to be reset to 0 by input
I0,03 or when it reaches step 3.
Step 0 controls output O0,01, step 1 controls output O0,02 and step 2 controls output
O0,03.
Program
incrementation
Remark : On a cold restart, the active step is reset to 0 and step 0 of each step counter
is set to 1.
15
2 PL7-1 Language: Structure and functions
Presentation
The TSX 17-20 micro-PC is equipped with a fast counter C15 which, depending on
the way it is configured, can be used as a fast counter or a fast timer. The preset value
is defined in the Configuration mode and can be modified by the terminal in the Adjust
mode, or by the program with the operation code S.
Characteristics
. Fast counter (configuration by default) :
The maximum frequency of the counter is 2 KHz. It has two physical inputs (a
counting input and a reset input) permitting the connection of 5VDC and 24VDC
sensors. Counting : 10 000 points.
. Fast timer :
In the fast timer, an internal time base of 0.555ms replaces the physical counting
input. A rising edge on the reset input resets the current value of the timer to 0.
System bit SY 15
The 9-pin D-type connector in the top left corner of the TSX 17-20 has two
independent, isolated inputs :
. Reset input :
0V = pin 5; 5V = pin 8; 24V = pin 9
Remarks . Resetting of the counter to 0 by the physical input resets the current value
only (the preset value is retained).
. By associating the fast counter with a step counter (in which each step is
loaded with a value K), a fast counter with multiple preselections can be
obtained.
. On a cold restart, the current value is reset to 0 and the preset value is the
value that was defined in the Configuration mode.
16
3 PL7-1 Language: Grafcet 3
3.1 Characteristics
Presentation
The PL7-1 language comprises 62 Grafcet steps maximum, including the initial
steps. Within this limitation, the number of simultaneously active steps is unlimited.
Instructions
=*= i initial step i (*),
-*- i step i (*),
# deactivation of the current step without activation of any other step,
#i activation of step i after deactivation of the current step,
=*= POST start of Post-processing and end of Sequential processing,
Xi read/write bit associated with step i.
(*) The first step =*= i or -*- i that is written indicates the start of Sequential
processing and therefore the end of Pre-processing.
1 4
2 5 6
3 7
Simultaneous sequences
8 14
I0,07 I0,10
9 10 15 16
11 12 17
=1 I0,12. I0,13
13 18
I0,14
17
3 PL7-1 Language: Grafcet
Master task
Pre-processing :
= a series of instructions.
S000 L ....
.... Role
Processing of :
....
- mains break/return,
Pre-processing - failures,
Sn .... - application operating modes:
. init : by system bit SY21,
. reset : by system bit SY22,
. prepositioning of the Grafcet by system
bits SY22 and SY23,
. freezing of the Grafcet by system bit
SY23,
- input logic.
Sn+1 =*= i
.... Sequential processing :
= a series of instructions.
Sequential processing Role
Sequential processing of the application :
Sj .... steps and transitions and their associated
actions and conditions.
The scan cycle is defined in Section 1.5. Only the steps that are active (or to be
activated or deactivated) and their associated instructions are executed in the
Sequential processing section.
Reminder : Grafcet instructions must not be used in the Fast task.
18
4 Program Utilities 4
Consequences :
. system bit SY01 set to 1,
. all outputs reset to 0 (*),
. unsaved internal bits (B128 to B255) reset to 0,
. saved internal bits (B000 to B127) and Grafcet steps retain their states, and timers,
counters, shift registers and step counters retain their values,
. the scan restarts from where it stopped but without updating of outputs at the end
of the cycle, the next cycle is executed normally (inputs, program, outputs) and
SY01 is reset to 0 by the system.
(*) with PLC software versions earlier than V1.2, all output states are saved.
Possible causes :
. back-up battery defective or absent,
. change of user program back-up cartridge,
. system bit SY00 set to 1 by the terminal or the program,
. initialization of the PLC by the terminal.
Consequences :
. system bit SY00 set to 1,
. all internal bits, I/O bits and current values of functions are reset to 0 (registers at
0, step counters at step 0, etc.),
. loss of the adjustment values modified by the terminal and resetting to the values
defined in the Configuration mode,
. cancellation of forcings,
. acknowledgement of an I/O fault,
. reinitialization of the Grafcet,
. the scan restarts at the start of the cycle (inputs, program, outputs) and system bit
SY00 is reset to 0 by the system.
Remark The Fast task cannot be executed until system bits SY00 and SY01 have been
reset to 0, i.e. not until after the execution of the first complete cycle.
19
4 Program Utilities
Example L SY01 If SY01 = 1 (hot restart) then set SY00 to 1 to initialize the PC.
S SY00 These two bits are reset to 0 by the system at the end of the next
cycle.
Presentation
The program and data are stored in the RAM memory of the PC. This memory has
an autonomy of 1 hour. The autonomy of the RAM can be increased to 2 years by
installing a TSX 17 ACC1 lithium back-up battery (refer to the installation manual).
For permanent back-up storage, the user program can also be transferred to a TSX
MC70 E38 or E324 EEPROM memory cartridge.
Presentation
The input I0,00 and the output O0,00 of the basic PC module can each be configured
either as normal I/O or for special functions :
Input I0,00
Remarks . IO,00 and O0,00 must be used in the program only for the function that
was selected in the Configuration mode.
. The RUN/STOP input has priority over a RUN/STOP command from the
terminal.
20
4 Program Utilities 4
System biits
SY10 = 0 : I/O module fault or configuration fault,
Sx,4 = 1 : Internal power supply fault of the coils of the relay outputs of
module x.
21
4 Program Utilities
. Checking,
. Operation or production,
. Stopping.
These different operating modes can be obtained by using the following possibilities
of the Grafcet language :
Use of the Pre-processing section and the system bits facilitates control of the
application operating modes without complicating the program.
Power-up YES
. Power up, Initialization
Processing
NO
The Grafcet system bits SY21, SY22 and SY23 must be used only in the Pre-
processing section. These bits are automatically reset to 0 by the system and must
be written by using operating code S only.
Consequences :
. deactivation of all the active steps and activation of all the initial steps.
22
4 Program Utilities 4
Cause :
. SY22 set to 1 by the program or the terminal.
Consequences :
. deactivation of all the active steps,
. stopping of the scan of the Sequential processing section.
Procedure :
. reset the Grafcet to 0 by setting SY22 to 1,
. preset the steps to be activated by S Xi,
. validate the presetting by setting SY23 at 1.
Jump instructions should be used with caution. Avoid upstream jumps and avoid long
loops in the program which could increase the scan time. Do not make jumps from
one task to another.
Programming of outputs
Each output bit or internal bit must be turned on or off only once in the program, since
only the last state that is scanned is taken into account when the outputs are updated
at the end of the scan cycle.
Sensors that are used in direct safety circuits must not be processed by the PC, but
must be free to act directly on the corresponding actuators.
An automatic restart of the application after a mains power return could be highly
dangerous. Users are therefore strongly recommended to make the restarting of the
application after a mains power return conditional on a manual operation.
23
4 Program Utilities
I1,00
B017
The operation code L or LN always stores the logical result of the previous line in
the IM memory until the next operation code L or LN is encountered.
24
5 Appendix 5
L,LN X X X X X(k) - X - X - X X
A,AN X X X X - - X - X X X X
O,ON X X X X - - X - X X X X
XO X X X X - - X - X X X X
P - X - - - - - - - - - -
S X X X X X(k) - X - X - X -
R X X X X X - - X X - X -
S* X X - - - - - - - - X -
R* X X - - - - - - - - X -
=,=N X X X X - - - - X - X -
=* X X - - - - - - X - X -
CU - - - - X X - X - - - -
except
C15
CD - - - - X X - X - - - -
H - - - - X - - - - - - -
EP
NOP
X = Possible associations
- = Impossible associations
25
5 Appendix
(*) For a program written in the Fast task, add 8 microseconds to the above execution
times for the operation codes L and LN assigned to the operands I, O, B, SY, X,
T and S.
26
Index
B Battery 19,20
D Diagnostics 21
Display of internal bits B240 to B255 6,21
G Grafcet 6,8,9,17,19,22
P Printing 3,5
Program and data storage 20
program jumps 8,10,11,23
Program memory 11
W Watchdog 9
27