Schneider Electric PL7 Micro/Junior/Pro Appendices Reference manual
Advertisement
Advertisement
Reference manual
PL7 Micro/Junior/Pro
Appendices
07/2008 eng www.schneider-electric.com
2
Document Set
At a Glance This manual is made up of three volumes: z z z
Volume 1: Description of the PL7 software z z
General
Ladder language z z z
Instruction List language
Structured Text language
Grafcet language
DFB function blocks z z Functional modules
Volume 2: Detailed description of the instructions and functions z z
Basic instructions
Advanced instructions z Bit objects and system words
Volume 3: Appendices z z z z z z
Differences between PL7-2/3 and PL7-Micro/Junior
Checklist
List of reserved words
In conformance with the IEC standard 1131-3
OLE Automation server
Performance characteristics
Document Set
35013153.01 07/2008
3
Document Set
4
35013153.01 07/2008
Table of Contents
About the Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Chapter 1
Differences between PL7-2/3 and PL7 Micro/Junior . . . . . . . . 11
Chapter 2
Memory aids . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
35013153.01 07/2008
5
6
Chapter 3
Reserved words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Chapter 4
Compliance with IEC standard 1131-3 . . . . . . . . . . . . . . . . . . . 61
Chapter 5
OLE Automation Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
5.1
OLE Automation server operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
5.2
Accessing the PL7 OLE Automation server. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
Remote Mode Server Launch (DCOM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
5.3
35013153.01 07/2008
CompareSymbolPCAndSymbolPLCAppli . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
Chapter 6
Instruction times. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
6.1
6.2
Boolean instruction performance characteristics. . . . . . . . . . . . . . . . . . . . . . . . 143
Instructions on the program and monitoring structures . . . . . . . . . . . . . . . . . . . 153
Instructions on tables of words, double words and floating points . . . . . . . . . . 159
6.3
Boolean instruction performance characteristics. . . . . . . . . . . . . . . . . . . . . . . . 176
Instructions on the program and monitoring structures . . . . . . . . . . . . . . . . . . . 188
35013153.01 07/2008
7
8
Instructions on tables of words, double words and floating points. . . . . . . . . . . 194
6.4
Review of the Memory Usage of Modules on Micro . . . . . . . . . . . . . . . . . . . . . 220
Memory Usage for Modules on Premium . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Method for calculating the number of instructions . . . . . . . . . . . . . . . . . . . . . . . 240
Index
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
35013153.01 07/2008
About the Book
At a Glance
Document Scope This manual gives additional information for programming Micro, Premium and
Atrium PLCs.
Validity Note This publication has been updated to incorporate the functions of PL7 V4.5.
However, previous versions of PL7 can still be implemented.
User Comments We welcome your comments about this document. You can reach us by e-mail at [email protected]
35013153.01 07/2008
9
About the Book
10
35013153.01 07/2008
Differences between PL7-2/3 and
PL7 Micro/Junior
1
Introduction
Contents of this section
This section describes the differences in objects and instructions between
PL7-2/PL7-3 software and PL7 Micro/PL7 Junior software
What's in this
Chapter?
This chapter contains the following topics:
Topic
Immediate values and labels
Bits
Words
Function blocks
Bit and word tables
Optional function blocks
Instructions
Delimiters
Page
11
35013153.01 07/2008
PL7-2/3 and PL7 Micro/Junior difference
Immediate values and labels
Immediate values
Objects
Base 10 integer
Base 2 integer
Base 16 integer
Floating point
Character string
Table showing differences between PL7-2/3 and PL7-Micro/Junior
PL7-2/3
1234
L’10011110’
H’ABCD’
-1.32e12
(PL7-3)
M’aAbBcC’
PL7 Micro/Junior
1234
2#10011110
16#ABCD
-1.32e12
‘aAbBcC’
Labels
Objects
Label
Table showing differences between PL7-2/3 and PL7-Micro/Junior
PL7-2/3
Li i = 0 to 999
PL7 Micro/Junior
%Li i = 0 to 999
12
35013153.01 07/2008
PL7-2/3 and PL7 Micro/Junior difference
Bits
Input bits in rack Table showing differences between PL7-2/3 and PL7-Micro/Junior
Objects
Input bit in rack
Input bit in an indexed rack
Remote input bit
Indexed remote input bit
PL7-2/3
Ixy,i
Ixy,i(Wj) (PL7-3)
RIx,y,i (PL7-3)
RIx,y,i(Wj) (PL7-3)
PL7 Micro/Junior
%Ixy.i
%Ixy.i[%MWj]
%I\chemin\mod.voie
-
Output Bits in rack
Table showing differences between PL7-2/3 and PL7-Micro/Junior
Objects
Output Bit in rack
Output Bit in indexed rack
Remote output bit
Indexed remote output bit
PL7-2/3
Oxy,i
Oxy,i(Wj) (PL7-3)
ROx,y,i (PL7-3)
ROx,y,i(Wj) (PL7-3)
PL7 Micro/Junior
%Qxy.i
%Qxy.i[%MWj]
%Q\chemin\mod.voie
-
I/O error bits in rack
Objects
Module error bit
Channel bit
Table showing differences between PL7-2/3 and PL7-Micro/Junior
PL7-2/3
Ixy,S / Oxy,S
-
PL7 Micro/Junior
%Ixy.MOD.ERR
%Ixy.i.ERR
Remote I/O error bit
Table showing differences between PL7-3 and PL7-Micro/Junior
Objects
Module error bit
Channel bit output channel tripped bit output channel reactivation bit
PL7-3 (only)
-
RDx,y,i/ERRORx,y,i
TRIPx,y,i
RSTx,y,i
PL7 Micro/Junior
%I\chemin\mod.MOD.ERR
%I\chemin\mod.voie.ERR
-
-
35013153.01 07/2008
13
PL7-2/3 and PL7 Micro/Junior difference
Internal bits and system bits
Objects
Internal bit
Indexed internal bit
System bit
Table showing differences between PL7-2/3 and PL7-Micro/Junior
PL7-2/3
Bi
Bi(Wj) (PL7-3)
SYi
PL7 Micro/Junior
%Mi
%Mi[%MWj]
%Si
Step bits Table showing differences between PL7-2/3 and PL7-Micro/Junior
Objects
Step bit
Macro-step bit
Step i bit of macro-step j
Input step bit of macro-step j
Output step bit of macro-step j
PL7-2/3
Xi
XMj (PL7-3)
Xj,i (PL7-3)
Xj,I (PL7-3)
Xj,O (PL7-3)
PL7 Micro/Junior
%Xi
%XMj
%Xj.i
%Xj.IN
%Xj.OUT
Word bits
Objects
Bit j of internal word i
Bit j of indexed internal word i
Bit j of constant word i
Bit j of indexed constant word i
Bit j of register i
Bit k of common word j of station i
Bit j of system word i
Table showing differences between PL7-2/3 and PL7-Micro/Junior
PL7-2/3
Wi,j
Wi(Wk),j (PL7-3)
CWi,j
CWi(Wk),j (PL7-3)
IW/OWxy,i,j
COMi,j,k
COMXi,j,k (X = B, C, D)
SWi,j
PL7 Micro/Junior
%MWi:Xj
%MWi[%MWk]:Xj
%KWi:Xj
%KWi[%MWk]:Xj
%IW/%QWxy.i:Xj
%NWi.j:Xk
%NXWi.j:Xk
%SWi:Xj
14
35013153.01 07/2008
PL7-2/3 and PL7 Micro/Junior difference
Words
Internal words Table showing differences between PL7-2/3 and PL7-Micro/Junior
Objects
Single length internal word
Indexed single length internal word
Double length internal word
Indexed double length internal word
Real internal word
Indexed real internal word
PL7-2/3
Wi
Wi(Wj) (PL7-3)
DWi (PL7-3)
DWi(Wj) (PL7-3)
-
-
PL7 Micro/Junior
%MWi
%MWi[%MWj]
%MDi
%MDi[%MWj]
%MFi
%MFi[%MWj]
Constant words Table showing differences between PL7-2/3 and PL7-Micro/Junior
Objects
Single length constant word
PL7-2/3
CWi
Indexed single length constant word
Double length constant word
CWi(Wj)
CDWi (PL7-3)
Indexed double length constant word CDWi(Wj) (PL7-3)
Real constant word
Indexed real constant word
-
-
PL7 Micro/Junior
%KWi
%KWi[%MWj]
%KDi
%KDi[%MWj]
%KFi
%KFi[%MWj ]
Register words Table showing differences between PL7-2/3 and PL7-Micro/Junior
Objects
Single length input register word
Double length input register word
Single length output register word
Double length output register word
Remote input register word
Remote output register word
PL7-2/3
IWxy,i
-
OWxy,i
-
RIWx,y,i (PL7-3)
ROWx,y,i (PL7-3)
PL7 Micro/Junior
%IWxy.i
%IDxy.i
%QWxy.i
%QDxy.i
%IW\chemin\mod.voie
%QW\chemin\mod.voie
35013153.01 07/2008
15
PL7-2/3 and PL7 Micro/Junior difference
Other words Table showing differences between PL7-3 and PL7-Micro/Junior
Objects
System word
Common word j of station
Status word from a remote discrete module
Status word from a remote discrete module channel
PL7-3 (only)
SWi
COMi,j COMXi,j (where
X=B,C,D)
STATUSAx,y,i (PL7-3)
STATUSBx,y,i (PL7-3)
STSx,y,i (PL7-3)
PL7 Micro/Junior
%SWi
%NW{i}j %NW{[r.]i}j r= network number
-
%IW\chemin\mod.voie.ERR
16
35013153.01 07/2008
PL7-2/3 and PL7 Micro/Junior difference
Function blocks
Timer
Objects
Address
Preset value (word)
Current value (word)
Timer running (bit)
Timer elapsed (bit)
Table showing differences between PL7-2/3 and PL7-Micro/Junior
PL7-2/3
Ti
TI,P
Ti,V
Ti,R
Ti,D
PL7 Micro/Junior
%Ti
%Ti.P
%Ti.V
%Ti.R
%Ti.D
Monostable Table showing differences between PL7-2/3 and PL7-Micro/Junior
Objects
Address
Preset value (word)
Current value (word)
Monostable running (bit)
PL7-2/3
Mi
Mi,P
Mi,V
Mi,R
PL7 Micro/Junior
%MNi
%MNi.P
%MNi.V
%MNi.R
Up/Down
Counter
Table showing differences between PL7-2/3 and PL7-Micro/Junior
Objects
Address
Preset value (word)
Current value (word)
Counting overrun (bit)
Preset achieved (bit)
Down counting overrun (bit)
PL7-2/3
Ci
Ci,P
Ci,V
Ci,E
Ci,D
Ci,F
PL7 Micro/Junior
%Ci
%Ci.P
%Ci.V
%Ci.E
%Ci.D
%Ci.F
35013153.01 07/2008
17
PL7-2/3 and PL7 Micro/Junior difference
Register
Objects
Address
Input word (word)
Output word (word)
Full register (bit)
Empty register (bit)
Table showing differences between PL7-2/3 and PL7-Micro/Junior
PL7-2/3
Ri
Ri,I
Ri,O
Ri,F
Ri,E
PL7 Micro/Junior
%Ri
%Ri.I
%Ri.O
%Ri.F
%Ri.E
Text Block
Objects
Address
Table showing differences between PL7-2/3 and PL7-Micro/Junior
PL7-2/3
TXTi
PL7 Micro/Junior
No text block
Drum Table showing differences between PL7-2 and PL7-Micro/Junior
Objects
Address
Number of active steps (word) activity time of the current step (word)
16 order bits (word)
Final step in progress (bit)
PL7-2
Di (PL7-2)
Di,S
Di,V
Di,Wj
Di,F
PL7 Micro/Junior
%DRi
%DRi.S
%DRi.V
%DRi.Wj
%DRi.F
Fast Counter/
Timer
Objects
Address
Preset value (word)
Current value (word)
External reset (bit)
Preset achieved (bit)
Counting running (bit)
Table showing differences between PL7-2 and PL7-Micro/Junior
PL7-2
FC (PL7-2)
FC,P
FC,V
FC,E
FC,D
FC,F
-
-
-
-
-
PL7 Micro/Junior
-
18
35013153.01 07/2008
PL7-2/3 and PL7 Micro/Junior difference
Real time clock Table showing differences between PL7-2 and PL7-Micro/Junior
Objects
Address
"WEEK" or "YEAR" type day selection MTWTFSS (word)
Starting setpoint (word)
End setpoint (word)
Current value < setpoint (bit)
Current value = setpoint (bit)
Current value > setpoint (bit)
PL7-2
H (PL7-2)
VD
BGN
=
>
END
< -
-
-
-
-
-
PL7 Micro/Junior
-
35013153.01 07/2008
19
PL7-2/3 and PL7 Micro/Junior difference
Bit and word tables
Bit strings
Objects
Internal bit string
Input bit string
Output bit string
Grafcet step bit string
Macro-step bit string
Table showing differences between PL7-2/3 and PL7-Micro/Junior
PL7-2/3
Bi[L]
Ixy,i[L] (PL7-3)
Oxy.i[L] (PL7-3)
Xi[L] (PL7-3)
XMi[L] (PL7-3)
PL7 Micro/Junior
%Mi:L
%Ixy.i:L
%Qxy.i:L
%Xi:L
-
Character strings
Objects
String
Table showing differences between PL7-2/3 and PL7-Micro/Junior
PL7-2/3
-
PL7 Micro/Junior
%MBi:L (with i pair)
20
35013153.01 07/2008
PL7-2/3 and PL7 Micro/Junior difference
Word tables Table showing differences between PL7-2/3 and PL7-Micro/Junior
Objects
Internal word table
Indexed internal word table
Double internal word table
Indexed double internal word table
Constant word table
Indexed constant word table
Constant double word table indexed double constant word table
Real table
Indexed real table
Constant real table
Indexed constant real table
Remote input element table
Remote output element table
Indexed remote input element table
Indexed remote output element table
PL7-2/3
Wi[L]
Wi(Wj)[L]
DWi[L] (PL7-3)
DWi(Wj)[L] (PL7-3)
CWi[L]
PL7 Micro/Junior
%MWi:L
%MWi[%MWj]:L
%MDi:L
%MDi[%MWj]:L
%KWi:L
CWi(Wj)[L]
CDWi[L] (PL7-3)
-
CDWi(Wj)[L] (PL7-3)
-
%KWi[%MWj]:L
%KDi:L
%KDi[%MWj]:L
%MFi:L
%MFi[%MWj]:L
-
-
RIx,y,i[L] (PL7-3)
%KFi:L
ROx,y,i[L] (PL7-3) -
RIx,y,i(Wj)[L] (PL7-3) -
ROx,y,i(Wj)[L] (PL7-3) -
%KFi[%MWj]:L
-
35013153.01 07/2008
21
PL7-2/3 and PL7 Micro/Junior difference
Optional function blocks
OFB Table showing differences between PL7-3 and PL7-Micro/Junior
Objects
Address
OFB Element
Indexed OFB Element
OFB element table
Indexed OFB element table
PL7-3 (only)
< OFB >i
< OFB >i , <element>
< OFB >i , <element> (Wj)
< OFB >i , <element> [L]
< OFB >i , <element> (Wj)[L]
PL7 Micro/Junior
-
-
-
-
-
22
35013153.01 07/2008
PL7-2/3 and PL7 Micro/Junior difference
Instructions
Bit instructions
Objects
Logical inversion
AND
OR
Exclusive OR
Rising edge
Falling edge
Set to 1
Set to 0
Table showing differences between PL7-2, PL7-3 and PL7-Micro/Junior
PL7-2
-
AND
OR
-
-
XOR
-
-
PL7-3
NOT
*
+
-
RE
FE
SET
RESET
PL7 Micro/Junior
NOT
AND
OR
XOR
RE
FE
SET
RESET
35013153.01 07/2008
23
PL7-2/3 and PL7 Micro/Junior difference
Word and double word instructions
Objects
Addition
Subtraction
Multiplication
Division
Comparison
Remainder of a division
Square root
Absolute value logical AND logical OR exclusive logical OR
Logical complement
Incrementation
Decrementation
Logical shift left
Logical shift right
Rotate shift left
Rotate shift right
Table showing differences between PL7-2, PL7-3 and PL7-Micro/Junior
AND
OR
XOR
-
-
CPL
-
-
SLC
SRC
-
*
PL7-2
+
/
>,>=,<,<=,=,<>
MOD
-
-
AND
OR
XOR
CPL
INC
DEC
SHL
SHR
SLC
SRC
-
*
PL7-3
+
/
>,>=,<,<=,=,<>
REM
SQRT
ABS
AND
OR
XOR
CPL
INC
DEC
SHL
-
*
PL7 Micro/Junior
+
/
>,>=,<,<=,=,<>
REM
SQRT
SHR
ROL
ROR
24
35013153.01 07/2008
Floating point instructions
PL7-2/3 and PL7 Micro/Junior difference
Table showing differences between PL7-3 and PL7-Micro/Junior
Objects
Addition
Subtraction
Multiplication
Division
Square root
Absolute value
Equality test
Strict superiority test
Strict inferiority test
Other tests
PL7-3
ADDF
SUBF
MULF
DIVF
SQRTF
-
EQUF
SUPF
INFF
-
-
*
PL7 Micro/Junior
+
/
SQRT
ABS
=
>
<
>=, <=, <>
Byte string instructions
Table showing differences between PL7-3 and PL7-Micro/Junior
Objects
Rotate shift
PL7-3
SLCWORD
PL7 Micro/Junior
-
35013153.01 07/2008
25
PL7-2/3 and PL7 Micro/Junior difference
Conversion instructions
Table showing differences between PL7-2, PL7-3 and PL7-Micro/Junior
Objects
BCD Binary file conversion
Binary BCD file conversion
ASCII Binary file conversion
Binary ASCII file conversion
Gray Binary file conversion
Floating point Integer conversion
Integer Floating point conversion
BCD Floating point conversion
Floating point BCD conversion
ASCII Floating point conversion
Floating point ASCII conversion
PL7-2
BCD
BIN
ATB
BTA
-
-
-
-
-
-
-
PL7-3
DTB
BTD
ATB
BTA
GTB
FTB
FTF
DTF
FTD
ATF
FTA
PL7 Micro/Junior
BCD_TO_INT
INT_TO_BCD
STRING_TO_INT or
STRING_TO_DINT
INT_TO_STRING or
DINT_TO_STRING
GRAY_TO_INT
REAL_TO_INT or
REAL_TO_DINT
INT_TO_REAL or
DINT_TO_REAL
BCD_TO_REAL
REAL_TO_BCD
STRING_TO_REAL
REAL_TO_STRING
Table instructions
Table showing differences between PL7-3 and PL7-Micro/Junior
Objects PL7-3
Arithmetic operations
Logic operations
Addition of words from a table
+, -, *, /, REM
AND, OR, XOR
+
Searching for the first different word EQUAL
Searching for the first equivalent word SEARCH
PL7 Micro/Junior
+, -, *, /, REM
AND, OR, XOR, NOT
SUM
EQUAL
FIND_EQU
26
35013153.01 07/2008
Program instructions
Interruption
Instructions
Explicit I/O instructions
PL7-2/3 and PL7 Micro/Junior difference
Table showing differences between PL7-3 and PL7-Micro/Junior
Objects
Jump
Calling the subroutine
Return of subroutine
Stopping the application
Conditional sequence
Iterative sequence
PL7-3
JUMP Li
-
RET
HALT
IF/THEN/ELSE
WHILE/DO
PL7 Micro/Junior
JUMP %Li
CALL SRi SRi
RETURN
HALT
IF/THEN/ELSE/END_IF
WHILE/DO/END_WHILE
Table showing differences between PL7-3 and PL7-Micro/Junior
Objects
Test
Masking
Unmasking
Acknowledgment
Setting an IT on a module
PL7-3
READINT
MASKINT
DMASKINT
ACKINT
SETIT
PL7 Micro/Junior
-
MASKEVT
UNMASKEVT
-
-
Table showing differences between PL7-3 and PL7-Micro/Junior
Objects
Reading discrete inputs
Writing discrete outputs
Reading registers
Writing registers
Reading words
Writing words
PL7-3
READBIT
WRITEBIT
READREG
WRITEREG
READEXT
WRITEEXT
-
-
-
PL7 Micro/Junior
-
-
-
35013153.01 07/2008
27
PL7-2/3 and PL7 Micro/Junior difference
Function block instructions
Table showing differences between PL7-2, PL7-3 and PL7-Micro/Junior
Objects
Preset
Start
Task activation
Reset to zero
Task deactivation
Counting
Down counting
Storing in a register
Removal from register
Receiving a message
Sending a message
Sending/Receiving a message
Execution of an OFB
Reading telegrams
PL7-3
PRESET Ti / Ci
PL7 Micro/Junior
PRESET %Ti / %Ci
START Ti / Mi
START CTRLi
START %Ti / %MNi
-
RESET Ci / Ri / TXTi RESET %Ci / %Ri
RESET CTRLi -
UP Ci UP %Ci
DOWN Ci
PUT Ri
GET Ri
INPUT TXTi
OUTPUT TXTi
EXCHG TXTi
EXEC < OFBi >
READTLG
DOWN %Ci
PUT %Ri
-
-
-
GET %Ri
-
-
28
35013153.01 07/2008
PL7-2/3 and PL7 Micro/Junior difference
Delimiters
Differences Table showing differences between PL7-2/3 and PL7-Micro/Junior
Objects
Assignment
Left bracket for indexing
Right bracket for indexing
Table length
(
)
PL7-2/3
->
[length]
[
]
PL7 Micro/Junior
:=
:length
35013153.01 07/2008
29
PL7-2/3 and PL7 Micro/Junior difference
30
35013153.01 07/2008
Memory aids
Introduction
Contents of this section
This section contains memory aids for PL7 language instructions
2
35013153.01 07/2008
31
Memory aids
What's in this
Chapter?
This chapter contains the following topics:
Topic
Boolean Instructions
ST Instructions
LD and IL function blocks
ST function blocks
ST control structures
Full arithmetic (single and double length)
Arithmetic on floating points
Digital conversions
Bit tables
Instructions on tables
Floating point table instructions
"Orpheus" instructions
Explicit exchanges
Time management instructions
Timing instructions
Data storage instructions
Character string instructions
Multi-tasking and events
Communication
Page
32
35013153.01 07/2008
Boolean Instructions
Memory aids
35013153.01 07/2008
33
Memory aids
Memory Aid Quick memory-aid for Boolean instructions
Boolean instructions LD
Accumulator or network intialization
IL
LD TRUE
Direct (read) test, invert, rising edge, falling edge
LD, LDN
LDF, LDR
P N
Logical AND
P
P
N
N
AND ANDN ANDR ANDF
AND( AND(N AND(R AND(F
Inversion
Exclusive logical OR
(direct, invert, rising edge, falling edge)
Write (direct, inverse)
-
-
Set
Reset
Operate block
(contents: see following pages)
Horizontal comparison block
(contents: see following pages)
S action
OPERATE
COMPARE comparison
R
N
XOR XORN
XORR XORF
ST
STN
S
R
[action]
LD [comparison]
AND [comparison]
AND( [comparison]
OR [comparison]
OR( [comparison]
XOR [comparison]
34
35013153.01 07/2008
Boolean instructions LD
Vertical comparison block
MemoryPusH
MemoryReaD
MemoryPOP
COMPARE
EN
>
=
<
<>
IL
-
MPS
MRD
MPP
Memory aids
35013153.01 07/2008
35
Memory aids
ST Instructions
Memory aid Quick memory-aid for ST instructions
Instructions
Assignment
OR boolean
AND boolean
OR boolean exclusive
Inversion
Rising edge, falling edge
Set on 1, set on 0
ST
:=
OR
AND
XOR
NOT
RE, FE
SET, RESET
36
35013153.01 07/2008
LD and IL function blocks
Memory aid
Function blocks
IEC timers
PL-3 timer
Up/Down Counter
Monostable
Quick memory-aid for LD and IL function blocks
LD
%TMi
IN Q
IL
IN structure BLK..END_BLK
-
E
%Ti
C
D
R
R
%Ci
S
E
D
F CU
CD
R
S
CU
CD structure BLK..END_BLK
S
%MNi
R
S structure BLK..END_BLK
Register
Drum
R
%Ri
I
O
F
E
R
%DRi
U
F
R
I
O
STN structure BLK..END_BLK
R
U structure BLK..END_BLK
Memory aids
35013153.01 07/2008
37
Memory aids
ST function blocks
Memory aid Quick memory-aid for ST function blocks
Function blocks
IEC timer
PL-3 timer
Up/Down Counter
Monostable
Register
Drum
ST
START%TMi
DOWN%TMi
PRESET%Ti
START%Ti
STOP%Ti
RESET%Ci
PRESET%Ci
UP%Ci,DOWN%Ci
START%MNi
RESET%Ri
PUT%Ri
GET%Ri
RESET%DRi
UP%DRi
38
35013153.01 07/2008
Memory aids
ST control structures
Memory aid Quick memory-aid for ST control structures
Control structures
Conditional action
Conditional iterative action
Conditional iterative action
Repetitive action
Loop output instruction
ST
IF...THEN...ELSIF...THEN..ELSE...END_IF;
WHILE...DO...END_WHILE;
REPEAT...UNTIL...END_REPEAT;
FOR...DO...END_FOR;
EXIT
35013153.01 07/2008
39
Memory aids
Full arithmetic (single and double length)
Memory aid Quick memory-aid for full arithmetic instructions
Full arithmetic (single and double length) LD/IL/ST
Transfer or initialization
Comparisons
:=
= <> <= < > >=
Addition, subtraction, multiplication, division, division remainder
+ - * / REM
ET, OU, OU exclusive, complement
Absolute value, Square root
Increment
Decrement
Left shift
Right shift
Rotate shift left
Rotate shift right
AND OR XOR NOT
ABS, SQRT
INC
DEC
SHL
SHR
ROL
ROR
40
35013153.01 07/2008
Arithmetic on floating points
Memory aid Quick memory-aid for floating point arithmetic instructions
Arithmetic on floating points
Transfer or initialization
Comparisons
Addition, subtraction, multiplication, division, integer part
Absolute value, square root
Logarithm, exponentials
Sine, cosine, tangent
Arc sine, arc cosine, arc tangent
Degree <--> radian conversion
LD/IL/ST
:=
= <> <= < > >=
+ - * / TRUNC
ABS, SQRT
LOG, LN, EXPT, EXP
SIN, COS, TAN
ASIN, ACOS, ATAN
DEG_TO_RAD, RAD_TO_DEG
Memory aids
35013153.01 07/2008
41
Memory aids
Digital conversions
Memory aid Quick memory-aid for digital conversion instructions
Digital conversions
BCD conversion to single length integers
GRAY conversion to single length integers
Single length integer conversion to BCD
Single length integer conversion to floating point
Double length integer conversion to floating point
Floating point conversion to single length integers
Floating point conversion to double length integers
32 bit BCD conversion to 32 bit integers
32 bit integer conversion to 32 bit BCD
32 bit BCD conversion to 16 bit integers
16 bit integer conversion to 32 bit BCD
Extracting the least significant word from a double word
Extracting the most significant word from a double word
Concatenation of 2 single words
LD/IL/ST
BCD_TO_INT
GRAY_TO_INT
INT_TO_BCD
INT_TO_REAL
DINT_TO_REAL
REAL_TO_INT
REAL_TO_DINT
DBCD_TO_DINT
DINT_TO_DBCD
DBCD_TO_INT
INT_TO_DBCD
LW
HW
CONCATW
42
35013153.01 07/2008
Bit tables
Memory aid Quick memory-aid for instructions on bit tables
Bit tables
Transfer or initialization
Copy of a bits table in a bits table
AND between two tables
OR between two tables
OR exclusive between two tables
Negation in a table
Copy of a bits table in a word table
Copy of a bits table in a double word table
Copy of a word table in a bits table
Copy of a double word table in a bits table
Calculation of table length
LD/IL/ST
:=
COPY_BIT
AND_ARX
OR_ARX
XOR_ARX
NOT_ARX
BIT_W
BIT_D
W_BIT
D_BIT
LENGTH_ARX
Memory aids
35013153.01 07/2008
43
Memory aids
Instructions on tables
Memory aid Quick memory aid for instructions on tables
Instructions on tables
Transfer or initialization
Arithmetic operations between tables
Logic operations between tables
LD/IL/ST
:=
+ - * / REM
AND OR XOR
Arithmetic operations between a table and an integer
Logic operations between a table and an integer
Table elements complement
Sum of all the table elements
Comparison of two tables
Search for the first table element which is equal to certain value
+ - * / REM
AND OR XOR
NOT
SUM
EQUAL
FIND_EQW, FIND_EQD
Search for the first table element which is equal to certain value from a set position FIND_EQWP, FIND_EQDP
Search for the first table element which is greater than a certain value FIND_GTW, FIND_GTD
Search for the first table element which is less than a certain value FIND_LTW, FIND_LTD
Search for the greatest value in a table
Search for the smallest value in a table
Number of occurrences of value within a table
Left rotation shift of a table
Right rotation shift of a table
Table sort (increasing or decreasing direction)
Calculation of table length
MAX_ARW, MAX_ARD
MIN_ARW, MIN_ARD
OCCUR_ARW, OCCUR_ARD
ROL_ARW, ROL_ARD
ROR_ARW, ROL_ARW
SORT_ARW, SORT_ARD
LENGTH_ARW, LENGTH_ARD
44
35013153.01 07/2008
Floating point table instructions
Memory aid Quick memory aid for instructions on floating point tables
Floating point table instructions
Transfer and intialization
Sum of all the table elements
Comparison of two tables
Search for the first table element which is equal to certain value
Search for the first table element which is greater than a certain value
Search for the first table element which is less than a certain value
Search for the greatest value in a table
Search for the smallest value in a table
Number of occurrences of a certain value within a table
Left rotation shift of a table
Right rotation shift of a table
Table sort (increasing or decreasing direction)
Calculation of table length
LD/IL/ST
:=
SUM_ARR
EQUAL_ARR
FIND_EQR
FIND_GTR
FIND_LTR
MAX_ARR
MIN_ARR
OCCUR_ARR
ROL_ARR
ROR_ARR
SORT_ARR
LENGTH_ARR
Memory aids
35013153.01 07/2008
45
Memory aids
"Orpheus" instructions
Memory aid Quick memory aid for "Orpheus" instructions
"Orpheus" instructions
Left shift on the word with shifted bit retrieval
Right shift on the word with sign extension and shifted bit retrieval
Right shift on the word, with filling using 0 and shifted bit retrieval
Up/down counting with overshoot signaling
Left rotation shift
Right rotation shift
LD/IL/ST
WSHL_RBIT, DSHL_RBIT
WSHR_RBIT, DSHR_RBIT
WSHRZ_C, DSHRZ_C
SCOUNT
ROLW, ROLD
RORW, RORD
46
35013153.01 07/2008
Explicit exchanges
Memory aid Quick memory aid for explicit exchanges
Explicit exchanges
Read %M parameters using a logic channel
Read status %M using a logic channel
Restore %M parameters using a logic channel
Save %M parameters using a logic channel
Write command %M using a logic channel
Write %M parameters using a logic channel
LD/IL/ST
READ_PARAM
READ_STS
RESTORE_PARAM
SAVE_PARAM
WRITE_CMD
WRITE_PARAM
Memory aids
35013153.01 07/2008
47
Memory aids
Time management instructions
Memory aid Quick memory aid for time management instructions
Time management instructions
Dater
Comparisons
Transfer
Reading of date and code for last PLC stop
Reading of system date
System date update
Add time period to a complete date
Add time period to a time of day
Date string conversion
Day of the week
Interval between two dates
Interval between two complete dates
Interval between two times of day
Complete date string conversion
Remove time period from a complete date
Remove time period from a time of day
Duration string conversion
Time of day string conversion
Format duration to hours-mn-secs
LD/IL/ST
SCHEDULE
= <> <= < > >=
:=
PTC
RRTC
WRTC
ADD_DT
ADD_TOD
DATE_TO_STRING
DAY_OF_WEEK
DELTA_D
DELTA_DT
DELTA_TOD
DT_TO_STRING
SUB_DT
SUB_TOD
TIME_TO_STRING
TOD_TO_STRING
TRANS_TIME
48
35013153.01 07/2008
Timing instructions
Memory aid Timing instructions quick memory aid
Timing instructions
Timing on trigger event
Timing on trigger event
Pulse timing
Rectangular signal generator
LD/IL/ST
FTON
FTOF
FTP
FPULSOR
Memory aids
35013153.01 07/2008
49
Memory aids
Data storage instructions
Memory aid Data storage instructions rapid memory aid
Data storage instructions
PCMCIA card storing zone setting
PCMCIA card data writing
PCMCIA card data reading
DATA Archiving card storing zone setting
DATA Archiving card data writing
DATA Archiving card data reading
LD/IL/ST
SET_PCMCIA
WRITE_PCMCIA
READ_PCMCIA
SET_PCM_EXT
WRITE_PCM_EXT
READ_PCM_EXT
50
35013153.01 07/2008
Character string instructions
Memory aid Character string instructions rapid memory aid
Character string instructions
Comparisons
Transfer
Converting a double integer into a string
Converting a single integer into a string
Converting a string into a double integer
Converting a string into a single integer
Floating point string conversion
Floating point conversion into a string
Two string concatenation
Deleting a substring
Searching for a different initial character
Searching for a substring
Inserting a substring
Extracting the left part of a string
String length
Extracting a substring
Replacing a substring
Extracting the right part of a string
LD/IL/ST
= <> <= < > >=
:=
DINT_TO_STRING
INT_TO_STRING
STRING_TO_DINT
STRING_TO_INT
STRING_TO_REAL
REAL_TO_STRING
CONCAT
DELETE
EQUAL_STR
FIND
INSERT
LEFT
LEN
MID
REPLACE
RIGHT
Memory aids
35013153.01 07/2008
51
Memory aids
Multi-tasking and events
Memory aid Multi-tasking and event rapid memory aid
Multi-tasking and events
Task activation / deactivation
Adjusting the task cycle time
Global event masking.
Global event unmasking.
LD/IL/ST
%Si position
%SWi position
MASKEVT
UNMASKEVT
52
35013153.01 07/2008
Communication
Memory aid Communication instructions rapid memory aid
Communication
Stop request for function in action
Send / receive data
Character string read request
Send / receive character string request
Send a character string:
Receiving a telegram
Basic language object reading
Send / receive UNI-TE requests
Send a telegram
Basic language object writing
Shifting a byte to the right in a table
Swapping bytes in a word table
Reading Modbus+ common data
Writing Modbus+ common data
Calling the modem
Immediate server
Writing 1 K messaging
Reading 1 K messaging
LD/IL/ST
CANCEL
DATA_EXCH
INPUT_CHAR
OUT_IN_CHAR
PRINT_CHAR
RCV_TLG
READ_VAR
SEND_REQ
SEND_TLG
WRITE_VAR
ROR1_ARB
SWAP
READ_GDATA
WRITE_GDATA
CALL_MODEM
SERVER
WRITE_ASYN
READ_ASYN
Memory aids
35013153.01 07/2008
53
Memory aids
54
35013153.01 07/2008
Reserved words
3
Reserved Words
List of Reserved
Words
The following reserved words must not be used as symbols.
Words from
A to C
A
ABS
ACCEPT
ACOS
ACTION
ACTIVATE_PULSE
ACTIVE_TIME
ADD
ADDRESS
ADD_DT
ADD_TOD
ADR
AND
ANDF
ANDN
ANDR
AND_ARX
ANY
ANY_BIT
ANY_DATE
ANY_INT
List of reserved words
ANY_REAL
ARRAY
AR_D
AR_DINT
AR_F
AR_INT
AR_R
AR_W
AR_X
ASIN
ASK
ASK_MSG
ASK_VALUE
ASSIGN_KEYS
AT
ATAN
AUX
B
BCD_TO_INT
BIT_D
BIT_W
BLOCK
BODY
BOOL
BOTTOM
BTI
BTR
BY
BYTE
C
CAL
CALC
CALCN
CALL
CALL_COIL
CANCEL
CASE
CD
CHART
CH_M
CLK
CLOSE
COIL
COMMAND
COMMENTS
COMP4
COMPCH
CONCAT
CONCATW
CONF
CONFIGURATION
CONSTANT
CONTROL_LEDS
COPY_BIT
COS
CTD
CTU
CTUD
CU
CLOSED_CONTACT
BLK
ANY_NUM
35013153.01 07/2008
55
Reserved words
Words from
D to E
D
DATE
DATE_AND_TIME
DAT_FMT
DAY_OF_WEEK
DA_TYPE
DEACTIVATE_PULSE
DEC
DELETE
DELTA_D
DELTA_DT
DELTA_TOD
DINT
DINT_TO_REAL
DINT_TO_STRING
DISPLAY_ALRM
DISPLAY_GRP
DISPLAY_MSG
DIV
DMOVE
List of reserved words
DO
DOWN
DR
DRUM
DS
DSHL_RBIT
DSHRZ_C
DSHR_RBIT
DSORT_ARD
DSORT_ARW
DT
DTS
DWORD
D_BIT
E
EBOOL
ELSE
ELSIF
EMPTY
EMPTY_LINE
END
ENDC
ENDCN
END_ACTION
END_BLK
END_BLOCK
END_CASE
END_COMMENTS
END_CONFIGURATION
END_FOR
END_FUNCTION
END_FUNCTION_BLOCK
END_IF
END_MACRO_STEP
END_PAGE
END_PHRASE
END_PROG
END_PROGRAM
END_REPEAT
END_RESOURCE
END_RUNG
END_STEP
END_STRUCT
END_TRANSITION
END_TYPE
END_VAR
END_WHILE
EQ
EQUAL
EQUAL_ARR
ERR
EVT
EXCHG
EXCH_DATA
EXIT
EXP
EXPT
56
35013153.01 07/2008
Words from
F to J
F
FALSE
FAST
FBD
FE
FIFO
FIND
FIND_EQ
FIND_EQD
FIND_EQDP
FIND_EQR
FIND_EQW
FIND_EQWP
FIND_GTD
FIND_GTR
FIND_GTW
FIND_LTD
FIND_LTR
FIND_LTW
List of reserved words
FOR
FPULSOR
FROM
FTOF
FTON
FTP
FUNC
FUNCTION
FUNCTION_BLOCK
F_B
F_EDGE
F_TRIG
G
GE
GET
GET_MSG
GET_VALUE
GLOBAL_COMMENT
GR7
GRAY_TO_INT
GT
GTI
H
HALT
HALT_COIL
HASH_COIL
I
IF
IL
HW
H_COMPARE
H_LINK
IN
INC
INCJUMP
INDEX_CH
INFO
INITIAL_STEP
Words from
L to M
L
LAD
LANGAGE
LANGUAGE
LD
LDF
LDN
LDR
LE
LEFT
LEN
LENGTH_ARD
LENGTH_ARR
LENGTH_ARW
LENGTH_ARX
List of reserved words
LIFO
LIMIT
LINT
LIST
LIT
NL
LOCATION
LOG
LREAL
LT
LW
LWORD
M
MACRO_STEP
MAIN
MASKEVT
MAST
MAX
MAX_ARD
MAX_ARR
MAX_ARW
MAX_PAGES
MAX_STEP
MCR
MCR_COIL
MCS
MCS_COIL
MID
MIN
MIN_ARD
MIN_ARR
MIN_ARW
MN
MOD
MONO
MOVE
MPP
MPS
MRD
MS
MUL
MUX
M_CH
M_MACRO_STEP
Reserved words
INIT_BUTTONS
INPUT
INPUT_CHAR
INSERT
INT
INTERVAL
INT_TO_BCD
INT_TO_REAL
INT_TO_STRING
ITB
ITS
J
JMP
JMPC
JMPCN
JUMP
JUMP_COIL
35013153.01 07/2008
57
Reserved words
Words from
N to P
List of reserved words
N
N1
NAME
NB_ACTIVE_STEPS
NB_ACTIVE_TIME
NB_BLOCKS
NB_COMMON_WORDS
NB_CONSTANT_WORDS
NB_CPT
NB_DRUM
NB_INTERNAL_BITS
NB_INTERNAL_WORDS
NB_MACRO_STEPS
NB_MONO
NB_PAGES
NB_REG
NB_TIMER
NB_TM
NB_TRANSITIONS
NE
NIL
NO
NON_STORED
NOP
NOT
NOT_ARX
NOT_COIL
NOT_READABLE
NO_GR7
NO_PERIOD
N_CONTACT
O
OCCUR
OCCUR_ARD
OCCUR_ARR
OCCUR_ARW
OF
ON
OPEN
OPEN_CONTACT
OPERATE
OR
Words from
Q to R
Q
QUERY
R
R1
RCV_TLG
RE
READ
READ_EVT_UTW
READ_ONLY
READ_PARAM
READ_STS
READ_VAR
READ_WRITE
REAL
REAL_TO_DINT
List of reserved words
REAL_TO_INT
REAL_TO_STRING
REG
REM
REPEAT
REPLACE
REQ
RESET
RESET_COIL
RESOURCE
RESTORE_PARAM
RET
RETAIN
RETC
RETCN
ORF
ORN
ORR
OR_ARX
OTHERS
OUT
OUTIN_CHAR
OUTPUT
OUT_BLK
P
P0
P1
PAGE
PAGE_COMMENT
PANEL_CMD
PERIOD
PHRASE
PHRASE_COMMENT
PID
PID_MMI
PLC
POST
PRESET
PRINT_CHAR
PRIO0
PRIO1
PRIORITY
PRL
PROG
PROGRAM
PROG_LANGAGE
PROG_LANGUAGE
PT
PTC
PUT
PV
PWM
P_CONTACT
RETURN
RET_COIL
RIGHT
ROL
ROLD
ROLW
ROL_ARD
ROL_ARR
ROL_ARW
ROL_DWORD
ROL_WORD
ROR
RORD
RORW
ROR_ARD
ROR_ARR
ROR_ARW
ROR_DWORD
ROR_WORD
RRTC
RS
RTB
RTC
RTS
RUNG
R_EDGE
R_TRIG
58
35013153.01 07/2008
Reserved words
Words from
S to S
S
S1
SAVE
SAVE_PARAM
SCHEDULE
SD
SEARCH
SECTION
SEL
SEMA
SEND
SENDER
SEND_ALARM
SEND_MBX_ALARM
SEND_MBX_MSG
SEND_MSG
List of reserved words
SEND_REQ
SEND_TLG
SERVO
SET
SET_COIL
SFC
SHIFT
SHL
SHOW_ALARM
SHOW_MSG
SHOW_PAGE
SHR
SHRZ
SIN
SINGLE
SINT
Words T to W List of reserved words
T
TAN
TASK
TASKS
THEN
TIME
TIMER
TIME_OF_DAY
TM
TMAX
TMOVE
TO
TOD
TOF
TOFF
TON
TOP
TP
TRANSITION
TRANS_TIME
TRUE
TRUNC
TYPE
TYPES
T_S_AND_LINK
T_S_OR_LINK
U
UDINT
UINT
ULINT
UNMASKEVT
UNTIL
SL
SLCWORD
SMOVE
SOFT_CONFIGURATION
SORT
SORT_ARD
SORT_ARR
SORT_ARW
SQRT
SR
ST
STANDARD
START
STD
STEP
STI
STN
STOP
STR
STRING
STRING_TO_DINT
STRING_TO_INT
STRING_TO_REAL
STRUCT
SUB
SUB_DT
SUB_TOD
SUM
SU_TYPE
SWAP
S_T_AND_LINK
S_T_OR_LINK
UP
USINT
USORT_ARD
USORT_ARW
UTIN_CHAR
V
VAR
VAR_ACCESS
VAR_EXTERNAL
VAR_GLOBAL
VAR_INPUT
VAR_IN_OUT
VAR_OUTPUT
VAR_PUBLIC
VERSION
V_COMPARE
V_LINK
W
WHILE
WITH
WORD
WRITE
WRITE_CMD
WRITE_PARAM
WRITE_VAR
WRTC
WSHL_RBIT
WSHRZ_C
WSHR_RBIT
W_BIT
35013153.01 07/2008
59
Reserved words
Words
X, Y, and Misc
List of reserved words
X
XM
XM_MONO
XM_MULTI
XOR
XORF
XORN
XORR
XOR_ARX
Y
YES
*_TO_* * = Letter
SRi
AUXi
EVTi
XMi
i = integer
60
35013153.01 07/2008
Compliance with IEC standard
1131-3
4
Introduction
Contents of this section
This section describes compliance with IEC standard 1131-3: "Programmable
Controllers"
What's in this
Chapter?
This chapter contains the following topics:
Topic
Compliance with IEC standard 1131-3
Common elements
IL language elements
ST language elements
Common graphics elements
LD language elements
Implementation-dependent parameters
Error Situations
Page
35013153.01 07/2008
61
Compliance with IEC standard 1131-3
Compliance with IEC standard 1131-3
Introduction to
IEC standard
1131-3
IEC Standard 1131-3 "Programmable controllers – Part 3: Programming languages" specifies the syntax and semantics of software elements used for programming programmable controllers.
This standard contains the description of 2 text languages, IL (Instruction List) and
ST (Structured Text); of 2 graphic languages, LD (Ladder Diagram) and FDB
(Function Block Diagram); and a graphic formalism, SFC (Sequential Function
Chart) which is used to structure the internal organization of a programmed sequence.
PL7 programming software is used to program a programmable controller in accordance with the IEC standard. PL7 implements a sub-assembly of language elements defined by the standard, and defines extensions which are authorized within the framework of this standard.
The IEC standard 1131-3 does not define the interactivity rules for software supplied by a manufacturer claiming compliance with the standard. This allows marked flexibility for the introduction and entry of programming elements for the convenience of the user.
The elements of the standard implemented in PL7, information relating to implementation and error detection are all summarized in the compliance tables.
62
35013153.01 07/2008
Compliance with IEC standard 1131-3
Common elements
General Description of the characteristics common to languages which comply with IEC
1131-3
The following table lists implementations in PL7 languages. This information is in regard to tables of characteristics described in the IEC 1131-3 standard. This is for characteristics common to all PL7 languages.
35013153.01 07/2008
63
Compliance with IEC standard 1131-3
Table of characteristics
10
10
10
10
10
6
7
10
10
6
6
6
6
6
6
4
5
4
4
4
4
4
4
2
3
1
2
1
1
1
1
Table No.
1
Characteristics common to all languages:
12
13
14
15
16
8
1a
1
10
6
7
4
5
2
3
8
1
6
7
3
4
1
2
2
1
4a
5a
6a
1
Characteristic No.
1
2
3a
Description of characteristics
Character set required (see paragraph 2.1.1 of 1131-3)
Lower case characters
Number sign (#)
Dollar sign ($)
Vertical line (|)
Index delimiters Left and right square brackets "[ ]"
Upper case and numbers
Upper and lower case, numbers, integrated character underlining
Comments
Text integers (Note 1)
Text integers (Note 1)
Text integers with exponents
Literals in base 2 (Note 1)
Literals in base 16 (Note 1)
Zero and One Booleans
TRUE and FALSE Booleans
Text character string features
$$ Dollar sign
$’ Apostrophe
$L or $l Change line
$N or $n New line
$P or $p Change page
$R or $r Cursor return
$T or $t Tabulation
Time period text with t# short prefix (Note 2)
BOOL -1 bit-
REAL -32 bits-
TIME -32 bits- (Note 3)
DATE -32 bits- (Note 3)
TIME_OF_DAY -32 bits- (Note 3)
DATE_AND_TIME -64 bits- (Note 3)
STRING
64
35013153.01 07/2008
Compliance with IEC standard 1131-3
17
17
17
18
21
21
22
22
23
23
23
18
18
15
15
15
15
15
15
15
15
16
Table No.
10
10
10
3
5
2
3
4
1
2
2
3
3
5
1
4
5
6
1
2
3
Characteristic No.
17
18
19
7
8
VAR
VAR_INPUT
VAR_OUTPUT
VAR_IN_OUT
VAR_EXTERNAL
VAR_GLOBAL
CONSTANT
AT
2
Description of characteristics
BYTE -8 bits-
WORD -16 bits-
DWORD -32 bits-
Prefix I for Input
Prefix Q for Output
Prefix M for Memory
Prefix X, bit size
No prefix, bit size
Prefix B, byte size (8 bits)
Prefix W, word size (16 bits)
Prefix D, size of double word (32 bits)
Key words (Note 4)
Declaration of directly represented non-volatile variables (addresses)
(Note 4)
Declaration of symbolic variables slots (symbols of addresses) (Note 4)
Automatic attribution of symbolic variables to memory (function block variables) (Note 4)
Initialization of directly represented non-volatile variables (addresses)
(Note 4)
Slot assignation of initial values and symbolic variables (symbols on addresses) (Note 4)
Initialization of symbolic variables (function block variables) (Note 4)
Overloaded PL7 functions are as follows;
ABS, EQUAL, ROL, ROR, SHL, SHR, SQRT, SUM
In general, PL7 functions belong to this category.
BCD_TO_INT conversion function (Note 6)
INT_TO_BCD conversion function (Note 6)
ABS function: absolute value
SQRT function: square root
LN function: natural logarithm
35013153.01 07/2008
65
Compliance with IEC standard 1131-3
37
37
38
39
40
33
33
33
37
29
29
29
29
29
29
32
29
29
29
25
25
25
23
23
25
23
23
23
Table No.
23
23
23
10
11
1
7
8
9
Characteristic No.
4
5
6
7
8
9
4
5
6
1
2
3
2
3
4
4a
1
2a
3a
1
2
Inputread
Inputwrite
Outputread
Outputwrite time diagrams
19
1
Description of characteristics
LOG function: logarithm in base 10
EXP function : natural exponential
SIN function: sine in radians
COS function: cosine in radians
TAN function: tangent in radians
ASIN function: arc sine
ACOS function: arc cosine
ATAN function: arc tangent
SHL function: left shift
SHR function: right shift
ROR function: right rotation
ROL function: left rotation
LEN function: string length
LEFT function: n the most characters to the left
RIGHT function: n the most characters to the right
MID function: n characters from a given position
CONCAT function: string concatenation (Note 7)
INSERT function: inset one string into another
DELETE function: delete characters
REPLACE function: replace with other characters
FIND function: search for one string within another
(Note 8)
RETAIN qualifier for function block internal variables.) (Note 9) (Note 4)
RETAIN qualifier for function block output (Note 9) (Note 4)
Declaring (literal) function block input/output. (Note 4)
Pulse timer: TP (Note 10)
Engagement timer: TON (Note 10)
Trigger timer: TOF (Note 10)
TP, TON, TOF
Usage of directly represented variables (addresses)
Step, graphical form
Note: A step number replaces a step identifier
66
35013153.01 07/2008
Compliance with IEC standard 1131-3
45
45
45
46
46
49
49
49
49
50
46
46
46
46
46
48
Table No.
40
41
41
42
43
3
4
5c
6c
7
40
41
42
43
44
45
46
3
5a
6a
7
5b
2
11
12
2l
1
2
1
2c
Characteristic No.
2
1
2
Description of characteristics
Step, textual format used in Grafcet source format only
Transition condition in ST language
Transition condition in LD language
Action declaration in LD language
Action block
Concatenated action blocks
Action N qualifier (not memorized)
Action P1 qualifier (Pulse rising edge)
Action P0 qualifier (Pulse falling edge)
Simple sequence, alternating between step/transition
Divergence in "or": the user ensures that transition conditions are mutually exclusive.
Convergence in "or"
Divergence in "and", Convergence in "and"
Sequence jump in a divergence in "or"
Sequence loop: return to previous step
Directional arrows
Note: Directional arrows rise and descend
Grafcet language fulfils the conditions required for the minimum level of compliance with SFC 1131-3
Graphic presentation
RESOURCE...ON...END_RESOURCE construction
Periodic TASK construction in RESOURCE
PROGRAM declaration with PROGRAM-to-TASK association
Declaration of variables directly represented in VAR_GLOBAL
Pre-emptive scheduling in multi-tasking model
35013153.01 07/2008
67
Compliance with IEC standard 1131-3
68 z z z z
Note: z Note 1: The underlining characters (_) inserted between figures in numerical z text are not accepted.
Note 2: This text is only visible in the source application for expressing z configured task times.
Note 3: This type of data has not yet been set up for the user to be able to see.
Nevertheless, this table specifies how their internal representation takes up the memory.
z z
Note 4: These key words are only used in the sources generated by PL7 and by the PL7-2 and PL7-3 application conversion tool.
Note 5: Effects of limited conversions:
DINT_TO_STRING: If the string receiving the result is less than 13 characters,
%S15 is sectioned and re-positioned.
INT_TO_STRING: If the string receiving the result is less than 7 characters,
%S15 is sectioned and re-positioned.
STRING_TO_DINT and STRING_TO_INT: If the string is not fully convertible, the result is undetermined and %S18 is re-positioned.
DATE_TO_STRING: If the string receiving the result is less than 11 characters,
%S15 is sectioned and re-positioned.
DT_TO_STRING: If the string receiving the result is less than 20 characters, z
%S15 is sectioned and re-positioned.
TIME_TO_STRING: If the string receiving the result is less than 15 characters,
%S15 is sectioned and re-positioned.
TOD_TO_STRING: If the string receiving the result is less than 9 characters,
%S15 is sectioned and re-positioned.
REAL_TO_STRING: If the string receiving the result is less than 15 characters,
%S15 is sectioned and re-positioned.
STRING_TO_REAL: If the string is not convertible to integers, the result is worth
"1#NAN" (16#FFC0_0000) and %S18 is re-positioned.
REAL_TO_INT: If the integer is not convertible within the limits of [-32768,
=32767], the result is worth –32768 and both %S18 and %SW17 X0 are repositioned.
REAL_TO_DINT: If the integer is not convertible within the limits of [-
2147483648, =+2147483647], the result is worth -2147483648 and both %S18 and %SW17 X0 are repositioned.
INT_TO_REAL: Conversion is always possible.
DINT_TO_REAL: Conversion is always possible.
Note 6: With the INT type not being formally implemented, but used all the same, these functions are used to change the format of a WORD coding.
Note 7: CONCAT function limitations on concatenating 2 strings.
Note 8: This paragraph applies to predefined PL7 function blocks.
Note 9: The RETAIN qualifier is implicit.
Note 10: Timers TP, TON and TOF respect the table 38 time graphs, but offer a I/O interface different to that of 1131-3.
35013153.01 07/2008
Compliance with IEC standard 1131-3
IL language elements
General Description of the characteristics of IL language elements which comply with IEC
1131-3
The following table lists implementations in PL7 languages. This information is in regard to tables of characteristics described in the IEC 1131-3 standard.
54
54
54
52
52
52
53
Table of characteristics
Table No.
51
52
52
52
52
Characteristics of IL language elements:
11
12
13
18
20
21
3
3
4
5
6
1
2
Characteristic No.
Instruction fields
Description of characteristics
Label, operator, operand, comment
LD
ST
S and R
AND
OR
XOR
JMP
RET
)
Usage of input operators for starting function blocks in IL
IN (see Note)
IN (see Note)
IN (see Note)
Note: PT operator has not been set up.
35013153.01 07/2008
69
Compliance with IEC standard 1131-3
ST language elements
General Description of the characteristics of ST language elements which comply with IEC
1131-3
The following table lists implementations in PL7 languages. This information is in regard to tables of characteristics described in the IEC 1131-3 standard.
This language is separately but fully used in ST modules. An ST sub-assembly is also used in IL and LD language OPERATE and COMPARISON blocks.
70
35013153.01 07/2008
Compliance with IEC standard 1131-3
55
55
55
56
56
55
55
55
55
56
56
56
56
56
Table of characteristics
55
55
55
Table No.
55
55
55
Characteristics of ST language elements:
1
3
16
17
11
12
13
15
7
8
4
6
9
4
5
6
7
9
10
2
3
Characteristic No.
1
Description of characteristics
Between brackets
Function evaluation
- Negation
NOT Complement
JMP
* Multiplication
/ Division
+ Addition
- Subtraction
<, >, <=, >= Comparison
= Equate
<> Does not equate
AND for the "and" boolean
XOR for the "exclusive or" boolean
OR for the "or" boolean
:= Assignment
RETURN structure
IF structure "if... then... elsif... then... else... end_if"
FOR structure "for... to... do... end_for" (see Note)
WHILE structure "while... do... end_while"
REPEAT structure "repeat ... until... end_repeat"
EXIT structure
Note: Set-up of FOR loop with an implicit step of 1 (by 1).
35013153.01 07/2008
71
Compliance with IEC standard 1131-3
Common graphics elements
General Description of the characteristics of common graphics elements which comply with
IEC 1131-3
The following table lists implementations in PL7 languages. This information is in regard to tables of characteristics described in the IEC 1131-3 standard.
Table of characteristics
58
58
58
57
57
58
Table No.
57
57
57
57
Characteristics of common graphics elements:
4
5
8
10
12
2
4
6
8
Characteristic No.
2
Description of characteristics
Horizontal graphic lines
Vertical graphic lines
Horizontal graphic line / vertical graphic line junction point
Graphic crossing of lines without connections
Connected and unconnected graphic corners
Blocks with connected graphic lines
Unconditional jump in LD language
Conditional jump in unconditional LD language
Conditional return in LD language
Unconditional return in LD language
72
35013153.01 07/2008
Compliance with IEC standard 1131-3
LD language elements
General Description of the characteristics of LD language elements which comply with IEC
1131-3
The following table lists implementations in PL7 languages. This information is in regard to tables of characteristics described in the IEC 1131-3 standard.
Table of characteristics
61
62
62
61
61
61
62
62
Table No.
59
59
60
60
Characteristics of LD language elements:
7
1
2
3
4
1
3
5
2
1
2
Characteristic No.
1
Description of characteristics
Left power rail
Right power rail
Horizontal link
Vertical link
Open contact
Closed contact
Positive transition contact detector
Negative transition contact detector
Coil
Negated coil
SET (latch) coil
RESET (unlatch) coil
35013153.01 07/2008
73
Compliance with IEC standard 1131-3
Implementation-dependent parameters
General Description of PL7 parameters which depend on implementation.
The following table lists implementations in PL7 languages. This information is in regard to tables of characteristics described in the IEC 1131-3 standard.
74
35013153.01 07/2008
Compliance with IEC standard 1131-3
Table of characteristics
Characteristics of IL language elements:
Parameters
Procedure for processing errors
Nationally used characters
Maximum identifier length
Maximum comment length
Duration value format
TIME type value format
PL7 limitations and behavior
Many errors can be indicated on execution by the way that bits and system words are arranged.
ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÑÒÓÔ
ÕÖØÙÚÛÜàáâãäåæçèéêëìí îïñòóôõöøùúûüßÿ
#, $, |
32
222
Note 1
Note 1
Note 2 More detail on the presentation of seconds in
TIME_OF_DAY and DATE_AND_TIME types
Maximum number of table indexes
Maximum table size
Maximum default length of STRING variables
Maximum authorized length for STRING variables
1 (Note 3) depends on the indexed zone (Note 3) does not apply
255
Maximum number of hierarchical levels
Logical or physical configuration
3
Logic configuration
Maximum interval of index values
Initialization of system input depends on the indexed zone (Note 3) z z
Variables are initialized by the system: to the initial value specified by the user, if need be if not to zero cf table 22, characteristic 1 Effect of conversions on more detail
Maximum number of types and function block instances Not the maximum number (limits are linked to the volume of the application)
Program size limit Maximum program code volume = 64 Kbytes
More detail on time elapsed associated with a step 100ms
Maximum number of steps per chart 96 on 3710 PLCs
128 on 3720 PLCs
1024 on 57xx V3.0 PLCs
Maximum number of transitions per chart and per step) 1024 transitions per chart
11 transition per step 1
Action control mechanism Qualifiers P0, P1 and N1
35013153.01 07/2008
75
Compliance with IEC standard 1131-3
Parameters PL7 limitations and behavior
Maximum number of action blocks per step
Graphic representation of state of step
Time for overshooting a transition (disabling of upstream steps, and enabling of downstream steps)
Depth of divergent and convergent constructions
3 types of action are possible: on activation (P1), continue (N1) and on deactivation (P0)
Active step is highlighted
The overshoot time varies, and is never zero
Limit given by entry grid
List of PLCs that can be programmed by PL7
Maximum number of tasks
TSX MICRO, TSX PREMIUM
1 periodic or cyclic task
1 periodic task
8 event tasks for 37 10 PLCs
16 event tasks for 37 20 PLCs
32 event tasks for 57 10 PLCs
64 event tasks for 57 20/30 PLCs from 1 ms to 225 ms
Pre-emptive scheduling Task interval formats
Pre-emptive or non-pre-emptive scheduling
Maximum length of an expression
Partial evaluation of boolean expressions variable no variable Maximum length of command structures ST
Value of command variable after complete execution of a
FOR loop
The command variable value equals the limit value + 1
(as the step is 1)
Graphic/semi-graphic representation
Restrictions on network topology
Graphic representation
An LD network may extend over a maximum of 16 columns and 7 lines
Note: z Note 1: This type of data has not yet been set up for the user to be able to see.
Nevertheless, this table details their value formats in the IEC 1131-3 format.
TIME : from T#0 to T#429496729.5s
TIME_OF_DAY: from TOD#0:0:0 to TOD#23:59:59
DATE_AND_TIME: from DT#1990-01-01:0:0:0 to DT#2099-12-31:23:59:59
DATE: from D#1990-01-01 to D#2099-12-31DT#2099-12-3 z z
Note 2: Rounding is done as follows: from x.0 s to x.4 s, you round to x s and from x.5 s to x.9 s you round to x+1 s.
Note 3: All types of directly represented variable can be indexed positively and negatively within the limit of their respective maximums defined in configuration.
76
35013153.01 07/2008
Compliance with IEC standard 1131-3
Error Situations
General Points Description of PL7 parameters which depend on implementation.
The following table lists implementations in PL7 languages. This information is in regard to tables of characteristics described in the IEC 1131-3 standard.
Table of
Characteristics
Error situations
Type conversion errors
Error situations:
The digital result exceeds the format for the data type
Position of specified characters is invalid
The result exceeds the maximum string length
Edge effects during transition evaluation
Execution times are not respected
PL7 limitations and behavior
Indicated during execution by setting of a system bit: cf
Common elements table: table 22, characteristic 1
Indicated during execution via the setting of system bit
%S18
Indicated during execution via the setting of system bit
%S18
Indicated during execution via the setting of system bit
%S15
Detected during programming
Indicated on execution via the setting of system bit %S19
Detected during configuration
Other task scheduling conflicts
Division by 0
Data type invalid for an operation
FOR or WHILE iteration failure to be finished
Detected during programming if possible, if not it is indicated during execution via the setting of system bit %S18
On the occurrence of a fault, the PLC overruns the watchdog and the programming unit concerned is then indicated
35013153.01 07/2008
77
Compliance with IEC standard 1131-3
78
35013153.01 07/2008
OLE Automation Server
5
Introduction
Contents of this section
This section describes how the OLE Automation server works
What's in this
Chapter?
This chapter contains the following sections:
Section
5.1
5.2
5.3
Topic
Introduction
Implementation
OLE Functions
Page
35013153.01 07/2008
79
OLE Automation Server
5.1
Introduction
Introduction
Subject of this sub-section
What's in this
Section?
This sub-section makes some general points concerning the OLE Automation server
This section contains the following topics:
Topic ntroduction to the OLE Automation Server
OLE Automation server operating modes
Page
80
35013153.01 07/2008
OLE Automation Server
Introduction to the OLE Automation Server
Introduction The OLE Automation Server PL7 function offers the possibility of executing the
PL7 in a programmed, non-interactive mode (i.e. without operator intervention) for applications external to the PL7. You use PL7 OLE Automation Server client application terminology.
PLC
Server
Client
Client clients
PL7
*.stx
Conforming fully with the standard defined by Microsoft in its OLE package to respond to this need, PL7 now features a standard, public interface, which is independent of the client application programming language.
The characteristic principles are: z z z z automation of repetitive tasks delegation to PL7 of processing tasks that only it can handle access to application information contained in the *.stx files more generally, development of an integrator function greater than PL7, with encapsulation of PL7 specific implementation details.
35013153.01 07/2008
81
OLE Automation Server
Context of Use The OLE Automation server PL7 functionality is built into PL7 Pro. It is installed and executed with the same installation and usage conditions as PL7. The OLE
Automation server PL7 relies on the OLE Automation Microsoft run-time provided with Windows XP Professionnel and Windows VISTA Professional Edition 32 systems.
z z z
Note: To create an OLE server client application, you must know one of the following OLE Automation programming languages:
Microsoft Visual Basic, version 5.0 or above,
Microsoft Visual C++, version 4.2 or above,
Microsoft VBA in Excel, version 5.0 or above.
82
35013153.01 07/2008
OLE Automation Server
OLE Automation server operating modes
General
Description
In addition to the PL7 operating mode known up until the present which is designated as "interactive", where the PL7 reacts to operator inputs only, there is now the OLE automation server operating mode where the PL7 can also react to commands transmitted from an OLE client application.
Operating mode selection is dependen on the PL7 start procedure: z z
Interactive mode is initialized during PL7 start via Windows
(Start menu/Programs/ Modicon Telemecanique/PL7 Pro.).
Server mode is selected if the OLE Automation PL7 server is invoked in the programming of an OLE client application. An instance can not change the current mode.
Each time a client application invokes the OLE Automation PL7 server, a specific
PL7 instance is started, independently of any other instances which may be in progress. Any number of PL7 instances in server mode or interactive mode can be running on the same terminal. The instances are all completely independent of each other and so can each run in their own context.
For all of these instances the same denial rules concerning concurrent access to an
STX application or a PLC apply, these being: an STX application or a PLC can only be handled by one instance at a time.
This rule was developed for the OLE Automation PL7 server which can open an already open STX application but not save it. In the same way, it can perform a
PLC —> PC transfer, on explicit demand, from a reserved PLC.
A client application can instantiate several competing "OLE Automation PL7 servers".
35013153.01 07/2008
83
OLE Automation Server
5.2
Implementation
Introduction
Subject of this sub-section
What's in this
Section?
This sub-section describes the procedure for implementation of the OLE Automation server
This section contains the following topics:
Topic
Installation of OLE Automation
Accessing the PL7 OLE Automation server
Server Start in Local Mode (COM Mode)
Remote Mode Server Launch (DCOM)
Installation of the server in the remote mode
PL7 Server execution modes
Input points: OLE Function
Page
84
35013153.01 07/2008
OLE Automation Server
Installation of OLE Automation
Description Installation of the PL7 product OLE Automation Server is transparent for the user, as it self-installs during PL7 installation.
The installation includes: z z z
Four OLE Automation client examples, complete with source code and README file supplied with the software.
These examples are: z z a "minimal" visual C++ 4.2 client: the minimum needed to be able to write an
OLE client.
a "complete" visual C++ 4.2 client, which makes use of all the available input points.
z z a visual Basic 5.0 client, which makes use of all the available input points.
an Excel client.
A *.h file which defines the value of the error codes generated by the server.
A TLB interface file for a Visual C++ client.
35013153.01 07/2008
85
OLE Automation Server
Accessing the PL7 OLE Automation server
Local access
The PL7 OLE Automation server offers two ways to access its utilities.
The client application and the PL7 OLE Automation server are on the same terminal.
Remote access via DCOM
The client application and the PL7 Automation server are on two separate terminals which are linked by the TCP/IP network:
Client station Server station
DCOM
86
35013153.01 07/2008
OLE Automation Server
Server Start in Local Mode (COM Mode)
Introduction
Server Start in
Local Mode
(COM Mode)
COM mode (Component object Model) defines an interface for communication between applications. It provides independence from the development tools.
To start the server in local mode, follow the procedure below:
1
2
3
4
Declare an object " A " on the client application to communicate with the server application.
Execute a Createdispatch function on object " A " from the client application in order to instantiate the server application.
Save PL7Pro as OLE server in the register base for correct operation in server mode
(the link between the client application and the server application is created if the latter is referenced in the register base).
The client application can now interrogate the server application via the interface accessed through object "A".
E.g.: OpenStx("C:\appli.stx).
35013153.01 07/2008
87
OLE Automation Server
Remote Mode Server Launch (DCOM)
Introduction The Pl7 server is executed as a function of information present in the list base. It can be located on a client or remote machine.
The DCOM mode is, in fact, an extension of the COM mode (Component Object
Model). The COM mode facilitates a dialog between a client application and a server application on the same machine.
The DCOM mode facilitates a dialog between two remote machines. It replaces the inter-process communication protocols with the network protocols.
Illustration of the OLE Automation operation in the remote server mode:
Driver selection
PL7 server
Client
PC a
Client
Client
PC b
COM run-time
Security provider
DCE RPC
Protocol stack
Driver selection
PL7 server
PC c
COM run-time
Security provider
DCE RPC
Protocol stack
Component
DCOM network protocol
88
35013153.01 07/2008
OLE Automation Server
Installation of the server in the remote mode
Introduction
Client configuration
DCOM is a specific configuration required on a client PC to support remote access to the PC on which the server (PL7 Pro Server) is installed. On a PC supporting
Windows XP Professional or Windows VISTA Professional Edition 32, DCOM must be configured by using the DCOMCnfg.exe
tool.
The following procedure shows how to configure the DCOM and is applied to
Windows XP Professional and Windows VISTA Professional Edition 32 operating systems:
Step Action
1 z z
Launch DCOMCnfg.exe
located in the list:
C:\Windows\System32
Then on the icon ‘ Console source
→
Component service
→
Computers
→
Work station , display the properties using the right click of the mouse or,
Click on Configuration panel
→
Administration utilities
→
Component services .
In the window that appears, click on Component services
→
Computers .
On the Work station icon, display the properties using the right click of the mouse.
2
3
In the Default properties tab, check that: z z z
The option
The
The
Activate Distributed COM (DCOM) on this computer
Default authentification level
Default identity loan level
field is defined on
field is defined on
Connect
Identify .
.
is selected.
In the COM Security tab:
Modify the Access authorization list in order to make sure that the SYSTEM ,
INTERACTIVE , NETWORK and Everyone users are figured. This last parameter is only required to authorize the server to resend the notifications to the client.
35013153.01 07/2008
89
OLE Automation Server
Server configuration
These configuration parameters must be defined when connected to the machine when you use an account with the authorizations required for access and server start-up.
Step Action
1 z z
Launch DCOMCnfg.exe
located in the list:
C:\Windows\System32
Then on the icon ‘ Console source
→
Component service
→
Computers
→
Work station , display the properties using the right click of the mouse or,
Click on Configuration panel
→
Administration utilities
→
Component services .
In the window that appears, click on Component services
→
Computers .
On the Work station icon, display the properties using the right click of the mouse.
2
3
In the Default properties tab, check that: z z z
The option
The
The
Activate Distributed COM (DCOM) on this computer
Default authentification level
Default identity loan level
field is defined on
field is defined on
Connect
Identify .
.
is selected.
z z
In the list DCOM configuration
→
OLE Automation , display the properties using the right click of the mouse. The Properties of OLE Automation Server dialog box will appear.
z Click on the Identity tab. The Interactive user option must be selected. The This user option with an appropriate password must be selected.if no user is connected to the server or if the session is modified or interrupted without a cause.
Click on the
Click on the
General
Slot
tab, the authentification level must be defined on
tab, the Execute the application on this computer
By default .
option must be z selected.
In the tab Security
→
Authorizations for execution and activation , select z z
Personalize .
Click on Modify , the Authorization for execution dialog box will appear.
Click on Add , add the users, then authorize the access (the SYSTEM ,
INTERACTIVE , NETWORK and Everyone users must be figured in this list, z z Click on OK to close the dialog boxes.
In the tab Security
→
Access authorizations , select Personalize .
z Click on Modify , the Authorization for access dialog box will appear.
z Click on Add , add the users, then authorize the server launch (the SYSTEM , z
INTERACTIVE and NETWORK users must be figured in this list, others such as
Everyone can be added).
Click on OK to close the dialog boxes.
Note: If the client and the server do not belong to the same XP or VISTA domain, or if no XP or VISTA domain exists, do not forget that the identical users using an identical password must be created on the two machines (ensure that the damage is taken into consideration).
90
35013153.01 07/2008
OLE Automation Server
PL7 Server execution modes
Introduction
Execution modes
The OLE Automation PL7 server has two execution modes which can be chosen dynamically during execution (see SetHMIServer ) z z
Execution mode without HMI. The PL7 is started as a "background task", with no display or possibility of operator input. It is the mode used typically, for example, to automate repetitive tasks or to access application information contained in an stx file.
Application mode with HMI. The PL7 is started as an "interactive" PL7 with display and the possibility of operator input but it remains receptive to commands from its client application. This mode has been developed to view the program or configuration elements of an application contained in an stx file using external tools such as DIAG Viewer.
Note: Utilities for displaying programs, tools, and modules can only be executed in the mode with HMI.
The OLE Automation PL7 server in HMI mode is subject to monitoring of user rights. It is set in "Read Only" user profile, which corresponds to its code display and PL7 I/O module display role.
When not in HMI mode the OLE Automation PL7 server is not subject to monitoring of user rights but the application cannot be modified with the utilities provided.
35013153.01 07/2008
91
OLE Automation Server
Input points: OLE Function
Introduction
Execution
Context
There are four types of input points: z z z z
Execution context
API monitoring
Read information
Application element display
Input points
Name
OpenStx
SaveStx
CloseStx
Set DriverAndAddress
SetServerHMI
GetPL7IHM
GetMessageError
Description
Opening an application
Saving the active application
Closing the active application
Setting the driver and the address of the accessed PLC
Making the OLE Automation PL7 server interactive or noninteractive
Giving the status: open or closed application, offline – online mode , PLC status
Reads the error message associated with the error code
PLC Monitoring Input points
Name
ConnectPLC
DisconnectPLC
SenCommandToPLC
DownloadToPLC
UploadFromPLCM
DownloadStationWithSym bol
Description
Enters online mode
Exits online mode
Command sent to the PLC (RUN, STOP INIT)
Loading the active application into a PLC
Copies a PLC application into the active application
Loads an application and its zipped symbols database into the PLC
92
35013153.01 07/2008
OLE Automation Server
Read Information Input points
Name
ExportScyFile
ExportFefFile
GetSymbol
GetSTXAppIdentity
GetPLCAppIdentity
GetServerVersion
CompareSymbolPCAndSymb olPLCAppli
Description
Exports the symbols in the active application as an scy file
Exports the active application as an fef file
Reads the symbol and the comment associated with an address
Reads the general application information contained in an
STX file
Reads the general application information contained in a
PLC
Reads the server version
Lets you know the general application information contained in a PLC
Application
Element Display
Input points
Name
SetPosPL7Window
ShowProgram
CloseProgram
ShowIOModule
CloseIOModule
ShowDFB
CloseDFB
OpenTool :
Description
Sets the PL7 display characteristics (position and form)
Opens an editor on a given program module
Closes a program editor
Opens an editor on a given I/O module
Closes a given I/O module editor
Opens an editor on a given DFB code
Closes a editor on the given DFB code
Opens any MDI tool without context
Note: The input points concerning application element display do not work if the server is not in HMI mode.
35013153.01 07/2008
93
OLE Automation Server
5.3
OLE Functions
Introduction
Subject of this sub-section
What's in this
Section?
This sub-section describes the OLE functions of the OLE Automation server
This section contains the following topics:
Topic
OpenStx
CloseStx
OpenStxWithMaj
ExportScyFile
ExportFeFile
ExportFefFileWithConfiguration
DisconnectPLC
ConnectPLC
SaveStx
DownloadDataToPLC
DownloadToPLC
UploadFromPLC
UploadDataFromPLC
UploadFromPLCWithSymbol
GetSymbol
SetServerHMI
SetDownloadFunction
GetPL7State
GetSTXAppIdentity
GetPLCAppIdentity
SendCommandToPLC
SetDriverAndAddress
OpenTool
SetPosPL7Windows
ShowProgram
CloseProgram
94
Page
35013153.01 07/2008
Topic
ShowIOModule
CloseIOModule
ShowDFB
CloseDFB
GetMessageError
GetServerVersion
ImportScyFile
DownloadStationWithSymbol
CompareSymbolPCAndSymbolPLCAppli
OLE Automation Server
Page
35013153.01 07/2008
95
OLE Automation Server
OpenStx
General Points
Description
This function is used to open the stx file application type.
Syntax: integer OpenStx (String lpAppPathName) z z z z
Enter:
Enter the string of characters containing the name of the file that needs to be opened.
Function called:
OpenStation : Station management function ( gesta.dll
).
Nominal context :
The PL7 server is active.
When there is an error:
SRV_ERR_GEN_FILENOTFOUND The file could not be found.
SRV_ERR_OPEN_BADZIP
SRV_ERR_OPEN_BADFILE
There is a problem with opening the file
There is a problem reading the stx file
SRV_ERR_OPEN_NOK_COMPATIBLE The processor is not compatible with the PL7 being open.
SRV_ERR_OPEN_OPEN
SRV_ERR_GEN_PARAM_EMPTY
SRV_ERR_GEN_ACTION
SRV_ERR_GEN_DRIVE FULL
An application is already open
The Path Name is empty
There is an error on opening the application
There is no more free disk space for opening the application z Output:
Return code, short type. Either 0 on a successful opening, or error code.
96
35013153.01 07/2008
OLE Automation Server
CloseStx
General
Description
This function is used to close the current application
Syntax: integer CloseStx ( integer p_bWithoutSave) z z z z
Input:
If an application has been modified, it can be closed without having to notify the user ( p_bWithoutSave a TRUE ).
Function called:
CloseStation : Station management function ( gesta.dll
).
Nominal context :
The PL7 server is active and an application is open.
When there is an error:
SRV_ERR_GEN_NOTOPEN
SRV_ERR_CLOSE_NOTSAVE
No application is open.
The application has been modified, and changes must be saved before closing.
z Output:
Short type feedback code. Either 0 on a successful closing, or error code.
35013153.01 07/2008
97
OLE Automation Server
OpenStxWithMaj
General
Description
This function is used to export the active application along with its configuration to a fef file.
Syntax:
OpenStxWithMaj integer (NameFile string, WithNewCat integer) z z z z
Input: z Enter 1 character string containing the name and the path of the stx file that you wish to open.
z An integer which indicates whether or not it is necessary to update the catalog files (0 for no update necessary or 1 for update necessary).
Function called:
OpenStation: Station management function ( gesta.dll
).
Nominal context: z The PL7 server is active, z PL7 is in offline mode.
Errors:
SRV_ERR_GEN_ACTION
SRV_ERR_GEN_PARAM_EMPTY
SRV_ERR_GEN_DRIVEFULL
SRV_ERR_OPEN_OPEN
SRV_ERR_GEN_FILENOTFOUND
SRV_ERR_OPEN_BADZIP
Error occurred while the function was being executed.
The name of the dat file is incorrect or empty.
No free space on disk available to open the application.
An application is already open.
The file could not be found.
Problem encountered when extracting zip file.
z z
Output:
Short return code. Either 0 for a successfully opened station, or an error code.
Limitations:
Once an import has been successful, a PL7 server without an HMI cannot operate with an HMI without first saving the open application.
98
35013153.01 07/2008
OLE Automation Server
ExportScyFile
General
Description
This function is used to export symbols in the enabled application under the scy file format.
Syntax: integer ExportScyFile (String p_psScyFile) z z z z
Input:
Enter the character string containing the scy file name.
Function called:
ExportScyFile : Station management function ( gesta.dll
).
Nominal context :
The PL7 server is active. An application is open.
When there is an error:
SRV_ERR_GEN_ACTION Error on creation of sourcesymbol file.
SRV_ERR_GEN_NOTOPEN No application is open.
SRV_ERR_GEN_PARAM_EMPTY p_ psScyFile is empty.
SRV_EXPORT_ERRFILE A write error has occurred in the source file.
z Output:
Short type feedback code. Is either 0 on a successful export, or error code.
35013153.01 07/2008
99
OLE Automation Server
ExportFeFile
General
Description
This function is used to export the active application under the fef file format.
Syntax: integer ExportFefFile (String p_psNamefile) z z z z
Input:
Enter the character string containing the fef file name.
Function called:
ExportFefFile : Station management function ( gesta.dll
).
Nominal context :
The PL7 server is active. An application is open.
When there is an error:
SRV_ERR_GEN_ACTION Error on creation of source application file.
SRV_ERR_GEN_PARAM_EMPTY No application is open.
SRV_ERR_GEN_PARAM_EMPTY p_ psNamefile is empty.
SRV_EXPORT_ERRFILE A write error has occurred in the source file.
z Output:
Short type feedback code. Is either 0 on a successful export, or error code.
100
35013153.01 07/2008
OLE Automation Server
ExportFefFileWithConfiguration
General
Description
This function is used to export the active application along with its configuration to a fef file.
Syntax:
ExportFefFileWithConfiguration integer (FefFile string) z z z z
Input:
Enter 1 character string containing the name and the path of the scy file that you wish to export.
Function called:
ExportFefFileWithConf: Station management function ( gesta.dll
).
Nominal context: z The PL7 server is active, z PL7 is in offline mode, and the station is open.
Errors:
SRV_ERR_GEN_ACTION
SRV_ERR_GEN_PARAM_EMPTY
SRV_ERR_GEN_NOTOPEN
SRV_EXPORT_ERRFILE
Error occurred while the function was being executed.
The name of the dat file is incorrect or empty.
No STX application open.
Unable to create the export file.
z Output:
Short return code. Either 0 for a successful export, or an error code.
35013153.01 07/2008
101
OLE Automation Server
DisconnectPLC
General
Description
This function is used to carry out disconnection between the PLC and the PL7.
Syntax: integer ExportFefFile (String p_psNamefile) z z
Function called:
DisconnectStation : Station management function ( gesta.dll
).
Nominal context :
The PL7 server is active.
z Output:
Short feedback code type. Either shows 0 on a successful disconnection, or error code (SRV_ERR_GEN_ACTION).
102
35013153.01 07/2008
OLE Automation Server
ConnectPLC
General
Description
This function is used to connect up to a PLC.
Syntax: integer ConnectPLC (String p_lpDriver, String p_lpAddress) z z z z
Enter:
Enter the two character strings containing the driver and the PLC address.
Function called:
ConnectStation : Station management function ( gesta.dll
).
Nominal context:
The PL7 server is active. Wherever parameters consist of empty strings, the server carries out the function using the driver and/or the current address.
When there is an error:
SRV_ERR_GEN_CONNECT
SRV_ERR_GEN_COMMUNICATION
SRV_ERR_GEN_RESERVED
SRV_ERR_PLC_BLANK
SRV_ERR_PC_BLANK
SRV_ERR_DIFFERENCE_PLC_STX
Connection was unsuccessful.
There is a communication problem between the PL7pro and the PLC
The PLC has been reserved, and therefore cannot be connected to.
The PLC does not contain any applications, and therefore connection cannot take place.
No applications are open, and therefore connection cannot take place.
The application which is open and the application contained in the PLC are different, and it is therefore impossible for connection to take place.
SRV_ERR_GEN_ADDRESS
SRV_ERR_GEN_ACTION
SRV_ERR_GEN_DRIVER
SRV_ERR_GEN_NOTOPEN
The parameter address is invalid.
An error has occurred on carrying out the function.
The parameter driver is invalid.
No application is open.
SRV_ERR_GEN_PROTECTEDAPPLI Protected application.
SRV_COMPATIBLE_PLC There is a compatibility problem with the PLC.
z Output:
Short type feedback code. Either 0 on a successful connection, or error code.
35013153.01 07/2008
103
OLE Automation Server
SaveStx
General
Description
This function is used to save the application which is open.
Syntax: integer SaveStx (String p_lpStxFile) z z z z
Enter:
Enter a character string containing the path and the name of the file to be saved.
Function called:
SaveStx : Station management function ( gesta.dll
).
Nominal context:
The PL7 server is active. An application is open and PL7 is in offline mode.
When there is an error:
SRV_ERR_SAVEDENIED
SRV_ERR_SAVEERRZIP
SRV_ERR_SAVEERRREN
SRV_ERR_GEN_NOTOPEN
SRV_ERR_GEN_PARAM_EMPTY
SRV_ERR_GEN_ACTION
SRV_ERR_PLC_CONNECT
Access to the file has been refused
An error has occurred on compacting the application
Renaming has not been allowed
No application is open p_ lpStxFile is empty.
There is an error on saving the application
Saving can only be carried out in offline mode.
z Output:
Short type feedback code. Either 0 on a successful save, or error code.
104
35013153.01 07/2008
OLE Automation Server
DownloadDataToPLC
General This function is used to download a file containing words to the PLC.
35013153.01 07/2008
105
OLE Automation Server
Description Syntax:
DownLoadDataToPLC integer (Driver string, Address string, NameFile string) z z z z
Input:
Enter the 3 character strings containing the driver, the PLC address and the complete name of the dat file.
Function called:
DownloadData: Station management function ( gesta.dll
).
Nominal context: z z
The PL7 server is active,
PL7 is in offline mode, z If the parameters (driver and address) are empty strings, the server executes the function with the current driver and/or address.
Errors:
SRV_ERR_DOWNLOAD_CART
SRV_ERR_COMPATIBLE_PLC
SRV_ERR_PC_BLANK
SRV_ERR_GEN_ADDRESS
SRV_ERR_GEN_DRIVER
SRV_ERR_GEN_RESERVED
SRV_ERR_GEN_COMMUNICATION
SRV_ERR_PLC_CONNECT
SRV_ERR_GEN_ACTION
SRV_ERR_GEN_PARAM_EMPTY
SRV_ERR_GEN_PROTECTEAPPLI
SRV_ERR_TRFDATA_READDS
SRV_ERR_TRFDATA_NODATA
SRV_ERR_TRFDATA_READWRITE
SRV_ERR_TRFDATA_INFOFILE
Problem of compatibility of cartridge between the open application and the PLC.
Problem of compatibility between the open application and the PLC.
No application is open.
The p_IpAddress parameter is incorrect.
The p_IpDriver parameter is incorrect.
The PLC is reserved. It is therefore impossible to connect to the PLC.
Communication problem between PL7pro and the PLC.
You have to be in offline mode to download.
Error occurred while the function was being executed.
The name of the dat file is incorrect or empty.
The application is read-protected. It is not possible to connect to the PLC.
Communication error.
Numerical variables not configured or incorrectly read. The file has not been created.
Problem with dat file.
Problem with dat file.
106
35013153.01 07/2008
OLE Automation Server
SRV_ERR_TRFDATA_RUNREFUSED
SRV_ERR_TRFDATA_READOBJ
SRV_ERR_TRFDATA_WRITEOBJ
SRV_TRFDATA_OVERFLOW
SRV_TRFDATA_BORNENOCORRECT
The PLC has refused the request to change to RUN (RUN/STOP input set to STOP).
Numerical variable read or write error.
Numerical variable read or write error.
Caution, the range of values was too large.
An overflow has occurred.
The minimum and maximum values are incorrect.
z Output:
Short return code. Either 0 for a successful download, or an error code.
35013153.01 07/2008
107
OLE Automation Server
DownloadToPLC
General
Description
This function is used to download an application into the PLC memory.
Syntax: integer DownloadToPLC (String p_lpDriver, String p_lpAdresse) z z z z
Enter:
Enter the two character strings containing the driver and the PLC address.
Function called:
DownloadStation : Station management function ( gesta.dll
).
Nominal context:
The PL7 server is active. An application is open and PL7 is in offline mode.
Wherever parameters consist of empty strings, the server carries out the function using the driver and/or the current address.
When there is an error:
SRV_ERR_DOWNLOAD_CART
SRV_ERR_COMPATIBLE_PLC
SRV_ERR_GEN_ADDRESS
SRV_ERR_GEN_DRIVER
SRV_ERR_GEN_NOTOPEN
SRV_ERR_GEN_RESERVED
SRV_ERR_GEN_COMMUNICATION
SRV_ERR_PLC_CONNECT
SRV_ERR_PLC_ACTION
There is a memory cartridge compatibility problem between the application which is open and the PLC.
There is a compatibility problem between the
PLC and the application which is open.
The p_lpAdresse parameter is invalid.
The p_lpDriver parameter is invalid.
No application is open.
The PLC has been reserved.
Communication problem.
The PLC has already been connected.
An error has occurred while downloading.
z Output:
Short type feedback code. Either 0 on a successful download, or error code.
108
35013153.01 07/2008
OLE Automation Server
UploadFromPLC
General
Description
This function is used to copy an application in a PLC over to the memory.
Syntax: integer UploadFromPLC (String p_lpDriver, String p_lpAdresse, integer p_iReservedMode) z z z z
Input:
Enter the two character strings containing the driver and the PLC address. An integer ( p_iReservedMode ) which can be used to upload onto a reserved PLC.
Function called:
UploadStation : Station management function ( gesta.dll
).
Nominal context:
The PL7 server is active. There are no applications open and the PL7 is in offline mode. If parameters consist of empty strings, the server carries out the function using the driver and/or the current address.
When there is an error:
SRV_ERR_UPLOAD_TRANSFER
SRV_ERR_UPLOAD_ABORT
SRV_ERR_UPLOAD_RESERVED
SRV_ERR_UPLOAD_NOAPPLI
SRV_ERR_GEN_ADDRESS
SRV_ERR_GEN_ACTION
SRV_ERR_PLC_CONNECT
SRV_ERR_GEN_DRIVER
SRV_ERR_GEN_COMMUNICATION
SRV_ERR_PLC_CONNECT
SRV_OPEN_NOT_COMPATIBLE
There is a problem in transferring the application contained in the PLC
Transfer is put on hold.
The application has been reserved.
The PLC is empty.
Invalid address.
An error has occurred in carrying out the function.
There is a connection error.
Invalid driver.
There is a communication error.
The PLC has already been connected.
Compatibility problem.
z Output:
Short type feedback code. Either 0 on a successful upload, or error code.
35013153.01 07/2008
109
OLE Automation Server
UploadDataFromPLC
General This function is used to upload a file containing words contained in the PLC.
110
35013153.01 07/2008
Description
35013153.01 07/2008
OLE Automation Server
Syntax:
UpLoadDataFromPLC integer (Driver string, Address string, ValMin integer, ValMax integer, NameFile string) z z z z
Input: z Enter the 3 character strings containing the driver, the PLC address and the complete name of the dat file, z Enter the 2 integers for the minimum and maximum values you wish to retrieve.
Function called:
UploadData: Station management function ( gesta.dll
).
Nominal context: z The PL7 server is active, z z
PL7 is in offline mode,
If the parameters (driver and address) are empty strings, the server executes the function with the current driver and/or address.
Errors:
SRV_ERR_COMPATIBLE_PLC
SRV_ERR_GEN_ADDRESS
SRV_ERR_GEN_DRIVER
SRV_ERR_GEN_RESERVED
SRV_ERR_GEN_COMMUNICATION
SRV_ERR_PLC_CONNECT
SRV_ERR_GEN_ACTION
SRV_ERR_GEN_PARAM_EMPTY
SRV_ERR_GEN_PROTECTEAPPLI
SRV_ERR_TRFDATA_READDS
SRV_ERR_TRFDATA_NODATA
SRV_ERR_TRFDATA_READWRITE
SRV_ERR_TRFDATA_INFOFILE
SRV_ERR_TRFDATA_RUNREFUSED
Problem of compatibility between the open application and the PLC.
The p_IpAddress parameter is incorrect.
The p_IpDriver parameter is incorrect.
The PLC is reserved. It is therefore impossible to connect to the PLC.
Communication problem between PL7pro and the PLC.
You have to be in offline mode to download.
Error occurred while the function was being executed.
The name of the dat file is incorrect or empty.
The application is read-protected. It is not possible to connect to the PLC.
Communication error.
Numerical variables not configured or incorrectly read. The file has not been created.
Problem with dat file.
Problem with dat file.
The PLC has refused the request to change to RUN (RUN/STOP input set to STOP).
111
OLE Automation Server
SRV_ERR_TRFDATA_READOBJ
SRV_ERR_TRFDATA_WRITEOBJ
SRV_TRFDATA_OVERFLOW
SRV_TRFDATA_BORNENOCORRECT
Numerical variable read or write error.
Numerical variable read or write error.
Caution, the range of values was too large.
An overflow has occurred.
The minimum and maximum values are incorrect.
z Output:
Short return code. Either 0 for a successful upload, or an error code.
112
35013153.01 07/2008
OLE Automation Server
UploadFromPLCWithSymbol
General Points
Description
35013153.01 07/2008
This function is used to upload an application with the associated symbols contained in the PLC.
Syntax:
UpLoadFromPLCWithSymbol integer (Driver string, Address string, ReserveMode integer) z z z z
Enter:
Enter the 2 character strings containing the driver and the PLC address. An integer ( p_IReserveMode ) allowing a PLC to PC transfer to be performed on a reserved PLC.
Function called:
UploadStationWithSymbol: Station management function ( gesta.dll
).
Nominal context: z z
The PL7 server is active,
PL7 is in offline mode, z If the parameters (driver and address) are empty strings, the server executes the function with the current driver and/or address.
When there is an error:
SRV_ERR_COMPATIBLE_PLC
SRV_ERR_GEN_ADDRESS
SRV_ERR_GEN_DRIVER
SRV_ERR_GEN_RESERVED
SRV_ERR_GEN_COMMUNICATION
SRV_ERR_PLC_CONNECT
SRV_ERR_GEN_ACTION
SRV_ERR_GEN_PARAM_EMPTY
SRV_ERR_GEN_PROTECTEAPPLI
SRV_OPEN_NOK_COMPATIBLES
SRV_ERR_UPLOAD_NOAPPLI
Problem of compatibility between the open application and the PLC.
The p_IpAddress parameter is incorrect.
The p_IpDriver parameter is incorrect.
The PLC is reserved. It is therefore impossible to connect to the PLC.
Communication problem between PL7pro and the PLC.
You have to be in offline mode to download.
Error occurred while the function was being executed.
The name of the dat file is incorrect or empty.
The application is read-protected. It is not possible to connect to the PLC.
The server does not support the level of STX application to be opened.
An error occurred while the application was being transferred.
113
OLE Automation Server
SRV_ERR_UPLOAD_READINFOSYMB Communication error while reading data from the on-board database.
SRV_ERR_UPLOAD_WRITEINFOSYMBOL Write error. If the disk is on which the dat file is saved is saturated.
SRV_ERR_UPLOAD_INVALIDSYMB
SRV_ERR_UPLOAD_INVALIDVERSION
SRV_ERR_UPLOAD_SYMBERR
SRV_ERR_UPLOAD_NBSYMBERR_NOCO
RRECT
SRV_ERR_UPLOAD_SYMBFILE
SRV_ERR_UPLOAD_READSYMBFILE
SRV_ERR_UPLOAD_PBMEM
SRV_ERR_UPLOAD_ABORTSYMB
SRV_ERR_UPLOAD_CHECKSYMB
SRV_ERR_UPLOAD_DIFFSYMB
On-board symbol database in the PLC invalid.
The version of the on-board symbol database is not supported by this version of
PL7.
Internal error in on-board symbol database.
Inconsistency in objects stored in the compressed database
Problem reading from the database in the
PLC.
Error reading from the database in the PLC.
The memory is saturated. The operation cannot be completed in the normal way.
Reading of on-board symbol database abandoned.
A difference has been detected between the on-board "checksum" and the recalculated
"checksum".
A difference has been detected between the information transferred and the recalculated information.
z Output:
Short return code. Either 0 for a successful upload, or an error code.
114
35013153.01 07/2008
OLE Automation Server
GetSymbol
General
Description
This function is used to give the symbol and comment associated with an address.
Summary: integer GetSymbol (String p_lpRepere, String* p_bsSymbole, String* p_bsComment) z z z z
Input:
Enter the character string containing the address to be modified or completed.
Function called:
GetSymbol : Station management function ( gesta.dll
).
Nominal context:
The PL7 server is active. An application is open and in offline mode.
When there is an error:
SRV_ERR_ADDRESSSYNTAX
SRV_ERR_GEN_NOTOPEN
SRV_ERR_GEN_PARAM_EMPTY
SRV_ERR_GEN_ACTION
SRV_ERR_GEN_ADDRESS
SRV_ERR_GEN_ACTION the character string entered as a parameter does not match an address.
No application is open.
p_lpRepere is empty.
Error has occurred on carrying out the function.
Invalid address.
Error has occurred in carrying out the function.
z Output:
Short type feedback code. Either 0 on a successful upload, or error code.
Two character strings: z The associated symbol ( p_bsSymbol ).
z The associated comment ( p_bsComment )
35013153.01 07/2008
115
OLE Automation Server
SetServerHMI
General
Description
This function can be used to display (or not display) the PL7 server. It switches from one operating mode to another. i.e. switch from a PL7 Pro server without HMI to a
PL7 Pro server with HMI, and vice versa.
Syntax: integer SetServerHMI (integer p_bHMI) z z z z
Input:
A Boolean (HMI display or non-display).
Function called:
SetIHMServer : Windows application function ( sawinapp.cpp
).
Nominal context:
The PL7 server is active.
When there is an error:
SRV_ERR_GEN_ACTION
SRV_ERR_GEN_MODIFAPPLI
Error has occurred on carrying out the function.
Application is in the process of being modified.
z Output:
Short type feedback code. Either 0 on a successful upload, or error code.
116
35013153.01 07/2008
OLE Automation Server
SetDownloadFunction
General
Description
This function is used to authorize or block the transfer of an application to the PLC via the server.
Syntax:
SetDownloadFunction Boolean (Download integer) z z z z
Input:
Enter 1 integer (value 0 or 1) to activate or deactivate transfer of the application to the PLC,
Nominal context: z The PL7 server is active, z PL7 is in offline mode.
Output:
TRUE.
Limitations:
This function only prohibits the transfer when used in server mode.
35013153.01 07/2008
117
OLE Automation Server
GetPL7State
General
Description
This function is used to obtain the state of the server.
Syntax: integer GetPL7State (String* p_lpStation, String * p_lpConnection) z z z
Function called:
GetPL7State : Station management function ( gesta.dll
).
Nominal context:
The PL7 server is active.
When there is an error:
SRV_ERR_GEN_ACTION An error has occurred on carrying out the function.
z Output:
Short feedback code type. Either 0 on a successful upload, or error code.
Two character strings inform the user on: z The state of the station (open or closed).
z The mode state (on- or offline). In online mode, the state of the PLC (run or stop) is indicated.
118
35013153.01 07/2008
OLE Automation Server
GetSTXAppIdentity
General Points
Description
This function is used to find out general information about an application.
Syntax: integer GetSTXAppIdentity (String p_lpNameStx, VARIANT FAR* p_pVarInfo) z z z z
Enter:
Enter the character string ( p_1pNameStx ) containing the name of the application.
Function called:
IdentAppliForm : Station management function ( gesta.dll
).
Nominal context:
The PL7 server is active.
When there is an error:
SRV_ERR_GEN_PARAM_EMPTY
SRV_ERR_GEN_ACTION
SRV_ERR_APPLIINFO_NOK p_ lpNameStx is empty.
An error has occurred on carrying out the function.
Invalid information
6
7
8
3
4
5
9
10
11
0
1
2 z Output:
Return code, short type. Either 0 on a successful upload, or there is a code error.
Displayed information:
Station name,
Application version number,
Date and time of modification,
Station application ID,
ID concerning local inputs/outputs configuration,
ID concerning remore inputs/outputs configuration,
PL7 code ID
Grafcet ID,
Constants ID,
Symbol ID,
ID for reservations,
The comment associated with the application.
35013153.01 07/2008
119
OLE Automation Server
GetPLCAppIdentity
General
Description
120
This function is used to find out general information about an application in a PLC.
Syntax: integer GetPLCAppIdentity (String p_lpDriver, String p_lpAdresse, VARIANTFAR* p_pvInfoAppli) z z z z
Enter:
Enter the two character strings containing the driver and the PLC address.
Function called:
IdentAppliOnPlcForm : Station management function ( gesta.dll
).
Nominal context:
The PL7 sever is enabled and in offline mode.
When there is an error:
SRV_ERR_APPLIINFO_NOK
SRV_ERR_GEN_ACTION
SRV_ERR_GEN_ADDRESS
SRV_ERR_COMPATIBLE_PLC
SRV_ERR_PLC_BLANK
SRV_ERR_GEN_ACTION
SRV_ERR_GEN_DRIVER
SRV_ERR_GEN_COMMUNICATION
Invalid information
An error has occurred on carrying out the function.
Invalid address.
Compatibility problem between the API and PL7 software.
There are no applications in the PLC.
A problem has occurred while storing application information.
The p_lpDriver parameter is invalid.
There is a communication error.
2
3
4
0
1
5 z Output:
Short feedback code type. Either 0 on a successful upload, or there is a code error.
Displayed information:
Station name,
Application version number,
Date and time of modification
Station application ID,
ID concerning local inputs/outputs configuration,
ID concerning remote inputs/outputs configuration,
35013153.01 07/2008
6
7
8
9
10
11
PL7 code ID
Grafcet ID,
Constants ID,
Symbol ID,
ID for reservations,
The comment associated with the application.
OLE Automation Server
35013153.01 07/2008
121
OLE Automation Server
SendCommandToPLC
General
Description
This function is used to send a command to the PLC.
Syntax: integer SendCommandToPLC (integer p_iCommand)) z z z z
Enter:
The type of command that is to be executed
There are 3 possible types: z SRV_COMMAND_INIT: Command to initialize PLC z z
SRV_COMMAND_STOP: Command to stop PLC
SRV_COMMAND_RUN: Command to run PLC
Function called:
StationCommand : Station management function ( gesta.dll
).
Nominal context:
The PL7 server is active. An application is open, and PL7 is online and in STOP mode.
When there is an error:
SRV_ERR_GEN_ACTION
SRV_ERR_GEN_NOTOPEN
SRV_ERR_COMMAND_NOTINLOCAL
SRV_COMMAND_ERRINIT
Invalid command.
There are no applications open.
The server is in offline mode.
INIT function cannot be carried out as PLC is already in RUN mode.
z Output:
Short feedback code type. Either 0 on a successful upload, or there is a code error.
122
35013153.01 07/2008
OLE Automation Server
SetDriverAndAddress
General Points
Description
This function is used to change the driver and the address for the current station.
Syntax: integer SetDriverAndAddress (String p_lpDriver, String p_lpAddress) z z z z
Enter:
Enter the two character strings containing the driver and the PLC address.
Function called:
DriverAndAddress : Station management function ( gesta.dll
).
Nominal context:
The PL7 server is active. An application is open and in offline mode. If parameters are not fully completed or are invalid, their current values remain unchanged.
When there is an error:
SRV_ERR_GEN_ADDRESS
SRV_ERR_GEN_DRIVER
SRV_ERR_PLC_CONNECT
SRV_ERR_PLC_ACTION
The address put into the parameter is invalid.
The driver in the parameter is invalid.
The server is in online mode.
An error has occurred on carrying out the function.
The parameters are empty.
SRV_ERR_PARAM_EMPTY z Output:
Return code, short type. Either 0 on a successful upload, or there is a code error.
35013153.01 07/2008
123
OLE Automation Server
OpenTool
General Points
Description
This function opens the tools in the character string that has been configured.
Syntax: integer OpenTool (String p_lpListTool) z z z z
Enter:
Character string containing the list of tools that the server must open.
Formatting example: tools1;tools2;tools3
Function called:
OpenTool : Station management function ( gesta.dll
).
Nominal context:
The PL7 server with HMI is enabled. An application is open.
Errors:
SRV_ERR_GEN_ACTION
SRV_ERR_GEN_PARAM_EMPTY
SRV_ERR_GEN_NOTOPEN
SRV_ERR_GEN_WITHIHM
SRV_ERR_GEN_OPENEDTVDATA
Impossible to open tool.
Empty parameter.
No application is open.
Function available using PL7 server in HMI mode.
The "Animation table" tool cannot be opened.
124
35013153.01 07/2008
35013153.01 07/2008 z Output:
Return code, short type.
List of tool numbers applicable to PL7
188
189
207
210
212
214
215
13
14
15
8
10
12
Number
5
6
7
Designation
Opens the LD editor
Opens the Grafcet editor
Opens the IL editor
Opens the ST editor
Opens the configuration editor
Opens the variables editor
Opens the cross-reference browser
Creates an animation table
Opens the documentation editor
Opens the application import tool
Opens the text editor
Opens the runtime screen
Opens the DFB type editor
Opens the application browser
Opens the Grafcet debug browser
Opens the DFB code editor in ST
OLE Automation Server
125
OLE Automation Server
SetPosPL7Windows
General
Description
This function is used to set the position of the PL7 window.
Syntax: integer PosPL7Windows (integer CoordX, integer CoordY, integer CoordCX,integer
CoordCY) z z z z
Enter:
Th X-Y coordinates for the window.
Function called:
MoveWindow : mfc. function
Nominal context:
The PL7 server with HMI is enabled.
When there is an error:
SRV_ERR_GEN_ACTION
SRV_ERR_GEN_PARAM_EMPTY
SRV_ERR_GEN_WITHIHM
Command failed.
Empty parameter.
Function available using PL7 server in HMI mode.
z Output:
Short feedback code type.
126
35013153.01 07/2008
OLE Automation Server
ShowProgram
General Points
Description
This function is used to open the programs present in the parameter string placed in the parameters.
Syntax: integer ShowProgram (String p_lpListProgram) z z z z
Enter:
Enter the character strings containing the list of programs that the server must open.
Formatting example: mast\lad1;mast\lit2;evt\evt0;sr1;mast\prl
Function called:
ShowProgram : Station management function ( gesta.dll
).
Nominal context:
The PL7 server with HMI is enabled.
An application is open.
When there is an error:
SRV_ERR_GEN_ACTION
SRV_ERR_GEN_NOTOPEN
SRV_ERR_GEN_PARAM_EMPTY
SRV_ERR_GEN_WITHIHM
Command failed.
There are no applications open.
Empty parameter.
Function available using PL7 server in HMI mode.
The module cannot be opened.
SRV_ERR_GEN_SHOWPROGRAM z z
Output:
Return code, short type. Either 0 on a successful upload, or there is a code error.
Limitations:
This fonction is unable to open an uninstantiated DFB. To view the code for an uninstantiated DFB you must use the fonction ShowDFB .
35013153.01 07/2008
127
OLE Automation Server
CloseProgram
General Points
Description
This function is used to close the programs present in the character string placed in the parameters.
Syntax: integer CloseProgram (String p_lpListProgram) z z z z
Enter:
The character strings containing the list of programs that the server must close.
Formatting example: mast\lad1;mast\lit2;evt\evt0;sr1;mast\prl.
Function called:
CloseProgram : Station management function ( gesta.dll
).
Nominal context:
The PL7 server with HMI is enabled.
An application is open.
When there is an error:
SRV_ERR_GEN_NOTOPEN
SRV_ERR_GEN_ACTION
SRV_ERR_GEN_PARAM_EMPTY
SRV_ERR_GEN_WITHIHM
There are no applications open.
Close failed.
Empty parameter.
Function available using PL7 server in HMI mode.
The module cannot be closed.
SRV_ERR_GEN_CLOSEPROGRAMM z z
Output:
Return code, short type. Either 0 on a successful upload, or there is a code error.
Limitations:
This function cannot close a DFB which is open.
128
35013153.01 07/2008
OLE Automation Server
ShowIOModule
General Points
Description
This function is used to open the input/output modules present in the character string placed in the parameters.
z z z z
Enter:
The character strings containing the list of modules that the server must open.
The formatting for the character string is rack,module; rack,module
Formatting example: 0,0;0,1;1,2.
Function called:
ShowIOModule : Station management function ( gesta.dll
).
Nominal context:
The PL7 server with HMI is enabled.
An application is open.
When there is an error:
SRV_ERR_GEN_NOTOPEN
SRV_ACTION_NOK
There are no applications open.
There is a problem with enabling user rights.
SRV_ERR_GEN_PARAM_EMPTY Empty parameter.
SRV_ERR_GEN_WITHIHM Function available using PL7 server in HMI mode.
z z
Output:
Return code, short type. Either 0 on a successful upload, or there is a code error.
Limitations:
An IO module is opened in offline mode, while the module configuration screen is open. If the user changes from offline to online mode, the server does not switch from the configuration screen to the debugging screen. The user can either operate the PL7 Pro directly or open/close the module using a client.
35013153.01 07/2008
129
OLE Automation Server
CloseIOModule
General Points
Description
This function is used to close the input/output modules present in the character string placed in the parameters.
Syntax
CloseIOModule (String p_lpListIOModule) integer.
z z z z
Enter:
The character strings containing the list of modules that the server must open.
Formatting example: 0,0;0,1;1,2.
Function called:
CloseIOModule : Station management function ( gesta.dll
).
Nominal context:
The PL7 server with HMI is enabled.
An application is open.
When there is an error:
SRV_ERR_GEN_ACTION
SRV_ERR_GEN_PARAM_EMPTY
SRV_ERR_GEN_NOTOPEN
SRV_ERR_GEN_WITHIHM
Close command failed.
Empty parameter.
There are no applications open.
Function available using PL7 server in HMI mode.
z z
Output:
Return code, short type. Either 0 on a successful upload, or there is a code error.
Limitations:
This function does not close the configuration editor which is open using the
ShowIOModule function.
130
35013153.01 07/2008
OLE Automation Server
ShowDFB
General Points
Description
This function is used to display the code for one or many DFBs present in the character string placed in the parameters. Opening a DFB using this application does not require instancing.
Syntax integer ShowDFB (String p_lpListeDFB) z z z z
Enter:
The character strings containing the list of DFBs that the server must open.
Function called:
ShowDFB : Station management function ( gesta.dll
).
Nominal context:
The PL7 server with HMI is enabled.
An application is open.
When there is an error:
SRV_ERR_GEN_PARAM_EMPTY
SRV_ERR_GEN_NOTOPEN
SRV_ERR_GEN_ACTION
SRV_ERR_GEN_WITHIHM
Empty parameter
There are no applications open
A problem has occurred while opening a DFB
Function available using PL7 server in HMI mode z Output:
Return code, short type. Either 0 on a successful upload, or there is a code error.
35013153.01 07/2008
131
OLE Automation Server
CloseDFB
General Points
Description
This function is used to close the one or several DFBs present in the character string placed in the parameters.
Syntax integer CloseDFB (String p_lpListeDFB) z z z z
Enter:
The character strings containing the list of DFBs that the server must close.
Function called:
CloseDFB : Station management function ( gesta.dll
).
Nominal context:
The PL7 server with HMI is enabled.
An application is open.
When there is an error:
SRV_ERR_GEN_PARAM_EMPTY
SRV_ERR_GEN_NOTOPEN
SRV_ERR_GEN_ACTION
SRV_ERR_GEN_WITHIHM
Empty parameter
There are no applications open
A problem has occurred while opening a DFB
Function available using PL7 server in HMI mode z Output:
Return code, short type. Either 0 on a successful upload, or there is a code error.
132
35013153.01 07/2008
OLE Automation Server
GetMessageError
General
Description
This function is used to associate an error message with and according to the error code placed in the parameters.
Syntax
String GetMessageError (integer p_iCodeError) z z
Enter:
The error code for one of the departments to return.
Nominal context:
The PL7 server is active.
z Output:
A character string corresponding to the error label.
35013153.01 07/2008
133
OLE Automation Server
GetServerVersion
General
Description
This function is used to find out the version number for the PL7 Pro server.
Syntax
String GetServerVersion () z Nominal context:
The PL7 server is active.
z Output:
A character string corresponding to the version number label for the PL7 Pro server.
134
35013153.01 07/2008
OLE Automation Server
ImportScyFile
General
Description
This function is used to import symbols into the active application from a scy file.
Syntax:
ImportScyFile integer (ScyFile string) z z z z
Input:
Enter 1 character string containing the name and the path of the scy file that you wish to import.
Function called:
ImportScyFile: Station management function ( gesta.dll
).
Nominal context: z z
The PL7 server is active,
PL7 is in offline mode, and the station is open.
Errors:
SRV_ERR_GEN_ACTION
SRV_ERR_GEN_PARAM_EMPTY
SRV_ERR_GEN_NOTOPEN
SRV_ERR_SRC_FILE
Error occurred while the function was being executed.
The name of the dat file is incorrect or empty.
No STX application open.
Problem with source file.
z z
Output:
Short return code. Either 0 for a successful import.
Limitations:
Once an import has been successful, a PL7 server without an HMI cannot operate with an HMI without first saving the open application.
35013153.01 07/2008
135
OLE Automation Server
DownloadStationWithSymbol
General Points
Description
This function is used to upload an application with its zipped symbols database contained in the PLC.
Syntax: integer DownloadStationWithSymbol (String p_IpDriver, String p_IpAddress) z z z z
Input: z 2 character strings containing the driver and the PLC address.
Function called:
DownloadStationWithSymbol: Station management function ( gesta.dll
).
Nominal context: z z
The PL7 server is active,
An application is open, it contains symbols and/or DFBs. The application is z configured with a memory cartridge supporting the symbol database, PL7 is offline,
If the parameters are empty strings, the server executes the function with the current driver and/or address.
Errors:
SRV_ERR_DOWNLOAD_CART
SRV_ERR_COMPATIBLE_PLC
SRV_ERR_PC_BLANK
SRV_ERR_GEN_NOTOPEN
SRV_ERR_GEN_ADDRESS
SRV_ERR_GEN_DRIVER
SRV_ERR_GEN_RESERVED
Problem of compatibility of cartridge between the open application and the PLC.
Problem of compatibility between the open application and the PLC.
No application is open.
No application is open.
The p_IpAddress parameter is incorrect.
The p_IpDriver parameter is incorrect.
The PLC is reserved. It is therefore impossible to connect to the PLC.
SRV_ERR_GEN_COMMUNICATION
SRV_ERR_PLC_CONNECT
Communication problem between PL7pro and the PLC.
You have to be in offline mode to download.
SRV_ERR_GEN_ACTION Error occurred while the function was being executed.
SRV_ERR_GEN_PROTECTEDAPPLI The application contained in the PLC is protected.
z Output:
Short return code. Either 0 for a successful download, or an error code.
136
35013153.01 07/2008
OLE Automation Server
CompareSymbolPCAndSymbolPLCAppli
General Points
Description
This function gives the general application information contained in a PLC.
Syntax: integer CompareSymbolPCAndSymbolPLCAppli (VARIANT FAR* p_pVarInfo i) z z z
Function called:
CompareSymbolPCAndSymbolPLCAppli file: Station management function
( gesta.dll
).
Nominal context: z z
The PL7 server is active and in offline mode. An application is open, it contains the symbols and/or DFBs,
The application is configured with a memory cartridge supporting the symbol database.
Errors:
SRV_ERR_GEN_ADDRESS
SRV_ERR_COMPATIBLE_PLC
SRV_ERR_PLC_BLANK
SRV_ERR_GEN_ACTION
SRV_ERR_APPLIINFO_NOK
SRV_ERR_GEN_DRIVER
SRV_ERR_GEN_COMMUNICATION
SRV_ERR_GEN_NOTOPEN
SRV_ERR_GEN_CONNECT
SRV_ERR_GEN_COMPARESYMB
Incorrect address.
Compatibility problem of TSX with PL7 software.
The PLC contains no applications.
Problem when storing application information.
Incorrect information.
The p_IpDriver parameter is incorrect.
Communication error.
No application is open.
The connection could not be made.
An error occurred during the comparison.
35013153.01 07/2008
137
OLE Automation Server z Output:
Short return code. Either 0 for a successful download, or an error code.
z z
1: Total number of symbols contained in the local application,
2: Checksum of the symbols database contained in the local application, z z z
3: Size of the symbols database contained in the local application,
4: Size of the zipped symbols database contained in the local application,
5: Date of the last modification to the zipped database contained in the local application, z z z z z z z z z z
6: Total number of DFBs contained in the local application,
7: Date of the last modification to the DFB zipped database contained in the local application,
8: Total number of symbols contained in the loaded application,
9: Checksum of the symbols database contained in the loaded application,
10: Size of the symbols database contained in the loaded application,
11: Size of the zipped symbols database contained in the loaded application,
12: Date of the last modification to the zipped database contained in the loaded application,
13: Total number of DFBs contained in the loaded application,
14: Date of the last modification to the DFBs of the zipped database contained in the loaded application,
15: Result of the comparison.
138
35013153.01 07/2008
Instruction times
6
At a Glance
Aim of this chapter
What's in this
Chapter?
This chapter describes the PL7 language instruction times. Thus it can be used to calculate the execution time for an application and the memory size occupied.
This chapter contains the following sections:
Section
6.1
6.2
6.3
6.4
Topic
General information
Instruction times on Micro PLCs
Instruction Times on Premium PLCs
Advanced functions
Page
139
35013153.01 07/2008
Instruction times
6.1
General information
Calculation Principles
Application
Program
Execution Time
The execution time of the program can be calculated using the tables on the following pages to find the sum of all program instruction times.
Note: The time calculated is the maximum time. Operate blocks and subroutines are only processed if the condition of execution (logical equation determining the execution of a block or subroutine) is true, therefore it is possible that the actual time will be much shorter than the maximum time calculated.
Calculating the complete cycle time incorporates parameters which are specific to the PLC (overhead time, I/O Exchange time etc.). For the complete calculation procedure refer to the appropriate PLC operation manual (chapter on performance).
140
35013153.01 07/2008
Application
Memory Size
Instruction times
The size of the application is equal to the sum of the following elements:
Element
Program
Advanced functions
Configured PL7 objects
Configured input/output module
Comments
Calculation method
Calculate the sum of each program instruction, and multiply by the appropriate coefficient corresponding to the language in use
(see next page)
See
Memory Size for Advanced Functions, p. 230
See
See
Review of the Memory Usage of Modules on Micro, p. 220
and
Memory Usage for Modules on Premium, p. 223
The program comments occupy 1 byte per character.
In the tables on the following pages, the information on sizes refers to the instruction code size.
To find out the total size of an instruction or a program, use a multiplication coefficient that takes into account information typical of each language.
Language
Ladder Language
Structured Text
Instruction List
Grafcet
Size
Total size = 1.7 x Code size
Total size = 1.6 x Code size
For the Micro PLC: Total size = 1.4 x Code size
For the Premium PLC: Total size = 1.6 x Code size
Chart size (in words) = 214 = 17 * number of chart steps = 2 * total number of configured steps + 4 * number of programmed actions
Note: The figures given in the following tables are average estimates, calculated using one application type. It is not possible to provide exact figures, as PL7 optimizes memory use according to the structure and contents of the application.
The chapter
Description of the memory zones, p. 218 gives a reminder of the
various memory areas taken up by the application.
35013153.01 07/2008
141
Instruction times
6.2
Instruction times on Micro PLCs
At a Glance
Aim of this section
What's in this
Section?
This section describes the time taken by instructions executed on Micro PLCs.
This section contains the following topics:
Topic
Boolean instruction performance characteristics
Instruction times for the Function Blocks
Integer and Floating Point Arithmetic
Instructions on the program and monitoring structures
Digital conversions
Instructions on a string of bits
Instructions on tables of words, double words and floating points
Time management instructions
Character String Instructions
Application-specific and Orphee Functions
Explicit input/output instructions
Page
142
35013153.01 07/2008
Boolean instruction performance characteristics
Instruction times
35013153.01 07/2008
143
Instruction times
Performance characteristics
LD IL
The table below shows the performance characteristics of the boolean instructions.
ST Objects Execution time (
μ s)
37 05/08/10 37 20
RAM
0,25 0,13
37 20 card
0,19
Size
In words
1
P
N
LD
LDN
LDR,
LDF
%M1 (1)
%M1[%MW2]
%MW0:X0 (2)
%IWi.j:Xk (3)
%MW0[%MW8]:X0
%KW0[%MW8]:X0
%M1
%M1[%MW2]
0,25
13.10
6.06
77.04
16.29
87.27
0.50
13.01
0,13
12.85
5.75
69.25
15.55
79.05
0.25
12.75
0,19
12.85
5.75
69.25
15.55
79.05
0.38
12.75
2
7
8
12
4
8
1
7
AND,
ANDN , AND (, AND (N , idem OR idem LD,LDN
ANDR, ANDF, AND (R, AND (F, idem OR idem LDR,LDF
P
N
XOR
XORN
XORR,
XORF
%M1
%M1[%MW2]
%MW0:X0
%IWi.j:Xk
%MW0[%MW8]:X0
%KW0[%MW8]:X0
%M1
%M1[%MW2]
1.25
26.94
12.86
83.84
33.33
104.31
2.25
27.28
0.63
26.08
11.88
75.38
31.48
94.98
1.13
26.13
0.94
26.26
12.06
75.56
31.66
95.16
1.69
26.44
14
14
18
5
13
10
9
19
144
35013153.01 07/2008
Instruction times
LD IL ST Objects
ST
STN
S
R
%M1 (1)
%M1[%MW2]
S
%MW0:X0
%NW{i}.j:Xk (3)
R
%MW0[%MW8]:X0
Multiple coils on ladder, «cost» of the second and subsequent coils
Operate block [ action]
Horizontal comparison block
[ LD
[comparis on]] block executed
Not executed
Additional comparison time
Vertical operate block
Convergence
Untracked divergence of a convergence
[ )]
[ ]
[ )] between 2 %MWi block executed
0.74
5.55
0.00
12.38
0.25
Ladder, 1 divergence 0.25
Execution time (
μ s)
37 05/08/10 37 20
RAM
0.50
13.10
5.88
76.86
16.41
0.25
0.25
12.85
5.60
69.10
15.65
0.13
0.75
5.40
0.00
11.85
0.13
0.13
[MPS,
MPP,
MRD]
List MPS+MPP
List MRD
0.75
0.25
0.38
0.13
37 20 card
0.38
12.85
5.60
69.10
15.65
0.19
0.75
5.40
0.00
11.85
0.19
0.19
0.56
0.19
Size
In words
4
1
1
3
1
1
1
0
4
8
2
7
8
1
Legend
1.
This applies to all forcible object bits: %I, %Q, %X, %M, %S,
2.
other objects of the same kind: Output bits of function block %Tmi.Q …, Extract bits of system words %SWi:Xj
3.
other objects of the same kind: Extract bits of shared words %NW{i}j:Xk, extract bits of I/O %IWi.j.Xk, %QWi.j.Xk words, extract bits of %KW, error bits %Ii.j.ERR.
35013153.01 07/2008
145
Instruction times
Instruction times for the Function Blocks
IEC Timer The table below describes the instruction times for the IEC timer function block
LD IL ST Conditions Execution time (
μ s)
3705/08/10 3720 start timer 43.39
41.11
Size
(words)
3 rising edge on IN
IN %TM1
(rising edge) falling edge on IN
IN %TM1
(falling edge)
IN =1
START
%TM1
DOWN
%TM1
IN =0
IN %TM1
(=1)
IN %TM1
(=0) stop timer timer inactive
17.47
timer active 18.74
17.40
17.01
17.99
16.67
PL7-3 Timer The table below describes the instruction times for the PL7-3 timer function block.
LD IL ST Conditions Execution time (
μ s)
3705/08/10 3720 start
Size
(words)
3 START
%T1
STOP
%T1 stop 12.63
12.15
E =0 RESET
%T1 reset 12.94
12.15
timer active 17.55
timer inactive
17.00
146
35013153.01 07/2008
Upcounter/ downcounter
Monostable
Register
Instruction times
The table below describes the instruction times for the upcounter/downcounter function block.
LD IL ST Conditions Execution time (
μ s)
3705/08/10
18.69
3720
17.92
reset, R=1 R %C8 (=1) RESET
%C8 reset preset, S=1 S %C9 (=1) PRESET
%C9 preset 20.42
19.73
rising edge on CU rising edge on CD
CU %C8
(rising edge)
CD %C9
(rising edge)
UP %C8
DOWN
%C9 up down
19.92
19.92
19.10
19.10
Size
(words)
3 inactive inputs
R/S/CU/CD inactive bit no action 13.27
12.81
The table below describes the instruction times for the monostable function block.
LD IL ST Conditions Execution time (
μ s)
3705/08/10 3720
Size
(words) rising edge on S
S=1
S %MN0, rising edge
S %MN0,
S =1/0
START
%MN0 start active monostable
35.08
11.64
33.16
11.17
3
The table below describes the instruction times for the register function block.
LD edge on I
IL ST Conditions Execution time (
μ s)
21.27
Size
(words)
3 edge on O
R=1 inactive inputs
I %R2
(edge)
O %R2
(edge)
PUT %R2 store 21.90
GET %R2 remove from storage
21.90
reset 16.90
R %R1
(=1)
I/O/R, inactive bit
RESET
%R2 no action 12.61
21.27
16.02
12.19
35013153.01 07/2008
147
Instruction times
Drum The table below describes the instruction times for the drum.
LD edge on U
R=1
IL
U %DR0
R %DR1
ST
UP %DR1
RESET
%DR2
Conditions up, fixed per command bit reset, fixed
Execution time (
μ s) Size
(words)
181.37
19.30
169.13
19.30
3
174.15
162.03
inactive inputs
R/U, inactive bit per command bit
19.30
no action, fixed 175.92
19.30
164.00
per command bit
19.30
19.30
148
35013153.01 07/2008
Instruction times
Integer and Floating Point Arithmetic
Corrections according to
Object Type
The following time and size pages are given for objects of type %MW0, %MD0 or
%MF0.
The table below gives corrections which should be applied to the values given in the arithmetic instruction times table if different types of objects are used.
Type of object Object position
Single length immediate value
-
Type of correction
Execution time (
μ s)
3705/08/10 3720
1.10
Size in word s
0
Double length immediate value
Words, Double
Words or indexed floating points
-
After the := sign
Value to be subtracted from value mentioned for %MW
1.20
Value to be subtracted from value mentioned for %MD or
%MF
0.75
10.52
Value to be added
Value to be added
11.20
1
10.05
10.60
0
4
5 First operation, when the first operand is not indexed, or assignment
Second operand if the first operand is equally indexed
-
Value to be added
Value to be added
13.37
70.98
12.60
63.50
5
2 %KWi,
%KWi[%MWj]
%KDi, %KFi shared words, input/output words
35013153.01 07/2008
149
Instruction times
Correction according to the
Context of the
Operation
This table describes the corrections to be made to the values given in the arithmetic instruction times table according to the context of the operation.
Context of the operation
Type of object Type of correction
Execution time (
μ s)
3705/08/10 3720
0.69
0.55
Size
37xx
0 The operation is in at least the second position in the statement
E.g: %MW2 in:=%MW0*%MW1*
%MW2
%MW Value to be added to value mentioned for
%MW
%MD or %MF Value to be added to value mentioned for
%MD or %MF
0.99
0.75
0
Operation with result of an operation in parentheses or with higher priority
E.g:
%MW0+%MW2+(...)
%MW Value to be added to value mentioned for
%MW
%MD or %MF Value to be added to value mentioned for
%MD or %MF
2.86
3.60
2.55
3.15
1
1
150
35013153.01 07/2008
Table of
Instruction
Times
Instruction times
The table below shows the arithmetic instruction times.
ST Objects Conditions Execution time (
μ s)
3705/08/10 3720 object after the := sign
%MW0
%MD0,%MF0
/
:= %MW0
%MD0 and %MF0
=, <>, <=, <, >, >= %MW0
%MD0
%MF0
AND, OR, XOR %MW0
+, -
*
/, REM
%MD0
%MW0
%MD0
%MF0
%MW0
%MD0
%MF0
%MW0
ABS, -object
NOT
SQRT
INC, DEC
%MD0
%MF0
%MW0
%MD0
%MF0
%MW0
%MD0
%MW0
%MD0
%MF0
%MW0
%MD0
4.81
6.45
4.46
5.15
4.50
5.70
4.30
4.85
9.75
39.63
58.26
10.69
205.21
62.47
7.20
9.97
8.94
10.71
29.06
7.29
9.21
7.29
9.21
62.83
13.01
6.69
7.80
17.02
85.73
165.04
4.86
5.20
9.10
36.50
56.90
10.08
201.38
60.25
6.95
9.53
8.50
10.26
28.39
6.90
8.55
6.90
8.55
61.20
12.50
6.45
7.40
16.70
85.25
158.40
4.40
4.75
3
3
3
3
3
3
3
3
3
3
3
3
4
3
4
4
2
2
3
3
3
3
3
3
2
2
Size
(words)
37xx
2
2
35013153.01 07/2008
151
Instruction times
ST Objects
SHL, SHR, ROL,
ROR
%MW0
%MD0
NL
LOG
EXP
EXPT
TRUNC
COS
SIN
TAN
ACOS
ASIN
ATAN
DEG_TO_RAD
RAD_TO_DEG
%MF0
%MF0
%MF0
%MF0
%MF0
%MF0
%MF0
%MF0
%MF0
%MF0
%MF0
%MF0
%MF0
Conditions for 1 bit for 1 bit per supplementary bit
Execution time (
μ s)
3705/08/10 3720
17.74
20.58
0.063
1371.60
1458.00
1155.60
2988.00
204.00
2829.60
2840.40
2937.60
4082.40
4082.40
2786.40
852.00
720.00
17.05
19.15
1270.00
1350.00
1070.00
2490.00
170.00
2620.00
2630.00
2720.00
3780.00
3780.00
2580.00
710.00
600.00
3
3
3
3
3
3
3
3
3
3
3
3
3
Size
(words)
37xx
5
5
152
35013153.01 07/2008
Instruction times
Instructions on the program and monitoring structures
Instruction time on the program
The table below shows the instruction time on the program.
ST
Jump %Li
Maskevt
Execution time (
μ s)
3705/08/10
41.93
12.21
3720
38.20
10.80
Unmaskevt
SRi
Return
40.27
48.68
42.18
37.10
42.88
38.33
1
3
3
3
1
Size (words)
37xx
35013153.01 07/2008
153
Instruction times
Performance of the monitoring structures
The table below shows the instruction times of the monitoring structure type.
ST Execution time (
μ s)
3705/08/10 3720
Size (words)
37xx
<cond> forcible bit comparison condition evaluation see LD %M1 boolean instruction see comparisons =,<,> etc.
if <cond > then
<action> end_if; condition true the times and sizes below should be added to those of the action contained in the structure
3.60
5.55
3.30
5.40
2 condition false
(jump)
If <cond> then <action1> else <action2> end_if; condition true condition false while <cond> do.<action> end_while
9.15
5.55
8.70
5.40
4
8.70
2 go into the loop with loop iteration
9.15
exiting the loop 5.55
repeat <action> until <cond> end_repeat
5.55
go into the loop with loop iteration last entry 3.60
for <word1:=word2>to <word3> do <action> end_for input in the for, executed only once
8.58
29.38
go into the loop with loop iteration exit the loop 20.42
5.40
5.40
3.30
8.25
27.35
19.40
2
15
154
35013153.01 07/2008
Instruction times
Digital conversions
Performance times
The table below shows the digital conversion instruction times.
ST
BCD_TO_INT
INT_TO_BCD
GRAY_TO_INT
INT_TO_REAL
DINT_TO_REAL
REAL_TO_INT
REAL_TO_DINT
DBCD_TO_DINT
DINT_TO_DBCD
INT_TO_DBCD
Execution time (
μ s)
3705/08/10 3720 RAM
25.03
21.66
24.55
21.15
36.98
40.90
33.32
58.75
44.59
1 324.85
1 124.85
564.85
36.55
40.75
32.55
58.55
44.05
1 065.15
925.70
825.15
445.15
3720 card
24.55
21.15
36.55
40.75
32.55
58.55
44.05
1 134.70
986.15
879.10
474.40
5
5
3
5
5
3
3
3
3
3
3
Size (words)
37xx
35013153.01 07/2008
155
Instruction times
Instructions on a string of bits
Initializing a table of bits
This table shows the instruction times of a table of bits.
ST
%M30:8:= 0
%M30:16:= 1
%M30:24:= 2
%M30:32:= 2
Size (bit)
8
16
24
32
Execution time (
μ s)
3705/08/10 3720
RAM
19.38
20.38
24.25
25.25
18.88
19.88
23.35
24.35
3720 card
Size (words)
37xx
18.88
19.88
23.35
24.35
6
6
6
6
Copying a table of bits into a table of bits
This table shows the instruction times for copying a table of bits into another table of bits.
ST Size (bit)
%M30:8:= %M20:8 8
%M30:16:= %M20:16 16
%M30:24:= %M20:24 24
%M30:32:= %M20:32 32
%M30:16:=
COPY_BIT(%M20:16)
16
32
128
Execution time (
μ s)
3705/08/10 3720
RAM
25.54
26.16
33.41
24.79
25.41
32.26
35.91
281.63
440.82
1261.22
34.76
230.00
360.00
3720 card
24.79
25.41
32.26
34.76
244.95
383.40
1030.00
1096.95
Size
(words)
37xx
6
6
6
6
9
9
9
156
35013153.01 07/2008
Instruction times
Logic instructions on a table of bits
The table below shows the logic instruction times on a table of bits.
ST Size
(bits)
Execution time (
μ s)
3705/08/10 3720
RAM
3720 card
Size
(words)
37xx
AND_ARX, OR_ARX, XOR_ARX
%M0:16:=
AND_ARX(%M30:16,%M50:16)
%M0:32:=
AND_ARX(%M30:32,%M50:32)
%M0:128:=
AND_ARX(%M30:128,%M50:128)
NOT_ARX
16 397.42
32
128
620.97
1 887.74
320.00
500.00
340.80
532.50
12
12
1 520.00
1 618.80
12
%M0:16:= NOT_ARX(%M30:16) 16
32
128
281.63
440.82
1261.22
230.00
360.00
244.95
383.40
1030.00
1096.95
9
9
9
Copying a table of bits into a table of words
The table below shows the instruction times for copying a table of bits into a table of words.
ST
%MW1:= %M30:8
%MW1:= %M30:16
%MD2:= %M30:24
%MD2:= %M30:32
%MW1:4:=
BIT_W(%M40:80,0,17,2)
Size
(bits)
8
16
24
32
17
Execution time (
μ s)
3705/08/10 3720
RAM
14.84
16.34
14.36
15.86
14.54
16.04
501.43
14.23
15.73
390.00
3720 card
Size
(words)
37xx
14,36
15.86
14.23
15.73
415.35
5
5
5
5
16
%MD1:4:= BIT_D(%M30:80,0,33,0) 33 379.53
530.00
564.45
16
35013153.01 07/2008
157
Instruction times
Copying a table of words into a table of bits
This table shows the instruction times for copying a table of words into a table of bits.
ST Size
(bits)
%M30:8:= %MW1
%M30:16:= %MW2
%M30:24:= %MD1
%M30:32:= %MD3
8
16
24
32
%M30:32:=
W_BIT(%MW200:2,0,2,0)
32
%M30:32:= D_BIT(%MD0:1,0,2,0) 32
Execution time (
μ s)
3705/08/10 3720
RAM
19.28
20.28
18.68
19.68
21.20
22.20
488.68
20.37
21.37
370.00
567.33
460.00
3720 card
Size
(words)
37xx
18.68
19.68
20.37
21.37
394.05
489.90
5
5
5
5
16
16
158
35013153.01 07/2008
Instruction times
Instructions on tables of words, double words and floating points
Initializing a table of words with one word
The table below shows the instruction times for initializing a table of words with one word.
ST Size (of the table of words)
Execution time (
μ s)
3705/08/10 3720
RAM
%MW0:10:= %MW100 10 words per word
47,46
0,34
%MD0:10:= %MD100 10 double words 81,27 per double word
42,15
0,20
74,45
2,87
3720 card
42,15
0,20
74,45
2,65
Size (words)
37xx
7
7
2,65
Copying a table of words into a table of words
This table shows the instruction times for copying a table of words into another table of words.
ST Size (of the table of words)
%MW0:10:=%MW20:10; 10 words per word
Execution time (
μ s)
3705/08/10
95,80
0,77
3720
RAM
3720 card
85,35 85,35
0,50 0,50
%MD0:10:=%MD20:10; 10 double words 111,13 per double word 1,54
97,65 97,65
1,00 1,00
Size (words)
37xx
9
9
35013153.01 07/2008
159
Instruction times
Arithmetic and logic instructions between 2 tables of words
The table below shows the arithmetic and logic instruction times between two tables of words.
ST Size (of the table of words)
Execution time (
μ s)
3705/08/10 3720
RAM
3720 card
Size (words)
37xx
+, -
%MW0:10:=
%MW10:10 + %MW20:10;
%MD0:10:=
%MD10:10+%MD20:10;
10 words per word
10 double words per double word
*
%MW0:10:=
%MW10:10 * %MW20:10;
%MD0:10:=
%MD10:10 * %MD20:10;
10 words per word
10 double words per double word
/, REM
%MW0:10:=
%MW10:10 / %MW20:10;
%MD0:10:=
%MD10:10 / %MD20:10;
10 words per word
10 double words per double word
AND, OR, XOR
%MW0:10:=%MW10:10
AND %MW20:10;
%MD0:10:=%MD10:10
AND %MD20:10;
10 words per word
10 double words per double word
168,04
7,13
239,17
13,84
189,32
9,27
710,35
61,64
224,76
13,14
2 192,38
209,16
163,69
6,66
240,14
13,94
151,95 151,95 14
6,35 6,35
214,40 214,40 14
12,25 12,25
175,40 175,40 14
8,70 8,70
603,80 603,80 14
51,20 51,20
181,40 181,40 14
9,30 9,30
2
157,35
2
157,35
206,55 206,55
14
147,40 147,40 14
5,85 5,85
215,90 215,90 14
12,40 12,40
160
35013153.01 07/2008
Instruction times
Arithmetic and logic instructions between 1 table of words and 1 word
The table below shows the arithmetic and logic instruction times between 1 table of words and 1 word.
ST Size (of the table of words)
Execution time (
μ s)
3705/08/10 3720
RAM
3720 card
Size (words)
37xx
+, -
%MW0:10:=%MW10:10 +
%MW20; or %MW0:10:= %MW20 +
%MW10:10
%MD0:10:=%MD10:10 +
%MD20;
10 words 119,12 per word 2,87
10 double words
159,68 per double word
6,57
108,5
5
2,65
147,4
5
6,25
108,55 12
2,65
147,45 12
6,25
*
%MW0:10:=
%MW20*%MW10:10;
10 words 166,86
%MD0:10:=
%MD20*%MD10:10; per word 7,94
10 double words
587,01 per double word
49,18
132,4
5
5,05
132,45
5,05
12
522,9
5
522,95
43,80 43,80
12
/, REM
%MW0:10:=%MW10:10 /
%MW30;
10 words 196,69 155,85 15
%MD0:10:=
MD10:10 / %MD30 per word 10,86
10 double words
2 230,17 per double word
213,66
155,8
5
7,30
2
173,9
5
208,9
0
7,30
2
173,95
208,90
12
AND, OR, XOR
%MW0:10:=%MW10:10 AND
%MW20;
10 words 117,20 106,45 12
%MD0:10:=%MD20 AND
%MD10:10; per word 2,64
10 double words per double word
587,01
6,47
106,4
5
2,40
522,9
5
6,15
2,40
522,95 12
6,15
35013153.01 07/2008
161
Instruction times
ST Size (of the table of words)
Execution time (
μ s)
3705/08/10 3720
RAM
3720 card
NOT
%MW0:10:=NOT(%MW10:10); 10 words 110,28 100,25
Size (words)
37xx
9 per word 2,96
100,2
5
2,75 2,75
%MD0:10:=NOT(%MD10:10) 10 double words
126,39 per double word
4,50
114,0
0
4,05
114,00
4,05
9
Addition function on the table
The table below shows the instruction times for addition on a table.
ST
%MW20:=SUM(%MW0:10);
%MD20:=SUM(%MD0:10);
Size (of the table of words)
Execution time (
μ s)
3705/08/10 3720
RAM
3720 card
10 words 74,30 per word 2,44
69,00
2,35
69,00
2,35
Size (words)
37xx
10
76,90 76,90 10 10 double words
83,58 per double word
3,17 2,95 2,95
%MF20:=SUM_ARR(%MF0:10); 10 double words
1634 1257 1257 10 per double word
162
35013153.01 07/2008
Table comparison function
Instruction times
The table below shows the instruction times for table comparison.
ST
%MW20:=
EQUAL(%MW0:10;%MW10:10);
Size (of the table of words)
Execution time (
μ s)
3705/08/10 3720
RAM
3720 card
10 words 103,78 93,5
0
Size (words)
37xx
93,50 11
%MD20:=
EQUAL(%MD0:10;%MD10:10);
%MF20:=
EQUAL_ARR(%MF0:10;%MF10:
10); per word 1,13
10 double words
116,17 per double word
2,23
10 double words
741 per double word
0,90 0,90
103,
40
103,40 11
1,75 1,75
570 607 11
35013153.01 07/2008
163
Instruction times
Find function The table below shows the instruction times for finding in a table.
ST Size (of the table of words)
Execution time (
μ s)
3705/08/10 3720
RAM
3720 card
Size (words)
37xx
250,00 266,25 15 %MW20:=
FIND_EQW(%MW0:10,%KW0)
%MD20:= FIND_EQD(%MD0:10,
%KD0)
10 words max poss
340,00
10 double words, max poss
350,00 260,00 276,90 16
833 648 690,12 15 %MF20:=
FIND_EQR(%MF0:10,%KF0)
%MF20:=
FIND_EQRP(%MF0:10, %KF0)
10 double words
10 double words
%MD20:= FIND_GTR(%MF0:10,
%KF0)
10 double words
%MD20:= FIND_LTR(%MF0:10,
%KF0)
10 double words
845
836
836
650
643
643
692,25 15
684,79 15
684,79 15
Finding highest and lowest values
This table describes the instruction times for finding the highest and lowest values in a table.
ST
%MW20:=
MAX_ARW(%MW0:10)
%MD20:=
MAX_ARD(%MD0:10)
Size (of the table of words)
Execution time (
μ s)
3705/08/10 3720
RAM
3720 card
10 words 350,00
Size (words)
37xx
260,00 276,90 9
10 double words
%MF20:=MAX_ARR(%MF0:10
);
10 double words
%MF20:=MIN_ARR(%MF0:10) 10 double words
410,00
1366
1270
300,00 319,50
1051
977
9
1119,31 9
1040,50 9
164
35013153.01 07/2008
Calculating the number of occurrences
Instruction times
This table shows instruction times for the number of occurrences of a value in a table of words.
ST Size (of the table of words)
Execution time (
μ s)
3705/08/10 3720
RAM
10 words 350,00
3720 card
Size (words)
37xx
250,00 266,25 15 %MW20:=
OCCUR_ARW(%MW0:10,
%KW0)
%MD20:=
OCCUR_ARD(%MD0:10,
%KD0)
%MF20:=
OCCUR_ARR(%MF0:10,
%KF0)
10 double words
10 double words
370,00
1265
270,00 287,55 16
973
1036,24
16
35013153.01 07/2008
165
Instruction times
Rotate shift The table below shows the rotate shift instruction times.
ST
ROL_ARW(word or value,%MWj:10)
Size (of the table of words)
10 words
Execution time (
μ s)
3705/08/10
550,00
3720
RAM
3720 card
Size (words)
37xx
400,00 426,00 9
430,00 457,95 9 ROL_ARD(%MDi,%MDj:10) 10 double words
ROL_ARR(%MFi,%MFj:10) 10 double words
590,00
585 450 479,25 9
Sort instruction The table below shows the instruction times for sorting the elements in a table.
ST Size (of the table of words)
Execution time (
μ s)
3705/08/10 3720
RAM
3720 card
700,00 745,50 9 SORT_ARW(%MWi,%MWj:10) 10 words max poss
SORT_ARD(%MDi,%MDj:10) 5 double words, max poss
SORT_ARR(%MFi,%MFj:10) 10 double words
970,00
610,00
1863
450,00 479,25
1433
Size (words)
37xx
9
1526,14 9
166
35013153.01 07/2008
Instruction times
Time management instructions
Instructions on date, hour and period management
The table below shows the date, hour and period instruction times.
ST Execution time (
μ s)
3705/08/10 3720
%MW2:4:= ADD_DT(%MW2:4,%MD8) 4 400.00
%MD2:= ADD_TOD(%MD2,%MD8)
%MB2:11:=
DATE_TO_STRING(%MD40)
2 100,00
1 370,00
RAM
3720 card
Size (words)
37xx
3 300.00 3 514.50
13
1 550,00 1 650,75 9
900,00 958,50 9
280,00 298,20 5
1 130,00 1 203,45 9
2 300,00 2 449,50 13
%MW5:= DAY_OF_WEEK()
%MD10:= DELTA_D(%MD2, %MD4)
%MD10:=
DELTA_DT(%MD2:4,%MW6:4)
%MD10:=
DELTA_TOD(%MD2,%MD4)
220,00
1 520,00
3 170,00
2 330,00
%MB2:20:=
DT_TO_STRING(%MW50:4)
2 050,00
%MW2:4:= SUB_DT(%MW2:4,%MD8) 4 750,00
%MD2:= SUB_TOD(%MD2,%MD8) 2 330,00
%MB2:15:=
TIME_TO_STRING(%MD40)
1 560,00
%MB2:9:=
TOD_TO_STRING(%MD40)
%MD100:= TRANS_TIME(%MD2)
1 270,00
500,00
1 700,00 1 810,50 9
1 450,00 1 544,25 11
3 500,00 3 727,50 13
1 700,00 1 810,50 9
1 200,00 1 278,00 9
800,00 852,00
500,00 532,50
9
7
35013153.01 07/2008
167
Instruction times
Real-time clock access
The table below shows the real time clock instruction times.
ST Execution time (
μ s) Size (words)
3705/08/10 3720 RAM 3720 card 37xx
RRTC(%MW0:4)
WRTC(%MW0:4)
PTC(%MW0:5)
SCHEDULE(%MW0,%MW1,%MW2,
%MD10,%MD12,%M0)ÿ
93,60
248,61
97,98
1430
84,80
230,85
88,60
1100
84,80
230,85
88,60
1171,5
5
5
5
5
168
35013153.01 07/2008
Instruction times
Character String Instructions
Character String
Assignment and
Copying
The table below describes the instruction times for assigning and copying character strings.
ST Size
(characters)
Execution time (
μ s)
3705/08/10 3720 RAM 3720 card
%MB0:8:=%MB10:8 8 characters 105.16
per character 1.65
93.80
1.30
93.80
1.30
%MB0:8:=’abcdefg’ 8 characters 120.72
per character 4.15
110.20
3.85
110.20
3.85
Size (words)
37xx
9
11
0.5
Converting
Words <->
Character
Strings
This table describes the instruction times for converting words and character strings.
ST Execution time (
μ s)
3705/08/10 3720 RAM 3720 card
97.69
91.95
91.95
Size (words)
37xx
7 %MW1:=
STRING_TO_INT(%MB0:7)
%MB0:7:=
INT_TO_STRING(%MW0)
104.36
96.70
96.70
7
Converting
Double Words <-
> Character
Strings
This table describes the instruction times for converting double words and character strings.
ST Execution time (
μ s)
3705/08/10 3720 RAM 3720 card
1 070.53
965.62
965.62
Size (words)
37xx
7 %MD1:=
STRING_TO_DINT(%MB0:13)
%MB0:13:=
DINT_TO_STRING(%MD0)
322.29
295.35
295.35
7
35013153.01 07/2008
169
Instruction times
Converting
Character
Strings <->
Floating Point
This table describes the instruction times for converting floating points into character strings.
ST Execution time (
μ s)
3705/08/10 3720 RAM 3720 card
1 783.70
1 634.53
1 634.53
7
Size (words)
37xx
%MF1:=
STRING_TO_REAL(%MB0:15)
%MB0:15:=
REAL_TO_STRING(%MF0)
741.75
681.20
681.20
7
Instructions for
Manipulating
Character
Strings
This table describes the instruction times for manipulating character strings.
ST Execution time (
μ s)
3705/08/10 3720 RAM 3720 card
1 170.00
770.00
820.05
Size
(words)
37xx
15 %MB10:20:=
CONCAT(%MB30:10,%MB50:10)
%MB10:20:= DELETE(%MB10:22,2,3);
%MW0:=
EQUAL_STR(%MB10:20,%MB30:20); (the fifth character differs)
950.00
860.00
600.00
520.00
639.00
553.80
15
13
%MW0:= FIND(%MB10:20,%MB30:10);
%MB10:20:=
INSERT(%MB30:10,%MB50:10,4);
%MB10:20:= LEFT(%MB30:30,20);
%MW0:= LEN(%MB10:20);
1 610.00
1 270.00
920.00
770.00
1 000.00
1 065.00
13
800.00
852.00
17
570.00
340.00
607.05
362.10
13
9
%MB10:20:= MID(%MB30:30,20,10);
%MB10:20:=
REPLACE(%MB30:20,%MB50:10,10,10);
%MB10:20:= RIGHT(%MB30:30,20);
1 080.00
1 450.00
1 480.00
700.00
870.00
950.00
745.50
926.55
15
19
1 011.75
13
170
35013153.01 07/2008
Instruction times
Application-specific and Orphee Functions
Communication
Functions
The table below shows the communication function instruction times.
ST Execution time (
μ s)
3705/08/10 3720
RAM
3720 card
Size (words)
37••
1818 1936 21 SEND_REQ(%KW0:6,15,%MW0:1,
%MW10:10,%MW30:4)
2182
SEND_TLG(%KW0:6,1,%MW0:5,%MW30:2) 1636 1364 1452 15
Operator Dialog
Function
The table below shows the operator dialog instruction times.
ST
SEND_MSG(ADR#1.0,%MW0:2,%MW10:2)
SEND_ALARM(ADR#1.0,%MW0:2,%MW10:2)
GET_MSG(ADR#1.0,%MW0:2,%MW10:2)
GET_VALUE(ADR#1.0,%MW0,%MW10:2)
ASK_MSG(ADR#1.0,%MW0:2,%MW10:2,%MW2
0:2)
ASK_VALUE(ADR#1.0,%MW0,%MW10:2,%MW2
0:2)
2 240
DISPLAY_ALRM(ADR#1.0,%MW0,%MW10:2)
DISPLAY_GRP(ADR#1.0,%MW0,%MW10:2)
1 120
1 120
DISPLAY_MSG(ADR#1.0,%MW0,%MW10:2) 1 120
CONTROL_LEDS(ADR#1.0,%MW0:2,%MW10:2) 2 240
ASSIGN_KEYS(ADR#1.0,%MW0:2,%MW10:2)
PANEL_CMD(ADR#1.0,%MW0:2,%MW10:2)
2 240
2 240
Execution time (
3705/08/
10
3720
RAM
μ s)
3720 card
Size (words)
37••
2 240
2 240
2 000 2208
2 000 2208
19
19
2 240
1 120
2 240
2 000 2 208 19
1 000 1 104 17
2 000 2 208 23
2 000 2 208 21
1 000 1 104 17
1 000 1 104 17
1 000 1 104 17
2 000 2 208 19
2 000 2 208 19
2 000 2 208 19
35013153.01 07/2008
171
Instruction times
Process Control
Function
The table below shows the process control function instruction times.
ST
PID("PIDS1",’Unit’,%IW3.5,%M
W12,%M16,%MW284:43)
Condition Execution time (
μ s)
3705/08/10 3720
RAM
3720 card
Size (words)
37•• deval_mmi=0 1320 deval_mmi=1 1080
1100 1172 24
900 958.5
PWM(%MW11,%Q2.1,%MW385
:5)
SERVO(%MW12,%IW3.6,%Q2.
2,%Q2.3,
%MW284:43,%MW390:10)
PID_MMI(ADR#0.0.4,%M1,%M2
:5, %MW410:62)
EN=1
600
960
1140
500 532.5 11
800 852 19
950 1012 20
Data Storage The table below shows the instruction times for the data storage functions.
ST Execution time (
μ s) Size (words)
3705/08/10 3720 RAM 3720 card 37••
SET_PCMCIA (for 1600 words)
WRITE_PCMCIA (for 1600 words)
READ_PCMCIA (for 1600 words)
1000
2000
2000
24
24
24
172
35013153.01 07/2008
Instruction times
Orphee Function The table below shows the process control function instruction times.
ST Condition Execution time (
μ s)
3705/08/10 3720
RAM
3720 card
DSHR_RBIT(%MD102,16,%MD204
,%MD206) write 10 words
660 480 511
Size (words)
37••
13
310 330 13 DSHRZ_C(%MD102,16,%MD204,
%MD206) request to copy 10 words
410
300 WSHL_RBIT(%MW102,8,%MW204
,%MW206) exchange
10 words
20 bytes WSHR_RBIT(%MW102,8,%MW20
4,%MW206)
WSHRZ_C(%MW102,8,%MW204,
%MW206)
20 bytes
SCOUNT(%M100,%MW100,%M10
1,%M102,%MW101,
%MW102,%M200,%M201,%MW20
0,%MW201)
20 bytes
390
300
510
220 234
280 298
220 234
410 437
13
13
13
25
35013153.01 07/2008
173
Instruction times
Explicit input/output instructions
Performance times
This table shows the explicit input/output instruction times.
ST Execution time (
μ s)
3705/08/10 3720 RAM 3720 card
Read_Sts %CHi.MOD
Any application except the processor communication channel
Read_Sts %CHi
Analog input
Analog output
Counting module CTZ
Write_Param %CHi
Analog input
Counting module CTZ
Read_Param %CHi
Analog input
Counting module CTZ
Save_Param %CHi
Analog input
Counting module CTZ
Restore_Param %CHi
Analog input
Counting module CTZ
Write_Cmd %CHi
Discrete output
30
180
90
110
790
1127
260
338
1234
1370
550
1160
50
30
180
70
95
570
1080
290
295
1220
1220
510
1080
47
32
216
74
104
790
1083
316
300
1240
1240
535
1097
52
Size (words)
37xx
2
6
6
6
6
6
6
174
35013153.01 07/2008
Instruction times
6.3
Instruction Times on Premium PLCs
At a Glance
Subject of this
Section
What's in this
Section?
This section describes the times for instructions carried out on Premium PLCs
(except for references TSX P57•A).
This section contains the following topics:
Topic
Boolean instruction performance characteristics
Instruction times for the function blocks
Integer and floating point arithmetic
Instructions on the program and monitoring structures
Digital conversions
Instructions on a bit string
Instructions on tables of words, double words and floating points
Time management instructions
Character String Instructions
Application-specific and Orphee functions
Explicit input/output instructions
DFB function block
Page
35013153.01 07/2008
175
Instruction times
Boolean instruction performance characteristics
176
35013153.01 07/2008
Instruction times
P57 1•/2• processor instruction times
LD IL
The table below shows the boolean instruction times for the P57 1•/2• processors.
ST Objects Execution time (
μ s)
57 1• ram
57 1• card
57 1• ram >
4 K
0,37 0,50
57 1• card
> 4 K
57 2• ram
57 2• card
0,06 0,21
57 2• ram >
4 K
57 2• card
> 4 K
Size
(words)
1
P
N
LD
LDN
LDR,
LDF
%M1 (1) 0,50 0,62 0,62 0,87 0,19 0,21 0,25 0,42 1
%M1[%MW2] 1,50 2,25 1,50 2,25 0,62 1,25 0,62 1,25 6
%MW0:X0 (2) 1,12 1,62 1,12 1,62 0,37 0,83 0,37 0,83 4
%IWi.j:Xk (3) 1,75 2,50 1,75 2,50 0,62 1,25 0,62 1,25 6
%MW0[%MW
8]:X0
2,25 3,37 2,25 3,37 0,94 1,87 0,94 1,87 9
%KW0[%MW
8]:X0
2,25 3,37 2,25 3,37 0,94 1,87 0,94 1,87 9
%M1 0,87 1,12 1,00 1,37 0,25 0,42 0,31 0,62 2
%M1[%MW2] 1,87 2,75 1,87 2,75 0,69 1,46 0,69 1,46 7
AND,
ANDN, AND (, AND (N, same as OR same as LD,LDN
P
N
ANDR, ANDF, AND (R, AND
(F, same as OR same as LDR,LDF
XOR
XORN
%M1 2,12 2,75 2,37 3,25 0,56 1,04 0,69 1,46 5
%M1[%MW2] 3,37 4,75 3,37 4,75 0,94 2,29 0,94 2,29 12
%MW0:X0
%IWi.j:Xk
3,37 4,62 3,37 4,62 0,75 2,08 0,75 2,08 10
4,00 5,50 4,00 5,50 1,00 2,50 1,00 2,50 12
%MW0[%MW
8]:X0
4,50 6,37 4,50 6,37 1,31 3,12 1,31 3,12 15
%KW0[%MW
8]:X0
4,50 6,37 4,50 6,37 1,31 3,12 1,31 3,12 15
35013153.01 07/2008
177
Instruction times
LD IL
,
XORR
XORF
ST Objects Execution time (
57 1• ram
57 1• card
μ s)
57 1• ram >
4 K
57 1• card
> 4 K
57 2• ram
57 2• card
57 2• ram >
4 K
57 2• card
> 4 K
Size
(words)
%M1 3,62 4,75 3,87 5,25 0,81 1,87 0,94 2,29 9
%M1[%MW2] 5,62 8,00 5,62 8,00 1,69 3,96 1,69 3,96 19
S
R operate block
ST
STN
S
R
[ action]
%M1 (1)
%MW0:X0
%NW{i}.j:Xk
(3)
1,00
%M1[%MW2] 1,62
1,25
1,25
2,37
1,75
1,12
1,62
1,25
1,50
2,37
1,75
0,37
0,75
0,50
0,46
1,29
0,83
0,44
0,75
0,50
0,62
1,29
0,83
2
6
4
%MW0[%MW
8]:X0
2,37 3,50 2,37 3,50 0,75 1,92 0,75 1,92 9 multiple ladder coils, «cost» of the second and subsequent coils
0,62 0,75 0,75 1,00 0,31 0,25 0,37 0,42 1 executed block
1,87
0,25
2,62
0,50
1,87
0,25
2,62
0,50
0,75
0,12
1,25
0,42
0,75
0,12
1,25
0,42
6
2 not executed 0,50 0,75 0,50 0,75 0,12 0,42 0,12 0,42 2
1,62 11,85 1,62 2,25 0,56 1,04 0,56 1,04 5 vertical operate block
Converge nce
[ )]
Untracked divergenc e of a convergen ce
[ ]
[MPS,
MPP,
MRD] between 2
%MWi
[ )] executed block
Ladder, 1 divergence
MPS+MPP list
MRD List
0,37
0,37
1,12
0,37
0,13
0,50
1,50
0,50
0,37
0,37
1,12
0,37
0,50
0,50
1,50
0,50
0,06
0,06
0,19
0,06
0,21
0,21
0,62
0,21
0,06
0,06
0,19
0,06
0,21
0,21
0,62
0,21
1
1
3
1
Legend
1.
This applies to all forcible bit objects: %I, %Q, %X, %M, %S,
2.
other objects of the same kind: output bits of function block %Tmi.Q etc, extract bits of %SWi:Xj system words
3.
other objects of the same kind: extract bits of shared words %NW{i}j:Xk, extract bits of I/O %IWi.j.Xk, %QWi.j.Xk words, extract bits of %KW, %Ii.j.ERR error bits.
178
35013153.01 07/2008
Instruction times
P57 3•/4• processor instruction times
LD IL
The table below shows the boolean instruction times for the P57 3•/4• processors.
ST Objects Execution time (
μ s)
57 3• ram
57 3• card
57 3• ram >
4 K
0,04 0,17
57 3• card >
4 K
57 4• ram
0,02
57 4•
> 4K
Size in words
1
P
N
LD
LDN
LDR,
LDF
%M1 (1)
%M1[%MW2]
%MW0:X0 (2)
%IWi.j:Xk (3)
0,12
0,42
0,25
0,42
%MW0[%MW8]:X0 0,62
%KW0[%MW8]:X0 0,62
%M1
%M1[%MW2]
0,17
0,46
0,17
1,00
0,67
1,00
1,50
1,50
0,33
1,17
0,17
0,42
0,25
0,42
0,62
0,62
0,21
0,46
0,33
1,00
0,67
1,00
1,50
1,50
0,50
1,17
0,06
0,21
0,12
0,21
0,31
0,31
0,08
0,23
0,08
0,21
0,12
0,21
0,31
0,31
0,10
0,23
2
7
9
9
4
6
1
6
AND,
ANDN, AND (, AND (N, same as OR same as LD,LDN
P
N
ANDR, ANDF, AND (R, AND (F, same as OR same as LD,LDN
XOR
XORN
XORR,
XORF
%M1
%M1[%MW2]
%MW0:X0
%IWi.j:Xk
0,37
0,62
0,50
0,67
%MW0[%MW8]:X0 0,87
%KW0[%MW8]:X0 0,87
%M1 0,54
%M1[%MW2] 1,12
0,83
1,83
1,67
2,00
2,50
2,50
1,50
3,17
0,46
0,62
0,50
0,67
0,87
0,87
0,62
1,12
1,17
1,83
1,67
2,00
2,50
2,50
1,83
3,17
0,19
0,31
0,25
0,33
0,44
0,44
0,27
0,56
0,23
0,31
0,25
0,33
0,44
0,44
0,31
0,56
15
15
9
19
5
12
10
12
35013153.01 07/2008
179
Instruction times
LD IL ST Objects
S
R
ST
STN
S
R
%M1 (1)
%M1[%MW2]
%MW0:X0
0,25
0,50
0,33
%NW{i}.j:Xk (3) 0,50
%MW0[%MW8]:X0 0,62
0,21 multiple ladder coils, «cost» of the second and subsequent coils operate block [ action] executed block not executed
0,25
0,50 vertical operate block
Convergence [ )] [ )] between 2 %MWi 1,62 executed block 0,37
Ladder, 1 divergence
Execution time (
μ s)
57 3• ram
57 3• card
57 3• ram >
4 K
57 3• card >
4 K
57 4• ram
0,33
1,00
0,67
0,29
0,50
0,33
0,50
1,00
0,67
0,12
0,25
0,17
0,37
1,00
0,75
0,17
0,50
0,75
0,13
0,50
0,50
0,50
0,25
0,08
0,08
11,85 0,37
0,04
0,04
1,00
1,50
033
0,33
0,33
0,83
0,17
0,17
0,25
0,25
0,10
0,04
0,04
0,19
0,02
0,02 Untracked divergence of a convergence
[ ]
[MPS,
MPP,
MRD]
MPS+MPP list
MRD List
1,12
0,37
1,50
0,50
0,12
0,04
0,50
0,17
0,06
0,02
57 4•
> 4K
0,15
0,25
0,17
0,25
0,25
0,12
0,04
0,04
0,19
0,02
0,02
0,06
0,02
Size in words
2
6
4
6
9
1
2
2
5
1
1
3
1
Legend
1.
This applies to all forcible bit objects: %I, %Q, %X, %M, %S,
2.
other objects of the same kind: output bits of function block %Tmi.Q etc, extract bits of %SWi:Xj system words
3.
other objects of the same kind: extract bits of shared words %NW{i}j:Xk, extract bits of I/O %IWi.j.Xk, %QWi.j.Xk words, extract bits of %KW, %Ii.j.ERR error bits.
180
35013153.01 07/2008
Instruction times
Instruction times for the function blocks
IEC timer
LD IL
The table below describes the instruction times for the IEC timer function block
ST Conditions start timer
Execution time (
μ s)
571• 572•
29 8,0
573•
5,4
574•
3,7
Size
(words)
3 rising edge on IN falling edge on IN
IN %TM1 (rising edge)
START
%TM1
IN %TM1
(falling edge)
DOWN
%TM1
IN =1
IN =0
IN %TM1 (=1)
IN %TM1 (=0) stop timer 9 timer active 12 timer inactive 10
2,6
3,5
3,3
1,7
2,3
2,2
1,2
1,6
1,5
PL7-3 timer
LD IL
E =0
The table below describes the instruction times for the PL7-3 timer function block
ST Conditions Execution time (
μ s)
571• 572• 573• 574•
Size
(words)
START
%T1
STOP
%T1
RESET
%T1 start stop reset
7
7
2,8
3,1
2,0
2,2
1,4
1,6
3 timer active 11 timer inactive
3,4 2,3 1,7
35013153.01 07/2008
181
Instruction times
Upcounter/ downcounter
LD IL
The table below describes the instruction times for the upcounter/downcounter function block
ST Condition s
Execution time (
μ s)
571•
11
572•
3,4
573•
2,3
574•
1,7
Size
(words)
3 reset, R=1 R %C8 (=1) RESET
%C8 rising edge on CD
CD %C9
(edge reset preset, S=1 S %C9 (=1) PRESET
%C9 rising edge on CU
CU %C8
(edge preset
UP %C8 up
DOWN
%C9 down
12
12
12
3,6
3,7
3,7
2,4
2,5
2,5
1,7
1,8
1,8 inactive inputs
R/S/CU/CD inactive bit no action 7 2,5 1,7 1,2
Monostable
LD IL rising edge on S
S=1
S %MN0, rising edge
S %MN0,
S =1/0
The table below describes the instruction times for the monostable function block
ST Conditions Execution time (
μ s)
571• 572• 573• 574•
Size
(words)
START
%MN0 start active monostable
24
6
7,2
2,2
4,9
1,5
3,4
1,1
3
Register The table below describes the instruction times for the register function block
LD IL edge on I I %R2
(edge edge on O O %R2
(edge)
R=1 inactive inputs
R %R1
(=1)
I/O/R, inactive bit
ST Conditions Execution time (
μ s)
571• 572•
PUT %R2 store 13 3,9
GET %R2 remove from strorage
13
RESET
%R2 reset 9 no action 6
3,9
3,3
2,6
573•
2,6
2,6
2,3
1,8
574•
1,8
1,8
1,6
1,3
Size
(words)
3
182
35013153.01 07/2008
Drum
LD edge on U
R=1 inactive inputs
IL
U %DR0
R %DR1
The table below describes the instruction times for the drum
ST
UP %DR1
RESET
%DR2
Conditions up, fixed per command bit reset, fixed
Execution time (
μ s)
571• 572•
124
25
35
25
573•
24
25
118 33 23
R/U, inactive bit per command bit
25 no action, fixed 120
25
34
25
23 per command bit
25 25 25
574•
16
25
15
25
16
25
Instruction times
Size
(words)
3
35013153.01 07/2008
183
Instruction times
Integer and floating point arithmetic
Corrections according to object type
The times and volumes below are given for objects of the %MW0, %MD0 or %MF0 type.
This table describes the corrections which should be applied to the values given in the arithmetic instruction times table if other object types are used.
Object type
Single length immediate value
Object position
-
Type of correction
Execution time (
μ s)
57 1• ram
57 1• card
57 2• ram
57 2• card
Value to be subtracted from or added to value mentioned for
%MW
-0,12 -0,12 -0,12 0,00
-0,19 0,21 Double length immediate value
Value to be subtracted from or added to value mentioned for
%MD or %MF
-0,12 0,00
1,12 1,75 Words, double
Words or indexed floating points
After the := sign
First operation, when the first operand is not indexed, or assignment
Value to be added
Value to be added
1,12 1,75
0,56
0,56
1,04
1,04
Second operand if the first operand is also indexed
Value to be added
1,12 1,75 0,56 1,04
57 3• ram
57 3• card
-0,08 0,00
-0,12 0,17
0,37
0,37
0,37
0,83
0,83
0,83
57 4•
Size
(words)
-0,04 0
-0,06 1
0,19
0,19
0,19
5
5
5
184
35013153.01 07/2008
Instruction times
Object type Object position
Type of correction
Execution time (
μ s)
57 1• ram
0,62
57 1• card
0,87
57 2• ram
0,25
57 2• card
0,42
57 3• ram
0,17
57 3• card
0,33
57 4•
0,08
Size
(words)
2 %KWi,
%KWi[%MWj]
%KDi, %KFi shared words, input/output words
Value to be added
Correction according to the context of the operation
This table describes the corrections to be made to the values given in the arithmetic instruction times table according to the context of the operation.
Context of the operation
The operation is in at least the second position in the statement
E.g.: %MW2 in:=%MW0*%MW
1*%MW2
Object type
Type of correction
Execution time (
μ s)
57 1• ram
57 1• card
57 2• ram
57 2• card
57 3• ram
57 3• card
57 4•
Size
(words)
0,50 0,62 0,19 0,33 0,12 0,25 0,06 1 %MW
%MD or
%MF
Value to be added to value mentioned for %MW
Value to be added to value mentioned for %MD or %MF
0,62 0,75 0,31 0,46 0,21 0,33 0,10 1
Operation with result of an operation in parentheses or more urgent
E.g.:
%MW0+%MW2+(.
..)
%MW
%MD or
%MF
Value to be added to value mentioned for %MW
Value to be added to value mentioned for %MD or %MF
0,37 0,37 0,12 0,12 0,08 0,08 0,04 1
0,50 0,50 0,25 0,25 0,17 0,17 0,08 1
35013153.01 07/2008
185
Instruction times
Table of instruction times
ST
The table below shows the arithmetic instruction times.
Objects Conditions Execution time (
μ s)
57 1• ram
57 1• card
57 2• ram
0,6 0,9 0,2
0,7 1,0 0,4
57 2• card
0,4
0,4
57 3• ram
0,2
0,2 object after the := sign
:=
=, <>, <=, <,
>, >=
AND, OR,
XOR
+, -
*
%MD0
%MF0
%MW0
%MD0
%MF0
%MW0 /, REM
/
%MD0
%MF0
ABS, -object %MW0
NOT
%MD0
%MF0
%MW0
%MD0
%MW0 -
%MW0+(...or
%MW0 before
*,/ or REM)
%MD0 -
%MW0+(...or
%MW0 before
*,/ or REM)
%MF0
%MW0
%MD0 and
%MF0
%MW0
%MD0
%MF0
%MW0
%MD0
%MW0
0,7
1,0
1,0
0,6
0,7
0,4
2,5
2,0
9,3
2,5
2,1
0,3
0,4
2,6
0,2
0,4
0,2
34
3,3
0,2
0,4
2,1
0,2
0,4
1,0
48
6,5
29
44
7,2
1,4
1,5
24
0,9
1,0
0,9
149
47
0,9
1,0
10
0,9
1,0
0,7
48
6,3
29
44
6,9
1,0
1,5
24
0,6
0,7
0,6
148
46
0,6
0,7
9
0,6
0,7
1,0
1,2
1,2
0,9
1,0
0,4
0,6
0,6
0,2
0,4
0,4
0,5
0,5
0,4
0,4
0,2
0,4
0,4
0,2
0,2
0,4
2,5
2,2
9,3
2,5
2,3
0,6
0,6
2,6
0,4
0,4
0,4
34
3,4
0,4
0,4
2,1
0,4
0,4
0,2
1,9
1,5
6,3
1,9
1,5
0,2
0,3
1,9
0,2
0,2
0,2
21
2,5
0,2
0,2
1,6
0,2
0,2
0,3
0,3
0,3
0,3
0,3
0,3
2,0
1,6
6,4
2,0
1,6
0,5
0,5
2,0
0,3
0,3
0,3
21
2,6
0,3
0,3
1,7
0,3
0,3
57 3• card
0,3
0,3
57 4•
0,08
0,12
Size
(words)
2
2
0,12
0,21
0,21
0,08
0,12
2
2
2
2
2
0,12
1,4
1,2
4,7
1,4
1,2
0,10
0,15
1,4
0,08
0,12
0,08
15
1,8
0,08
0,12
1,2
0,1
0,1
3
3
3
2
3
3
2
2
2
3
3
4
2
3
2
3
3
2
2
186
35013153.01 07/2008
Instruction times
ST
SQRT
INC, DEC
SHL, SHR,
ROL, ROR
LN
LOG
EXP
EXPT
TRUNC
COS
SIN
TAN
ACOS
ASIN
ATAN
DEG_TO_RA
D
RAD_TO_DE
G
%MF0
%MF0
%MF0
%MF0
%MF0
%MF0
%MF0
%MF0
%MF0
%MF0
%MF0
%MF0
%MF0
Objects Conditions
%MW0
%MD0
%MF0
%MW0
%MD0
%MW0 for 1 bit
%MD0 for 1 bit
1,0
2,0
2,1 per additional bit 0,042
Execution time (
μ s)
57 1• ram
57 1• card
57 2• ram
19
62
117
0,7
19
62
117
1,0
3,5
10,2
2,8
0,4
1,2
2,9
3,0
0,6
0,8
0,9
847
900
713
847
900
713
2,2
2,2
6,4
1 747 1 747 2,2
1 753 1 753 2,2
1 813 1 813 2,2
2 520 2 520 2,7
2 520 2 520 3,4
57 2• card
3,7
10,3
2,8
0,4
0,5
1,5
1,5
2,2
2,2
6,4
2,2
2,2
2,2
2,7
3,4
57 3• ram
2,1
5,7
2,1
0,2
0,4
0,5
0,6
1,6
1,6
4,7
1,6
1,6
1,6
2,0
2,5
57 3• card
2,2
5,8
2,1
0,3
0,3
1,2
1,2
1,6
1,6
4,7
1,6
1,6
1,6
2,0
2,5
57 4•
1,5
1,5
4,0
1,5
1,5
1,5
1,8
2,2
1,5
4,4
1,5
0,12
0,21
0,27
0,31
1 720 1 720 2,1
1 640 1 640 61
103
392
380
142
537
522
32
86
86
2,1
68
36
96
96
1,6
43
23
61
61
1,6
49
26
69
69
1,4
32
17
45
46
2
7
7
3
2
3
3
Size
(words)
35013153.01 07/2008
187
Instruction times
Instructions on the program and monitoring structures
Instruction times on the program
ST
The table below shows the instruction times on the program.
Jump %Li
Maskevt
Unmaskevt
SRi
Return
Execution time (
μ s)
57 1• ram
57 1• card
57 2• ram
1,2
15,5
15,7
1,9
0,6
1,6
15,5
15,7
2,2
0,9
0,8
5,8
6,0
1,4
0,2
57 2• card
0,6
5,8
6,0
1,2
0,4
57 3• ram
0,5
4,0
4,2
1,0
0,2
57 3• card
0,5
4,0
4,2
0,8
0,3
57 4•
0,3
2,8
3,0
0,5
0,1
3
1
1
2
2
Size (words)
57• •
188
35013153.01 07/2008
Instruction times
Instruction times for the monitoring structures
The table below shows the instruction times for the monitoring structure-types.
ST
<cond> forcible bit comparison if <cond > then
<action> end_if; true condition false condition
(jump)
Execution time (
μ s)
57 1• ram condition evaluation
57 1• card
57 2• ram see LD %M1 boolean instruction see comparisons =,<,> .etc.
the times and volumes below should be added to those of the action contained in the structure
0,2
0,5
0,5
0,7
If <cond> then <action1> else <action2> end_if; true condition 0,7 1,2 false condition 0,5 0,7
0,1
0,1
0,2
0,1
57 2• card
0,4
0,4
0,8
0,4
57 3• ram
0,1
0,1
0,2
0,1
57 3• card
0,3
0,3
0,7
0,3
57 4•
0,04
0,04
0,08
0,04
Volume (words)
57• •
2
4 while <cond> do.<action> end_while go into the loop with loop iteration
0,7 exit the loop 0,5 repeat <action> until <cond> end_repeat
1,2
0,7 go into the loop with loop iteration last entry
0,5
0,2
0,7
0,5 for <word1:=word2>to <word3> do <action> end_for input in the for, executed only once go into the loop with loop iteration exit the loop
1,2
3,5
1,7
1,7
5,0
2,5
0,2
0,1
0,1
0,1
0,5
1,2
0,6
0,8
0,4
0,4
0,4
0,8
2,5
1,2
0,2
0,1
0,1
0,1
0,3
0,8
0,4
0,7
0,3
0,3
0,3
0,7
2,0
1,0
0,08
0,04
0,04
0,04
0,17
0,42
0,21
2
2
15
35013153.01 07/2008
189
Instruction times
Digital conversions
Instruction times The table below shows the instruction times for the digital conversions.
ST Execution time (
μ s)
57 1• ram 57 4•
Volume
(words)
57• •
BCD_TO_INT(%MW0)
INT_TO_BCD(%MW0)
GRAY_TO_INT(%MW0)
INT_TO_REAL(%MW0)
DINT_TO_REAL(%MD0) 24
REAL_TO_INT(%MF0) 41
REAL_TO_DINT(%MF0) 33
DBCD_TO_DINT(%MD0) 612
17
14
27
28
DBCD_TO_INT(%MD0) 537
DINT_TO_DBCD(%MD0) 512
INT_TO_DBCD(%MW0) 274
33
840
737
702
376
28
28
24
42
57 1• card
17
14
1,7
231
203
193
104
4,7
1,5
1,7
1,6
57 2• ram
3,3
2,8
1,8
233
204
195
104
4,9
1,7
1,8
1,7
57 2• card
3,4
3,0
1,6
178
156
149
80
2,7
1,4
1,6
1,5
57 3• ram
1,9
1,7
1,7
179
157
150
80
2,8
1,6
1,7
1,6
57 3• card
2,1
1,9
1,2
1,1
1,2
138
1,5
1,3
1,9
1,0
121
115
62
5
5
5
3,0
3,0
3,0
5
3,0
3,0
3,0
3,0
190
35013153.01 07/2008
Instruction times
Instructions on a bit string
Initializing a bit table
ST
This table shows the instruction times for initializing a bit table.
Size (bit)
%M30:8 := 0
%M30:16 := 1
%M30:24 := 2
%M30:32 := 2
8
16
24
32
Execution time (
μ s)
57 1• ram
57 1• card
57 2• ram
3,6
5,6
12
14
4,5
6,5
14
16
2,4
4,4
5,6
7,6
57 2• card
3,2
5,2
6,8
8,8
57 3• ram
1,6
3,0
3,7
5,1
57 3• card
2,3
3,7
4,8
6,1
Size (words)
57 4• 57• •
0,8
1,5
2,4
3,1
7
7
12
12
Copying a bit table into a bit table
ST
This table shows the instruction times for copying a bit table into another bit table.
%M30:8 := %M20:8 8
%M30:16 := %M20:16 16
%M30:24 := %M20:24 24
%M30:32 := %M20:32 32
%M30:16 :=
COPY_BIT(%M20:16)
16
32
128
Size
(bit)
8,1
22
27
173
263
818
Execution time (
μ s)
57 1• ram
57 1• card
57 2• ram
6,9 7,9 5,4
9,1
23
28
237
360
1 122
6,6
14
19
65
99
309
57 2• card
6,0
7,3
16
21
66
100
312
57 3• ram
3,6
4,4
10
13
50
76
238
57 3• card
4,2
5,1
11
14
50
77
239
Size (words)
57 4• 57• •
1,8
2,2
5,4
7,0
39
59
184
8
8
13
13
17
17
17
35013153.01 07/2008
191
Instruction times
Logic instructions on a bit table
The table below shows the logic instruction times for a bit table.
ST Size
(bits)
Execution time (
57 1• ram
57 1• card
μ s)
57 2• ram
57 2• card
57 3• ram
57 3• card
Size
(words)
57 4• 57• •
AND_ARX, OR_ARX, XOR_ARX
%M0:16:=
AND_ARX(%M30:16,%M50:16)
%M0:32:=
AND_ARX(%M30:32,%M50:32)
%M0:128:=
AND_ARX(%M30:128,%M50:128)
NOT_ARX
%M0:16:= NOT_ARX(%M30:16)
16 233
32
128
16
32
128
368
1 178
173
263
818
319
504
1 616
237
360
1 122
88
139
445
65
99
309
89
140
449
66
100
312
68
107
343
50
76
238
68
107
344
50
77
239
52
83
265
39
59
184
24
24
24
17
17
17
Copying a bit table into a word table
ST
This table shows the instruction times for copying bit tables into a word table.
%MW1:= %M30:8
%MW1:= %M30:16
%MW2:= %M30:24
%MD2:= %M30:32
%MW1:4:=
BIT_W(%M40:80,0,17,2)
%MD1:4:=
BIT_D(%M30:80,0,33,0)
8
16
24
32
17
Size
(bits)
Execution time (
μ s)
57 1• ram
4,5
7,5
11
14
231
57 1• card
5,2
8,2
11
14
317
57 2• ram
3,4
6,4
10
13
87
57 2• card
3,9
6,9
10
13
88
57 3• ram
2,2
4,2
6,8
8,8
67
57 3• card
2,7
4,7
7,2
9,2
68
Size
(words)
57 4• 57• •
1,1
2,1
3,8
4,8
52
6
6
6
6
23
33 325 446 123 124 95 95 73 23
192
35013153.01 07/2008
Instruction times
Copying a word table into a bit table
ST
This table shows the instruction times for copying word tables into a bit table.
%M30:8:= %MW1
%M30:16:= %MW2
%M30:24:= %MD1
%M30:32:= %MD3
%M30:32:=
W_BIT(%MW200:2,0,2,0)
%M30:32:=
D_BIT(%MD0:1,0,2,0)
8
16
24
32
32
Size
(bits)
Execution time (
μ s)
57 1• ram
3,6
5,6
12
14
231
57 1• card
4,4
6,4
13
15
317
57 2• ram
2,5
4,5
6,1
8,1
87
57 2• card
3,0
5,0
6,9
8,9
88
57 3• ram
1,7
3,0
4,3
5,7
67
57 3• card
2,2
3,5
5,1
6,4
68
Size
(words)
57 4• 57• •
0,8
1,5
3,1
3,7
52
6
6
11
11
23
32 275 377 104 105 80 80 62 23
35013153.01 07/2008
193
Instruction times
Instructions on tables of words, double words and floating points
Initializing a table of words with one word
ST
This table shows the instruction times for initializing a table of words with one word.
%MW0:10:= %MW100
%MD0:10:= %MD100
Size (of the table of words)
Execution time (
μ s)
10 words per word
10 double words per double word
57 1• ram
34
0,16
53
1,98
57 1• card
35
0,16
54
1,98
57 2• ram
14
0,15
19
0,57
57 2• card
15
0,15
20
0,57
57 3• ram
10
0,12
13
0,37
57 3• card
11
0,12
14
0,37
Size
(words)
57 4• 57• •
6,7
0,08
8,8
0,26
10
10
Copying a table of words into a table of words
This table shows the instruction times for copying a table of words into another table of words.
ST Size (of the table of words)
Execution time (
57 1• ram
%MW0:10:=%MW20:10; 10 words 63 per word 0,28
%MD0:10:=%MD20:10; 10 double words
69
57 1• card
65
0,28
71
μ s)
57 2• ram
25
0,31
29 per double word
0,79 0,79 0,71
57 2• card
26
0,31
30
0,71
57 3• ram
17
0,24
20
0,53
57 3• card
19
0,24
22
0,53
Size
(words)
57 4• 57• •
12
0,15
14
0,36
15
15
194
35013153.01 07/2008
Instruction times
Arithmetic and logic instructions between 2 tables of words
The table below shows the arithmetic and logic instruction times between two tables of words.
ST Size (of the table of words)
Execution time (
μ s)
57 1• ram
57 1• card
57 2• ram
+, -
%MW0:10:=
%MW10:10 + %MW20:10;
%MD0:10:=
%MD10:10+%MD20:10;
10 words 110 per word 4,7
10 double words
154 per double word
8,9
112
4,7
156
8,9
41
1,8
60
3,6
*
%MW0:10:=
%MW10:10 * %MW20:10;
%MD0:10:=
%MD10:10 * %MD20:10;
10 words 127 per word 6,4
10 double words
441 per double word
37,6
129
6,4
444
37,6
47
2,4
153
12,9
/, REM
%MW0:10:=
%MW10:10 / %MW20:10;
%MD0:10:=
%MD10:10 / %MD20:10;
10 words 133 per word 7,0 per double word
157
135
7,0
49
2,6
10 double words
1 639 1 642 395
157 37
AND, OR, XOR
%MW0:10:=%MW10:10
AND %MW20:10;
10 words 108 per word 4,5
%MD0:10:=%MD10:10 AND
%MD20:10;
10 double words
155 per double word
9
111
4,5
158
9
40
1,7
61
4
57 2• card
43
1,8
62
3,6
50
2,4
155
12,9
52
2,6
397
37
43
1,7
63
4
57 3• ram
28
1,3
41
2,5
33
1,7
104
8,7
34
1,8
248
23
28
1,2
42
3
57 3• card
30
1,3
43
2,5
35
1,7
106
8,7
36
1,8
250
23
30
1,2
44
3
Size
(words)
57 4• 57• •
19
0,9
28
1,7
23
1,2
73
6,2
24
1,4
172
16
19
0,8
29
2
23
23
23
23
23
23
23
23
35013153.01 07/2008
195
Instruction times
Arithmetic and logic instructions between 1 table of words and 1 word
The table below shows the arithmetic and logic instruction times between 1 table of words and 1 word.
ST Size (of the table of words)
Execution time (
μ s)
57 1• ram
57 1• card
57 2• ram
+, -
%MW0:10 :=%MW10:10 +
%MW20; or %MW0:10:= %MW20 +
%MW10:10
10 words 86 per word 2,8
88
2,8
30
0,8
%MD0:10:=%MD10:10 +
%MD20;
10 double words
112 per double word
5,2
114
5,2
41
1,9
*
%MW0:10:=
%MW20*%MW10:10;
10 words per word
113
5,6
115
5,6
38
1,6
57 2• card
32
0,8
43
1,9
40
1,6
57 3• ram
21
0,5
28
1,3
26
1,1
57 3• card
22
0,5
30
1,3
27
1,1
Size
(words)
57 4• 57• •
14
0,4
19
0,9
18
0,7
18
18
18
383 132 134 90 92 64 18 %MD0:10:=
%MD20*%MD10:10;
10 double words
381 per double word
32
/, REM
%MW0:10 :=%MW10:10 /
%MW30;
10 words 140 per word 8,4
32
142
8,4
11
46
2,4
11
48
2,4
7,4
31
1,6
7,4
33
1,6
5,3
21
1,1
18
%MD0:10:=
MD10:10 / %MD30
10 double words
1 585 1 587 375 per double word
152 152 35
377
35
235
22
236
22
163
15
18
AND, OR, XOR
196
35013153.01 07/2008
Instruction times
ST
%MW0:10:=%MW10:10
AND %MW20;
%MD0:10:=%MD20 AND
%MD10:10;
Size (of the table of words)
Execution time (
μ s)
57 1• ram
57 1• card
57 2• ram
10 words per word
10 double words per double word
86
2,8
381
4,2
NOT
%MW0:10:=NOT(%MW10:
10);
10 words 74 per word 1,9
%MD0:10:=NOT(%MD10:
10)
10 double words
84
88
2,8
383
4,2
75
1,9
86
30
0,8
132
1,5
26
0,5
31 per double word
2,9 2,9 1,0
1,5
28
0,5
33
1,0
57 2• card
32
0,8
134
57 3• ram
21
0,5
90
1,0
18
0,4
22
0,7
57 3• card
22
0,5
92
Size
(words)
57 4• 57• •
14
0,4
64
18
18
1,0
19
0,4
23
0,7
0,7
12
0,2
15
0,5
15
15
Addition function on the table
The table below shows the instruction times for the addition function on the table.
ST
%MD20:=SUM(%MD0:10);
Size (of the table of words)
Execution time (
57 1• ram
%MW20:=SUM(%MW0:10); 10 words 51 per word 1,6
58
57 1• card
53
1,6
59
μ s)
57 2• ram
17
0,4
19 10 double words per double word
2,1 2,1 0,6
57 2• card
18
0,4
20
0,6
57 3• ram
12
0,3
13
0,4
57 3• card
12
0,3
14
0,4
Size
(words)
57 4• 57• •
8
0,2
9
0,3
16
16
35013153.01 07/2008
197
Instruction times
Table comparison function
The table below shows the table comparison instruction times.
ST
%MW20:=
EQUAL(%MW0:10;%MW10:10);
Size (of the table of words)
Execution time (
57 1• ram
10 words 67 per word 0,6
57 1• card
69
0,6
μ s)
57 2• ram
26
0,4
57 2• card
28
0,4
57 3• ram
18
0,3
57 3• card
20
0,3
Size
(words)
57 4• 57• •
13
0,2
27
76 31 33 22 23 15 27 %MD20:=
EQUAL(%MD0:10;%MD10:10);
10 double words per double word
74
1,2 1,2 0,9 0,9 0,7 0,7 0,5
Find function The table below shows the find in a table instruction times.
ST
%MW20:=
FIND_EQW(%MW0:10,%KW0)
%MD20:=
FIND_EQD(%MD0:10, %KD0)
Size (of the table of words)
Execution time (
10 words, max poss
57 1• ram
150
57 1• card
206
μ s)
57 2• ram
57
10 double words, max poss
163 223 61
57 2• card
57
62
57 3• ram
44
47
57 3• card
44
48
Size
(words)
57 4• 57• •
34
37
14
15
Finding highest and lowest values
ST
This table describes the instruction times for finding the highest and lowest values in a table.
Size (of the table of words)
Execution time (
57 1• ram
10 words 163
57 1• card
223
μ s)
57 2• ram
61
57 2• card
62
57 3• ram
47
57 3• card
48 37
Size
(words)
57 4• 57• •
12 %MW20:=
MAX_ARW(%MW0:10)
%MD20:=
MAX_ARD(%MD0:10)
10 double words
194 266 73 74 56 57 44 12
198
35013153.01 07/2008
Instruction times
Calculating the number of occurrences
This table shows the instruction times for the number of occurrences of a value in a table of words.
ST
%MW20:=
OCCUR_ARW(%MW0:10, %KW0)
%MD20:=
OCCUR_ARD(%MD0:10, %KD0)
Size
(of the table of words)
10 words
10 double words
Execution time (
μ s)
57 1• ram
163
175
57 1• card
223
240
57 2• ram
61
66
57 2• card
62
67
57 3• ram
47
51
57 3• card
48
51
Size
(words)
57 4• 57• •
37
39
14
15
Rotate shift The table below shows the rotate shift instruction times.
ST Size (of the table of words)
Execution time (
57 1• ram
10 words 250
57 1• card
343
μ s)
57 2• ram
94 ROL_ARW(word or value,%MWj:10)
ROL_ARD(%MDi,%MDj:10) 10 double words
269 369 102
57 2• card
95
102
57 3• ram
73
78
57 3• card
73
79
Size
(words)
57 4• 57• •
56
61
12
12
Sort instruction The table below shows the instruction times for sorting the elements in a table.
ST
SORT_ARW(%MWi,%MWj:10)
Size (of the table of words)
10 words max poss
Execution time (
μ s)
57 1• ram
450
57 1• card
618
57 2• ram
170
SORT_ARD(%MDi,%MDj:10) 5 double words, max poss
275 377 104
57 2• card
172
105
57 3• ram
131
80
57 3• card
132
80
Size
(words)
57 4• 57• •
101
62
12
12
35013153.01 07/2008
199
Instruction times
Calculation of length
ST
LENGTH_ARW(tab_word)
LENGTH_ARD(tab_dword)
LENGTH_ARW(tab_reel)
LENGTH_ARW(tab_bit)
The table below shows the instruction times for calculating the length of a table.
Size (of the table of words)
Execution time (
57 1• ram
31
31
31
31
57 1• card
43
43
43
43
μ s)
57 2• ram
12
12
12
12
57 2• card
12
12
12
12
9
9
9
57 3• ram
9
9
9
9
57 3• card
9
7
7
7
7
Size
(words)
57 4• 57• •
6
6
6
6
200
35013153.01 07/2008
Instruction times
Floating point tables
ST
SUM_ARR
FIND_EQR
FIND_EQRP
FIND_GTR
FIND_LTR
MAX_ARR
MIN_ARR
OCCUR_ARR
ROL_ARR
ROR_ARR
SORT_ARR
EQUAL_ARR
The table below shows the instruction times on a floating point table.
Size (of the table of words)
Execution time (
μ s) Size
(words)
57 4• 57• • 57 1• ram
57 1• card
57 2• ram
57 2• card
57 3• ram
57 3• card
794 942 186 207 132 149 98
390 535 83 93 59 67 44
10 integers
10 integers, median poss
10 integers, median poss
10 integers, median poss
10 integers, median poss
10 integers
10 integers
10 integers
10 integers
10 integers
10 integers
10 integers
391
390
390
648
601
598
273
264
896
344
536
535
535
889
825
821
374
363
83
83
83
1 229 220
472
160
148
147
67
65
84
93
93
93
179
164
164
75
72
245
94
59
59
59
114
105
104
48
46
156
60
67
67
67
128
118
118
54
52
176
68
44
44
44
85
78
78
35
34
116
45
35013153.01 07/2008
201
Instruction times
Time management instructions
Instructions for date, hour and period management
ST
The table below shows the instruction times for date, hour and period management.
Execution time (
μ s)
57 1• ram
57 1• card
57 2• ram
%MW2:4:= ADD_DT(%MW2:4,%MD8) 1 951 2 677 737
%MD2:= ADD_TOD(%MD2,%MD8) 1 025 1 407 387
832 229 %MB2:11:=
DATE_TO_STRING(%MD40)
%MW5:= DAY_OF_WEEK()
606
88
%MD10:= DELTA_D(%MD2, %MD4) 731
121
1 004
33
276
%MD10:=
DELTA_DT(%MD2:4,%MW6:4)
%MD10:=
DELTA_TOD(%MD2,%MD4)
%MB2:20:=
DT_TO_STRING(%MW50:4)
1 506
1 113
707
2 067
1 527
970
569
421
267
%MW2:4:= SUB_DT(%MW2:4,%MD8) 2 344 3 216 886
%MD2:= SUB_TOD(%MD2,%MD8) 1 113 1 527 421
794 1 089 300 %MB2:15:=
TIME_TO_STRING(%MD40)
%MB2:9:=
TOD_TO_STRING(%MD40)
%MD100:= TRANS_TIME(%MD2)
519
331
712
455
196
125
34
279
574
424
269
893
424
303
198
126
57 2• card
744
391
231
57 3• ram
568
298
176
26
213
438
324
206
682
324
231
151
96
57 3• card
571
300
177
Size
(words)
57 4• 57• •
440
231
137
19
9
12
26
214
441
325
207
685
325
232
152
97
20
165
339
251
159
528
251
179
117
75
5
9
19
9
17
19
9
12
12
7
202
35013153.01 07/2008
Instruction times
Real-time clock access
ST
The table below shows the instruction times for the real-time clock.
Execution time (
μ s)
RRTC(%MW0:4)
WRTC(%MW0:4)
PTC(%MW0:5)
SCHEDULE(%MW0,%MW1,%MW2
,%MD10,%MD12,%M0)ÿ
57 1• ram
88
69
74
88
57 1• card
89
70
75
89
57 2• ram
30
25
26
30
57 2• card
30
25
27
30
57 3• ram
21
17
18
21
57 3• card
21
17
19
21
14
11
12
14
Size
(words)
57 4• 57• •
8
8
8
8
Timer functions
ST
FTON
FTOF
FTP
FPULSOR
The table below shows the instruction times for the timer functions.
Execution time (
μ s)
57 1• ram
53
53
53
181
57 1• card
53
53
53
249
57 2• ram
28
28
28
69
57 2• card
32
32
32
69
57 3• ram
21
21
21
53
57 3• card
24
24
24
53
57 4•
12
12
12
41
Size
(words)
57• •
35013153.01 07/2008
203
Instruction times
Character String Instructions
Character String
Assignment and
Copying
ST
The table below describes the instruction times for assigning and copying character strings.
%MB0:8:=%MB10:8
%MB0:8:=’abcdefg’
Size
(characters)
Execution time (
8 characters
57 1• ram
66 per character 0.39
8 characters 85 per character 2.37
57 1• card
67
0.39
85
2.37
μ s)
57 2• ram
27
0.30
29
0.68
57 2• card
27
0.30
29
0.68
57 3• ram
18
0.23
20
0.47
57 3• card
19
0.23
20
0.47
Size
(words)
57 4• 57• •
14
0.16
14
0.36
15
14
0.5
Converting
Words <->
Character
Strings
ST
This table describes the instruction times for converting words and character strings.
%MW1:=
STRING_TO_INT(%MB0:7)
%MB0:7:=
INT_TO_STRING(%MW0)
Execution time (
57 1• ram
69
57 1• card
71
μ s)
57 2• ram
23
57 2• card
23
57 3• ram
16
57 3• card
16
Size
(words)
57 4• 57• •
12 10
74 75 23 23 15 16 12 10
204
35013153.01 07/2008
Instruction times
Converting
Double Words <-
> Character
Strings
ST
This table describes the instruction times for converting double words and character strings.
Execution time (
57 1• ram
706
57 1• card
707
μ s)
57 2• ram
237
57 2• card
237
Size
(words)
57 4• 57• • 57 3• ram
160
57 3• card
160 115 10 %MD1:=
STRING_TO_DINT(%MB0:13)
%MB0:13:=
DINT_TO_STRING(%MD0)
215 216 66 67 44 45 33 10
Converting
Character
Strings <->
Floating Point
ST
This table describes the instruction times for converting floating points into character strings.
%MF1:=
STRING_TO_REAL(%MB0:15)
%MB0:15:=
REAL_TO_STRING(%MF0)
Execution time (
57 1• ram
1 912
57 1• card
1 913
μ s)
57 2• ram
344
57 2• card
344
57 3• ram
237
57 3• card
237
Size
(words)
57 4• 57• •
155 10
500 501 140 140 96 96 63 10
35013153.01 07/2008
205
Instruction times
Instructions for
Manipulating
Character
Strings
ST
This table describes the instruction times for manipulating character strings.
%MB10:20:= LEFT(%MB30:30,20);
%MW0:= LEN(%MB10:20);
%MB10:20:= MID(%MB30:30,20,10);
%MB10:20:=
REPLACE(%MB30:20,%MB50:10,10,1
0);
%MB10:20:= RIGHT(%MB30:30,20);
Execution time (
%MW0:=
EQUAL_STR(%MB10:20,%MB30:20);
(the fifth character differs)
57 1• ram
%MB10:20:=
CONCAT(%MB30:10,%MB50:10)
494
%MB10:20:= DELETE(%MB10:22,2,3); 400
338
%MW0:=
FIND(%MB10:20,%MB30:10);
%MB10:20:=
INSERT(%MB30:10,%MB50:10,4);
650
519
369
219
444
556
606
57 1• card
678
549
463
892
712
506
300
609
763
832
μ s)
57 2• ram
187
57 2• card
188
151
128
246
196
139
83
168
210
229
152
129
248
198
141
83
169
212
231
Size
(words)
57 4• 57• • 57 3• ram
144
57 3• card
144 111 24
116
98
189
151
107
64
129
162
176
117
99
190
152
108
64
130
163
177
90
76
146
117
83
49
100
125
137
21
19
19
26
19
12
21
28
19
Extracting
Words
ST
LW
HW
CONCATW
The table below shows the instruction times for extracting words.
Execution time (
57 1• ram
32
32
32
57 1• card
44
44
44
μ s)
57 2• ram
12
12
12
57 2• card
12
12
12
9
9
57 3• ram
9
9
9
57 3• card
9 7
7
7
Size
(words)
57 4• 57• •
206
35013153.01 07/2008
Instruction times
Application-specific and Orphee functions
Communication functions
The table below shows the instruction times for the communication functions.
ST Execution time (
μ s) Size
(words)
57 4• 57• • 57 1• ram
57 1• card
57 2• ram
57 2• card
57 3• ram
SEND_REQ: instruction execution time, time to be added in the communication system
57 3• card
SEND_REQ(%KW0:6,15,%MW0:1,
%MW10:10,%MW30:4)
1 250 1 715 472 476 364 366 282 33
SEND_TLG: processing is simultaneous with the instruction, no time needs to be added in the communication system
SEND_TLG(%KW0:6,%MW0:5,%MW3
0:2)
938 1 287 354 357 273 274 211 24
SERVER for 120 octets 3 825 4 244 2 225 2 229 1 677 1 679 1 427 16
WRITE_ASYN for 500 words
READ_ASYN for 500 words
2 975 3 301 1 731 1 734 1 305 1 306 1 110 16
2 975 3 301 1 731 1 734 1 305 1 306 1 110 16
35013153.01 07/2008
207
Instruction times
Dialog operator function
The table below shows the instruction times for the dialog operator.
ST Execution time (
μ s)
57 1• ram
57 1• card
57 2• ram
SEND_MSG(ADR#1.0,%MW0:2,%MW10:2) 1250 1715 472
SEND_ALARM(ADR#1.0,%MW0:2,%MW10:2) 1250 1715 472
GET_MSG(ADR#1.0,%MW0:2,%MW10:2)
GET_VALUE(ADR#1.0,%MW0,%MW10:2)
ASK_MSG(ADR#1.0,%MW0:2,%MW10:2,%M
W20:2)
1250
625
1250
1715
858
1715
472
236
472
ASK_VALUE(ADR#1.0,%MW0,%MW10:2,%M
W20:2)
1250
DISPLAY_ALRM(ADR#1.0,%MW0,%MW10:2) 625
DISPLAY_GRP(ADR#1.0,%MW0,%MW10:2) 625
1715
858
858
472
236
236
DISPLAY_MSG(ADR#1.0,%MW0,%MW10:2) 625 858 236
CONTROL_LEDS(ADR#1.0,%MW0:2,%MW10
:2)
1250 1715 472
ASSIGN_KEYS(ADR#1.0,%MW0:2,%MW10:2) 1250 1715 472
PANEL_CMD(ADR#1.0,%MW0:2,%MW10:2) 1250 1715 472
476
238
238
238
476
476
476
57 2• card
476
476
476
238
476
57 3• ram
364
364
364
182
364
364
182
182
182
364
364
364
57 3• card
366
366
366
183
366
Size
(words)
57 4• 57• •
282
282
282
141
282
25
25
25
20
32
366
183
183
183
366
366
366
282
141
141
141
282
282
282
27
20
20
20
25
25
25
208
35013153.01 07/2008
Instruction times
Process control function
The table below shows the instruction times for the process control functions.
ST Condition Execution time (
μ s)
PID("PIDS1",’Unit’,%IW3.5,%MW12
, %M16,%MW284:43) deval_mm i=0 deval_mm i=1
57 1• ram
688
563
PWM(%MW11,%Q2.1,%MW385:5)
SERVO(%MW12,%IW3.6,%Q2.2,%
Q2.3, %MW284:43,%MW390:10)
PID_MMI(ADR#0.0.4,%M1,%M2:5,
%MW410:62)
EN=1
313
500
625
57 1• card
943
772
429
686
858
57 2• ram
260
57 2• card
262
213
118
189
236
214
119
191
238
57 3• ram
200
57 3• card
201
Size
(words)
57 4• 57• •
155 32
164
91
145
182
165
91
146
183
127
70
113
141
17
31
30
Data storage
ST
SET_PCMCIA
WRITE_PCMCIA
READ_PCMCIA
The table below shows the instruction times for the data storage functions.
Condition fixed per word fixed per word fixed per word
Execution time (
μ s)
57 1• ram
57 1• card
57 2• ram
350
0,4
350
0,8
350
0,7
70
0,3
70
0,4
57 2• card
70
0,3
57 3• ram
40
0,3
40
0,3
57 3• card
40
0,2
30
0,2
30
0,2
30
0,4
Size (words)
57 4• 57• •
35013153.01 07/2008
209
Instruction times
Orphee function The table below shows the instruction times for the process control functions.
ST Execution time (
μ s)
57 1• ram
57 1• card
57 2• ram
57 2• card
Size (words)
57 3• ram
57 3• card
57 4• 57• •
DSHL_RBIT(%MD102,16,%MD204,%MD206) 200 274 76 76 58
DSHR_RBIT(%MD102,16,%MD204,%MD206) 319 437 120 122 93
58
93
45
72
17
17
DSHRZ_C(%MD102,16,%MD204,%MD206) 194 266 73
WSHL_RBIT(%MW102,8,%MW204,%MW206) 138 189 52
WSHR_RBIT(%MW102,8,%MW204,%MW206) 181 249 69
WSHRZ_C(%MW102,8,%MW204,%MW206) 138 189 52
SCOUNT(%M100,%MW100,%M101,%M102,
%MW101,%MW102,%M200,%M201,%MW200,
%MW201)
263 360 99
74
52
69
52
56
40
53
40
100 76
57
40
53
40
77
44
31
41
31
59
17
17
17
17
38
210
35013153.01 07/2008
Explicit input/output instructions
Instruction times
35013153.01 07/2008
211
Instruction times
Performance times
ST
This table shows the explicit input/output instruction times.
Execution time (
μ s)
57 1• ram
57 1• card
57 2• ram
57 2• card
57 3• ram
57 3• card
Size
(words)
57 4• 57• •
Read_Sts %CHi.MOD
Any application except the processor communication channel
Read_Sts %CHi
Discrete input
Discrete output
Analog input
Analog output
CTY 2A/4A counting module
CTY 2C counting module
CFY 11/22 step by step module
CAY 21/41 axis command module
Write_Param %CHi
Analog input
Analog output
CTY 2A/4A counting module
CTY 2C counting module
CFY 11/22 step by step module
CAY 21/41 axis command module
Read_Param %CHi
Analog input
Analog output
CTY 2A/4A counting module
CTY 2C counting module
CFY 11/22 step by step module
CAY 21/41 axis command module
Save_Param %CHi
552 651 291 292 220 220 2
296
386
334
327
327
311
448
334
317
426
363
354
354
335
505
363
180
227
201
197
197
189
254
201
181
227
201
197
197
189
255
201
136
171
151
148
148
142
192
151
136
171
151
148
148
142
192
151
117
145
129
127
127
122
163
129
6
499
474
603
400
577
461
574
540
731
444
691
522
274
265
302
233
297
260
275
265
303
234
298
260
207
200
229
176
225
196
207
200
230
176
226
196
174
169
190
150
187
166
6
115
115
334
349
393
386
118
118
363
381
435
426
75
75
201
209
230
227
75
75
201
209
230
227
56
56
151
157
173
171
56
56
151
157
173
171
49
49
129
134
148
145
6
212
35013153.01 07/2008
Instruction times
ST Execution time (
μ s)
Analog input
Analog output
CTY 2A/4A counting module
CTY 2C counting module
CFY 11/22 step by step module
CAY 21/41 axis command module
57 1• ram
635
640
752
379
421
421
57 1• card
787
795
57 2• ram
306
306
1 049 271
417
470
470
223
243
243
Restore_Param %CHi
Analog input
Analog output
CTY 2A/4A counting module
CTY 2C counting module
CFY 11/22 step by step module
467
467
608
349
588
480
531
531
739
381
707
548 CAY 21/41 axis command module
Write_Cmd %CHi
Discrete output 288 308 176
Analog inputs
Input forcing
Input recalibration
134
691
138
895
86
303
Analog outputs
Forcing 143 147 92
Smove %CH1.0(%MW1,%MW2,%MW3,%MD4,%MD5,%MW6)
CFY 11/22 step by step module
CAY 21/41 axis command module
617
608
755
739
304
303
262
262
303
209
299
267
263
263
304
209
300
268
57 2• card
307
307
274
223
243
243
176
86
304
92
305
304
198
198
230
157
227
202
133
65
231
69
231
230
57 3• ram
232
233
209
168
183
183
57 3• card
233
233
211
168
183
183
Size
(words)
57 4• 57• •
191
191
160
143
155
155
6
198
198
230
157
227
202
133
65
232
69
231
230
167
167
190
134
188
170
114
0
56
186
0
60
190
190
6
6
19
35013153.01 07/2008
213
Instruction times
DFB function block
Size occupied by the DFB type
The following formula is used to calculate the size occupied by the DFB type:
DFB type size = Size of DFB variables and parameters + DFB Code size
Size of DFB variables and parameters
The size of the DFB variables and parameters is calculated as follows:
Size of DFB variables and parameters = 110 + sum of variable and parameter descriptors + sum of sizes occupied by each variable or parameter with:
Descriptor of'a variable or of'a parameter = 5.5 + (Number of characters in the name of the variable or parameter)/2 and
Size occupied by each variable or parameter:
Type
EBOOL
BOOL
WORD
DWORD
REAL
AR_X
AR_W
AR_D
AR_R
STRING
3
3
3
3
2
2
3
IN
0,5
0,5
1
3
3
3
3
2
2
3
IN/OUT
2
2
2
OUT
0,5
0,5
1
2
2
0.5*N
N
2*N
2*N
0.5*N
PUBLIC
0,5
0,5
1
2
2
0.5*N
N
2*N
2*N
0.5*N
N = number of'table elements or character string length (STRING)
PRIVATE
0,5
0,5
1
2
2
0.5*N
N
2*N
2*N
0.5*N
214
35013153.01 07/2008
DFB code size
Instruction times
The size of the DFB variables and parameters is calculated as follows:
DFB size code = 11 + sum of each of the instruction sizes(1)
(1) The following volumes, depending on the variable or parameter contained in the'instructions, are to be added to the instruction size:
Nature
IN
IN/OUT
OUT,
PUBLC
PRIVATE
Type
EBOOL
BOOL, WORD, DWORD, REAL
AR_X,AR_W,AR_D,AR_R,STRING
EBOOL
BOOL, WORD, DWORD, REAL
AR_X,AR_W,AR_D,AR_R,STRING
EBOOL
BOOL, WORD, DWORD, REAL
AR_X,AR_W,AR_D,AR_R,STRING
3
3
3
0,5
0
0
Volume
0,5
0
3
Indexed object:
Nature
IN
IN/OUT
OUT,
PUBLIC,
PRIVATE
Type
AR_X,AR_W,AR_D,AR_R
AR_X,AR_W,AR_D,AR_R
AR_X,AR_W,AR_D,AR_R
Volume
7
7
6
Size occupied by
' DFB usage
Calling'one instance of the DFB with no parameter = 6 words
Calculation for a parameter
Nature
IN
IN/OUT
OUT,
Type
EBOOL, BOOL, WORD, DWORD, REAL
AR_X,AR_W,AR_D,AR_R, STRING
EBOOL, WORD, DWORD, REAL
BOOL, AR_X,AR_W,AR_D,AR_R
All types
Volume same assignment:=
14
10
14 same assignment:=
Using'one variable of'one instance: add one word per report
35013153.01 07/2008
215
Instruction times
Execution time The total DFB execution time is given by the following formula:
Total time of'DFB execution = DFB maximum transmission rate code + Sum of times of'access to DFB variables and parameters + DFB call (no parameter) + Sum of time of'access for each parameter
The following table gives the execution time in
μ s.
574• Element Type 571• ram
13,0
0,2
0
1,4
1,4
571• card
16,3 Projection for DFB code
Accessing a DFB variable or parameter (1)
Indexed objects
IN EBOOL
BOOL,WORD,DWORD,REAL
AR_X,AR_W,AR_D,AR_R,STRING
IN/OUT
OUT,
PUBLIC,
PRIVAT
E
EBOOL
BOOL,WORD,DWORD,REAL
AR_X,AR_W,AR_D,AR_R,STRING
0,2
0
0
0,3
0
0
Non-indexed objects
IN, IN/
OUT
OUT,
PUBLIC,
PRIVAT
E
AR_X,AR_W,AR_D,AR_R,
AR_X,AR_W,AR_D,AR_R,
DFB call (no parameter)
Calculating by parameter (1)
IN EBOOL
BOOL,WORD,DWORD,REAL
2,8
2,1
3,8
3,5
2,6
4,8
AR_X,AR_W,AR_D,AR_R,STRING
IN/OUT EBOOL,WORD,DWORD,REAL
OUT same:= same:=
3,5
2,8
4,4
3,5
BOOL,AR_X,AR_W,AR_D,AR_R,STRING 3,5
All types same:=
4,4
0,3
0
1,7
1,7
572• ram
4,8
0,09
0
0,5
0,5
0,09
0
0
1,0
0,8
1,5
1,5
1,0
1,5
572• card
4,8
0,12
0
0,8
0,8
0,12
0
0
0,9
1,1
1,8
1,9
1,4
1,9
573• ram
3,4
0,06
0
0,4
0,4
0,06
0
0
0,7
0,5
1,0
1,0
0,7
1,0
573• card
3,8
0,10
0
0,6
0,6
0,10
0
0
0,7
0,9
1,4
1,6
1,1
1,6
1,1
0,2
0,2
0,3
0,3
0,2
0,3
0,02
0
0,1
0,1
0,02
0
0
(1) value to add relating to operations applying to %M-type objects.
216
35013153.01 07/2008
Instruction times
6.4
Advanced functions
At a Glance
Aim of this section
What's in this
Section?
This section gives the amount of memory occupied by the advanced functions, and the method of calculating the number of instructions.
This section contains the following topics:
Topic
Description of the memory zones
Object memory size
Review of the Memory Usage of Modules on Micro
Memory Usage for Modules on Premium
Memory Size for Advanced Functions
Method for calculating the number of instructions
Page
35013153.01 07/2008
217
Instruction times
Description of the memory zones
Recap z z
The application is divided into several memory zones: z bit memory zone: z z this zone is specific to the TSX 37 PLCs and is restricted to 1280 bits this zone is part of the data memory zone for the TSX 57 PLCs, data memory zone (words), application memory zone, comprising: z z the configuration, the program, z the constants.
The bit memory and data zones are always stored in the internal RAM while the application memory zone can be stored in the internal RAM or on the memory card.
218
35013153.01 07/2008
Instruction times
Object memory size
Description This table shows the memory size occupied by each type of PL7 language object.
Object type
Grafcet steps (%Xi, %Xi.T)
%Mi
Words (%MWi)
Constants (%KWi)
%NWi
%Ti
%TMi
%MNi
%Ci
%Ri (length lg)
%DRi
Bit memory (in words)
0,5
0,5
Data (in words)
1
1
5
4
1
4
3
6+lg
6
Application (in words)
1,25
2
1
2
2
2
49
Grafcet interpreter data = 355 + 2 x No. of active configured steps + (No. of valid configured transitions) / 2
35013153.01 07/2008
219
Instruction times
Review of the Memory Usage of Modules on Micro
General Points
Processors
Note: This information is for a specific processor version. They can be subject to
‘slight’ variations according to how the product develops.
The tables below give the size occupied in each of the zones and a fixed size to be added to the memory usage the first time an application-specific function is used, for each module type.
The table below gives the memory usage for the TSX 37 processor modules.
Processors
TSX 37-05/08/10
TSX 37-21
TSX 37-22
Using FAST task (TSX 37)
Using first event (TSX 37)
Bit memory
(words)
70
70
70
Data
(words)
1560
1570
2110
260
520
Application zone
(words)
920
930
1280
Discrete
Modules
The table below gives the memory usage for Discrete modules.
Discrete family
8 discrete inputs
16 discrete inputs
4 discrete outputs
8 discrete outputs
8I/8O discrete
16I/12O discrete
32I/32O discrete
2
4
4
16
32
4
8
Bit memory
(words)
12
12
12
20
20
Data
(words)
12
12
40
40
40
100
142
Application zone
(words)
40
50
220
35013153.01 07/2008
Instruction times
Analog modules The table below gives the memory usage for analog modules.
Analog family Bit memory
(words)
Data (words) Application zone
(words)
4 analog input module
AEZ414
Additional cost for the first 4-analog input module
8 analog input module
AEZ801/AEZ802
Additional cost for the first 8-analog input module
Analog output module
ASZ200
ASZ401
Additional cost for the first analog output module
0
0
0
0
156
212
52
100
56
120
72
120
40
59
120
Counting
Modules
The table below gives the memory usage for the counting modules.
Counting family
CTY1A
CTY2A
Additional cost for the first upcounting channel
Additional cost for the first downcounting channel
Additional cost for the first channel in
UP/DOWN counting
Bit memory
(words)
16
32
Data (words) Application zone
(words)
108 64
212 106
144
144
144
35013153.01 07/2008
221
Instruction times
Communication
Modules
The table below gives the memory usage for the communication modules.
Communication family
STZ010
SCP111/SCP112/SCP114
(on UC UTW)
FPP 20 on UC (Channel 0 UTW)
MDM 10
0
0
0
0
Bit memory
(words)
Data (words) Application zone (words)
36
40
168
763
40
2528
755
12880
222
35013153.01 07/2008
Instruction times
Memory Usage for Modules on Premium
General Points
Processors
Note: This information is for a specific processor version. They can be subject to
‘slight’ variations according to how the product develops.
The tables below give the size occupied in each of the zones and a fixed size to be added to the memory usage the first time an application-specific function is used, for each module type.
The table below gives the memory usage for the TSX 57 processor modules.
Processors
P 57-1•
P 57-2•/3•/4•
Using FAST task (TSX 57)
Additional cost for first module in configuration
P 57-1•: per process control loop
Additional cost for first loop
P 57-2•/3•/4•: per process control loop
Additional cost for first loop
Bit memory
(words)
70
70
Data (words) Application zone (words)
4714
4714
1720
1784
520
600
500
500
25000
5000
35013153.01 07/2008
223
Instruction times
Discrete
Modules
The table below gives the memory usage for discrete modules.
Discrete family Bit memory
(words)
Single discrete input family
8 discrete inputs
16 discrete inputs
32 discrete inputs
64 discrete inputs
Additional cost for the first input module
4
8
16
32
Single discrete output family
8 discrete outputs
16 discrete outputs
32 discrete outputs
64 discrete outputs
Additional cost for the first output module
Discrete event input family
16 discrete inputs (DEY 16FK)
4
8
16
32
8
Additional cost for the first input module
Discrete Safety Input/Output family
12I/4O or 12I/4O(PAY) 16
Additional cost for the first DIS EVT input module
Mixed discrete input/output family
16 inputs/12 outputs (DMY 28FK) 16
Additional cost for the first module
Mixed discrete
Reflex 16 I/12 O (DMY 28RFK)
Additional cost for the first reflex mixed discrete module
32
Data (words) Application zone (words)
110
160
280
550
100
130
230
430
220
128
304
976
100
110
120
190
570
100
110
120
190
610
130
680
200
1320
152
1432
656
5596
224
35013153.01 07/2008
Instruction times
Analog Modules The table below gives the memory usage for analog modules.
Analog family Bit memory
(words)
Analog input families
AEY414
AEY800
AEY1600
Additional cost for the first analog input module (AEY 414/800/1600)
AEY810
AEY1614
Additional cost for the first analog input module (AEY 810/1614)
AEY420
Additional cost for the first analog input module (AEY 810/1614)
Analog output family
ASY410
Additional cost for the first ASY410 analog output module
ASY800
Additional cost for the first ASY800 analog output module
4
8
16
8
16
4
4
8
Data (words) Application zone (words)
430
840
1670
888
1768
476
430
744
160
240
430
2990
248
432
3056
168
2080
160
1700
248
1760
Counting
Modules
The table below gives the memory usage for the counting modules.
Counting family
CTY2A module
CTY4A module
Additional cost for the first configured counting channel
CTY2C module
Additional cost for the first configured counting channel
Bit memory
(words)
32
64
48
Data (words) Application zone (words)
410
800
170
250
1740
672 184
1992
35013153.01 07/2008
225
Instruction times
Servo-motor
Modules
Step by Step
Modules
The table below gives the memory usage for the servo-motor modules.
Servo-motor family (words) (words)
CAY•1
CAY•2
CAY33 channel 3
Additional cost for the first CAY•1 configured channel
Additional cost for the first CAY•2/33 configured channel
Additional cost for the first CAY•33 configured channel 3
Bit memory
(words)
78
78
78
520
376
264
140
232
170
2130
3600
3600
The table below gives the memory used for the step by step modules.
Step by step family Bit memory
(words)
Data
(words)
CFY11
CFY21
Additional cost for the first configured step by step channel
29
58
323
646
Application zone
(words)
104
152
2368
226
35013153.01 07/2008
Instruction times
Communication
Modules
The table below gives the memory usage for the communication modules.
Communication module family
SCY21600 (Channel 0 UTW) on SCY21600 (Channel 1 UTW)
Additional cost for the first channel configured in UTW
ETY 110
Additional cost for the first ETY 110 configured channel
ETY 120
Additional cost for the first ETY 120 configured channel
ETY 210
Additional cost for the first ETY 210 configured channel
IBY 100
1
1
Bit memory
(words)
1
1
1
1
Data
(words)
230
450
431
48
434
450
Application zone
(words)
80
40
1280
256
1984
136
1368
400
3424
40
Communication
Sub-Modules
The table below gives the memory usage for the communication sub-modules.
Communication sub-module Bit memory
(words)
1
Data
(words)
60
Application zone
(words)
580 SCP111/ SCP112/ SCP114 (UTW) on UC (Channel 0 UTW)
FPP 20 on UC (Channel 0 UTW)
FPP 10 on UC (Channel 0 UTW)
1
1
60
40
580
870
AS-i Module The table below gives the memory usage for the AS-i module.
AS-i family Bit memory
(words)
Data
(words)
SAY
Additional cost for the first ASi channel
3 373
Application zone
(words)
176
2272
35013153.01 07/2008
227
Instruction times
Weighing
Modules
TBX Remote
Input/Output
Modules
The table below gives the memory usage for the weighing modules.
Weighing family
AWY001
Additional cost for the first configured weighing channel
Bit memory
(words)
1
Data (words) Application zone (words)
170 120
3920
The table below gives the memory usage for the TBX remote input/output modules.
Remote input/output family
Discrete inputs
Additional cost for the first configured base
Discrete outputs
Additional cost for the first configured base
Programmable
Additional cost for the first configured base
Latching
Additional cost for the first configured base
AES 400
ASS 200
AMS 620
Additional cost for the first configured base
Bit memory
(words)
8
8
8
8
2
2
4
Data (words) Application zone (words)
152 88
1400
176
160
160
270
270
508
88
1320
88
2304
88
1400
104
104
112
3968
228
35013153.01 07/2008
Momentum
Modules
Instruction times
The table below gives the memory usage for the Momentum modules.
Momentum family
Inputs
Additional cost for the first configured base
Output 16
Additional cost for the first configured base
16 Mixed
Additional cost for the first configured base
Bit memory
(words)
16
Data (words) Application zone (words)
96 72
1384
112
104
72
1256
72
1424
Remote X Bus
Modules
The table below gives the memory usage for the remote X bus module.
Remote X bus
TSX REY 200 module
Bit memory
(words)
0
Data (words) Application zone (words)
0 56
35013153.01 07/2008
229
Instruction times
Memory Size for Advanced Functions
Description
Example
Numerical
Conversions
The tables below show the size of the code taken into the application (application zone) for each advanced function (OF) when one is called.
Functions in the same family share code (shared code). This shared code is taken into the PLC the first time a function from this family is called. The code specific to a function is taken in the first time this function is called.
z z
The first time a function of the numerical conversion family is called, with the case of DBCD_TO_DINT, the code is taken into the application zone: z Shared code = 154 words z OF DBCD_TO_INT code = 149 words
When another function of the numerical conversion family is called, in the case of
DINT_TO_DBCD, the code is taken into the application zone: z OF DINT_TO_DBCD code = 203 words z If a function in the numerical conversion family already called is called
(DBCD_TO_DINT or DINT_TO_DBCD): no code taken in
The table below gives the memory usage for advanced conversion functions.
Numerical conversions
Converting a 32 bit BCD number into a 32 bit integer
Converting a 32 bit BCD number into a 16 bit integer
OF Code size
(in words)
DBCD_TO_DINT 203
DBCD_TO_INT 149
Converting a 32 bit integer into a BCD 32 bit number DINT_TO_DBCD 203
Converting a 16 bit integer into a BCD 32 bit number INT_TO_DBCD
Extracting the least significant word from a double word LW
75
33
Extracting the most significant word from a double word HW
Forming a double word with 2 words CONCATW shared code
33
33
154
230
35013153.01 07/2008
Instruction times
Instructions for
Bit Strings
The table below gives the memory used for advanced bit string functions.
Bit strings
Logical AND between two tables
Copying a bit table into a double word table
Copying a bit table into a word table
Copying a bit table into a bit table
Copying a double word table into a bit table
Add-in at one of a table
Logical OR between two tables
Copying a word table into a bit table
Exclusive OR between two tables
Length in number of elements
OF
AND_ARX
BIT_D
BIT_W
COPY_BIT
D_BIT
NOT_ARX
OR_ARX
W_BIT
XOR_ARX
LENGTH_ARX shared code
196
157
209
195
209
20
427
Code size
209
248
205
146
Instructions for
Word Tables
The table below gives the memory usage for advanced conversion functions on word tables.
Instructions for word tables OF Code size
(in words)
75 Searching for the first element equal to one value in a table
Searching for the first element greater than a value in a table
FIND_EQW
FIND_GTW
Searching for the first element less than a value in a table FIND_LTW
Searching for the greatest value in a table MAX_ARW
Searching for the smallest value in a table MIN_ARW
Number of times a value occurs in a table
Rotate shift on the left of a table
Rotate shift on the right of a table
OCCUR_ARW
ROL_ARW
ROR_ARW
Table sorting (ascending or descending)
Partial search for the first element of a table equal to one value
Length in number of elements
SORT_ARW
FIND_EQWP
LENGTH_ARW shared code
75
78
78
74
145
150
144
164
77
20
162
35013153.01 07/2008
231
Instruction times
Instructions for
Double Word
Tables
The table below gives the memory used for advanced conversion functions on tables of double words.
Instructions for double word tables OF Code size
(in words)
79 Searching for the first element equal to one value in a table
FIND_EQD
Searching for the first element greater than a value in a table
FIND_GTD
Searching for the first element less than a value in a table FIND_LTD
Searching for the greatest value in a table MAX_ARD
Searching for the smallest value in a table
Number of times a value occurs in a table
Rotate shift on the left of a table
Rotate shift on the right of a table
MIN_ARD
OCCUR_ARD
ROL_ARD
ROR_ARD
Table sorting (ascending or descending) SORT_ARD
Partial search for the first element of a table equal to one value
FIND_EQWP
Length in number of elements LENGTH_ARW shared code
80
95
95
78
163
170
178
77
20
162
232
35013153.01 07/2008
Instruction times
Instructions for
Floating Point
Tables
The table below gives the memory usage for advanced conversion functions on floating point tables.
Instructions for floating point tables OF Code size
(in words)
152
134
Sum of the elements of a table of real values
Searching for the first element equal to one value in a table
Searching for the first element equal to one a value in a table starting from a row
SUM_ARR
FIND_EQR
FIND_EQRP
Searching for the first element greater than a value in a table
FIND_GTR
Searching for the first element less than a value in a table FIND_LTR
Searching for the greatest value in a table MAX_ARR
Searching for the smallest value in a table
Number of times a value occurs in a table
Rotate shift on the left of a table
Rotate shift on the right of a table
MIN_ARR
OCCUR_ARR
ROL_ARR
ROR_ARR
Table sorting (ascending or descending) comparing 2 tables of real values
Table sorting (ascending or descending)
SORT_ARR
EQUAL_ARR
LENGTH_ARR shared code
135
134
167
173
271
173
134
161
162
132
20
124
35013153.01 07/2008
233
Instruction times
Time
Management
Instructions
The table below gives the memory usage for advanced time management functions.
Dates, hours and periods
Adding a period to a complete date
Adding a period to a time of day
Converting a date into a string
Day of the week
Deviation between two dates
Deviation between two complete dates
Deviation between two times of day
Converting complete date into a string
Subtracting a period from a complete date
Subtracting a period from a time of day
Converting a period into a string
Converting a time of day into a string
Transferring a period into the form of hours-mins-secs
Real-time clock function
OF
ADD_DT
Code size
519
ADD_TOD 188
DATE_TO_STRING 150
DAY_OF_WEEK 99
DELTA_D
DELTA_DT
DELTA_TOD
DT_TO_STRING
SUB_DT
SUB_TOD
374
547
110
266
548
186
TIME_TO_STRING 413
TOD_TO_STRING 156
TRANS_TIME 211
SCHEDULE shared code
700
1703
Instructions for
Character
Strings
The table below gives the memory usage for advanced character string functions.
Dates, hours and periods
Character string instructions
OF Code size code size
Concatenating two strings
Deleting a sub-string
Searching for the first different character
Finding a sub-string
Inserting a sub-string
Extracting from the left of a string
String length
Extracting a sub-string
Replacing a sub-string
Extracting from the right of a string
CONCAT
DELETE
EQUAL_STR
FIND
INSERT
LEFT
LEN
MID
REPLACE
RIGHT shared code
38
70
44
365
279
212
225
287
55
418
234
35013153.01 07/2008
Orphee
Functions
The table below gives the memory usage for Orphee functions.
Orphee functions
Move to the left on 32, with moved bit recovery
OF
DSHL_RBIT
Move to the right on 32 with sign extension, recov. moved bits
DSHR_RBIT
Move to the right on 32 with 0 filling, recov. moved bits DSHRZ_C
Move to the left on 16, with moved bit recovery
Move to the right on 16 with sign extension, recov. moved bits
WSHL_RBIT
WSHR_RBIT
Move to the right on 16 with 0 filling, recov. moved bits WSHRZ_C shared code
Up/down counting with overshoot signaling
Rotating to the left of a word
Rotating to the right of a word
Rotating to the left of a double word
Rotating to the left of a double word
SCOUNT
ROLW
RORW
ROLD
RORD
Instruction times
617
41
49
49
Code size
152
152
133
91
103
90
173
Time Delay
Functions
The table below gives the memory usage for the time delay functions.
Time delay functions OF
Pulse output
Trigger time delay
Time until actuation
Pulse time
FPULSOR
FTOF
FTON
FTP
Code size
(in words)
215
272
217
245
35013153.01 07/2008
235
Instruction times
Logarithmic,
Exponential and
Trigonometric
Functions
The table below gives the memory usage for logarithmic, exponential and trigonometric functions.
OF Logarithmic, exponential and trigonometric functions
Natural logarithm
Decimal logarithm
Exponential
Exponentiation of a real by an integer
Whole part
Cosine of an angle in radians
Sine of an angle in radians
Tangent of an angle in radians
Arc cosine (result between 0 and pi)
Arc sine (result between -pi/2 and pi/2)
Arc tangent (result between -pi/2 and pi/2)
Converting degrees into radians
Converting radians into degrees
NL
LOG
EXP
EXPT
TRUNC
COS
SIN
TAN
ACOS
ASIN
ATAN
DEG_TO_RAD
RAD_TO_DEG shared code
0
0
0
257
247
392
0
0
0
0
523
128
Code size
(in words)
0
0
Process Control
Functions
The table below gives the memory usage for process control functions.
Process control functions OF
Mixed PID regulator
Pulse width modulation of a numerical value
PID output stage for discrete valve command
Dedicated operator dialog management on CCX17 of the PID
PID
PWM
SERVO
PID_MMI
Code size
(in words)
1800
600
1200
4400 shared code 573
236
35013153.01 07/2008
Instruction times
Operator Dialog
Functions
The table below gives the memory usage for the operator dialog functions.
Operator dialog functions OF
Blocking entry of a variable on CCX17 Ask_msg,
Blocking entry of a variable on msg contained in CCX17 Ask_value,
Dynamic command key assignment
Command of LED control
Assign_keyS,
Control_leds,
Displaying an alarm contained in the CCX17 Display_alarm,
Displaying a group of messages contained in the CCX17 Display_GRP,
Displaying a message contained in the CCX17
Multiple entry of a variable on CCX17
Display_MSG,
GET_MSG,
Multiple entry of a variable on msg contained in CCX17 GET_VALUE,
Sending a command to the CCX17 PANEL_CMD,
Displaying an alarm msg contained in the PLC memory SEND_alarm,
Displaying a message contained in the PLC memory Send_msg shared code
46.5
46.5
46.5
46.5
46.5
46.5
573
Code size
(in words)
46.5
46.5
46.5
46.5
46.5
46.5
35013153.01 07/2008
237
Instruction times
Communication
Functions
The table below gives the memory usage for the communication functions.
Communication functions
Reading standard language objects
Writing standard language objects
Sending/receiving UNI-TE requests
Sending and/or receiving data
Sending a character string
Reading request for a character string
Sending and/or receiving a character string
Sending a telegram
Receiving a telegram
Request to stop a function in progress
Right shift of 1 octet in a table of octets
Immediate server
Write 1K of messaging
Read 1K of messaging
OF
READ_VAR
WRITE_VAR
SEND_REQ
DATA_EXCH
PRINT_CHAR
INPUT_CHAR
OUT_IN_CHAR
SEND_TLG
RCV_TLG
CANCEL shared code
ROR1_ARB
SERVER shared code shared code
READ_ASYN shared code
32
936
32
920
506
235
32
648
438
375
476
625
Code size
(in words)
617
500
531
219
172
Movement
Command
Functions
The table below gives the memory usage for advanced movement functions.
Movement command functions
1 axis automatic movement command
Multi-axis automatic movement command
OF
SMOVE
XMOVE
Code size
(words)
24
32
238
35013153.01 07/2008
Data Storage
User-defined
Exchange
Function
Diagnostics
DFBs
Instruction times
The table below gives the memory usage for the data storage functions.
Data storage OF
Initializing the storage zone on the PCMCIA card
Write data on the PCMCIA card
Read data on the PCMCIA card
SET_PCMCIA
WRITE_PCMCIA
READ_PCMCIA shared code
Code size
(words)
24
24
24
288
The table below gives the memory usage for the user-defined exchange functions.
Explicit exchanges OF
Read status parameters
Read adjustment parameters
Update adjustment parameters
Save adjustment parameters
READ_STS
READ_PARAM
WRITE_PARAM
SAVE_PARAM
Restore adjustment parameters
Update command parameters
RESTORE_PARAM 0
WRITE_CMD
(1) specific OF, the code is counted in the volume of the I/O module.
0
0
0
0
0
Code size
(words)
The first time one of the diagnostics’ DFBs is programmed, 200 words are reserved in the application program zone.
The table below shows the size of the code taken into the application for each type of diagnostics’ DFB (in the program zone) and the size occupied per instance in the data and program zones.
Diagnostics’ DFB (sizes in words) DFB type size DFB type code size
IO_DIA
ALRM_DIA
NEPO_DIA
800
608
15184
64
40
128
TEPO_DIA
EV_DIA
MV_DIA
ASI_DIA
10896
1144
2616
7912
128
48
80
304
136
56
88
312
Data size per instance
72
48
136
35013153.01 07/2008
239
Instruction times
Method for calculating the number of instructions
General This method is used to calculate the number of basic (assembler level) Boolean or numeric instructions.
Calculating the number of
Boolean instructions z z z
The number of the following elements is taken into account in this calculation: unitary Boolean operations: load (LD), AND, OR, XOR,ST,etc closing brackets (or ladder convergences: vertical convergence links) comparison (AND[...], OR[...]...) blocks and operate ([...])
The operators NOT, RE and FE should not be counted as a boolean instruction.
Example:
LD %M0
AND (%M1
OR %M2
)
ST %M3
= 5 boolean instructions
Calculating the number of
Numeric instructions z z z z z z
The number of the following elements is taken into account in this calculation: assignments (:=) load of the first value after:= arithmetic instructions (+, -, *, /, <, =,...), operations on words or tables of words, double words, floating points) logic instructions on words functions(OF, EQUAL,…) irrespective of the number of parameters function blocks (or function block instruction)
Example:
%MW0:=(%MW1+%MW2)*%MW3; counted instructions:
:=
%MW1 (corresponds to the load instruction in the accumulator )
+
* i.e. 4 instructions.
240
35013153.01 07/2008
Instruction times
Example Example of program comprising 65% boolean and 35% numeric:
%M0
%M1
%M2
%M3 %M4
%M10 %M11 %M12 %M13
%M14 %M15 %M16
%M20 %M21
%M22 %M23
%M5
%M6
%M17
%M10 %M11 %M12
%M18
%M30 %M31 %M32 %M33
%M13 %M14 %M15
%M16
%M34
%M0
%M7
%M1
%M8
%M2
%M10 %M11 %M12
%M15 %M16
%M3
%M13
%M4 %M5 %M6
%M17 %M18 %M19
%M20
%M35
%M30
35013153.01 07/2008
241
Instruction times
%M0 %M1
Example (continued)
%M5 %M6 %M7
%M11 %M12 %M13
%M8
%M14
%M9
%M15 %M16
%M0 %M1
%M2
%M3 %M4 %M5 %M6
%M7
%M8
%M0 %M1 %M2
%M20 %M21 %M22
%M24
%M26
%M3
%M23
%M25
%M27
%M4 %M5 %M6
%M28
%M29
%M7 %M8 %M9 %M10
%M40
%M41
%M42
%M9
%M10
R
%M11
R
%M3
%M4
%M10
%M17
242
35013153.01 07/2008
Example (continued)
%M0
%M2
%M4
%M6
%M8
%M9
%M10 %M11
%M12
%M1
%M3
%M6
%M2
%M4
%M7
%M8
%M5
%M9
Instruction times
%M1
%M3
%M5
%M7
%M13
%M10
%M11
35013153.01 07/2008
243
Instruction times
Example (continued)
%M1
%M3
%M6
%M2
%M4
%M13
%M12
%M7
%M8
%M9
%M5 %M14
%M15
%M0
%M3
%M1
P
%M2
N
%M4
P
%M5
%M10 %M11 %M12
P
%M13 %M14
%M6
%M7
%M8 %M9
%M10
%M11
%M20
%M21
S
%M22
244
35013153.01 07/2008
Example (continued)
COMPARE
%MW3:=%MW5+1
COMPARE
%MW3< =1000
COMPARE
%MW3:=%MW5+1
COMPARE
%MW3<>%MW4
Instruction times
OPERATE
%MW2:=%MW3+%MW5+%KW0/2
OPERATE
%MW100:=%MW18-%KW10
OPERATE
INC%MW10
OPERATE
%MW2[%MW100]:=%MW3+%MW50*1
OPERATE
%MW100:=%MW78+SHL[%MW3,4]
OPERATE
%MW2:=%MW3*%MW5-%KW0
OPERATE
%MW2[%MW200]:=%MW3+%MW50*1
OPERATE
%MW100:=%MW78+ABS[%MW3]
35013153.01 07/2008
245
Instruction times
Example (continued)
OPERATE
%MW0:=16#FFFF
OPERATE
%MW2:=2
OPERATE
%TM0.P:%MW88+%MW89-1
OPERATE
%MW4:=%KW0+4
OPERATE
%MW5:=%KW0+5
OPERATE
%MW6:=%MW10/1024
OPERATE
%MW10[%MW0]:=%KW10[%MW0]+1
OPERATE
%MW11:=%MW10+1
OPERATE
%MW12:=%MW0*3+4
OPERATE
%MW13:=%KW13+%MW2+%MW3-1
OPERATE
%MW15:=15
OPERATE
%MW16:=1+%MW70+%MW71+%MW72
246
35013153.01 07/2008
Instruction times
Example (continued)
OPERATE
%MW20:=%SW10-1
OPERATE
%MW21:=ROL[%MW0.7]
OPERATE
%MW22:=%MW0+3*%MW1-1
OPERATE
%MW23:=0
OPERATE
%MW24:=1
OPERATE
%MW25:=%MW87/1024+22
OPERATE
%MW26:=%MW0+%MW25+1
%M0
OPERATE
%MW0:=%MW1+%MW2+%MW3+%MW (1)
R
%C0
C E
%MN0
S M
MODE: TON
TB: 1min
R
MN.P: 9999
MODIF: Y
S
C.P: 9999
CU
MODIF: Y
CD
D
F
%TM0
IN TM
MODE: TON
TB: 1min
Q
TM.P: 9999
MODIF: Y
(1):%MW0:=%MW1+%MW2+%MW3+%MW4+%MW5+%MW6+%MW7+%MW8+
%MW9+%MW10+1
Memory Usage
Boolean without edge
Boolean with edge
Operate block
Function block
Simple arithmetic (+,-,:=,AND,etc)
Indexed arithmetic
*, /
Immediate values
31
3
111
4
Number of instructions
187
4
6
24
%
54,05%
1,16%
8,96%
0,87%
32,08%
1,16%
1,73%
64,16%
35,84%
35013153.01 07/2008
247
Instruction times
Total
Number of instructions
346
%
100,00%
248
35013153.01 07/2008
Index
C
CompareSymbolPCAndSymbolPLCAppli,
D
DownloadStationWithSymbol, 136
E
ExportFefFileWithConfiguration, 101
G
35013153.01 07/2008
A C
I
O
S
U
249
Index
250
35013153.01 07/2008
Download
Advertisement