Upload
maickits
View
37
Download
11
Embed Size (px)
DESCRIPTION
pss win pro
Citation preview
Schnittmarke
Programmable control systems PSS®
PSS WIN-PRO
Programming Manual – Item No. 20 363-07
���������������� ��������������������������������������������������������������������������������
������������ ������������������������� ���������!������������������� ������
����"#��$%"#��&$"#��'()"#������"#�� *'"#�� "#��+$ "#� ����,- ��"#� ����*.*"# ����'*%��"#����������������"���������������������� ����������/����������������������������� �������
E
EB
EW
A
AB
AW
PB
PW
DB
DB
DL
DR
DW
FB
KB
KC
KF
KH
KM
KY
M
00.00 - 08.312)
32.00 - 95.313)
132.00 - 195.316)
00.00 - 08.242)
32.00 - 95.243)
132.00 - 195.246)
00.00 - 08.162)
32.00 - 95.163)
132.00 - 195.166)
00.00 - 08.312)
32.00 - 95.313)
132.00 - 195.316)
00.00 - 08.242)
32.00 - 95.243)
132.00 - 195.246)
00.00 - 08.162)
32.00 - 95.163)
132.00 - 195.166)
00.00 - 08.242)
32.00 - 95.243)
132.00 - 195.246)
00.00 - 08.162)
32.00 - 95.163)
132.00 - 195.166)
001, 002, 003
010 - 255
0000 - 1023
0000 - 1023
0000 - 1023
001 - 255
0-255
ASCII character set
-32768...+32767
0000 - FFFF
16 bit
0 - 255 per byte
064.00 - 099.31114.00 - 114.314)
130.00 - 255.314)
Input bit (PII)
Input byte (PII)
Input word (PII)
Output bit (PIO)
Output byte (PIO)
Output word (PIO)
Periphery byte (periphery access)
Periphery word (periphery access)
System data block (DB 001 and DB 002are read-only)
Data block
Data byte left (bit 8 - 15)
Data byte right (bit 0 -7)
Data word (bit 0 - 15)
Function block
Constant Byte
Constant Character (2 characters)
Constant Fixed point number
Constant Hexadecimal figure
Constant Bit state
Constant 2 Byte
Flags
Flag byte
Flag word
Communication flag in bit mode
Communication flag in byte mode
Communication flag in word mode
FALSE flag (RLO-0)
TRUE flag (RLO-1)
Arithmetic carry flag
Arithmetic overflow flag
Arithmetic zero flag
Arithmetic sign flag
Status flag ST RUN/STOP (RUN = 1)
Status flag ST no error/error (error = 1)
Status flag ST STOP command (SThalted via STOP command = 1)
Warm start ST STOP > RUN (afterwarm start 1, active for one cycle only)
Cold start ST OFF > RUN (after coldstart 1, active for one cycle only)
ST general reset performed (aftergeneral reset 1, active for one cycle only)
Status flag FS RUN/STOP (RUN = 1)
Status flag FS error/no error(error = 1)
064.00 - 099.24114.00 - 114.244)
130.00 - 255.244)
064.00 - 099.16114.00 - 114.164)
130.00 - 255.164)
100.00 - 104.31105.00 - 109.314)
100.00 - 104.24105.00 - 109.244)
100.00 - 104.16105.00 - 109.164)
110.00
110.01
111.00
111.01
111.02
111.03
112.00
112.01
112.02
112.03
112.04
112.05
113.00
113.01
MB
MW
M
MB
MW
M
M
M
M
M
M
M
M
M
M
M
M
M
M
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x1)
x1)
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x1)
x1)
x1)
Overview of Operands: FS
Writ
e
Rea
d
Dire
ct
Set
Indi
rect
DescriptionAddress rangeType Access Addressing
Writ
e
Rea
d
Dire
ct
Set
Indi
rect
DescriptionAddress rangeType Access Addressing
1) Only on 3rd generation PSS2) Depending on PSS and hardware3) Only on PSS with SafetyBUS p 04) Only on PSS with an FS operating system version ≥ 435) On PSS with an FS operating system version ≥ 43, also flags in the range 64 - 99, 130 - 2556) Only on PSS with an FS operating system version ≥ 47 and SafetyBUS p 1
Continued➞
M
M
M
M
M
M
MB
MW
M
MB
MW
M
MB
MW
M
MB
MW
113.02
113.03
113.04
113.05
113.06
113.08
114.00, 114.08,114.16, 114.24
114.00, 114.16
115.00 - 115.31
115.00 - 115.24
115.00 - 115.16
116.00 - 116.31
116.00 - 116.24
116.00 - 116.16
117.00 - 117.31
117.00 - 117.24
117.00 - 117.16
Status flag FS STOP command (FShalted via STOP command = 1)
Warm start FS STOP > RUN (afterwarm start 1, active for one cycle only)
Cold start FS OFF > RUN (after coldstart 1, active for one cycle only)
Status flag SafetyBUS p 0 RUN/STOP(RUN = 1), only on PSS with an FSoperating system version > 35
Status flag SafetyBUS p 1 RUN/STOP(RUN = 1), only on PSS with an FSoperating system version > 47
Reset of the remanent DBs in the FSsection (after reset 1, flag must be resetthrough SB255, FUNK = 50), only onPSS with FS operating system version> 65
Flag byte, indirect addressing5)
Flag word, indirect addressing5)
Deactivation flag in bit mode (selectiveshutdown)
Deactivation flag in byte mode (selectiveshutdown)
Deactivation flag in word mode(selective shutdown)
Status flag I/O-Groups in bit mode(SafetyBUS p 0, I/O-Group in RUN = 1)
Status flag I/O-Groups in byte mode(SafetyBUS p 0)
Status flag I/O-Groups in word mode(SafetyBUS p 0)
Status flag I/O-Groups in bit mode(SafetyBUS p 1, I/O-Group in RUN = 1)
Status flag I/O-Groups in byte mode(SafetyBUS p 1)
Status flag I/O-Groups in word mode(SafetyBUS p 1)
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x4)
x4)
Writ
e
Rea
d
Dire
ct
Set
Indi
rect
DescriptionAddress rangeType Access Addressing
OB
OB
OB
OB
PB
SB
T
XW
Z
ZW
010 - 073
101, 120, 1244),125, 127, 128,140 - 171
130, 131, 132,1336)
200 - 231
001 - 255
001 - 255
064 - 127
00000-00071
064 - 127
064 - 127
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
Writ
e
Rea
d
Dire
ct
Set
Indi
rect
DescriptionAddress rangeType Access Addressing
Alarm organisation blocks forSafetyBUS p (cannot be called up)
Organisation block (cannot be called up)
Organisation blocks for SafetyBUS p(cannot be called up)
Organisation blocks for selectiveshutdown (cannot be called up)
Program block
Standard function block
Timer
Word from a word module
Counter
Counter status (fixed point number)
1Programming Manual PSS WIN-PRO
Contents
Introduction 1-1
Definition of symbols 1-2
Basics 2-1
Project 2-1Programming languages 2-3Blocks 2-4Structure 2-4Organisation blocks (OB) 2-5
Organisation blocks for the FS section 2-5Organisation blocks for the ST section 2-8
Program blocks (PB) 2-10Function blocks (FB) 2-11
Parameters 2-11Programming and calling FBs 2-13Function blocks from Pilz 2-16
Standard function blocks (SB) 2-17Parameters 2-17Programming and calling SBs 2-18Standard function blocks from Pilz 2-18
Data blocks (DB) 2-19Approved blocks for the FS section 2-23Encrypted blocks 2-24Segments 2-24Networks 2-25Operations 2-25Operands 2-25Flags 2-25Constants 2-26Access to inputs and outputs 2-26Periphery access via process images 2-26Direct periphery access 2-27
Direct periphery access to bit modules 2-28Direct periphery access to word modules (ST section only) 2-28
Access rights of the FS and ST section 2-29
Contents
2 Programming Manual PSS WIN-PRO
Addressing 2-29Absolute addresses 2-29Tags 2-30Direct addressing 2-31Indirect addressing 2-32Set addressing 2-34Free addressing in the FS section 2-36Free addressing in the ST section 2-37
Offset für freie Adressierung 2-38Positive logic 2-39Program cycle 2-40Program structure 2-40
Linear programming 2-40Structured programming 2-41
Alarm processing 2-42Alarm processing in the FS section 2-42Alarm processing in the ST section 2-43
Error processing 2-44Error processing in the FS section 2-44Error processing in the ST section 2-44
IL 3-1
Programming in IL 3-1Structure of an operation 3-1
Segment operation 3-1Comments 3-2Accumulator, auxiliary accumulator and RLO 3-2Programming rules 3-3Operations in IL 3-4Overview 3-4Bit operations 3-7Timers and counters 3-16Byte/word operations 3-20
Load and transfer operations 3-20Convert operations 3-22Compare operations 3-24Arithmetic operations 3-26Logic operations 3-33Shift and rotate operations 3-37
3Programming Manual PSS WIN-PRO
Jump operations 3-42Organisational operations 3-44
LD 4-1
Programming in LD 4-1Networks 4-1Network comment 4-2Labels 4-2Segments 4-2RLO 4-3Graphic elements in LD 4-4Overview 4-4Bit operations 4-8Timers and counters 4-12Byte/word operations 4-16
Compare operations 4-16Jump operations 4-20Organisational operations 4-20
FBD 5-1
Programming in FBD 5-1Networks 5-1Network comment 5-2Labels 5-2Segments 5-2RLO 5-3Graphic elements in FBD 5-4Overview 5-4Bit operations 5-12Timers and counters 5-17Byte/word operations 5-22
Load and transfer operations 5-22Convert operations 5-23Compare operations 5-26Arithmetic operations 5-29Logic operations 5-38Shift and rotate operations 5-44
Contents
4 Programming Manual PSS WIN-PRO
Jump operations 5-48Organisational operations 5-49
Predefined SBs 6-1
Overview 6-2
Appendix 7-1
Operation execution times 7-1Changes in the documentation 7-3
Index 8-1
1-1Programming Manual PSS WIN-PRO
Introduction
This manual explains the structure and programming of user applicationsfor PSS-range programmable safety systems.
The manual is divided into the following chapters:
1 IntroductionDesigned to familiarise you with the contents and structure of thismanual.
2 BasicsProvides information on the most important terms and correlationswhen programming a safety system using PSS WIN-PRO.
3 ILExplains the programming procedure using IL programming languageand describes the available operations.
4 LDExplains the programming procedure using LD programming languageand describes the graphic elements within the language.
5 FBDExplains the programming procedure using FBD programminglanguage and describes the graphic elements within the language.
6 Pre-defined SBsDescribes the standard function blocks supplied with PSS WIN-PRO.
7 Appendix
8 Index
Introduction
1-2 Programming Manual PSS WIN-PRO
Definition of symbols
Information in this manual that is of particular importance can be identifiedas follows:
DANGER!
This warning must be heeded! It warns of a hazardous situation thatposes an immediate threat of serious injury and death and indicatespreventive measures that can be taken.
WARNING!
This warning must be heeded! It warns of a hazardous situation thatcould lead to serious injury and death and indicates preventivemeasures that can be taken.
CAUTION!
This refers to a hazard that can lead to a less serious or minor injury plusmaterial damage, and also provides information on preventive measuresthat can be taken.
NOTICEThis describes a situation in which the unit(s) could be damaged and alsoprovides information on preventive measures that can be taken.
INFORMATIONThis gives advice on applications and provides information on specialfeatures, as well as highlighting areas within the text that are of particularimportance.
2-1Programming Manual PSS WIN-PRO
Basics
Project
A “project” is required in order to operate a PSS-range programmablesafety system. All the necessary files are combined within this project. Theproject is created and maintained using PSS WIN-PRO.
Fig. 2-1: Programming model
�������
���� ����������������
���
������� ������������
������� �������
���
���
���
���
��������
�����������������
����������������
���
������� ������������
���
���
���
���
��������
�����������������
����������������
��������������
����������������������
Basics
2-2 Programming Manual PSS WIN-PRO
The project consists of the PSS configuration, the diagnostic configurationand one project section each for the safety system’s FS and ST section.If only one section of the PSS is being used, only the correspondingproject section will be processed. The other project section is available, butremains unchanged.
The project section includes the actual program that is transmitted to thePSS plus the allocation table.For the sake of clarity, the program is divided into blocks. There are fivedifferent types of block:
• Organisation blocks (OB)
• Program blocks (PB)
• Function blocks (FB)
• Standard function blocks (SB)
• Data blocks (DB)
The PSS configuration contains all the settings that are important for thePSS:
• Basic settings (e.g. PSS type, scan time, ...)
• Hardware registry
• Test pulse configuration
• Alarm configuration for PSS and SafetyBUS p
• Configuration of word modules
• Definition of password for the FS section
The PSS configuration is generated using the PSS configurator on PSSWIN-PRO. The data is stored in system data blocks.
PSS WIN-PRO (from Version 1.3.1) can be used to create a diagnosticconfiguration for a PSS with an FS operating system version ≥ 47. Thisdiagnostic configuration enables detailed PSS event messages (see PSSWIN-PRO’s online help).
If the PSS is to be connected to a SafetyBUS p network, a SafetyBUS pconfiguration will have to be generated for this network. This will containinformation on the structure of the network and all the connected devices.The data for the SafetyBUS p configuration is stored in the projects of allthe programmable safety systems connected to SafetyBUS p.
2-3Programming Manual PSS WIN-PRO
The SafetyBUS p configuration is generated using the SafetyBUS pconfigurator on PSS WIN-PRO.
Programming languages
Description
IL(Instruction List)
FBD(Function BlockDiagram)
LD(Ladder Diagram)
Symbol
LANDOR
Tab. 2.1: Programming languages in PSS WIN-PRO
PSS WIN-PRO supports the text-oriented programming languageInstruction List (IL), plus the graphical programming languages FunctionBlock Diagram (FBD) and Ladder Diagram (LD).
The programming language is defined separately for each block, i.e. withina project, one block may be programmed in IL, one in FBD and one in LD.A block’s programming language can be changed at any time.
Even individual networks within a block may be programmed in a differentprogramming language. If it’s possible, the next time the block is opened,these networks will appear in the block’s programming language.
The chapters entitled “IL”, “FBD” and “LD” describe in detail how theprogramming languages are used.
Basics
2-4 Programming Manual PSS WIN-PRO
Blocks
For the sake of clarity, the program is divided into a maximum of 511blocks. There are 5 different types of block:
• Organisation blocks (OB)Form the interface between the PSS operating system and the program
• Program blocks (PB)For elemental and plant-specific functions
• Function blocks (FB)For specific individual tasks
• Standard function blocks (SB)For standard functions
• Data blocks (DB)Contain fixed or variable data
Structure
Each block consists of a block header and a body.The block header contains the following details:
• Block nameName consisting of 5 characters XXyyy, e.g. DB124XX: Block type (OB, PB, ...)yyy: Block number (OB, PB, FB, SB: 1 ... 255; DB: 0 ... 255)
• Block short tagBlock description, max. 8 characters. The short tag is not unique, i.e.several blocks may have the same short tag.
• Date and time the block was last saved
• CRC check sumCheck sum formed via the block. This can be used to detect whether theblock has been modified. The PSS uses the CRC sum to detect whetherthe block has been transmitted without error.
• Formal parameters (FB and SB only)To enter values and issue results
2-5Programming Manual PSS WIN-PRO
The body of an OB, PB, FB and SB contains the actual programming forthe function that the block is to perform.A block may contain a maximum of 512 operations. It should be noted thata graphic element in LD or FBD may correspond to several operations.
The body of a DB contains data, maximum 1024 data words.
Organisation blocks (OB)
Organisation blocks are called by the PSS operating system. There is oneOB that is called in each PSS cycle (cycle OB). This OB must be includedin each program.All other OBs are only called under certain circumstances, e.g. on start-upor in the case of an alarm.
Organisation blocks for the FS section
OB010 ... 073 (SafetyBUS p alarm OBs)An alarm OB must be available for each alarm input used on SafetyBUS p. Theoperating system calls the alarm OB when the corresponding alarm istriggered. Alarm OBs are assigned to alarm inputs via the PSS configurator.
INFORMATIONSome of the functions of standard function block SB255 may not be usedin SafetyBUS p alarm OBs. Further information is available in thedescriptions of the SB255 functions.
OB101 (Cycle OB)The cycle OB is called in each PSS cycle, i.e. all instructions programmedwithin it are processed in each cycle and all blocks called within it are runthrough as part of each cycle. In this way the cycle OB manages the wholeprogram cycle.The sequence of the cycle OB can only be interrupted by an error OB oran alarm OB.The cycle OB must be available within each program.
Basics
2-6 Programming Manual PSS WIN-PRO
OB120 (Start-up OB)The operating system calls the start-up OB when the FS section switchesfrom a STOP to a RUN condition. It can be used for initialisation, forexample.
INFORMATIONPlease note the following for the start-up OB:
• Periphery access (PB, PW) is not permitted.
• Access to word modules is not permitted.
• All communication flags are initialised with “0”.
• All ST status flags are initialised with “0”.
• Polling the PII results in “0”.
• Access to the process image of outputs (PIO) is performed immediately,but the PIO is not sent to the outputs until the end of the cycle OB.
• Some of the functions of standard function block SB255 may not be usedin the start-up OB. Further information is available in the descriptions ofthe SB255 functions.
OB124 and OB128 (STOP OBs)
• OB124OB124 is called each time the system switches to a STOP condition.OB124 is only available on PSS with an FS operating system version ≥ 43.
• OB128When there is a manual switch to a STOP condition (“RUN-STOP”selector switch operated or PSS stopped via PSS WIN-PRO), OB128 iscalled first, followed by OB124.
The STOP OBs can be used to transfer data to the ST section, forexample. If no Stop OB is available, the FS section will immediately switchto a STOP condition.
2-7Programming Manual PSS WIN-PRO
OB125 and OB127 (Error OBs)If an error of error class F-21 (addressing error) or F-22 (error accessingdata block) occurs, the current block will be interrupted and OB125 will becalled.If an error of error class F-23 (error accessing read-only data block) orF-24 (set addressing error) occurs, the current block will be interruptedand OB127 will be called.For example, data can be transferred to the standard section in the errorOB; this data can then be used for diagnostic purposes. If no error OB isavailable, the FS section will immediately switch to a STOP condition.
OB140 ... 171 (Alarm OBs)An alarm OB must be available for each alarm input used on the PSS. Theoperating system calls the alarm OB when the corresponding alarm istriggered. Alarm OBs are assigned to alarm inputs via the PSS configurator.
INFORMATIONSome of the functions of standard function block SB255 may not be usedin the alarm OBs. Further information is available in the descriptions of theSB255 functions.
OB130 ... 133 (SafetyBUS p OBs)These OBs are only used with SafetyBUS p.
• OB130OB130 is called as soon as an I/O-Group on SafetyBUS p 0 switches toa STOP condition.For further information please refer to the “SafetyBUS p SystemDescription”, under “OB130”.
• OB131OB131 is called as soon as a SafetyBUS p bus subscriber sends aDomain to the PSS, without the PSS having requested the Domain.For further information please refer to the “SafetyBUS p SystemDescription”, under “OB131”.
• OB132OB132 is called as soon as a SafetyBUS p bus subscriber requests aDomain on the PSS.For further information please refer to the “SafetyBUS p SystemDescription”, under “OB132”.
Basics
2-8 Programming Manual PSS WIN-PRO
• OB133OB133 is called as soon as an I/O-Group on SafetyBUS p 1 switches toa STOP condition.For further information please refer to the “SafetyBUS p SystemDescription”, under “OB133”.
OB200 ... OB231 (Deactivation OBs)Deactivation OBs are only available on PSS units with selective shutdown.These are described in the relevant manual.
Organisation blocks for the ST section
OB001 (Cycle OB)The cycle OB is called in each PSS cycle, i.e. all instructions programmedwithin it are processed in each cycle and all blocks called within it are runthrough as part of each cycle. In this way the cycle OB manages the wholeprogram cycle.The sequence of the cycle OB can only be interrupted by an error OB oran alarm OB.The cycle OB must be available within each program.
OB019, OB023, OB025, OB027 and OB029 (Error OBs)If an error occurs, the current block is interrupted and the correspondingerror OB is called:
• OB019 with error class S-26 (“Block missing”)If an OB is missing and OB019 is not available, the ST section will switchto a “Fatal error” condition; if OB019 is available, the ST section willswitch to a “STOP” condition after processing OB019.If a different block type is missing and OB019 is not available, the STsection will switch to a “STOP” condition; if OB019 is available, the statuswill remain unchanged after OB019 is run, in other words, it will notswitch to a “STOP” condition.
• OB023 with error class S-05 (configuration error)If OB023 is not available, the ST section will immediately switch to aSTOP condition; if OB023 is available, the status will remain unchangedafter OB023 is run, in other words, it will not switch to a “STOP”condition.
2-9Programming Manual PSS WIN-PRO
• OB025 with error class S-21 (addressing error) and S-22 (erroraccessing data block)If OB025 is not available, the ST section will immediately switch to aSTOP condition; if OB025 is available, the status will remain unchangedafter OB025 is run, in other words, it will not switch to a “STOP”condition.
• OB027 with error class S-23 (error accessing read-only data block) or S-24 (set addressing error)If OB027 is not available, the ST section will immediately switch to aSTOP condition; if OB027 is available, the status will remain unchangedafter OB027 is run, in other words, it will not switch to a “STOP”condition.
• OB29 with error class S-04 (battery error)The ST section remains in a RUN condition, whether or not OB029 isavailable.
OB020 (Start-up OB)The operating system calls the start-up OB when the ST section switchesfrom a STOP to a RUN condition. It can be used for initialisation, forexample.If a general reset is to be performed when switching from STOP-RUN, thegeneral reset OB must be available and not the start-up OB.
INFORMATIONPlease note the following for the start-up OB:
• Periphery access (PB, PW) is not permitted.
• Access to word modules is not permitted.
• All communication flags are initialised with “0”.
• All FS status flags are initialised with “0”.
• Polling the PII results in “0”.
• Access to the process image of outputs (PIO) is performed immediately,but the PIO is not sent to the outputs until the end of the cycle OB.
• Some of the functions of standard function block SB254 may not be usedin the start-up OB. Further information is available in the descriptions ofthe SB254 functions.
Basics
2-10 Programming Manual PSS WIN-PRO
OB024 and OB028 (STOP OBs)
• OB024OB024 is called each time the system switches to a STOP condition.OB024 is only available on PSS with an FS operating system version ≥ 43.
• OB028When there is a manual switch to a STOP condition (“ST selector switch operated or PSS stopped via PSS WIN-PRO), OB028 is calledfirst, followed by OB024.
The STOP OBs can be used to transfer data to the FS section, forexample. If no Stop OB is available, the ST section will immediately switchto a STOP condition.
OB022 (General reset OB)If a general reset is to be performed when switching from STOP-RUN, thegeneral reset OB must be available and not the start-up OB.If OB020 and OB022 are present, the PSS will only run OB022.The guidelines given for the start-up OB are also valid for the general reset OB.
Program blocks (PB)
Program blocks are used for elemental and plant-specific functions. Theyare used to structure the program into organised program sections.Program blocks can be called in all blocks, with the exception of datablocks.Program blocks PB001 ... 255 can be programmed in both the FS and theST section.
2-11Programming Manual PSS WIN-PRO
Type
X
B
W
D
Z
Key
Bit
Byte
Word
Data block
Timer/counter
Function blocks (FB)
Function blocks contain programming instructions for specific individualtasks within a user program. They can be compared to sub-routines. Theycan be called in all blocks, with the exception of data blocks.Function blocks FB001 ... 255 can be programmed in both the FS and theST section.
Parameters
Function blocks may have formal parameters. These formal parametersare used to enter values in the FB and to issue results from the FB. EachFB may have 64 parameters in total.Formal parameters must be established when the block is created. Theyare shown in the block header.
• Name of formal parameterMax. 4 characters, special characters are permitted, case-sensitive
• Type of formal parameter
Basics
2-12 Programming Manual PSS WIN-PRO
If a function block is called in a different block, the block header will becopied into that block. If the function block has formal parameters, they willbe shown in the block header.
Formal parameters
X
B
W
D
Z
Actual parameters
Input, output and flag bits: E, A, M
Input, output and flag bytes, constants,data word range: EB, AB, MB, KB, DL, DR
Input, output and flag words, constants, datawords: EW, AW, MW, KF, KH, KM, KC, KY,DW
Data blocks: DB
Timers or counters: T, Z
The formal parameters must be assigned actual parameters. Actualparameters are written directly to the block’s connection lines.
A function block can be called several times. Each time the block is called itcan be given different actual parameters.
Formal parametersInput side
Formal parametersOutput side
2-13Programming Manual PSS WIN-PRO
INFORMATION
• If an FB’s formal parameters are edited (parameters inserted, deleted ortransposed, type changed), the block calls will need to be updated andthe actual parameters adapted in all the blocks in which the FB is called.
• Each formal parameter must be assigned a corresponding actualparameter. Errors in the assignment of actual parameters may cause theprogram to malfunction.
Programming and calling FBs
When a block is created, it’s type, number and short tag are defined. Thisdata is displayed in the block header along with the input and outputparameters that are entered in the block editor.
Example:Block header of FB100 with input parameters IN1 (Bit), IN2 and IN3(Word) and output parameter OUT (Bit).
Basics
2-14 Programming Manual PSS WIN-PRO
The block’s function is programmed in the body. The formal parameters,preceded by an “=” sign, may be stated as operands (“Set addressing”).Make sure that the parameter type is permitted for that operation.
Example:Body of FB100 in IL
Body of FB100 in LD
Body of FB100 in FBD
2-15Programming Manual PSS WIN-PRO
When a function block is called up, the formal parameters are assignedactual parameters.
Example:Call FB100 in PB025 in IL
Call FB100 in PB025 in LD
Basics
2-16 Programming Manual PSS WIN-PRO
Call FB100 in PB025 in FBD
Function blocks from Pilz
Ready-made function blocks are available from Pilz for many applications.There are ready-made FBs for both the ST and FS section.These blocks must be imported into the project before they can be used.
INFORMATIONIf you are using Pilz FBs but are also creating your own FBs, make sureyou use different numbers on each, otherwise you could overwrite anexisting FB.
2-17Programming Manual PSS WIN-PRO
Standard function blocks (SB)
Standard function blocks are function blocks that process standardfunctions. They are used to build up libraries.
Standard function blocks are divided into two groups:
• Available SBsSB002 ... 199 are freely available. They can be used in the FS and theST section for any function. Exception: SB003, SB007, SB011, SB015and SB041 are reserved for 32 bit arithmetic.
• Pre-defined/reserved SBsSB001, SB 003, SB007, SB011, SB015, SB041, SB200 ... SB255 arepre-defined and are supplied by Pilz.Pre-defined standard function blocks have level 2 encryption (see“Encrypted blocks”, in this chapter).They have the following functions:- SB001: CRC calculation (in FS section only)- SB003: 32 bit addition- SB007: 32 bit subtraction- SB011: 32 bit multiplication- SB015: 32 bit division- SB041: 32 bit comparison- SB200 ... SB253: Reserved- SB254: Communication between ST section and operating system (in
ST section only)- SB255: Communication between FS section and operating system (in
FS section only)
The pre-defined SBs are supplied with PSS WIN-PRO. They are storedin the installation path under “PSSBLOCKS\FS” (FS section) or“PSSBLOCKS\ST” (ST section) and must be imported into the projectbefore they can be used.The standard function blocks for the FS and ST section have the samenumber and function, but are not identical.
Parameters
The parameters on standard function blocks and function blocks areidentical. See the section in this chapter entitled “Function blocks”.
Basics
2-18 Programming Manual PSS WIN-PRO
Programming and calling SBs
Standard function blocks are handled in exactly the same way as functionblocks. See the section in this chapter entitled “Function blocks”.
Standard function blocks from Pilz
Ready-made standard function blocks are available from Pilz for manyapplications. There are ready-made SBs for both the ST and FS section.These blocks must be imported into the project before they can be used.
INFORMATIONIf you are using Pilz SBs but are also creating your own SBs, make sureyou use different numbers on each, otherwise you could overwrite anexisting SB.
2-19Programming Manual PSS WIN-PRO
Data blocks (DB)
Data blocks are memory areas within the PSS, where data such as signalstatus, calculation results and constants are stored.
Each data block consists of memory cells, from one up to a maximum of1024. Each memory cell has a length of 16 bits and is called a data word.Each data word is assigned an address. The address range lies between 0and 1023 (DW0000 ... DW1023).The two bytes within a data word can also be addressed separately:
• DR0000 ... 1023 for the right data byte (bit 0 ... 7)
• DL0000 ... 1023 for the left data byte (bit 8 ... 15)
Data words may have different formats. The format for each data wordmust be defined when the data blocks are created. The following formatsare permitted:
• H: Hexadecimal display (range: 0000 ... FFFF)
• M: Bit state (16 Bit)
• F: 16 bit fixed point number (range: -32768 ... 32767)
• Y: 2 byte constant (range: 0 ... 255 per byte)
• C: 2 IBM ASCII characters
The programmable safety system has 256 data blocks each (DB000 ...DB255) for the FS and the ST section. Some of these are reserved forsystem data blocks. System data blocks are used as the communicationsinterface between the operating system and the user program.
System data blocks for the FS section:
• DB000: Reserved for ST section
• DB001: Result of operating system calls (read-only)
• DB002: Configuration data block (read-only)
• DB003: Call-up parameters from operating system calls
• DB004 ... DB009: Reserved
Basics
2-20 Programming Manual PSS WIN-PRO
System data blocks for the ST section:
• DB000: General data (read-only)
• DB001 ... DB003: Reserved for communication with the FS section
• DB004: General data
• DB005: Start addresses for addressable modules
• DB006: Configuration of user interface
• DB007: Send buffer for user interface
• DB008: Receive buffer for user interface
• DB009: Data block whose content is retained after a general reset
There are three different types of data block:
• Read-only data blockscan only be read by the user program.FS and ST: Data is non-volatile.
• Read/write-Data blockscan be read and written to by the user program.FS: To ensure that the start-up behaviour of the programmable safety andcontrol system always remains the same, a copy of each read/write datablock is saved in the program memory, containing the values enteredduring programming. This copy is used to automatically pre-assign theread/write data blocks when the FS user program is started. The valuesfrom the copy of the read/write data block are also used if the FS sectionis switched to a STOP condition on account of an error and is thenrestarted.Data that is written to the DBs by the user program is non-retentive.ST: When the program is started with a general reset, all the DBs in theST section, with the exception of DB009, read in the values that wereentered when programming in the DB editor. DB009 retains the valuesthat were entered in previous program cycles. Please note that if thegeneral reset OB is present (OB022) or if the “Operate PSS withoutbattery” option has been selected when programming the PSS in thesystem software’s PSS Configurator, a general reset will be triggeredeach time the ST section is started.If the ST section is started without a general reset, the values entered inthe DBs in previous program cycles will be retained.DBs in the ST section can therefore be used for non-volatile data storage.
2-21Programming Manual PSS WIN-PRO
• Remanent data blocks (FS section only)can be read and written to.In contrast to the data in the read/write DBs, data in the remanent DBs isretained when the FS user program is started; it is only reset in certaincircumstances. Remanent DBs can be used, for example, if the userprogram is to establish certain values during commissioning and, aftercommissioning, these values are to be used each time the PSS isstarted.Remanent data blocks are supported from FS operating system version65 and PSS WIN-PRO Version 1.8.0. They can only be used if the PSScontains a battery.Values are pre-assigned to the remanent data blocks duringprogramming. The system operates with these values once the userprogram has been downloaded to the programmable safety and controlsystem; the values can also be overwritten by the user program. If theuser program is stopped and restarted, it continues working with theamended values. To ensure that the remanent data blocks can be restored to their originalstatus, a copy is made of every remanent data block as soon as the userprogram is downloaded to the programmable safety and control system.After a reset, the values from this copy are pre-assigned to the remanentdata blocks.The reset can be triggered manually by selecting „Reset remanent DBs“from the „PSS“ menu in PSS WIN-PRO or by setting the FS selectorswitch from STOP to RUN with the error stack button pressed.After a manual reset, message F-20, error number 31 is displayed andflag M113.08 is set.A reset is performed automatically if an error is detected within theremanent data blocks as the FS section switches from STOP to RUN.Potential error sources:- Power failure or power switched off- Supply interruptions- Scan time exceeded (error F-0C)If the error occurs at the precise moment in which the user program iswriting data to the remanent DBs, the remanent DBs will be reset the nexttime the programmable safety and control system is started. If the erroroccurs after the data has been written, the data will be retained. Howeverit is important to note that processing of the user program will be abortedat any point in the cycle. If there are any remaining write operations toremanent blocks programmed between this point and the end of thecycle, these will not be carried out. The data in the remanent DBs will nothave the status that it would have had at the end of the cycle.
Basics
2-22 Programming Manual PSS WIN-PRO
After an automatic reset, message F-20, error number 32 is displayedand flag M113.08 is set. You can react to the reset in the user program by polling the flag, e.g. inthe start-up organisation block (OB120), and programming the desiredreaction.Flag M113.08 remains set until it is reset using SB255, FUNK = 50.Provided the flag is set, the remanent DBs will be reset each time thePSS is cold/warm started. The flag is non-volatile.
Block
SB255
Entry
FUNK = 50
Output
ERG = 4
ERG = 16
Key
Confirm reset of remanent DBs
Function performed without error
Error calling up SB255,FUNK = 50 (M113.08 was alreadyreset)
Please refer to the FS System Description for the PSS-Range for detailsof how to use SB255.
If a new user program is downloaded into the programmable safety andcontrol system and this program contains the same remanent data blocksas the previous user program (quantity of DBs, DB numbers and length ofDBs must be identical, content may vary), the current values on the oldDBs are not automatically overwritten. A prompt will appear in PSS WIN-PRO, asking whether the values are to be overwritten. If the values arenot overwritten, the programmable safety and control system will start upwith the old values when it is cold/warm started.If the remanent DBs on the new user program are not identical to thoseon the old program, the remanent data blocks on the programmablesafety and control system must be reset before downloading. PSS WIN-PRO performs the reset after approval from the user.
If the user program is stopped via the „Stop program“ operation or aprogramming error occurs (error F-21 to F-28), processing of the userprogram will be aborted within the cycle and the PSS will switch to aSTOP condition. If there are any remaining write operations to remanentblocks programmed between this point and the end of the cycle, thesewill not be carried out. The data in the remanent DBs will not have thestatus that it would have had at the end of the cycle.
2-23Programming Manual PSS WIN-PRO
The FS program may contain a maximum of 10 remanent DBs with amaximum total of 3072 data words.If remanent DBs are used, an ST block run time of at least 5 ms must beset.Access to remanent DBs in Alarm-OBs is not permitted.
Please note:
• Before accessing a data word, you will need to select the data blockcontaining that data word, using the “Select data block” operation. Allsubsequent data word access, including from called blocks, will refer tothe selected data block. If a new data block is selected from within acalled block, the selection will only apply for that called block. Once thecalled block has been processed, the DB selected previously willautomatically be reselected.
• Within a block, a selected data block remains valid until a new data blockis selected.
• When you exit an alarm OB, the DB that was valid prior to the alarm willbe selected.
• Data blocks are addressed in the program by their number. If data wordsare shifted within the data blocks, this must be taken into account in theblocks which refer to them.
• The ST section has read-only access to data blocks in the FS section viaSB254, function 36.
Approved blocks for the FS section
Test houses such as BG, TÜV or domestic organisations can carry out atype approval test on blocks. Once the test has been performed, a utilityprogram is used to encrypt the block and give it a specific check sum. Ablock that has been processed in this way can no longer be modified.
Approved Pilz blocks are available for many applications. Users can alsocreate their own blocks and have them approved and encrypted.
INFORMATIONOnce approved, blocks cannot be modified and cannot be shown indynamic program display in online mode.
Basics
2-24 Programming Manual PSS WIN-PRO
Encrypted blocks
Blocks can be encrypted using a special encryption tool. Two encryptionlevels are available:
• Level 1: Type 1 lockThe block cannot be modified. The block may be shown in dynamicprogram display in PSS WIN-PRO’s online mode.
• Level 2: Type 2 lockThe block can neither be opened nor shown in dynamic program displayin PSS WIN-PRO’s online mode.
Segments
Blocks can be sub-divided into segments (with the exception of datablocks). A block can have a maximum of 64 segments.
The first segment (Segment: –) begins at the start of the block and ends atthe first segment operation (IL) or at the first label (LD, FBD). If there is nosegment operation/label, it finishes at the end of the block.Additional segments (Segment: 0, Segment: 1, ...) extend from onesegment operation/label to the next. The last segment finishes at the endof the block.
When a new segment operation/label is inserted, the numbering of thesegments is updated automatically.
2-25Programming Manual PSS WIN-PRO
Networks
Segments can be sub-divided into networks. Networks only exist in LD andFBD. They are used to indicate a linked current path in LD and connectedgraphic elements in FBD.
Operations
Each block (with the exception of the data block) consists of a maximum of512 operations. These operations will be displayed differently, dependingon the programming language. It should be noted that a graphic element inLD or FBD may correspond to several operations.The operations that are available are described in the chapters entitled “IL”,“LD” and “FBD”.
Operands
The signal status of inputs and outputs, plus the contents of flags, timersand counters are known as operands. The name of an operand consistsmostly of a prefix for the operand type plus the operand address.The table on the front cover flap shows all the operands for the FS section,with their address ranges; the table on the back cover flap shows those ofthe ST section.
Flags
Flags are internal memories, which can be accessed in bit, byte and wordmode. Flags 064.00 to 099.31 in the FS section and flags 000.00 to 063.31in the ST section are available to use as required.Flags 100.00 to 116.31 are special flags with a pre-defined function (seeOverview of Operands on the cover flaps).The ST section is only permitted read-only access to flags 064.00-099.31in the FS section and to all the flags marked FS in the operand overviewon the back cover flap.
Basics
2-26 Programming Manual PSS WIN-PRO
Constants
Constants may also be stated as operands or parameters.
Type
Byte
2-Byte
Bit state
16 bit fixed pointnumber
Hexadecimal figure
2 IBM ASCIIcharacters
Range
0 ... 255
0 ... 255 per byte
16 bit
-32768 ... 32767
0000 ... FFFF
ASCII character set
Example
KB016
KY016,065
KM1111000011110000
KF-523
KHFAD3
KCM-
Prefix
KB
KY
KM
KF
KH
KC
Access to inputs and outputs
It is possible to access inputs and outputs on the PSS or SafetyBUS pdirectly or via process images.
Periphery access via process images
Access to inputs and outputs is normally via the process images.
The FS section has a process image for bit modules and a process imagefor word modules. Both process images have an area in which the statusof the inputs is stored, and an area in which the status of the outputs isstored:
• Process image for bit modules- Memory area for input statuses: PII- Memory area for output statuses: PIO
• Process image for word modules- Memory area for input statuses: XW-PII- Memory area for output statuses: XW-PIO
2-27Programming Manual PSS WIN-PRO
The ST section only has a process image for bit modules. This is alsodivided into two memory areas:
• Memory area for input statuses: PII
• Memory area for output statuses: PIO
Access to the process images is via operations such as “Load” or “Trans-fer”. The operands are called “E”, “AB” and “XW” for example (FS only).
The benefit of periphery access via process images is that the status ofinputs and outputs remains the same during a program cycle. The inputmodules are polled as cyclical program processing starts up, beforeorganisation block OB101 (FS) or OB001 (ST) is called. The processimage of inputs (FS: PII, XW-PII; ST: PII) is stored. The program operateswith this process image. If the input status changes as the program isprocessed, the new image is not loaded until the next time OB101 (FS) orOB001 (ST) is started up, in other words, at the next cycle.
The process image of outputs is transmitted to the outputs at the end of thecycle.Access to the process image also requires less time than direct access.
The “FS System Description” and the “ST System Description” for thePSS-range describe in detail how communication via the process imagesoperates.
Direct periphery access
The reading of input signal statuses or setting of outputs can be triggeredvia specific operations in the user program. Inputs/outputs are accessedimmediately, irrespective of the cycle.
The benefit of direct access is that signals that are shorter than the scantime can also be processed. The user program can poll the inputs andoutputs several times during a program cycle and always receives thecurrent status.
Basics
2-28 Programming Manual PSS WIN-PRO
Direct periphery access to bit modules
The operands involved in direct periphery access to bit modules are called“periphery word PW” or “periphery byte PB”. “Load” or “Store” are availableas operations.
Please note:
• When the status of an input is read directly, to transfer that status to theprocess image it is necessary to “Store” the input byte/word after theperiphery byte/word has been “loaded”.Example:L PB2.08T EB2.08
• If an output is being accessed directly (example: T PB2.08), the processimage is updated automatically.
• FS only: The user program must check the feasibility of any peripheryword that is read in.
• The operations “Load” and “Store” may not be used on PWx.8 andPWx.24 (x = slot number).
• FS section only: Commands for direct access are slower than access tothe process images. Reason: The FS section is multi-channel and thesignals between the channels have to be aligned before reading/sending.To do this the channels must first be synchronised.
Direct periphery access to word modules (ST section only)
ST word modules can only be accessed via direct periphery access. Theoperands are called “XW”. “Load” or “Store” are available as operations.
2-29Programming Manual PSS WIN-PRO
Access rights of the FS and ST section
In the FS program it is only possible to access FS inputs and FS outputs.In the ST program it is possible to read ST as well as FS inputs/outputs. It is only possible to write to ST outputs in the ST program. If thereis an attempt to write to FS outputs within the ST program, the ST PIO willbe modified for the current cycle, but the FS outputs themselves will beunchanged.
Addressing
Absolute addresses
The name of an operand consists mostly of a prefix for the operand typeplus the operand address. On most operands (e.g. XW, DB, …), theaddress is a number; only on inputs, outputs, periphery access and flagsdoes the address consist of two numbers separated by a decimal point.On flags, the number before the decimal point is the flag number; on inputs,outputs and periphery access it is the slot number. The number after thedecimal point is the bit number.When addressing words or bytes, the bit number indicates the leastsignificant bit (LSB). Bytes can only start with bit numbers 0, 8, 16 or 24and words with bit numbers 0 and 16 (words starting with 8 or 24 arepermitted, but require more access time than words starting with 0 or 16).
ExamplesE 02.17: Input bit 17 on slot 2EB 02.08: Input byte (bit number 8 ... 15) on slot 2AW 03.00: Output word (bit number 0 ... 15) on slot 3MB 75.08: Flag byte (bit number 8 ... 15) from flag 75Z 60: Counter 60
The table on the front cover flap shows all the operands for the FS section,with their address ranges; the table on the back cover flap shows those ofthe ST section.
Basics
2-30 Programming Manual PSS WIN-PRO
INFORMATIONWith inputs, outputs and periphery access please note the following:
• The addresses that can be addressed will vary from PSS to PSS, and onmodular PSS systems will depend on the hardware configuration; detailsare given in the operating manuals for the programmable safety system.
• It will not be possible to access a word with the address x.24 if x is thenumber of the last slot on the programmable safety system.
• On compact programmable safety systems, not all of a slot’s inputs/outputs are always available on the screw terminals. An error occurswhen such an output is set. If you wish to address an output byte/wordcontaining such an output, you will need to mask the output byte/word insuch a way that “0” is written to this output.Inputs that are not available are read with “0”.
Tags
Tags can be defined for all operands, with the exception of constants andblocks; for example, the operand “EB02.08” could have the tag“AUTOMATIC_ON”.When programming, you can enter “EB02.08” or “AUTOMATIC_ON” as theoperand.In this way, tags can be used as an expressive description for operands.
The assignment between operands and tags is stored in the allocationtable. The FS and ST project section each have their own allocation table.Each allocation table may contain a max. 4000 allocations. Each allocationmay have a comment text, containing up to 256 characters.
Conventions for tags: Max. 32 characters, special characters arepermitted, not case-sensitive.
2-31Programming Manual PSS WIN-PRO
Direct addressing
The simplest type of addressing is direct addressing. The operand’s abso-lute address (see section entitled “Addresses”, in this chapter) is stateddirectly within the operation.
Example:Load input E 2.12. The tag “Start” has been defined for the input in theallocation table.
IL:L E2.12 .Start
LD:
FBD:
�����
����
�����
����
Basics
2-32 Programming Manual PSS WIN-PRO
Indirect addressing
With indirect addressing, a flag word is stated instead of the operandaddress. This flag word contains the current address and is called theaddress indicator. Indirect addressing enables an address to be changedwhile the program is being processed.
Please note the following with indirect addressing:
• Flag words MW114.00 and MW114.16 are available as addressindicators for indirect addressing. On PSS with an FS operating systemversion ≥ 43, flags in the range 00 - 63 in the ST section and flags in therange 64 - 99 and 130 - 255 in the FS section can also be used asaddress indicators.No other flags are permitted as address indicators.
• The address indicator (flag word) must always be in parentheses. Thetype of operand being addressed must be stated before the parentheses(see examples).
• The operand address in the address indicator (flag word) can bespecified as a constant or can be calculated within the program.
• The PSS will detect any access outside the permitted operand range(e.g. DB400) and will switch to a STOP condition.
• Load errors or unintentionally overwriting the address indicator (flagword) can cause the user program to operate incorrectly.
The configuration of the address indicator depends on the operands thatare to be addressed; see table.
Operand type
E, EB, EW
A, AB, AW
M, MB, MW
Z, ZW
T
DW, DL, DR
DB
XW
Address indicator
Bit 15 ... 8 Bit 7 … 0
Slot number Bit number 0 ... 31
Slot number Bit number 0 ... 31
Flag number Bit number 0 ... 31
Any Counter number
Time base Timer number
Data word number
Data block number
Number of the word in the XW process image
2-33Programming Manual PSS WIN-PRO
Examples
Indirect addressing using the address indicator MW114.16.Before the address indicator is used, flag word MW114.16 must beassigned the corresponding values.
Addressdirect
E1.6
AB2.8
MW64.00
Z88
ZW88
T67.1
DL100
DB199
XW40
Contents ofMB114.24 MB114.16
1 6
2 8
64 0
Any 88
Any 88
1 67
Contents of MW114.16
100
199
40
Addressindirect
E(114.16)
AB(114.16)
MW(114.16)
Z(114.16)
ZW(114.16)
T(114.16)
DL(114.16)
DB(114.16)
XW(114.16)
Basics
2-34 Programming Manual PSS WIN-PRO
Set addressing
Set addressing can only be used in function blocks and standard functionblocks that have parameters.
When programming, the parameters are simply used as operands, with an“=” placed in front. Make sure that the parameter type is permitted for thatoperation.
When the standard/function block is called, the (formal) parameters arethen replaced by actual parameters.
ExampleAn FB100 has been defined. The parameters and their types can be seenin the block header.
The parameters are used as operands within the body.
IL:
2-35Programming Manual PSS WIN-PRO
LD:
FBD:
Basics
2-36 Programming Manual PSS WIN-PRO
Free addressing in the FS section
Modules that can process more than 32 Bits are called word modules. Inthe FS section, word modules have their own process image, known as theXW process image. Words in this XW process image are addressed usingfree addressing.
INFORMATIONAccess to word modules is not permitted in the start-up OB.
An area of 8 words is reserved in the XW process image for each slot.
Slot
0
1
2
3
4
5
6
7
8
Operand
XW0 ... XW7
XW8 ... XW15
XW16 ... XW23
XW24 ... XW31
XW32 ... XW39
XW40 ... XW47
XW48 ... XW55
XW56 ... XW63
XW64 ... XW71
ExampleThere is a word module on slot 3. The 3rd and 4th words are to beaddressed.
Slot 3 corresponds to words XW24 … XW31 (see table above)
1st word – XW242nd word – XW253rd word – XW264th word – XW275th word – XW286th word – XW297th word – XW308th word – XW31
The 3rd word is XW26 and the 4th word XW27.
2-37Programming Manual PSS WIN-PRO
Free addressing in the ST section
Modules that can process more than 32 Bits are called word modules. Thewords are addressed using free addressing.
INFORMATIONAccess to word modules is not permitted in the start-up OB.
The addresses that a word module will occupy are defined via the startaddress. The start address is entered in the PSS Configurator (Hardwareregistry tab, highlight word module and select Configure).
Address requirements:
• The start address is the address through which the first input or output ona module is addressed. The second input or output contains the address= start address + 1 etc.
• The start address must be an integer multiple of the number ofaddresses that the module requires.Example: Module with 8 addresses
Permitted start addresses: 0, 8, 16, 24, 32, .... (decimal)
• Permitted address range: 0 ... 16383 (decimal)
• The modules’ address ranges are not permitted to overlap
Example:Addressing the PSS AIO module on a PSS 3000
The module occupies 8 addresses. The start address must therefore bedivisible by 8. 4096 (decimal) would be possible, for example.Analogue inputs are addressed with an offset of 0 ... 5; analogue outputswith an offset of 6 and 7.
Basics
2-38 Programming Manual PSS WIN-PRO
Start address: 4096 decimal
Module addresses:XW4096 1st inputXW4097 2nd inputXW4098 3rd inputXW4099 4th inputXW4100 5th inputXW4101 6th input
XW4102 1st outputXW4103 2nd output
The PSS Configurator enters the start addresses in DB5.
Data word
DW0000
DW0001
.
.
.
DW0008
DW0009
DW0010
.
.
.
DW0023
Start address for module on
Slot 0
Slot 1
.
.
. .
Slot 8 (base or expansion module rack)
Slot 9 (expansion module rack)
Slot 10 (expansion module rack)
.
.
.
Slot 23 (expansion module rack)
Offset for free addressing
Operating system call SB254, FUNK = 180 has been available since FSoperating system version 38 to enable programming to be largely indepen-dent of the start address. With this operating system call, the start addressis specified as an offset. Addressing continues as if the start addressequalled 0. The offset is valid until another block is called or until the end ofthe block.
2-39Programming Manual PSS WIN-PRO
Please refer to the ST System Description for the PSS-Range for details ofhow to use SB254.
Positive logic
Positive logic is valid when programming, i.e. “1” is “TRUE” and “0” is“FALSE”.
Block
SB254
DB004
Entry
FUNK = 180
DW200
Output
ERG = 1
ERG = 16
Key
Offset for free addressing
Function performed without error
Error calling up SB254,FUNK = 180 (start address transferredin DW200 was greater than 16383)
Word module’s start address
Basics
2-40 Programming Manual PSS WIN-PRO
Program cycle
The sequence of a program on the PSS is determined by its programstructure. The program cycle can be interrupted by alarms or errors.
Program structure
The program for the FS/ST section of a PSS is composed of severalblocks. A block consists of a series of operations. Either linear or structuredprogramming can be used, depending on the scope of the control task.
Linear programming
Linear programming only uses the cycle organisation block OB101 (FSsection) or OB001 (ST section). It contains all the instructions. Thisstructure is only recommended on very simple control tasks.
Fig. 2-2: Linear programming
����������������� ���������
���
����������������������������������
2-41Programming Manual PSS WIN-PRO
Structured programming
Extensive control functions should only be managed using structuredprogramming. Several blocks are used, each one fulfilling part of thecontrol function. This gives a better overview of the process. Modificationsand tests can be done piecemeal (per block).Blocks are called from within each other and within the cycle organisationblock OB101 (FS section) or OB001 (ST section). When a block is called,the program exits the current block and processes the operations in theblock that has been called. At the end of the block the program returns tothe original block and continues processing it.
There are 8 nesting levels for block calls:1st level: OB101 (FS section) or OB001 (ST section) calls block 12nd level: Block 1 calls block 23rd level: Block 2 calls block 3...8th level: Block 6 calls block 7
����
������
������
������
������
������
������
������
������
������� ������ ������� �������
����������������������������������
������
�����
����� ������
������
�����
Fig. 2-3: Structured programming
Basics
2-42 Programming Manual PSS WIN-PRO
Alarm processing
Alarm processing in the FS section
The program for the FS section is processed in cycles. OB101 and theblocks called within it are run periodically. Only an alarm or an error caninterrupt this process.If an alarm occurs, the alarm OB is called and processed at the start of thenext segment or at the next block change. The program then returns to theoriginal block and continues processing it.
INFORMATIONOn the subject of “Alarms”, you should also refer to the FS SystemDescription for the PSS-range.
�����
�������������
�������������
��������������
��������������
��������������
�����
���!���
�����"
�����#
Fig. 2-4: Alarm processing in the FS section
2-43Programming Manual PSS WIN-PRO
Alarm processing in the ST section
There are no ST section alarms.FS section alarms are processed within the ST section as soon as theyoccur. The ST program is continued once the alarm OB has beenprocessed.
Fig. 2-5: Alarm processing in the ST section
�����
��������������
��������������
�������������
�������������
�������������
������������ ����
��� ���!���
�����"
�����#
INFORMATIONOn the subject of “Alarms”, you should also refer to the FS SystemDescription for the PSS-range.
Basics
2-44 Programming Manual PSS WIN-PRO
Error processing
Error processing in the FS section
If an error occurs, the FS program is interrupted immediately and one ofthe error OBs is called. The error will determine which error OB is called(see section entitled “Organisation blocks for the FS section”).When the error OB has been run, or if no error OB is available, the FSsection will switch to a STOP condition.
Error processing in the ST section
If an error occurs, the ST program is interrupted immediately and one of theerror OBs is called. The error will determine which error OB is called (seesection entitled “Organisation blocks for the ST section”).The error will also determine whether or not the ST section switches to aSTOP condition once the error OB has been run, or if no error OB isavailable.
3-1Programming Manual PSS WIN-PRO
IL
IL
Programming in IL
The IL programming language (Instruction List) is a text-oriented language,i.e. all operations are shown in text format.
Structure of an operation
Operator Operand Tag
L E01.00 .INPUT1
Operator:Each operation consists of an operator at the very least. The operator is ashort description of the command to be executed. You can enter one of theoperators listed in the section entitled “Operations in IL”.
Operand:Operand on which the operator is to be used. The section entitled“Operations in IL” contains details of which operands are permitted foreach operator, and whether there are any restrictions when addressing theoperands.General information on operands and addressing is available in thechapter entitled “Basics”.
Tag:A symbol can be defined for each operand in the allocation table. If asymbol has been defined, it will be placed after the operand, preceded bya dot.
Segment operation
One particular operation is the segment operation, which marks the startof a segment. It consists of the “SEG” operator and the number of thesegment.A label may be entered before the segment operation. The label is used asthe target in jump operations. The label may be a maximum of 14
IL
3-2 Programming Manual PSS WIN-PRO
characters and may not contain spaces or colons. The label must befollowed by a colon.
Label Segment operation
xxx: SEG 13
Comments
Comments may be added within a block.Comments start with “//” and finish at the end of each line.
Example:
// This is a comment
L E01.12 // This is a comment
Accumulator, auxiliary accumulator and RLO
IL works with various memories.
The “RLO” memory (result of logic operation) is one bit wide. The RLO isused for all bit operations, but can also be influenced by some otheroperations, e.g. compare operations. There are also operations which areRLO-dependent, i.e. they are only performed when the RLO has aparticular status (e.g. the jump operation “SPB”).
The “accumulator” and “auxiliary accumulator” memories are both 16 bitswide. The accumulator is used with all byte and word operations. Theauxiliary accumulator is used by arithmetic operations to display overflows,for example.The auxiliary accumulator cannot be read directly. In order to evaluate it,the “TA” operation (transpose accumulator) must be used to transfer thecontents of the auxiliary accumulator into the accumulator.
3-3Programming Manual PSS WIN-PRO
IL
Fig. 3-1: Accumulator and auxiliary accumulator
Programming rules
The following rules must be followed when programming:
• Several binary logic operations (U, UN, O, ON) can follow in successionto form a logic chain.
• A binary load operation (L, LN) or a compare instruction (>, !=, <) mustprecede an individual binary logic operation or the first logic operation ina binary logic chain.
• The first operation within parentheses must be a binary load operation(L, LN) or a compare operation (>, !=, <). This may only be followed bybinary logic operations (U, UN, O, ON).
• One of the operations =, S, R, SPB, CALC, ), SE, ZV or ZR must followan individual binary logic operation or a binary logic chain.
• The operations =, S, R, SPB, CALC, SE, ZV and ZR must always bepreceded by an operation that affects the RLO.
• Binary logic operations and binary logic chains may not be interrupted bybyte or word operations.
• The final operation within a block must be “BE”.
• The operation “BE” may only occur once within a block.
�$ � � ���� ���
%�&'�()�� �*�()��
��+!+����
�$ � � ���� ���
%�&'�()�� �*�()��
+,�����)����+!+����
IL
3-4 Programming Manual PSS WIN-PRO
Operations in IL
Overview
Operator
L
L(
LN
U
U(
UN
O
O(
ON
)
S
R
=
=N
SE
ZV
ZR
L
T
DEF
DUF
>
!=
<
I
D
KZW
Description
Bit operations
Load
Load open parenthesis
Load NOT
AND connection
AND open parenthesis
AND operation, operand negated
OR operation
OR open parenthesis
OR operation, operand negated
Close parenthesis
Set
Reset
Store
Store NOT
Timers and counters
Start timer
Increment counter (count forwards)
Decrement counter (count backwards)
Byte/word operations
Load
Store
Convert BCD figure to binary
Convert binary figure to BCD
“Greater than” comparison
“Equals” comparison
“Less than” comparison
Increment
Decrement
Form a two’s complement (negate)
Page
3-7
3-7
3-8
3-8
3-9
3-10
3-11
3-12
3-13
3-13
3-14
3-14
3-15
3-15
3-16
3-18
3-19
3-20
3-21
3-22
3-23
3-24
3-25
3-25
3-26
3-27
3-28
3-5Programming Manual PSS WIN-PRO
IL
Description
Addition
Subtraction
Multiplication
Division
Bitwise AND operation (bytes/words)
Bitwise OR operation (bytes/words)
Bitwise EXCLUSIVE OR operation (bytes/words)
Form a one’s complement (invert)
Rotate left
Rotate right
Shift left
Shift right
Transpose accumulator and auxiliary accumulator
Jump operations
Unconditional jump
Conditional jump
Organisational operations
Select data block
Unconditional block call
Conditional block call
Block end
Start of segment
Disable alarms
Enable alarms
Shut down outputs
Stop program
CRC calculation
CRC calculation
32 bit arithmetic
Addition
Subtraction
Multiplication
Division
Comparison
Operator
+
-
*
:
AND
OR
XOR
KEW
RL
RR
SLV
SRV
TA
SPA
SPB
A
CAL
CALC
BE
SEG
AS
AF
BAS
STP
SB001
SB003
SB007
SB011
SB015
SB041
Page
3-29
3-30
3-31
3-32
3-33
3-34
3-35
3-36
3-37
3-38
3-39
3-40
3-41
3-42
3-43
3-44
3-45
3-46
3-47
3-47
3-48
3-48
3-49
3-49
seeChapter 6
IL
3-6 Programming Manual PSS WIN-PRO
INFORMATIONOnly the operands stated as “Permitted operands” in the operation’sdescription may be used for the operations. The corresponding addressranges can be found on the cover flaps.Please note that some operands are read-only. Example: if “MW” (flagwords) is stated for an operation under “Permitted operands” and theoperation is able to write to the operand, it will only be possible to usethose flag words to which write access is permitted, as stated on the coverflaps. See column: “Access, Write”
3-7Programming Manual PSS WIN-PRO
IL
L
L M 064.00 ////
Load status of flagM064.00 into the RLO.
L(
L( //L E 01.10 //U A 02.13U E 02.31U E 01.04)
Load result of logicoperation into the RLO.
Bit operations
Load[Operand] => [RLO]
DescriptionThe status of a bit operand is copied to the RLO.
Permitted operandsA, E, M, T, Z
Example
Load open parenthesis[Parenthesis result] => [RLO]
DescriptionThe result of a logic operation (U, UN, O, ON) is copied to the RLO.The logic operation must be within parentheses, i.e. the logic operationstarts with the operation “L(” and ends with the operation “)”.
Max. nesting level for parentheses: 3
Permitted operandsNone
Example
IL
3-8 Programming Manual PSS WIN-PRO
Load NOT[Operand negated] => [RLO]
DescriptionThe negated status of the operand is copied to the RLO.
Permitted operands
A, E, M, T, Z
Example
AND operation[Operand] AND [RLO] => [RLO]
DescriptionThe status of the operand and the RLO are AND-linked. The result iscopied to the RLO.
Permitted operandsA, E, M, T, Z
Example
LN
LN M 064.00 //////
Load negated status offlag M064.00 into theRLO.
U A 01.00 //////
AND-link status of RLOand output A01.00,copy result to the RLO.
RLO
0101
Result in RLO
0001
Operand
0011
U
3-9Programming Manual PSS WIN-PRO
IL
AND open parenthesis[Result from parentheses] AND [RLO] => [RLO]
DescriptionThe result of a logic operation (U, UN, O, ON) and the status of the RLOare AND-linked. The result of the logic AND operation is copied to theRLO.
The logic operation must be within parentheses, i.e. the logic operationstarts with the operation “U(” and ends with the operation “)”.
Max. nesting level for parentheses: 3
Permitted operandsNone
Example
RLO
0101
Result in RLO
0001
Parenthesisresult
0011
L E 02.05 //U( //L E 01.10 //O A 02.13 //O E 02.31)
AND-link status of RLOand the result of the ORoperation and copy theresult to the RLO.
U(
IL
3-10 Programming Manual PSS WIN-PRO
AND operation, operand negated[Operand negated] AND [RLO] => [RLO]
DescriptionThe status of the RLO and the negated status of the operand are AND-linked. The result is copied to the RLO.
Permitted operandsA, E, M, T, Z
Example
RLO
0101
Result in RLO
0100
Operand
0011
UN A 01.00 ////////
AND-link status of RLOand negated status ofoutput A01.00, copyresult to the RLO.
UN
3-11Programming Manual PSS WIN-PRO
IL
OR operation[Operand] OR [RLO] => [RLO]
DescriptionThe status of the operand and the RLO are OR-linked. The result is copiedto the RLO.
Permitted operandsA, E, M, T, Z
Example
O
O A 01.00 //////
OR-link status of RLO andoutput A01.00,copy result to the RLO.
RLO
0101
Result in RLO
0111
Operand
0011
IL
3-12 Programming Manual PSS WIN-PRO
OR open parenthesis[Result from parentheses] OR [RLO] => [RLO]
DescriptionThe result of a logic operation (U, UN, O, ON) and the status of the RLOare OR-linked. The result of the logic OR operation is copied to the RLO.
The logic operation must be within parentheses, i.e. the logic operationstarts with the operation “O(” and ends with the operation “)”.
Max. nesting level for parentheses: 3
Permitted operandsNone
Example
O(
RLO
0101
Result in RLO
0111
Parenthesisresult
0011
L E 02.05 //O( //L E 01.10 //U A 02.13 //U E 02.31 //)
OR-link status of RLO andthe result of the ANDoperation and copy theresult tothe RLO.
3-13Programming Manual PSS WIN-PRO
IL
)
OR operation, operand negated[Operand negated] OR [RLO] => [RLO]
DescriptionThe status of the RLO and the negated status of the operand are OR-linked. The result is copied to the RLO.
Permitted operandsA, E, M, T, Z
Example
Close parenthesis
DescriptionCloses the last parenthesis level to be opened. The RLO contains theresult from the overriding logic operation.
Max. nesting level for parentheses: 3
Permitted operandsNone
Example See operation “L(”, “O(” and “U(”
ON
RLO
0101
Result in RLO
1101
Operand
0011
ON A 01.00 ////////
OR-link status of RLO andnegated status of outputA01.00, copy result tothe RLO.
IL
3-14 Programming Manual PSS WIN-PRO
Set[Operand] = 1, if RLO = 1
DescriptionIf the status of the RLO is “1”, the status of the operand is set to “1”. If thestatus of the RLO is “0”, the status of the operand is unchanged. The RLOremains unchanged.
Permitted operands
A, M
Example
Reset[Operand] = 0, if RLO = 1
DescriptionIf the status of the RLO is “1”, the status of the operand is set to “0”. If thestatus of the RLO is “0”, the status of the operand is unchanged. The RLOremains unchanged.If the operand is a timer, the timer’s status bit is reset. If the operand is acounter, the status bit of the counter and the counter word are both reset.The counter is locked as a result of the reset. To enable the counter tocontinue, the status of the RLO must be set to “0” and the “R” operationmust be reapplied to the counter.
Permitted operandsA, M, T, Z
Example
S
S M 088.00 //////
Set status of flagM088.00 to "1" if RLOequals "1".
R
R M 088.00 //////
Set status of flagM088.00 to "0" if RLOequals "1".
3-15Programming Manual PSS WIN-PRO
IL
Store[RLO] => [Operand]
DescriptionThe status of the RLO is stored in the operand.
Permitted operandsA, M
Example
Store NOT[RLO negated] => [Operand]
DescriptionThe negated status of the RLO is stored in the operand.
Permitted operandsA, M
Example
=N
=N M 64.01 ////Store negated status ofRLO in flag M64.01.
=
= M 64.01 ////Store status of RLO inflag M64.01.
IL
3-16 Programming Manual PSS WIN-PRO
Timers and counters
Start timer
DescriptionThe “SE” operation is used to create a switch-on delay using a timer.
Timers: FS: T064 ... 127ST: T000 ... 063
The switch-on delay arises as follows:
Time = Time value x Time base
Time value: Any value in the range 1 ... 32767
Time base: 0 corresponds to 50 ms1 corresponds to 100 ms2 corresponds to 1 s3 corresponds to 10 s4 corresponds to 1 min
The time value must be loaded into the accumulator before the “SE”operation. The time base and timer are stated as operands in the “SE”operation.
Sequence:The timer is started as soon as the RLO before the “SE” operationswitches from “0” to “1”. The timer status is then “0” (see Fig. 3-1, ).Once the switch-on delay has elapsed, the timer status is set to “1” ( ).A falling edge at the RLO before the “SE” operation will reset the timerstatus ( ).The timer can also be reset using the “R” operation ( ). If the RLO beforethe “R” operation is set permanently to “1”, it will not be possible to startthe timer ( ).
The timer status can be polled using the operations “L”, “U”, “O”.Example for loading the status bit of timer 127: L T 127
It is even possible to read the FS section timers from the ST section.
SE
3-17Programming Manual PSS WIN-PRO
IL
Examples
� �
� � � � � �
RLO before“SE” instruction
RLO before“R” instruction
Timer running
Status oftimer
t = programmed time
Fig. 3-1: Timing diagram
L KF 00003 //L E 01.02 //
//SE T 127.1 //
//
L KF 00003 //L E 01.02 //
//SE =TIME.1 //
//
L KY 001,067 //T MW 114.00 //L KF 00003 //L E 01.02 //
//SE T(114.00) //
//
Load time value 3Set RLO through startinputStart timer T127 withtime base 1 (100 ms)
Load time valueSet RLO through startinputStart set timer with timebase 1
Load time base, timer inflag word MW114.00Load time valueSet RLO through startinputStart indirectlyaddressed timer T067
AddressingDirect:
Set:
Indirect:
IL
3-18 Programming Manual PSS WIN-PRO
Increment counter (count forwards)
DescriptionThe “ZV” operation is used to increment a counter. The counter is stated asoperand.
Counters: FS: Z064 ... 127ST: Z000 ... 063
A rising edge at the RLO increments the counter, i.e. the counter status isincreased by “1”.The current counter status is located in the ZW counter word that correspondsto the counter (e.g. counter Z064: counter word ZW064). The counter statuscan accept the values -32768 ... +32767. If counter status 32767 is reached,counting will continue at -32768.
The counter’s status bit indicates whether the counter status is greater thanor less than/equals 0. If the counter status is greater than “0”, the counter’sstatus bit is set to “1”.The counter status can be polled using the operations “L”, “U”, “O”.Example for loading the status bit of counter 127: L Z 127The counter word can be processed using most word operations (see“Byte /word operations).The counter can be reset using the “R” operation(counter’s status bit = 0, counter word = 0). The counter must be unlockedafter the reset, see “R” operation.
It is even possible to read the FS section counters from the ST section.
Example
ZV
L E 01.00 ////
ZV Z 064 //
Set RLO through counterinputIncrement counter Z064
3-19Programming Manual PSS WIN-PRO
IL
Decrement counter (count backwards)
DescriptionThe “ZR” operation is used to decrement a counter. The counter is statedas operand.
Counters: FS: Z064 ... 127ST: Z000 ... 063
A rising edge at the RLO decrements the counter, i.e. the counter status isdecreased by “1”.The current counter status is located in the ZW counter word thatcorresponds to the counter (e.g. counter Z064: counter word ZW064). Thecounter status can accept the values -32768 ... +32767. If counter status-32768 is reached, counting will continue at 32767.
The counter’s status bit indicates whether the counter status is greaterthan or less than/equals 0. If the counter status is greater than “0”, thecounter’s status bit is set to “1”.The counter status can be polled using the operations “L”, “U”, “O”.Example for loading the status bit of counter 127: L Z 127The counter word can be processed using most word operations (see“Byte /word operations”).The counter can be reset using the “R” operation(counter’s status bit = 0, counter word = 0). The counter must be unlockedafter the reset, see “R” operation.
It is even possible to read the FS section counters from the ST section.
Example
ZR
L E 01.00 ////
ZR Z 064 //
Set RLO through counterinputDecrement counter Z064
IL
3-20 Programming Manual PSS WIN-PRO
Byte/word operations
Load and transfer operations
Load[Operand] => [Accumulator]
DescriptionThe operand is loaded into the accumulator. If the operand is a byte, onlythe accumulator’s low byte will be written (Bit 0 ... 7). If the operand is aword, the entire contents of the accumulator will be overwritten.
This operation may not be followed by an operation that is dependent onthe RLO.
Permitted operandsAB/AW, EB/EW, PB/PW, DL, DR, DW, KB, KC, KF, KH, KM, KY, MB/MW,XW, ZW
Example
L
L MW 064.00 //////
Load contents of flagword MW064.00 into theaccumulator
3-21Programming Manual PSS WIN-PRO
IL
Store[Accumulator] => [Operand]
DescriptionThe contents of the accumulator is stored in the operand. If the operand isa byte, only the accumulator’s low byte will be stored (Bit 0 ... 7). If theoperand is a word, the entire contents of the accumulator will be stored.The contents of the accumulator will remain unchanged.
This operation may not be followed by an operation that is dependent onthe RLO.
Permitted operandsAB/AW, EB/EW, PB/PW, DL, DR, DW, MB/MW, XW, ZW
Example
T
T MB 64.24 //////
Store contents ofaccumulator (low byte) inflag byte MB64.24
IL
3-22 Programming Manual PSS WIN-PRO
Convert operations
Convert BCD figure to binaryBCD => Binary
INFORMATIONThis operation is only available in the ST section.
DescriptionThe contents of the accumulator is interpreted as a BCD figure andconverted into binary.
This operation may not be followed by an operation that is dependent onthe RLO.
Permitted operandsNone
Example
Contents of the accumulator before DEF: 00000010 10010110Result in the accumulator after DEF: 00000001 00101000
DEF
Convert BCD figure in theaccumulator into binary
DEF ////
3-23Programming Manual PSS WIN-PRO
IL
DUF
Convert binary figure inthe accumulator into BCD
DUF ////
Convert binary figure to BCDBinary => BCD
INFORMATIONThis operation is only available in the ST section.
DescriptionThe contents of the accumulator is interpreted as a binary figure andconverted into BCD.
This operation may not be followed by an operation that is dependent onthe RLO.
Permitted operandsNone
Example
Contents of the accumulator before DUF: 00000010 00101000Result in the accumulator after DUF: 00000101 01010010
IL
3-24 Programming Manual PSS WIN-PRO
> AB 01.24 ////////////
If the contents of theaccumulator (low byte) isgreater than the contentsof the output byteAB01.24, set RLO = 1,otherwise RLO = 0
Compare operations
“Greater than” comparison[Accumulator] > [Operand] => RLO = 1
DescriptionThe contents of the accumulator is compared with the contents of theoperand. If the contents of the accumulator is greater, the RLO is set to “1”.If the operand is a byte, it is compared with the accumulator’s low byte(unsigned). Compare operations with words must be signed comparisons.Neither the contents of the accumulator nor that of the operand ischanged.
Permitted operandsAB/AW, EB/EW, DL, DR, DW, KB, KC, KF, KH, KM, KY, MB/MW, ZW
Example
>
3-25Programming Manual PSS WIN-PRO
IL
“Equals” comparison[Accumulator] = [Operand] => RLO = 1
DescriptionThe contents of the accumulator is compared with the contents of theoperand. If both contents are the same, the RLO is set to “1”.If the operand is a byte, it is compared with the accumulator’s low byte(unsigned). Compare operations with words must be signed comparisons.Neither the contents of the accumulator nor that of the operand ischanged.
Permitted operandsAB/AW, EB/EW, DL, DR, DW, KB, KC, KF, KH, KM, KY, MB/MW, ZW
Example
“Less than” comparison[Accumulator] < [Operand] => RLO = 1
DescriptionThe contents of the accumulator is compared with the contents of theoperand. If the contents of the accumulator is less, the RLO is set to “1”.If the operand is a byte, it is compared with the accumulator’s low byte(unsigned). Compare operations with words must be signed comparisons.Neither the contents of the accumulator nor that of the operand ischanged.
Permitted operandsAB/AW, EB/EW, DL, DR, DW, KB, KC, KF, KH, KM, KY, MB/MW, ZW
Example
<
< AB 01.24 //////////
If the contents of theaccumulator (low byte) isless than the contents ofoutput byte AB01.24, setRLO = 1, otherwise RLO = 0
!= AB 01.24 //////////
If the contents of theaccumulator (low byte)equals the contents ofoutput byte AB01.24, setRLO = 1, otherwise RLO = 0
!=
IL
3-26 Programming Manual PSS WIN-PRO
Arithmetic operations
Increment[Accumulator] + 1 => [Accumulator][Operand] + 1 => [Operand]
DescriptionThe contents of the operand is increased by one. The contents of theaccumulator remains unchanged. If no operand is stated, the operation isperformed in the accumulator and the contents of the accumulator willtherefore be changed.
Overflows
• Overflow when incrementing byte operands:255 +1 = 0An overflow occurs if the contents of the operand is “255”. Afterincrementing, the contents of the operand is “0”.
• Overflow when incrementing word operands:+32.767 +1 = -32.768An overflow occurs if the contents of the operand is “+32.767”. Afterincrementing, the contents of the operand is “-32.768”.
This operation may not be followed by an operation that is dependent onthe RLO.
Permitted operandsAB/AW, DW, MB/MW
Example
I
I MB 064.16 ////Increase contents of flagbyte MB064.16 by 1
3-27Programming Manual PSS WIN-PRO
ILD MB 064.16 //
//Decrease contents of flagbyte MB064.16 by 1
Decrement[Accumulator] -1 => [Accumulator][Operand] - 1 => [Operand]
DescriptionThe contents of the operand is decreased by one. The contents of theaccumulator remains unchanged. If no operand is stated, the operation isperformed in the accumulator and the contents of the accumulator willtherefore be changed.
Overflows
• Overflow when decrementing byte operands:0 - 1 = 255An overflow occurs if the contents of the operand is “0”. Afterdecrementing, the contents of the operand is “255”.
• Overflow when decrementing word operands:-32.768 - 1 = +32.767An overflow occurs if the contents of the operand is “-32.768”. Afterdecrementing, the contents of the operand is “+32.767”.
This operation may not be followed by an operation that is dependent onthe RLO.
Permitted operandsAB/AW, DW, MB/MW
Example
D
IL
3-28 Programming Manual PSS WIN-PRO
Form a two’s complement (negate)Negate [Accumulator]
DescriptionA two’s complement is formed from the contents of the accumulator,inverting bit by bit. The result is incremented.The contents of the accumulator is always interpreted as a fixed pointnumber (16 Bit, signed). Forming a two’s complement corresponds tomultiplying a fixed point number by -1.
This operation may not be followed by an operation that is dependent onthe RLO.
Permitted operandsNone
ExampleKZW //Form a two’s complement
Contents of the accumulator before KZW: 10010010 10110000Result in the accumulator after KZW: 01101101 01010000
KZW
3-29Programming Manual PSS WIN-PRO
IL
+ KB 028 ////Add 28 to contents ofaccumulator
Addition[Operand] + [Accumulator] => [Accumulator]
DescriptionThe contents of the operand is added to the contents of the accumulator.The result is stored in the accumulator. The arithmetic flags are set. Theaccumulator contents and word operands are always interpreted as signed16 bit fixed point numbers, byte operands are unsigned.
Overflow:If an overflow occurs (if the result exceeds +32786 or falls below -32786),the value “FFFFH” (corresponding to “-1”) is entered in the auxiliaryaccumulator. The contents of the accumulator is then invalid!
This operation may not be followed by an operation that is dependent onthe RLO.
Permitted operandsAB/AW, EB/EW, DL, DR, DW, KB, KF, MB/MW, ZW
Example
+
IL
3-30 Programming Manual PSS WIN-PRO
Subtraction[Accumulator] - [Operand] => [Accumulator]
DescriptionThe contents of the operand is subtracted from the contents of theaccumulator. The result is stored in the accumulator. The arithmetic flagsare set. The accumulator contents and word operands are alwaysinterpreted as signed 16 bit fixed point numbers, byte operands areunsigned.
Overflow:If an overflow occurs (if the result exceeds +32786 or falls below -32786),the value “FFFFH” (corresponding to “-1”) is entered in the auxiliaryaccumulator. The contents of the accumulator is then invalid!
This operation may not be followed by an operation that is dependent onthe RLO.
Permitted operandsAB/AW, EB/EW, DL, DR, DW, KB, KF, MB/MW, ZW
Example
-
- KB 028 ////Subtract 28 from contentsof accumulator
3-31Programming Manual PSS WIN-PRO
IL
Multiplication[Operand] * [Accumulator] => [Accumulator], [Auxiliary accumulator]
DescriptionThe contents of the operand is multiplied by the contents of theaccumulator. The accumulator contents and word operands are alwaysinterpreted as signed 16 bit fixed point numbers, byte operands areunsigned. The result is a signed 32 bit fixed point number. The low word isstored in the accumulator, the signed high word in the auxiliaryaccumulator. The arithmetic flags are set.
This operation may not be followed by an operation that is dependent onthe RLO.
Permitted operandsAB/AW, EB/EW, DL, DR, DW, KB, KF, MB/MW, ZW
Example
* EB 04.08 //////
Multiply contents ofaccumulator by contentsof input byte EB04.08
*
IL
3-32 Programming Manual PSS WIN-PRO
Division[Accumulator] : [Operand] => [Accumulator], [Auxiliary accumulator]
DescriptionThe contents of the accumulator is divided by the contents of the operand.The accumulator contents and word operands are always interpreted assigned 16 bit fixed point numbers, byte operands are unsigned. The resultis also a signed 16 bit fixed point number. The remainder from the divisionis stored in the auxiliary accumulator. The arithmetic flags are set.
This operation may not be followed by an operation that is dependent onthe RLO.
Permitted operandsAB/AW, EB/EW, DL, DR, DW, KB, KF, MB/MW, ZW
Example
:
: EB 04.08 //////
Divide contents ofaccumulator by contentsof input byte EB04.08
3-33Programming Manual PSS WIN-PRO
ILAND
KH 52EE //
////
AND-link contents ofaccumulator and constant52EE
Logic operations
Bitwise AND operation (bytes/words)[Accumulator] AND [Operand] => [Accumulator]
DescriptionThe contents of the accumulator and the contents of the operand are AND-linked bit by bit.If the operand is a byte, it is linked with the accumulator’s low byte. Theaccumulator’s high byte remains unchanged. If the operand is a word, all16 bits of the operand and accumulator are linked.The result of the AND operation will be “1” if both bits equal “1”. If one ofthe bits or both bits equal “0”, the result will be “0”.
Example: 11110000 01011100AND 01010010 11101110= 01010000 01001100
This operation may not be followed by an operation that is dependent onthe RLO.
Permitted operandsAB/AW, EB/EW, DL, DR, DW, KH, KM, MB/MW
Example
AND
IL
3-34 Programming Manual PSS WIN-PRO
OR KH 52EE //////
OR-link contents ofaccumulator and constant52EE
Bitwise OR operation (bytes/words)[Accumulator] OR [Operand] => [Accumulator]
DescriptionThe contents of the accumulator and the contents of the operand are OR-linked bit by bit.If the operand is a byte, it is linked with the accumulator’s low byte. Theaccumulator’s high byte remains unchanged. If the operand is a word, all16 bits of the operand and accumulator are linked.The result of the logic OR operation will be “1” if one of the bits or both bitsequal “1”. If both bits equal “0”, the result will be “0”.
Example: 11110000 01011100OR 01010010 11101110= 11110010 11111110
This operation may not be followed by an operation that is dependent onthe RLO.
Permitted operandsAB/AW, EB/EW, DL, DR, DW, KH, KM, MB/MW
Example
OR
3-35Programming Manual PSS WIN-PRO
IL
XOR KH 52EE //////
EXCLUSIVE OR-linkcontents of accumulatorand constant 52EE
Bitwise EXCLUSIVE OR operation (bytes/words)[Accumulator] EXCLUSIVE OR [Operand] => [Accumulator]
DescriptionThe contents of the accumulator and the contents of the operand areEXCLUSIVE OR-linked bit by bit.If the operand is a byte, it is linked with the accumulator’s low byte. Theaccumulator’s high byte remains unchanged. If the operand is a word, all16 bits of the operand and accumulator are linked.The result of the EXCLUSIVE OR operation will be “1” if both bits aredifferent. If both bits are the same, the result will be “0”.
Example: 11110000 01011100XOR 01010010 11101110= 10100010 10110010
This operation may not be followed by an operation that is dependent onthe RLO.
Permitted operandsAB/AW, EB/EW, DL, DR, DW, KH, KM, MB/MW
Example
XOR
IL
3-36 Programming Manual PSS WIN-PRO
Form a one’s complement (invert)Invert [Accumulator]
DescriptionA one’s complement is formed from the contents of the accumulator,inverting bit by bit.
This operation may not be followed by an operation that is dependent onthe RLO.
Permitted operandsNone
ExampleKEW // Invert accumulator
Contents of the accumulator before KEW: 10010010 10110000Result in the accumulator after KEW: 01101101 01001111
KEW
3-37Programming Manual PSS WIN-PRO
IL
Shift and rotate operations
Rotate left[Accumulator] rotate n times to the left => [Accumulator]
DescriptionThe contents of the accumulator is rotated left n times. n is the number ofrotation cycles (0 ... 15). Bits that drop out on the left (Bit 15) are read inagain on the right (Bit 0).
This operation may not be followed by an operation that is dependent onthe RLO.
Permitted operandsNumber of rotation cycles, 0 ... 15
Example
RL 3 // Rotate accumulator 3 times to the// left
Contents of the accumulatorbefore RL 3: 10010010 10110000
00100101 01100001 1st rotation01001010 11000010 2nd rotation
Result in the accumulatorafter RL 3: 10010101 10000100 3rd rotation
RL
IL
3-38 Programming Manual PSS WIN-PRO
Rotate right[Accumulator] rotate n times to the right => [Accumulator]
DescriptionThe contents of the accumulator is rotated right n times. n is the number ofrotation cycles (0 ... 15). Bits that drop out on the right (Bit 0) are read inagain on the left (Bit 15).
This operation may not be followed by an operation that is dependent onthe RLO.
Permitted operandsNumber of rotation cycles, 0 ... 15
ExampleRR 3 // Rotate accumulator 3 times to the right
Contents of the accumulatorbefore RR 3: 10010010 10110000
01001001 01011000 1st rotation00100100 10101100 2nd rotation
Result in the accumulatorafter RR 3: 00010010 01010110 3rd rotation
RR
3-39Programming Manual PSS WIN-PRO
IL
SLV Shift left[Accumulator] <-- [RLO] shift n times to the left
DescriptionThe contents of the accumulator is shifted left n times. n is the number ofshift operations (0 ... 15). The status of the RLO is read into Bit 0.
Permitted operands:Number of shift operations, 0 ... 15
Example
SLV 3 // Shift accumulator 3 times to the// left
Contents of the accumulatorbefore SLV 3: 10010010 10110000Contents of the RLObefore SLV 3: 1
00100101 01100001 1st shift,Bit 0 = 1 (RLO)
01001010 11000011 2nd shiftBit 0 = 1 (RLO)
Result in the accumulatorafter SLV 3: 10010101 10000111 3rd shift
Bit 0 = 1 (RLO)
IL
3-40 Programming Manual PSS WIN-PRO
Shift right[RLO] --> [Accumulator] shift n times to the right
DescriptionThe contents of the accumulator is shifted right n times. n is the number ofshift operations (0 ... 15). The status of the RLO is read into Bit 15.
Permitted operandsNumber of shift operations, 0 ... 15
Example
SRV 3 // Shift accumulator 3 times to the// right
Contents of the accumulatorbefore SRV 3: 10010010 10110000Contents of the RLObefore SLV 3: 1
11001001 01011000 1st shift,Bit 15 = 1 (RLO)
11100100 10101100 2nd shift,Bit 15 = 1 (RLO)
Result in the accumulatorafter SRV 3: 11110010 01010110 3rd shift,
Bit 15 = 1 (RLO)
SRV
3-41Programming Manual PSS WIN-PRO
IL
TA Transpose accumulator and auxiliary accumulator[Accumulator] <=> [Auxiliary accumulator]
DescriptionThe contents of the accumulator and the auxiliary accumulator aretransposed.
This operation may not be followed by an operation that is dependent onthe RLO.
Permitted operandsNone
ExampleTA // Transpose contents of accumulator
// and contents of auxiliary accumulator
Contents of the accumulator before TA: 10010010 10110000Contents of the auxiliary accumulator before TA: 00001111 00001111
Result in the accumulator after TA: 00001111 00001111Result in auxiliary accumulator after TA: 10010010 10110000
IL
3-42 Programming Manual PSS WIN-PRO
Jump operations
Unconditional jump
Description A jump to the stated label is always carried out, irrespective of thecontents of the accumulator or RLO. An unconditional jump only makessense in a segment that it is processed conditionally.Jumps are only permitted within a block. A block may contain a maximumof 300 jumps.
Permitted operandsLabel preceded by “=”, example “=xxx”
Example
SPA
SEG 0L MB 064.00 //!= KH 0001 //SPB =M2 //. //. //. //. //.I MB 064.00 //SPA =M1 //
//////
SEG 1...
This section of thesegment is processeduntil MB064.00 equalsKH0001. The RLO will then= 1, triggering aconditional jump to label"M2".
As long as the contentsof MB064.00 is notKH0001, MB064.00 isincremented, followed bya jump to label "M1".
M1:
M2:
3-43Programming Manual PSS WIN-PRO
IL
Conditional jump
DescriptionA jump to the stated label is only carried out if the status of the RLOequals “1”.If the status of the RLO is “0”, the jump command is not performed and theRLO is set to “1”.Jumps are only permitted within a block. A block may contain a maximumof 300 jumps.
Permitted operandsLabel preceded by “=”, example “=xxx”
Example
SPB
SEG 0L MB 064.00 //!= KH 0001 //SPB =M2 //. //. //. //. //.I MB 064.00 //SPA =M1 //
//////
SEG 1...
This section of thesegment is processeduntil MB064.00 equalsKH0001. The RLO will then= 1, triggering aconditional jump to label"M2".
As long as the contentsof MB064.00 is notKH0001, MB064.00 isincremented, followed bya jump to label "M1".
M1:
M2:
IL
3-44 Programming Manual PSS WIN-PRO
Organisational operations
Select data block
Description This operation selects a data block. All subsequent operations that relateto a data word will use this block.
Permitted operandsDB
Example
A DB 025 //L DW 0100 //
Data word 100 of datablock DB025 is loaded
A
3-45Programming Manual PSS WIN-PRO
IL
Unconditional block call
DescriptionAn unconditional block call activates the PB, FB or SB stated as operand.Processing of the current block will be interrupted and the called block willbe processed. The contents of the RLO, accumulator and auxiliaryaccumulator is unchanged by the call; any data block selected is retained.The contents of the RLO, accumulator and auxiliary accumulator can bechanged within the called block and a different data block can be selected.When the called block has been processed, the contents of the RLO,accumulator and auxiliary accumulator will be retained, but the DBselected before the CAL operation will automatically be reselected. Theoperation following the CAL operation will now be performed.
When the “CAL” operation has been entered, the block header of thestated block is inserted into the program text. If the block contains formalparameters, these must be replaced by actual parameters, i.e. they mustbe assigned operands. The operands are simply added to the formalparameter’s connection lines. They must conform to the type required bythe formal parameter.
This operation may not be followed by an operation that is dependent onthe RLO.
Permitted operandsFB, PB, SB
Example
CAL
L E 01.00CAL PB 010 //
////
L MW 64.00
The current block isinterrupted and PB010 isprocessed
IL
3-46 Programming Manual PSS WIN-PRO
Conditional block call
DescriptionA conditional block call only activates a block if the status of the RLOequals “1”.A conditional block call activates the PB, FB or SB stated as operand.Processing of the current block will be interrupted and the called block willbe processed. The contents of the RLO, accumulator and auxiliaryaccumulator is unchanged by the call; any data block selected is retained.The contents of the RLO, accumulator and auxiliary accumulator can bechanged within the called block and a different data block can be selected.When the called block has been processed, the contents of the RLO,accumulator and auxiliary accumulator will be retained, but the DBselected before the CALC operation will automatically be reselected. Theoperation following the CALC operation will now be performed.
When the “CALC” operation has been entered, the block header of thestated block is inserted into the program text. If the block contains formalparameters, these must be replaced by actual parameters, i.e. they mustbe assigned operands. The operands are simply added to the formalparameter’s connection lines. They must conform to the type required bythe formal parameter.
This operation may not be followed by an operation that is dependent onthe RLO.
Permitted operandsFB, PB, SB
Example
CALC
L E 01.00 ////
CALC PB 010 //////
L MW 64.00
Load status of inputE01.00 into the RLO.The current block isinterrupted and PB010 isprocessed if RLO = 1
3-47Programming Manual PSS WIN-PRO
IL
Block end
DescriptionThe “BE” operation is the final operation within a block. When the “BE”operation occurs within a called block, the program will jump back to theblock that initiated the call.
Permitted operandsNone
Start of segment
DescriptionThis operation marks the start of a segment. It consists of the “SEG”operator and the number of the segment.A label may be entered before the segment operation. The label is used asthe target in jump operations. The label may be a maximum of 14characters and may not contain spaces or colons. The label must befollowed by a colon.
There is no need to enter “SEG” and the number when programming; youonly need to enter “***”. This will automatically be replaced by “SEG” andthe correct number.
Permitted operandsSegment number
Example
Label Segment operationxxx: SEG 13
BE
SEG
IL
3-48 Programming Manual PSS WIN-PRO
Disable alarms
Description The “AS” operation disables the alarms on modules with alarmcapabilities. Alarms are detected and stored but are not triggered.Disabling the alarms can prevent a program section being interrupted at apoint where this would not be desirable.A max. of 32 alarms can be stored. If this limit is exceeded, the PSS willswitch to a STOP condition. The alarms must be re-enabled before thenext cycle change (“AF” operation), otherwise an error message will betriggered and the PSS will switch to a STOP condition.
INFORMATIONThis operation is only available in the FS section.
Permitted operandsNone
Enable alarms
DescriptionRe-enables the alarms that were disabled through the “AS” operation.Stored alarms will be triggered.
INFORMATIONThis operation is only available in the FS section.
Permitted operandsNone
AS
AF
3-49Programming Manual PSS WIN-PRO
IL
BAS
STP
Shut down outputs
DescriptionFS section: The “BAS” operation is used to shut down the digital outputsin the FS section. All outputs receive the status 0. When this command hasbeen issued, it is possible to continue working in the user program until thenext cycle. At the next cycle change the self check will detect an error,because the process image of outputs will no longer match the outputs.For this reason you should program a STOP operation (“STP”) before thecycle change.Usage: To shut down the outputs when an error has been detected, thentransfer data to the ST section.
ST section: The “BAS” operation is used to shut down the digital outputsin the ST section. All outputs receive the status 0.
Permitted operandsNone
Stop program
DescriptionThe “STP” operation stops the program running in the FS / ST section.Organisation block OB128 (FS) or OB028 (ST) will be run. The user pro-gram can only be restarted by a PSS cold start.
Permitted operandsNone
IL
3-50 Programming Manual PSS WIN-PRO
Notes
4-1Programming Manual PSS WIN-PRO
LD
Programming in LD
In the LD programming language (ladder diagram), all operations areshown graphically.
LD
Fig. 4-1: Networks
The basic principle of LD is the description of the power flow throughindividual networks.
Networks
A network may be compared to a current path that runs between twopower rails. The power rails correspond to the vertical boundary lines in thegraphic. The left power rail has logic status 1 (“voltage present”); it is fromhere that the “current” is fed to the right power rail, via graphic elements.Graphic elements can include coils and contacts connected in series or in
LD
4-2 Programming Manual PSS WIN-PRO
parallel. However, graphic elements with several inputs and outpus mayalso be added. These elements each have a bit input and a bit output,which are used to incorporate them into the current path. The other inputsand outputs may be of any type, e.g. byte or even word.
The processing sequence on a network is from top to bottom and from leftto right.
On the graphic elements, the operand is placed above the element and thesymbol below the element.
Network comment
In LD, any comment may be entered before each network. Comments areshown in green. A comment may be a maximum of 16000 characters. Ablock may not contain more than 64000 characters of comment in total.
Labels
A “label” may be entered before a network. The label is used as the targetin jump operations. The label may be a maximum of 14 characters andmay not contain spaces or colons.
Segments
Blocks can be sub-divided into a max. of 64 segments. Each segment maycomprise several networks.The first segment (Segment: –) begins at the start of the block and ends atthe first label. If there is no label, it finishes at the end of the block.Additional segments (Segment: 0, Segment: 1, ...) extend from one label tothe next. The last segment finishes at the end of the block.
When a new label is inserted, the numbering of the segments is updatedautomatically.
4-3Programming Manual PSS WIN-PRO
LD
RLO
The status of the current path is stored in the “RLO” memory (result oflogic operation). The RLO is “1” when the current path is live and “0” whenit is not live.The RLO is used for all bit operations, but can also be influenced by someother operations, e.g. compare operations. There are also operations whichare RLO-dependent, i.e. they are only performed when the RLO has aparticular status (e.g. the “jump” operation).
LD
4-4 Programming Manual PSS WIN-PRO
Graphic elements in LD
INFORMATIONIf you wish to program operations that are not available in LD, you can alsoenter IL or FBD networks within an LD block.The next time the block is opened, PSS WIN-PRO will check whether thenetwork can be displayed in LD; if it can, it will change the display to LD. IfLD cannot be used but FBD can, the network will be shown in FBD.
Overview
Graphic element Description
Bit operations
N/O contact
N/C contact
Set
Reset
Store
Store NOT
Page
4-8
4-9
4-10
4-10
4-10
4-11
��
��
�
��
�
��
��
��
4-5Programming Manual PSS WIN-PRO
LD
Timers and counters
Start timer
Increment counter (count forwards)
Decrement counter (count backwards)
Byte/word operations
“Greater than” comparison (8 bit, unsigned)
“Greater than” comparison (16 bit, signed)
“Equals” comparison (8 bit, unsigned)
4-12
4-15
4-15
4-16
4-17
4-18
����
��
�����
��
Graphic element Description Page
��
��
��
��
���
��
����
���
���
��
����
���
���
��
��
���
LD
4-6 Programming Manual PSS WIN-PRO
���
��
“Equals” comparison (16 bit, signed)
“Less than” comparison (8 bit, unsigned)
Less than” comparison (16 bit, signed)
Jump operations
Unconditional jump
Conditional jump
Organisational operations
Select data block
Unconditional block call
Conditional block call
4-18
4-19
4-19
4-20
4-20
4-20
4-21
4-21
Graphic element Description Page
���
��
���
��
���
��
����
���
���
��
����
���
���
��
��
���
����
��
����
��
4-7Programming Manual PSS WIN-PRO
LDSB001
SB003
SB007
SB011
SB015
SB041
Disable alarms
Enable alarms
Shut down outputs
Stop program
CRC calculation
CRC calculation
32 bit arithmetic
Addition
Subtraction
Multiplication
Division
Comparison
4-22
4-22
4-23
4-23
SeeChapter 6
Graphic element Description Page
��
��
��
���
LD
4-8 Programming Manual PSS WIN-PRO
RLO
0101
Result in RLO
0001
Operand
0011
Bit operations
N/O contact[Operand] AND [RLO] => [RLO]
DescriptionThis graphic element is a N/O contact with positive logic (“1” is closed, “0”is open). In other words, if the status of the stated operand is “1”, the valueon the right of the N/O contact will always equal the value on the left. If thestatus of the stated operand is “0”, the value on the right will always be “0”.This corresponds to an AND-link between the RLO and the status of theoperand.
Permitted operandsA, E, M, T, Z
��
4-9Programming Manual PSS WIN-PRO
LD
N/C contact[Operand negated] AND [RLO] => [RLO]
DescriptionThis graphic element is a N/C contact with positive logic (“1” is open, “0” isclosed). In other words, if the status of the stated operand is “0”, the valueon the right of the N/C contact will always equal the value on the left. If thestatus of the stated operand is “1”, the value on the right will always be “0”.This corresponds to an AND-link between the RLO and the status of theoperand.
Permitted operandsA, E, M, T, Z
��
RLO
0101
Result in RLO
0100
Operand
0011
LD
4-10 Programming Manual PSS WIN-PRO
�
��Set[Operand] = 1, if RLO = 1
DescriptionIf there is a “1” to the left of the coil symbol, the stated operand will also beset to “1”. If there is a “0” on the left, the operand will be unchanged.
Permitted operandsA, M
Reset[Operand] = 0, if RLO = 1
DescriptionIf there is a “1” to the left of the coil symbol, the stated operand will bereset to “0”. If there is a “0” on the left, the operand will be unchanged.If the operand is a timer, the timer’s status bit is reset. If the operand is acounter, the status bit of the counter and the counter word are both reset.The counter is locked as a result of the reset. To enable the counter tocontinue, the “R” operation must be reapplied to the counter. There mustbe a “0” to the left of the coil symbol.
Permitted operandsA, M, T, Z
Store[RLO] => [Operand]
DescriptionThe value to the left of the coil symbol is stored in the stated operand.
Permitted operandsA, M
�
��
��
4-11Programming Manual PSS WIN-PRO
LD
Store NOT[RLO negated] => [Operand]
DescriptionThe value to the left of the coil symbol is inverted and then stored in thestated operand.
Permitted operandsA, M
��
LD
4-12 Programming Manual PSS WIN-PRO
����
��
�����
��
Timers and counters
Start timer
Operand
Op. Details of timer and time baseExample: T064.3
Parameters
Start Start timerStart = 0 -> 1: Timer is started, timer status is setStart = 1 -> 0: Timer status is reset
Range Time valueValue range: 1 ... 32767
DescriptionThe “SD” block is used to create a switch-on delay using a timer.
Timer: FS: T064 ... 127ST: T000 ... 063
The switch-on delay arises as follows:
Time = Time value x Time base
Time value: Any value in the range 1 ... 32767
Time base: 0 corresponds to 50 ms1 corresponds to 100 ms2 corresponds to 1 s3 corresponds to 10 s4 corresponds to 1 min
The time value is transferred to the Range parameter. The time base andtimer are stated as operands.The timer is inserted directly on to the right power rail.
4-13Programming Manual PSS WIN-PRO
LD
Sequence:The timer is started as soon as Start switches from “0” to “1”. The timerstatus is then “0” (see Fig. 4-2, ).Once the switch-on delay has elapsed, the timer status is set to “1” ( ).A falling edge at Start will reset the timer status ( ).The timer can also be reset using the “R” coil ( ). If the RLO before the “R”coil is set permanently to “1”, it will not be possible to start the timer ( ).
The timer status can be polled using a contact; in this case the timer isstated as an operand (e.g. T127).It is even possible to read the FS section timers from the ST section.
Permitted operands
� �
� � � � � �
Start
RLO before“R” coil
Timer running
Timer status
t = programmed time
Fig. 4-2: Timing diagram
Op.
Start
Range
T plus time base (0, 1, 2, 3 or 4)Example: T064.3
A, E, M, T, Z
AW, EW, PW, DW, KC, KF, KH, KM, KY, MW, XW, ZW
LD
4-14 Programming Manual PSS WIN-PRO
ExampleTimer T127 is used to implement a switch-on delay of 300 ms(time base = 1, time value = 3).
4-15Programming Manual PSS WIN-PRO
LD
Increment counter (count forwards)
DescriptionIf there is a “1” to the left of the coil symbol, the counter stated as operandwill be incremented. If there is a “0” on the left, the counter will beunchanged.
Counters: FS: Z064 ... 127ST: Z000 ... 063
The current counter status is located in the ZW counter word that correspondsto the counter (e.g. counter Z064 in counter word ZW064). The counter statuscan accept the values -32768 ... +32767. If counter status 32767 is reached,counting will continue at -32768.
The counter status indicates whether the counter status is greater than orless than/equal to “0”. The counter status will be “1” if the counter status isgreater than “0”. The counter status can be polled under the counter’saddress (e.g. Z064).
The counter can be reset using the “Reset” coil “ (counter status = 0, counterword = 0). The counter must be unlocked after the reset, see “R” operation.
Permitted operandsZ (FS: Z064 ... 127; ST: Z000 ... 063)
Decrement counter (count backwards)
DescriptionIf there is a “1” to the left of the coil symbol, the counter stated as operandwill be decremented. If there is a “0” on the left, the counter will beunchanged.
Counters: FS: Z064 ... 127ST: Z000 ... 063
The current counter status is located in the ZW counter word that correspondsto the counter (e.g. counter Z064 in counter word ZW064). The counter statuscan accept the values -32768 ... +32767. If counter status 32767 is reached,counting will continue at -32768.
��
��
��
��
LD
4-16 Programming Manual PSS WIN-PRO
���
��
����
���
IN1
IN2
OUT
AB, EB, PB, DL, DR, KB, MB
AB, EB, DL, DR, KB, MB
Current path
The counter status indicates whether the counter status is greater than orless than/equal to “0”. The counter status will be “1” if the counter status isgreater than “0”. The counter status can be polled under the counter’saddress (e.g. Z064).
The counter can be reset using the “Reset” coil (counter status = 0, counterword = 0). The counter must be unlocked after the reset, see “R” operation.
Permitted operandsZ (FS: Z064 ... 127; ST: Z000 ... 063)
Byte/word operations
Compare operations
“Greater than” comparison (8 bit, unsigned)[IN1] > [IN2] => [OUT] = 1
Parameters
IN1, IN2 Bytes that are to be compared
OUT ResultOut = 1: IN1 > IN2
DescriptionIN1 and IN2 are compared. If IN1 is greater than IN2, Out is set to “1”.The comparison is inserted directly on to the left power rail.
Permitted operands
4-17Programming Manual PSS WIN-PRO
LD
���
��
����
���
“Greater than” comparison (16 bit, signed)[IN1] > [IN2] => [OUT] = 1
Parameters
IN1, IN2 Words that are to be compared
OUT ResultOut = 1: IN1 > IN2
DescriptionIN1 and IN2 are compared. If IN1 is greater than IN2, Out is set to “1”.The comparison is inserted directly on to the left power rail.
Permitted operands
IN1
IN2
OUT
AW, EW, PW, DW, KC, KF, KH, KM, KY, MW, XW, ZW
AW, EW, DW, KC, KF, KH, KM, KY, MW, ZW
Current path
LD
4-18 Programming Manual PSS WIN-PRO
“Equals” comparison (8 bit, unsigned)[IN1] = [IN2] => [OUT] = 1
Parameters
IN1, IN2 Bytes that are to be compared
OUT ResultOut = 1: IN1 = IN2
DescriptionIN1 and IN2 are compared. If IN1 and IN2 are equal, Out is set to “1”.The comparison is inserted directly on to the left power rail.
Permitted operands
“Equals” comparison (16 bit, signed)[IN1] = [IN2] => [OUT] = 1
Parameters
IN1, IN2 Words that are to be compared
OUT ResultOut = 1: IN1 = IN2
DescriptionIN1 and IN2 are compared. If IN1 and IN2 are equal, Out is set to “1”.The comparison is inserted directly on to the left power rail.
Permitted operands
���
��
��
���
���
��
��
���
IN1
IN2
OUT
AB, EB, PB, DL, DR, KB, MB
AB, EB, DL, DR, KB, MB
Current path
IN1
IN2
OUT
AW, EW, PW, DW, KC, KF, KH, KM, KY, MW, XW, ZW
AW, EW, DW, KC, KF, KH, KM, KY, MW, ZW
Current path
4-19Programming Manual PSS WIN-PRO
LD
���
��
����
���
“Less than” comparison (8 bit, unsigned)[IN1] < [IN2] => [OUT] = 1
Parameters
IN1, IN2 Bytes that are to be compared
OUT ResultOut = 1: IN1 < IN2
DescriptionIN1 and IN2 are compared. If IN1 is less than IN2, Out is set to “1”.The comparison is inserted directly on to the left power rail.
Permitted operands
“Less than” comparison (16 bit, signed)[IN1] < [IN2] => [OUT] = 1
Parameters
IN1, IN2 Words that are to be compared
OUT ResultOut = 1: IN1 < IN2
DescriptionIN1 and IN2 are compared. If IN1 is less than IN2, Out is set to “1”.The comparison is inserted directly on to the left power rail.
Permitted operands
���
��
����
���
IN1
IN2
OUT
AB, EB, PB, DL, DR, KB, MB
AB, EB, DL, DR, KB, MB
Current path
IN1
IN2
OUT
AW, EW, PW, DW, KC, KF, KH, KM, KY, MW, XW, ZW
AW, EW, DW, KC, KF, KH, KM, KY, MW, ZW
Current path
LD
4-20 Programming Manual PSS WIN-PRO
���
��
Jump operations
Unconditional jump
DescriptionA jump to the stated label is always carried out.Jumps are only permitted within a block. A block may contain a maximumof 300 jumps.
Permitted operandsLabel preceded by “=”, example “=xxx”
Conditional jump
DescriptionIf there is a “1” to the left of the coil symbol, a jump to the stated label willbe carried out.Jumps are only permitted within a block. A block may contain a maximumof 300 jumps.
Permitted operandsLabel preceded by “=”, example “=xxx”
Organisational operations
Select data block
DescriptionThis operation selects a data block. All subsequent operations that relateto a data word will use this block.
Permitted operandsDB
���
��
����
��
4-21Programming Manual PSS WIN-PRO
LD
���
�� Unconditional block call
DescriptionThe block call activates the PB, FB or SB stated as operand. Processing ofthe current block will be interrupted and the called block will be processed.
A different data block can be selected from within the called block. Whenthe called block has been processed, the DB selected before the CALoperation will automatically be reselected.
When “CAL” is inserted into a network, the block header of the stated blockis displayed. If the block contains formal parameters, these must bereplaced by actual parameters, i.e. they must be assigned operands. Theoperands are simply added to the formal parameter’s connection lines.They must conform to the type required by the formal parameter.
Permitted operandsFB, PB, SB
Conditional block call
DescriptionIf there is a “1” to the left of the coil symbol, the block call will activate thePB, FB or SB stated as operand. Processing of the current block will beinterrupted and the called block will be processed.
A different data block can be selected from within the called block. Whenthe called block has been processed, the DB selected before the CALoperation will automatically be reselected.
When “CALC” is inserted into a network, the block header of the statedblock is displayed. If the block contains formal parameters, these must bereplaced by actual parameters, i.e. they must be assigned operands. Theoperands are simply added to the formal parameter’s connection lines.They must conform to the type required by the formal parameter.
Permitted operandsFB, PB, SB
����
��
LD
4-22 Programming Manual PSS WIN-PRO
��
��
Disable alarms
Description“ID” disables the alarms on modules with alarm capabilities. Alarms aredetected and stored but are not triggered. Disabling the alarms canprevent a program section being interrupted at a point where this would notbe desirable.A max. of 32 alarms can be stored. If this limit is exceeded, the PSS willswitch to a STOP condition. The alarms must be re-enabled before thenext cycle change (“IE” operation), otherwise an error message will betriggered and the PSS will switch to a STOP condition.
INFORMATIONThis operation is only available in the FS section.
Permitted operandsNone
Enable alarms
Description“IE” is used to re-enables the alarms that were disabled through “ID”.Stored alarms will be triggered.
INFORMATIONThis operation is only available in the FS section.
Permitted operandsNone
4-23Programming Manual PSS WIN-PRO
LD
��
���
Shut down outputs
DescriptionFS section: “OFF” is used to shut down the digital outputs in the FSsection. All outputs receive the status “0”. When this command has beenissued, it is possible to continue working in the user program until the nextcycle. At the next cycle change the self check will detect an error, becausethe process image of outputs will no longer match the outputs. For thisreason you should program a STOP operation (“STOP”) before the cyclechange.Usage: To shut down the outputs when an error has been detected, thentransfer data to the ST section.
ST section: “OFF” is used to shut down the digital outputs in the STsection. All outputs receive the status 0.
Permitted operandsNone
Stop program
Description“STOP” halts the program running in the FS / ST section. Organisationblock OB128 (FS) or OB028 (ST) will be run. The user program can onlybe restarted by a PSS cold start.
Permitted operandsNone
LD
4-24 Programming Manual PSS WIN-PRO
Notes
5-1Programming Manual PSS WIN-PRO
FB
D
Programming in FBD
In the FBD programming language (function block diagram), all operationsare shown graphically.
FBD
Individual program sequences are shown as networks.
Networks
Within a network, all the operations are shown using the graphic elementsof the FBD programming language.Graphic elements in FBD are execution control squares and symbols(jumps), which are connected within a network via horizontal and verticallines.
Fig. 5-1: Networks
FBD
5-2 Programming Manual PSS WIN-PRO
On the graphic elements, the operand is placed in the upper field and thesymbol in the lower field above the element.
Network comment
In FBD, any comment may be entered before each network. Commentsare shown in green. A comment may be a maximum of 16000 characters.A block may not contain more than 64000 characters of comment in total.
Labels
A “label” may be entered before a network. The label is used as the targetin jump operations. The label may be a maximum of 14 characters andmay not contain spaces or colons.
Segments
Blocks can be sub-divided into a max. of 64 segments. Each segment maycomprise several networks.The first segment (Segment: –) begins at the start of the block and ends atthe first label. If there is no label, it finishes at the end of the block.Additional segments (Segment: 0, Segment: 1, ...) extend from one label tothe next. The last segment finishes at the end of the block.
When a new label is inserted, the numbering of the segments is updatedautomatically.
5-3Programming Manual PSS WIN-PRO
FB
D
RLO
The “RLO” memory (result of logic operation) is one bit wide. The RLO isused for all bit operations, but can also be influenced by some otheroperations, e.g. compare operations. There are also operations which areRLO-dependent, i.e. they are only performed when the RLO has aparticular status (e.g. the jump operation “Conditional jump”).
FBD
5-4 Programming Manual PSS WIN-PRO
Graphic elements in FBD
INFORMATIONIf you wish to program operations that are not available in FBD, you canalso enter IL networks within an FBD block.The next time the block is opened, PSS WIN-PRO will check whether thenetwork can be displayed in FBD; if it can, it will change the display to FBD.
Overview
Graphic element Description
Bit operations
Input
Inverted input
AND operation
OR operation
Set
Reset
Store
Page
5-12
5-12
5-12
5-13
5-13
5-14
5-14
�
�
�
��
�
��
��
��
5-5Programming Manual PSS WIN-PRO
FB
D
Store NOT
SR Flip-Flop
RS Flip-Flop
Timers and counters
Start timer
Increment counter (count forwards)
Decrement counter (count backwards)
Byte/word operations
Store
5-14
5-15
5-16
5-17
5-20
5-21
5-22
Graphic element Description Page
��
��
���
��
� �
��
�
��
� �
��
�
��
��
��
��
��
����
��
�����
��
FBD
5-6 Programming Manual PSS WIN-PRO
Convert byte to word
Convert word to byte
Convert BCD figure to binary
Convert binary figure to BCD
“Greater than” comparison (8 bit, unsigned)
“Greater than” comparison (16 bit, signed)
“Equals” comparison (8 bit, unsigned)
“Equals” comparison (16 bit, signed)
5-23
5-23
5-24
5-25
5-26
5-26
5-27
5-27
��� ��
����
���
Graphic element Description Page
��� ��
����
���
��� ��
��
���
��� ��
��
���
�� ��
�������
�� ��
���
�� ��
�������
�� ��
���
5-7Programming Manual PSS WIN-PRO
FB
D
“Less than” comparison (8 bit, unsigned)
“Less than” comparison (16 bit, signed)
Increment operands
Increment
Decrement operands
Decrement
Form a two’s complement (negate)
Addition
5-28
5-28
5-29
5-30
5-31
5-32
5-33
5-34
��� ��
����
���
��� ��
����
���
������
��
Graphic element Description Page
�� ��
���
�����
��
�� ��
��
�� ��
��
��� ��
�����
���
FBD
5-8 Programming Manual PSS WIN-PRO
Graphic element Description Page
Subtraction
Multiplication
Division
Bitwise AND operation (bytes)
Bitwise AND operation (words)
Bitwise OR operation (bytes)
Bitwise OR operation (words)
5-35
5-36
5-37
5-38
5-39
5-40
5-40
��� ���
�����
��� ���
��� ��
�����
���
��� ��
�����
���
��� ��
����
���
��� ��
����
���
���
�����
���
��
��� ���
�����
��� ���
5-9Programming Manual PSS WIN-PRO
FB
D
Graphic element Description Page
��� ��
�����
���
��� ��
�����
���
Bitwise EXCLUSIVE OR operation (bytes)
Bitwise EXCLUSIVE OR operation (words)
Form a one's complement (invert)
Rotate left
Rotate right
Shift left
Shift right
5-41
5-42
5-43
5-44
5-45
5-46
5-47
�� ��
���
�� ��
���
�
�� ��
���
�
��
�
��
���
����
��
�
��
���
����
FBD
5-10 Programming Manual PSS WIN-PRO
Graphic element Description Page
Jump operations
Unconditional jump
Conditional jump
Organisational operations
Select data block
Unconditional block call
Conditional block call
Disable alarms
Enable alarms
5-48
5-48
5-49
5-49
5-50
5-51
5-51
���
��
���
��
���
��
����
��
����
��
��
�
5-11Programming Manual PSS WIN-PRO
FB
D
Graphic element Description Page
SB001
SB003
SB007
SB011
SB015
SB041
Shut down outputs
Stop program
CRC calculation
CRC calculation
32 bit arithmetic
Addition
Subtraction
Multiplication
Division
Comparison
5-52
5-52
SeeChapter 6
���
����
FBD
5-12 Programming Manual PSS WIN-PRO
Bit operations
Input
DescriptionInput of an element. The status of the input is passed to the elementunchanged.Additional inputs may only be inserted with logic AND-/OR operations.
Permitted operandsA, E, M, T, Z
Inverted input
DescriptionThe status of the input is inverted.Inputs positioned between two elements may not be inverted.Additional inverted inputs may only be inserted with logic AND-/ORoperations.
Permitted operandsA, E, M, T, Z
AND operation
DescriptionThe operands at the inputs are AND-linked. The result is copied to theRLO.A maximum of 510 inputs are possible. The operands can be negatedbefore they are linked. Such inputs are identified by the negation symbol
.
Permitted operandsA, E, M, T, Z
�
5-13Programming Manual PSS WIN-PRO
FB
D
�
��
ExampleThe status of input E1.0 and the negated status of E1.1 are AND-linked.The result is “1”, if the status of E1.0 is “1” and the status of E1.1 is “0”.
�
����
����
���� �
OR operation
DescriptionThe operands at the inputs are OR-linked. The result is copied to the RLO.A maximum of 510 inputs are possible. The operands can be negatedbefore they are linked. Such inputs are identified by the negation symbol
.
Permitted operandsA, E, M, T, Z
ExampleThe status of input E1.0 and the negated status of E1.1 are OR-linked. Theresult is “1”, if the status of E1.0 is “1” and/or the status of E1.1 is “0”.
�����
����
����
Set[Operand] = 1, if RLO = 1
DescriptionIf there is a “1” at the input, the stated operand will also be set to “1”. Ifthere is a “0” at the input, the operand will be unchanged.
Permitted operandsA, M
FBD
5-14 Programming Manual PSS WIN-PRO
Reset[Operand] = 0, if RLO = 1
DescriptionIf there is a “1” at the input, the stated operand will be reset to “0”. If thereis a “0” at the input, the operand will be unchanged.If the operand is a timer, the timer’s status bit is reset. If the operand is acounter, the status bit of the counter and the counter word are both reset.The counter is locked as a result of the reset. To enable the counter tocontinue, the “R” operation must be reapplied to the counter. There mustbe a “0” at the input.
Permitted operandsA, M, T, Z
Store[RLO] => [Operand]
DescriptionThe value at the input is stored in the stated operand.
Permitted operandsA, M
Store NOT[RLO negated] => [Operand]
DescriptionThe value at the input is negated and then stored in the stated operand.
Permitted operandsA, M
�
��
��
��
���
��
5-15Programming Manual PSS WIN-PRO
FB
D
SR Flip-Flop
Operand
Op. Operand in which the result (Q) is stored
Parameters
S Set input
R Reset input
Q Result
Description
Depending on inputs S and R, output Q is set or reset and the status of Qstored in the stated operand. This is a Flip-Flop with overriding reset.
Permitted operands
� �
��
�
��
S
0
0
1
1
R
0
1
0
1
Q (Op.)
No change
0
1
0
S
R
Q (Op.)
A, E, M, T, Z
A, E, M, T, Z
A, M, T, Z
FBD
5-16 Programming Manual PSS WIN-PRO
RS Flip-Flop
Operand
Op. Operand in which the result (Q) is stored
Parameters
S Set input
R Reset input
Q Result
Description
Depending on inputs S and R, output Q is set or reset and the status of Qstored in the stated operand. This is a Flip-Flop with overriding set.
Permitted operands
� �
��
�
��
S
R
Q (Op.)
A, E, M, T, Z
A, E, M, T, Z
A, M, T, Z
S
0
0
1
1
R
0
1
0
1
Q (Op.)
No change
0
1
1
5-17Programming Manual PSS WIN-PRO
FB
D
Timers and counters
Start timer
Operand
Op. Details of timer and time baseExample: T064.3
Parameters
Start Start timerStart = 0 -> 1: Timer is started, timer status is setStart = 1 -> 0: Timer status is reset
Range Time valueValue range: 1 ... 32767
DescriptionThe “SD” block is used to create a switch-on delay using a timer.
Timer: FS: T064 ... 127ST: T000 ... 063
The switch-on delay arises as follows:
Time = Time value x Time base
Time value: Any value in the range 1 ... 32767
Time base: 0 corresponds to 50 ms1 corresponds to 100 ms2 corresponds to 1 s3 corresponds to 10 s4 corresponds to 1 min
The time value is transferred to the Range parameter. The time base andtimer are stated as operands.
����
��
�����
��
FBD
5-18 Programming Manual PSS WIN-PRO
Sequence:The timer is started as soon as Start switches from “0” to “1”. The timerstatus is then “0” (see Fig. 5-2, ).Once the switch-on delay has elapsed, the timer status is set to “1” ( ).A falling edge at Start will reset the timer status ( ).The timer can also be reset using the “Reset” (R) operation ( ). If theoperand for the “Reset” operation is set permanently to “1”, it will not bepossible to start the timer ( ).
The timer status can be polled under the timer’s address (e.g. T127).It is even possible to read the FS section timers from the ST section.
Permitted operands
� �
� � � � � �
Start
Op. of "Reset"operation
Timer running
t = programmed time
Fig. 5-2: Timing diagram
Timer status
Op.
Start
Range
T plus time base (0, 1, 2, 3 or 4)Example: T064.3
A, E, M, T, Z
AW, EW, PW, DW, KC, KF, KH, KM, KY, MW, XW, ZW
5-19Programming Manual PSS WIN-PRO
FB
D
ExampleTimer T127 is used to implement a switch-on delay of 300 ms(time base = 1, time value = 3).
FBD
5-20 Programming Manual PSS WIN-PRO
Increment counter (count forwards)
DescriptionIf there is a “1” at the input, the counter stated as operand will beincremented. If there is a “0” at the input, the counter will be unchanged.
Counters: FS: Z064 ... 127ST: Z000 ... 063
The current counter status is located in the ZW counter word that corre-sponds to the counter (e.g. counter Z064 in counter word ZW064). Thecounter status can accept the values -32768 ... +32767. If counter status32767 is reached, counting will continue at -32768.
The counter status indicates whether the counter status is greater than orless than/equal to “0”. The counter status will be “1” if the counter status isgreater than “0”. The counter status can be polled under the counter’saddress (e.g. Z064).
The counter can be reset using the “Reset” (R) operation (counter status =0, counter word = 0). The counter must be unlocked after the reset, see “R”operation.
Permitted operandsZ (FS: Z064 ... 127; ST: Z000 ... 063)
��
��
5-21Programming Manual PSS WIN-PRO
FB
D
Decrement counter (count backwards)
DescriptionIf there is a “1” at the input, the counter stated as operand will bedecremented. If there is a “0” at the input, the counter will be unchanged.
Counters: FS: Z064 ... 127ST: Z000 ... 063
The current counter status is located in the ZW counter word that corre-sponds to the counter (e.g. counter Z064 in counter word ZW064). Thecounter status can accept the values -32768 ... +32767. If counter status32767 is reached, counting will continue at -32768.
The counter status indicates whether the counter status is greater than orless than/equal to “0”. The counter status will be “1” if the counter status isgreater than “0”. The counter status can be polled under the counter’saddress (e.g. Z064).
The counter can be reset using the “Reset” (R) operation (counter status =0, counter word = 0). The counter must be unlocked after the reset, see “R”operation.
Permitted operandsZ (FS: Z064 ... 127; ST: Z000 ... 063)
��
��
FBD
5-22 Programming Manual PSS WIN-PRO
Byte/word operations
Load and transfer operations
INFORMATIONFBD does not have a graphic element for loading bytes and words. Byteand word operands are written directly on to the blocks’ connection lines orabove the block.
Store[Current value] => [Operand]
DescriptionThe current value is stored in the operand.This operation is required to transfer the output parameters from graphicelements to operands.This operation is not required with function and standard function blocksbecause the operands are written directly on the outputs’ connection lines.
Permitted operandsByte and word operands that are permitted as output parameters for thepreceding graphic element.
Example
��
��
��
�� !���
�� ��
����"#���
5-23Programming Manual PSS WIN-PRO
FB
D
Convert operations
Convert byte to wordByte => Word
Parameters
IN Byte
OUT Word
Description8 zeros are added to the byte operand at IN, to form a word. Example:
IN 10010110OUT 00000000 10010110
Permitted operands
Convert word to byteWord => Byte
Parameters
IN Word
OUT Byte
DescriptionThe first 8 bits of the word operand at IN are deleted, to form a byte.Example:
IN 10010111 10010110OUT 10010110
Permitted operands
�� ��
���
IN
OUT
AB, EB, PB, DL, DR, KB, MB
AW, EW, PW, DW, MW, XW, ZW
IN
OUT
AW, EW, PW, DW, KC, KF, KH, KM, KY, MW, XW, ZW
AB, EB, PB, DL, DR, MB
�� ��
���
FBD
5-24 Programming Manual PSS WIN-PRO
Convert BCD figure to binaryBCD => Binary
INFORMATIONThis block is only available in the ST section.
Parameters
IN BCD figure
OUT Binary figure
DescriptionThe operand at IN is interpreted as a BCD figure and converted intobinary. Example:
IN 0000 0001 0010 1000OUT 0000 0001 0000 0000
Permitted operands
IN
OUT
AW, EW, PW, DW, KC, KF, KH, KM, KY, MW, XW, ZW
AW, EW, PW, DW, MW, XW, ZW
�� ��
�������
5-25Programming Manual PSS WIN-PRO
FB
D
Convert binary figure to BCDBinary => BCD
INFORMATIONThis block is only available in the ST section.
Parameters
IN Binary figureOUT BCD figure
DescriptionThe operand at IN is interpreted as a binary figure and converted intoBCD. Example:
IN 0000 0001 0000 0000OUT 0000 0001 0010 1000
Permitted operands
IN
OUT
AW, EW, PW, DW, KC, KF, KH, KM, KY, MW, XW, ZW
AW, EW, PW, DW, MW, XW, ZW
�� ��
�������
FBD
5-26 Programming Manual PSS WIN-PRO
Compare operations
“Greater than” comparison (8 bit, unsigned)[IN1] > [IN2] => [OUT] = 1
Parameters
IN1, IN2 Bytes that are to be compared
OUT ResultOut = 1: IN1 > IN2
DescriptionIN1 and IN2 are compared. If IN1 is greater than IN2, Out is set to “1”.
Permitted operands
“Greater than” comparison (16 bit, signed)[IN1] > [IN2] => [OUT] = 1
Parameters
IN1, IN2 Words that are to be compared
OUT ResultOut = 1: IN1 > IN2
DescriptionIN1 and IN2 are compared. If IN1 is greater than IN2, Out is set to “1”.
Permitted operands
IN1
IN2
OUT
AB, EB, PB, DL, DR, KB, MB
AB, EB, DL, DR, KB, MB
A, M
��� ��
����
���
IN1
IN2
OUT
AW, EW, PW, DW, KC, KF, KH, KM, KY, MW, XW, ZW
AW, EW, DW, KC, KF, KH, KM, KY, MW, ZW
A, M
��� ��
����
���
5-27Programming Manual PSS WIN-PRO
FB
D
“Equals” comparison (8 bit, unsigned)[IN1] = [IN2] => [OUT] = 1
Parameters
IN1, IN2 Bytes that are to be compared
OUT ResultOut = 1: IN1 = IN2
DescriptionIN1 and IN2 are compared. If IN1 and IN2 are equal, Out is set to “1”.
Permitted operands
“Equals” comparison (16 bit, signed)[IN1] = [IN2] => [OUT] = 1
Parameters
IN1, IN2 Words that are to be compared
OUT ResultOut = 1: IN1 = IN2
DescriptionIN1 and IN2 are compared. If IN1 and IN2 are equal, Out is set to “1”.
Permitted operands
��� ��
��
���
��� ��
��
���
IN1
IN2
OUT
AW, EW, PW, DW, KC, KF, KH, KM, KY, MW, XW, ZW
AW, EW, DW, KC, KF, KH, KM, KY, MW, ZW
A, M
IN1
IN2
OUT
AB, EB, PB, DL, DR, KB, MB
AB, EB, DL, DR, KB, MB
A, M
FBD
5-28 Programming Manual PSS WIN-PRO
“Less than” comparison (8 bit, unsigned)[IN1] < [IN2] => [OUT] = 1
Parameters
IN1, IN2 Bytes that are to be compared
OUT ResultOut = 1: IN1 < IN2
DescriptionIN1 and IN2 are compared. If IN1 is less than IN2, Out is set to “1”.
Permitted operands
“Less than” comparison (16 bit, signed)[IN1] < [IN2] => [OUT] = 1
Parameters
IN1, IN2 Words that are to be compared
OUT ResultOut = 1: IN1 < IN2
DescriptionIN1 and IN2 are compared. If IN1 is less than IN2, Out is set to “1”.
Permitted operands
IN1
IN2
OUT
AW, EW, PW, DW, KC, KF, KH, KM, KY, MW, XW, ZW
AW, EW, DW, KC, KF, KH, KM, KY, MW, ZW
A, M
��� ��
����
���
IN1
IN2
OUT
AB, EB, PB, DL, DR, KB, MB
AB, EB, DL, DR, KB, MB
A, M
��� ��
����
���
5-29Programming Manual PSS WIN-PRO
FB
D
Arithmetic operations
Increment operands[Operand] +1 => [Operand]
DescriptionThe contents of the operand is increased by one.
Overflows
• Overflow when incrementing byte operands:255 +1 = 0An overflow occurs if the contents of the operand is “255”. Afterincrementing, the contents of the operand is “0”.
• Overflow when incrementing word operands:+32.767 +1 = -32.768An overflow occurs if the contents of the operand is “+32.767”. Afterincrementing, the contents of the operand is “-32.768”.
Permitted operandsAB/AW, DW, MB/MW
������
��
FBD
5-30 Programming Manual PSS WIN-PRO
Increment[IN] + 1 => [OUT]
Parameters
IN Value that is to be incremented
OUT Result
DescriptionThe contents of IN is increased by one and assigned to OUT.
Overflows
• Overflow when incrementing byte operands:255 +1 = 0An overflow occurs if IN equals “255”. After incrementing, OUT equals“0”.
• Overflow when incrementing word operands:+32.767 +1 = -32.768An overflow occurs if IN equals “+32.767”. After incrementing, OUTequals “-32.768”.
IN and OUT must be of the same type, i.e. both bytes or both words.
Permitted operands
IN
OUT
AB/AW, EB/EW, PB/PW, DL, DR, DW, KB, KC, KF, KH,KM, KY, MB/MW, XW, ZW
AB/AW, EB/EW, PB/PW, DL, DR, DW, MB/MW, XW, ZW
�� ��
���
5-31Programming Manual PSS WIN-PRO
FB
D
Decrement operands[Operand] -1 => [Operand]
DescriptionThe contents of the operand is decreased by one.
Overflows
• Overflow when decrementing byte operands:0 - 1 = 255An overflow occurs if the contents of the operand is “0”. Afterdecrementing, the contents of the operand is “255”.
• Overflow when decrementing word operands:-32.768 - 1 = +32.767An overflow occurs if the contents of the operand is “-32.768”. Afterdecrementing, the contents of the operand is “+32.767”.
Permitted operandsAB/AW, DW, MB/MW
�����
��
FBD
5-32 Programming Manual PSS WIN-PRO
Decrement[IN] -1 => [OUT]
Parameters
IN Value that is to be decremented
OUT Result
Description
Overflows
• Overflow when decrementing byte operands:0 - 1 = 255An overflow occurs if IN equals “0”. After decrementing, OUT equals“255”.
• Overflow when decrementing word operands:-32.768 - 1 = +32.767An overflow occurs if IN equals “-32.768”. After decrementing, OUTequals “32.767”.
IN and OUT must be of the same type, i.e. both bytes or both words.
Permitted operands
�� ��
��
IN
OUT
AB/AW, EB/EW, PB/PW, DL, DR, DW, KB, KC, KF, KH,KM, KY, MB/MW, XW, ZW
AB/AW, EB/EW, PB/PW, DL, DR, DW, MB/MW, XW, ZW
5-33Programming Manual PSS WIN-PRO
FB
D
Form a two’s complement (negate)Negate [IN] => [OUT]
Parameters
IN: Value for which the two’s complement is to be formed
OUT: Result
DescriptionA two’s complement is formed from IN, inverting bit by bit. The result isincremented.Forming a two’s complement corresponds to multiplying a fixed pointnumber by -1. Example:
IN: 10010010 10110000OUT: 01101101 01010000
IN and OUT must be of the same type, i.e. both bytes or both words.
Permitted operands
�� ��
��
IN
OUT
AB/AW, EB/EW, PB/PW, DL, DR, DW, KB, KC, KF, KH,KM, KY, MB/MW, XW, ZW
AB/AW, EB/EW, PB/PW, DL, DR, DW, MB/MW, XW, ZW
FBD
5-34 Programming Manual PSS WIN-PRO
Addition[IN1] + [IN2] => [OUT]
Parameters
IN1 Addend 1
IN2 Addend 2
OUT Result
DescriptionIN1 and IN2 are added. IN1 and IN2 are interpreted as signed 16 bit fixedpoint numbers. The result is stored in OUT. The arithmetic flags are set. Ifthe arithmetic flag M110.01 is set, an overflow has occurred and the resultis invalid.
Permitted operands
IN1
IN2
OUT
AW, EW, PW, DW, KC, KF, KH, KM, KY, MW, XW, ZW
AB/AW, EB/EW, DL, DR, DW, KB, KF, MB/MW, ZW
AW, EW, PW, DW, MW, XW, ZW
��� ��
�����
���
5-35Programming Manual PSS WIN-PRO
FB
D
Subtraction[IN1] - [IN2] => [OUT]
Parameters
IN1 Minuend
IN2 Subtrahend
OUT Result
DescriptionIN2 is subtracted from IN1. IN1 and IN2 are interpreted as signed 16 bitfixed point numbers. The result is stored in OUT. The arithmetic flags areset. If the arithmetic flag M110.01 is set, an overflow has occurred and theresult is invalid.
Permitted operands
���
�����
���
��
IN1
IN2
OUT
AW, EW, PW, DW, KC, KF, KH, KM, KY, MW, XW, ZW
AB/AW, EB/EW, DL, DR, DW, KB, KF, MB/MW, ZW
AW, EW, PW, DW, MW, XW, ZW
FBD
5-36 Programming Manual PSS WIN-PRO
Multiplication[IN1] * [IN2] => [OUT1], [OUT2]
Parameters
IN1 Multiplicand
IN2 Multiplier
OUT1 Result, low word
OUT2 Result, high word
DescriptionIN1 and IN2 are multiplied. IN1 and IN2 are interpreted as signed 16 bitfixed point numbers. The result is a signed 32 bit fixed point number. Thelow word is stored in OUT1, the signed high word in OUT2. The arithmeticflags are set.
Permitted operands
��� ���
�����
��� ���
IN1
IN2
OUT1, OUT2
AW, EW, PW, DW, KC, KF, KH, KM, KY, MW, XW, ZW
AB/AW, EB/EW, DL, DR, DW, KB, KF, MB/MW, ZW
AW, EW, PW, DW, MW, XW, ZW
5-37Programming Manual PSS WIN-PRO
FB
D
Division[IN1] : [IN2] => [OUT1], [OUT2]
Parameters
IN1 Dividend
IN2 Divisor
OUT1 Result
OUT2 Remainder from the division
DescriptionIN1 is divided by IN2. IN1 and IN2 are interpreted as signed 16 bit fixedpoint numbers. The result OUT1 is also a signed 16 bit fixed point number.The remainder from the division is stored in OUT2. The arithmetic flags areset.
Permitted operands
��� ���
�����
��� ���
IN1
IN2
OUT1, OUT2
AW, EW, PW, DW, KC, KF, KH, KM, KY, MW, XW, ZW
AB/AW, EB/EW, DL, DR, DW, KB, KF, MB/MW, ZW
AW, EW, PW, DW, MW, XW, ZW
FBD
5-38 Programming Manual PSS WIN-PRO
Logic operations
Bitwise AND operation (bytes)[IN1] AND [IN2] => [OUT]
Parameters
IN1 Byte 1
IN2 Byte 2
OUT Result
DescriptionIN1 and IN2 are AND-linked bit by bit.The result of the AND operation will be “1” if both bits equal “1”. If one ofthe bits or both bits equal “0”, the result will be “0”.
Example: IN1 11110000IN2 01010010OUT 01010000
Permitted operands
��� ��
�����
���
IN1
IN2
OUT
AB, EB, PB, DL, DR, KB, MB
AB, EB, DL, DR, MB
AB, EB, PB, DL, DR, MB
5-39Programming Manual PSS WIN-PRO
FB
D
Bitwise AND operation (words)[IN1] AND [IN2] => [OUT]
Parameters
IN1 Word 1
IN2 Word 2
OUT Result
DescriptionIN1 and IN2 are AND-linked bit by bit.The result of the AND operation will be “1” if both bits equal “1”. If one ofthe bits or both bits equal “0”, the result will be “0”.
Example: IN1 11110000 01011100IN2 01010010 11101110OUT 01010000 01001100
Permitted operands
��� ��
�����
���
IN1
IN2
OUT
AW, EW, PW, DW, KC, KF, KH, KM, KY, MW, XW, ZW
AW, EW, DW, KH, KM, MW
AW, EW, PW, DW, MW, XW, ZW
FBD
5-40 Programming Manual PSS WIN-PRO
Bitwise OR operation (bytes)[IN1] OR [IN2] => [OUT]
Parameters
IN1 Byte 1
IN2 Byte 2
OUT Result
DescriptionIN1 and IN2 are OR-linked bit by bit.The result of the logic OR operation will be “1” if one of the bits or both bitsequal “1”. If both bits equal “0”, the result will be “0”.
Example: IN1 11110000IN2 01010010OUT 11110010
Permitted operands
Bitwise OR operation (words)[IN1] OR [IN2] => [OUT]
Parameters
IN1 Word 1
IN2 Word 2
OUT Result
DescriptionIN1 and IN2 are OR-linked bit by bit.The result of the logic OR operation will be “1” if one of the bits or both bitsequal “1”. If both bits equal “0”, the result will be “0”.
��� ��
����
���
IN1
IN2
OUT
AB, EB, PB, DL, DR, KB, MB
AB, EB, DL, DR, MB
AB, EB, PB, DL, DR, MB
��� ��
����
���
5-41Programming Manual PSS WIN-PRO
FB
D
Example: IN1 11110000 01011100IN2 01010010 11101110OUT 11110010 11111110
Permitted operands
Bitwise EXCLUSIVE OR operation (bytes)[IN1] EXCLUSIVE OR [IN2] => [OUT]
Parameters
IN1 Byte 1
IN2 Byte 2
OUT Result
DescriptionIN1 and IN2 are EXCLUSIVE OR-linked bit by bit.The result of the EXCLUSIVE OR operation will be “1” if both bits aredifferent. If both bits are the same, the result will be “0”.
Example: IN1 11110000IN2 01010010OUT 10100010
Permitted operands
IN1
IN2
OUT
AW, EW, PW, DW, KC, KF, KH, KM, KY, MW, XW, ZW
AW, EW, DW, KH, KM, MW
AW, EW, PW, DW, MW, XW, ZW
��� ��
�����
���
IN1
IN2
OUT
AB, EB, PB, DL, DR, KB, MB
AB, EB, DL, DR, MB
AB, EB, PB, DL, DR, MB
FBD
5-42 Programming Manual PSS WIN-PRO
Bitwise EXCLUSIVE OR operation (words)[IN1] EXCLUSIVE OR [IN2] => [OUT]
Parameters
IN1 Word 1
IN2 Word 2
OUT Result
DescriptionIN1 and IN2 are EXCLUSIVE OR-linked bit by bit.The result of the EXCLUSIVE OR operation will be “1” if both bits aredifferent. If both bits are the same, the result will be “0”.
Example: IN1 11110000 01011100IN2 01010010 11101110OUT 10100010 10110010
Permitted operands
��� ��
�����
���
IN1
IN2
OUT
AW, EW, PW, DW, KC, KF, KH, KM, KY, MW, XW, ZW
AW, EW, DW, KH, KM, MW
AW, EW, PW, DW, MW, XW, ZW
5-43Programming Manual PSS WIN-PRO
FB
D
Form a one’s complement (invert)Invert [IN] => [OUT]
Parameters
IN Value that is to be inverted
OUT Result
DescriptionA one’s complement is formed from the contents of IN, inverting bit by bit.
Example: IN 10010010 10110000OUT 01101101 01001111
IN and OUT must be of the same type, i.e. both bytes or both words.
Permitted operands
�� ��
���
IN
OUT
AB/AW, EB/EW, PB/PW, DL, DR, DW, KB, KC, KF, KH,KM, KY, MB/MW, XW, ZW
AB/AW, EB/EW, PB/PW, DL, DR, DW, MB/MW, XW, ZW
FBD
5-44 Programming Manual PSS WIN-PRO
Shift and rotate operations
Rotate left[IN] rotate n times to the left => [OUT]
Parameters
IN Value that is to be rotated
N Number of rotation cyclesValue range: 0 ... 15
OUT Result
DescriptionIN is rotated n times to the left. N is the number of rotation cycles (0 ... 15).Bits that drop out on the left (Bit 15) are read in again on the right (Bit 0).
IN and OUT must be of the same type, i.e. both bytes or both words.
Example: N = 3, IN is a word
IN 10010010 1011000000100101 01100001 1st rotation01001010 11000010 2nd rotation
OUT 10010101 10000100 3rd rotation
Example: N = 3, IN is a byte
IN xxxxxxxx 10110000xxxxxxx1 0110000x 1st rotationxxxxxx10 110000xx 2nd rotation
OUT xxxxx101 10000xxx 3rd rotation
If IN is a byte, bits will be inserted whose status is unknown (x).
Permitted operands
�� ��
���
�
IN
N
OUT
AB/AW, EB/EW, PB/PW, DL, DR, DW, KB, KC, KF, KH,KM, KY, MB/MW, XW, ZW
0 ... 15
AB/AW, EB/EW, PB/PW, DL, DR, DW, MB/MW, XW, ZW
5-45Programming Manual PSS WIN-PRO
FB
D
Rotate right[IN] rotate n times to the right => [OUT]
Parameters
IN Value that is to be rotated
N Number of rotation cyclesValue range: 0 ... 15
OUT Result
DescriptionIN is rotated n times to the right. N is the number of rotation cycles(0 ... 15). Bits that drop out on the right (Bit 0) are read in again on the left(Bit 15).
IN and OUT must be of the same type, i.e. both bytes or both words.
Example: N = 3, IN is a word
IN 10010010 1011000001001001 01011000 1st rotation00100100 10101100 2nd rotation
OUT 00010010 01010110 3rd rotation
Example: N = 3, IN is a byte
IN xxxxxxxx 101100000xxxxxxx x1011000 1st rotation00xxxxxx xx101100 2nd rotation
OUT 000xxxxx xxx10110 3rd rotation
If IN is a byte, bits will be inserted whose status is unknown (x).
Permitted operands
�� ��
���
�
IN1
N
OUT
AB/AW, EB/EW, PB/PW, DL, DR, DW, KB, KC, KF, KH,KM, KY, MB/MW, XW, ZW
0.. 15
AB/AW, EB/EW, PB/PW, DL, DR, DW, MB/MW, XW, ZW
FBD
5-46 Programming Manual PSS WIN-PRO
Shift left[IN] <-- [FILL] shift n times to the left
Parameters
IN Value that is to be shifted
FILL Status that is to be written into the newly available Bit 0 duringthe shift operation
N Number of shift operationsValue range: 0 ... 15
OUT Result
DescriptionIN is shifted n times to the left. N is the number of shift operations (0 ... 15).FILL is written in Bit 0.
IN and OUT must be of the same type, i.e. both bytes or both words.
Example: N = 3, FILL = 1, IN is a word
IN 10010010 1011000000100101 01100001 1st shift01001010 11000011 2nd shift
OUT 10010101 10000111 3rd shift
Example: N = 3, FILL = 1, IN is a byte
IN xxxxxxxx 10110000xxxxxxx1 01100001 1st shiftxxxxxx10 11000011 2nd shift
OUT xxxxx101 10000111 3rd shift
Permitted operands
��
�
��
���
����
IN
FILL
N
OUT
AB/AW, EB/EW, PB/PW, DL, DR, DW, KB, KC, KF, KH,KM, KY, MB/MW, XW, ZW
A, E, M, T, Z
0... 15
AB/AW, EB/EW, PB/PW, DL, DR, DW, MB/MW, XW, ZW
5-47Programming Manual PSS WIN-PRO
FB
D
Shift right[FILL] --> [IN] shift n times to the right
Parameters
IN Value that is to be shifted
FILL Status that is to be written into the newly available Bit 15 duringthe shift operation
N Number of shift operationsValue range: 0 ... 15
OUT Result
DescriptionIN is shifted n times to the right. N is the number of shift operations(0 ... 15). FILL is written in Bit 15.
IN and OUT must be of the same type, i.e. both bytes or both words.
Example: N = 3, FILL = 1, IN is a word
IN 10010010 1011000011001001 01011000 1st shift11100100 10101100 2nd shiftOUT11110010 01010110 3rd shift
Example: N = 3, FILL = 1, IN is a byte
IN xxxxxxxx 101100001xxxxxxx x1011000 1st shift11xxxxxx xx101100 2nd shiftOUT111xxxxx xxx10110 3rd shift
If IN is a byte, bits will be inserted whose status is unknown (x).
Permitted operands
��
�
��
���
����
IN
FILL
N
OUT
AB/AW, EB/EW, PB/PW, DL, DR, DW, KB, KC, KF, KH,KM, KY, MB/MW, XW, ZW
A, E, M, T, Z
0 ... 15
AB/AW, EB/EW, PB/PW, DL, DR, DW, MB/MW, XW, ZW
FBD
5-48 Programming Manual PSS WIN-PRO
Jump operations
Unconditional jump
DescriptionA jump to the stated label is always carried out, irrespective of the contentsof the RLO. An unconditional jump only makes sense in a network that it isprocessed conditionally.Jumps are only permitted within a block. A block may contain a maximumof 300 jumps.
Permitted operandsLabel preceded by “=”, example “=xxx”
Conditional jump
DescriptionA jump to the stated label is only carried out if the status of the RLOequals “1”.If the status of the RLO is “0”, the jump command is not performed and theRLO is set to “1”.Jumps are only permitted within a block. A block may contain a maximumof 300 jumps.
Permitted operandsLabel preceded by “=”, example “=xxx”
���
��
����
��
5-49Programming Manual PSS WIN-PRO
FB
D
Organisational operations
Select data block
DescriptionThis operation selects a data block. All subsequent operations that relateto a data word will use this block.
Permitted operandsDB
Unconditional block call
DescriptionAn unconditional block call activates the PB, FB or SB stated as operand.Processing of the current block will be interrupted and the called block willbe processed.
A different data block can be selected from within the called block. Whenthe called block has been processed, the DB selected before the CALoperation will automatically be reselected.
When “CAL” is inserted into a network, the block header of the stated blockis displayed. If the block contains formal parameters, these must bereplaced by actual parameters, i.e. they must be assigned operands. Theoperands are simply added to the formal parameter’s connection lines.They must conform to the type required by the formal parameter.
Permitted operandsFB, PB, SB
���
��
���
��
FBD
5-50 Programming Manual PSS WIN-PRO
Conditional block call
DescriptionA conditional block call only activates a block if the status of the RLOequals “1”.A conditional block call activates the PB, FB or SB stated as operand.Processing of the current block will be interrupted and the called block willbe processed.
A different data block can be selected from within the called block. Whenthe called block has been processed, the DB selected before the CALoperation will automatically be reselected.
When “CAL” is inserted into a network, the block header of the stated blockis displayed. If the block contains formal parameters, these must bereplaced by actual parameters, i.e. they must be assigned operands. Theoperands are simply added to the formal parameter’s connection lines.They must conform to the type required by the formal parameter.
Permitted operandsFB, PB, SB
����
��
5-51Programming Manual PSS WIN-PRO
FB
D
Disable alarms
Description“ID” disables the alarms on modules with alarm capabilities. Alarms aredetected and stored but are not triggered. Disabling the alarms canprevent a program section being interrupted at a point where this would notbe desirable.A max. of 32 alarms can be stored. If this limit is exceeded, the PSS willswitch to a STOP condition. The alarms must be re-enabled before thenext cycle change (“IE” operation), otherwise an error message will betriggered and the PSS will switch to a STOP condition.
INFORMATIONThis operation is only available in the FS section.
Permitted operandsNone
Enable alarms
Description“IE” is used to re-enables the alarms that were disabled through “ID”.Stored alarms will be triggered.
INFORMATIONThis operation is only available in the FS section.
Permitted operandsNone
��
�
FBD
5-52 Programming Manual PSS WIN-PRO
Shut down outputs
DescriptionFS section: “OFF” is used to shut down the digital outputs in the FSsection. All outputs receive the status “0”. When this command has beenissued, it is possible to continue working in the user program until the nextcycle. At the next cycle change the self check will detect an error, becausethe process image of outputs will no longer match the outputs. For thisreason you should program a STOP operation (“STOP”) before the cyclechange.Usage: To shut down the outputs when an error has been detected, thentransfer data to the ST section.
ST section: “OFF” is used to shut down the digital outputs in the STsection. All outputs receive the status 0.
Permitted operandsNone
Stop program
Description“STOP” halts the program running in the FS / ST section. Organisationblock OB128 (FS) or OB028 (ST) will be run. The user program can onlybe restarted by a PSS cold start.
Permitted operandsNone
���
����
6-1Programming Manual PSS WIN-PRO
Standard function blocks are supplied with PSS WIN-PRO. Standardfunction blocks for the FS section can be found in the installation directoryin the “PSSBLOCKS\FS” folder; standard function blocks for the ST sectionare in the “PSSBLOCKS\ST” folder.These SBs must be imported into the project before they can be called.Standard function blocks for the FS and ST section often have the samenumber and function, but they are not identical.
Predefined SBs
Predefined SBs
6-2 Programming Manual PSS WIN-PRO
���� ��$
�������������
�"���������
���
��
"""�
Overview
%�� �&
�������� !�
%��%��%��
%'(�%'�%'�
))��
����
%�� %'(�
�������� !�
%��%��%��
%'*%''%'�
))��
����
%'� �
%�� �&
����!��� !�
%��%��%��
%'(�%'�%'�
))��
����
6-4
6-6
6-8
6-10
Graphic element Description Page
CRC calculation
32 bit arithmetic
Addition
Subtraction
Multiplication
6-3Programming Manual PSS WIN-PRO
%�� ��$�
���"���� !�
%��%��%��
"����
&%)
%�� �&
����#��� !�
%��%��%��
��+%'(�%*(�
))))
����
%'�%'�%*�
���
%*� �
Division
Comparison
6-12
6-14
Graphic element Description Page
Predefined SBs
6-4 Programming Manual PSS WIN-PRO
CRC calculation
INFORMATIONSB001 is only available for the FS section.
DescriptionStandard function block SB001 is used to calculate the CRC via data andflag ranges. Using this block, up to five CRC calculations can be made inone cycle. The maximum run time per call is 2 ms.The CRC calculation is made on the basis of the generator polynomial1021
H with the start value FFFF
H.
B: Byte parameter; W: Word parameter
Parameters
SSNR Number of call,Value range: 0 ... 255
DBNR Data block number of data range over which the CRC sum is tobe calculated; only if parameter STRT = DL or DR (if STRT =MB: DBNR is irrelevant)Value range: 10 ... 255
STRT Start address of data range over which the CRC sum is to becalculated.Value ranges:MB64.00 ... MB99.24,MB100.00 ... MB109.24 (only on PSS with an FS operatingsystem version ≥ 49),MB130.00 ... MB255.24 (only on PSS with an FS operatingsystem version ≥ 49),DL0 ... DL1023, DR0 ... DR1023
���� ��$
�������������
�"���������
���
��
"""�
SB001
6-5Programming Manual PSS WIN-PRO
CNT Number of bytes over which the CRC sum is to be calculated.Value range: > 0
ERG ResultERG = 2: CRC calculation incomplete,another call is required.ERG = 4: CRC calculation is complete.ERG = 16: Error, because CNT = 0
CRC CRC sum, when ERG = 4
Permitted operands
Permitted operands
AB, EB, PB, DL, DR, KB, MB
AW, EW, PW, DW, KC, KF, KH, KM, KY, MW, XW, ZW
AW, EW, PW, DW, MW, XW, ZW
Parameter
SSNR, DBNR,STRT
CNT
ERG, CRC
Predefined SBs
6-6 Programming Manual PSS WIN-PRO
SB003
%�� �&
����!��� !�
%��%��%��
%'(�%'�%'�
))��
����
Addition
DescriptionStandard function block SB003 adds two signed 32 bit fixed point numbers(-2.147.483.648 ... +2.147.483.647).SB003 is supplied with PSS WIN-PRO. It is stored in the“PSSBLOCKS\FS” (FS section) or “PSSBLOCKS\ST” (ST section) folder inthe installation path and must be imported into the project before it can becalled.The standard function blocks for the FS and ST section have the samenumber and function, but are not identical.
W: Word parameter; X: Bit parameter
Parameters
Z12 Addend 1, high word (15 bit + sign)
Z11 Addend 1, low word (16 bit)
Z22 Addend 2, high word (15 bit + sign)
Z21 Addend 2, low word (16 bit)
OV Overflow
OV = 1: An overflow has occurred (the result exceeds+2.147.483.647 or falls below -2.147.483.648); the result istherefore invalid.Z32 and Z31 are set to “0”.
OV = 0: No overflow has occurred; the result is valid.
Z3=0 Compare the sum with “0”Z3=0 = 1: The sum is “0”Z3=0 = 0: The sum does not equal “0”
Z32 Sum, high word (15 bit + sign)
Z31 Sum, low word (16 bit)
6-7Programming Manual PSS WIN-PRO
Permitted operands
Permitted operands
EW, PW (in ST section only), DW, KF, KH, KM, MW, XW, ZW
A, M
AW, PW (in ST section only), DW, MW, XW, ZW
Parameters
Z11, Z12,Z21, Z22
OV, Z3=0
Z31, Z32
Predefined SBs
6-8 Programming Manual PSS WIN-PRO
Subtraction
DescriptionStandard function block SB007 subtracts two signed 32 bit fixed pointnumbers (-2.147.483.648 ... +2.147.483.647).SB007 is supplied with PSS WIN-PRO. It is stored in the“PSSBLOCKS\FS” (FS section) or “PSSBLOCKS\ST” (ST section) folder inthe installation path and must be imported into the project before it can becalled.The standard function blocks for the FS and ST section have the samenumber and function, but are not identical.
W: Word parameter; X: Bit parameter
Parameters
Z12 Minuend, high word (15 bit + sign)
Z11 Minuend, low word (16 bit)
Z22 Subtrahend, high word (15 bit + sign)
Z21 Subtrahend, low word (16 bit)
OV Overflow
OV = 1: An overflow has occurred (the result exceeds+2.147.483.647 or falls below -2.147.483.648); the result istherefore invalid.Z32 and Z31 are set to “0”.
OV = 0: No overflow has occurred; the result is valid.
Z3=0 Compare the difference with “0”Z3=0 = 1: The difference is “0”Z3=0 = 0: The difference does not equal “0”
SB007
%�� �&
�������� !�
%��%��%��
%'(�%'�%'�
))��
����
6-9Programming Manual PSS WIN-PRO
Z32 Difference, high word (15 bit + sign)
Z31 Difference, low word (16 bit)
Permitted operands
Permitted operands
EW, PW (in ST section only), DW, KF, KH, KM, MW, XW, ZW
A, M
AW, PW (in ST section only), DW, MW, XW, ZW
Parameters
Z11, Z12,Z21, Z22
OV, Z3=0
Z31, Z32
Predefined SBs
6-10 Programming Manual PSS WIN-PRO
Multiplication
DescriptionStandard function block SB011 multiplies two signed 32 bit fixed pointnumbers (-2.147.483.648 ... +2.147.483.647). The result is a signed 64 bitfixed point number.SB011 is supplied with PSS WIN-PRO. It is stored in the“PSSBLOCKS\FS” (FS section) or “PSSBLOCKS\ST” (ST section) folder inthe installation path and must be imported into the project before it can becalled.The standard function blocks for the FS and ST section have the samenumber and function, but are not identical.
W: Word parameter; X: Bit parameter
Parameters
Z12 Multiplicand, high word (15 bit + sign)
Z11 Multiplicand, low word (16 bit)
Z22 Multiplier, high word (15 bit + sign)
Z21 Multiplier, low word (16 bit)
Z3=0 Compare the product with “0”Z3=0 = 1: The product is “0”Z3=0 = 0: The product does not equal “0”
Z34 Product, bit 48 ... 63 (15 bit + sign)
Z33 Product, bit 32 ... 47 (16 bit)
Z32 Product, bit 16 ... 31 (16 bit)
Z31 Product, bit 0 ... 15 (16 bit)
SB011
%�� %'(�
�������� !�
%��%��%��
%'*%''%'�
))��
����
%'� �
6-11Programming Manual PSS WIN-PRO
Permitted operands
Permitted operands
EW, PW (in ST section only), DW, KF, KH, KM, MW, XW, ZW
A, M
AW, PW (in ST section only), DW, MW, XW, ZW
Parameters
Z11, Z12,Z21, Z22
OV, Z3=0
Z31, Z32,Z33, Z34
Predefined SBs
6-12 Programming Manual PSS WIN-PRO
Division
DescriptionStandard function block SB015 divides two signed 32 bit fixed pointnumbers (-2.147.483.648 ... +2.147.483.647). The result is a signed 64 bitfixed point number.SB015 is supplied with PSS WIN-PRO. It is stored in the“PSSBLOCKS\FS” (FS section) or “PSSBLOCKS\ST” (ST section) folder inthe installation path and must be imported into the project before it can becalled.The standard function blocks for the FS and ST section have the samenumber and function, but are not identical.
W: Word parameter; X: Bit parameter
Parameters
Z12 Dividend, high word (15 bit + sign)
Z11 Dividend, low word (16 bit)
Z22 Divisor, high word (15 bit + sign)
Z21 Divisor, low word (16 bit)
OV OverflowOV = 1: An overflow has occurred (the quotient or the remainderexceeds +2.147.483.647); the result is therefore invalid. Z42,Z41, Z32 and Z31 are set to “0”.With division, an overflow can occur if 8000 0000H is divided byFFFF FFFFH or FFFF FFFFH is divided by8000 0000H.
SB015
%�� �&
����#��� !�
%��%��%��
��+%'(�%*(�
))))
����
%'�%'�%*�
���
%*� �
6-13Programming Manual PSS WIN-PRO
OV = 0: No overflow has occurred; the result is valid.
FEH ErrorFEH = 1: Division by “0”FEH = 0: No error
Z3=0 Compare the quotient with “0”Z3=0 = 1: The quotient is “0”Z3=0 = 0: The quotient does not equal “0”
Z4=0 Compare the remainder with “0”Z4=0 = 1: Remainder is “0”Z4=0 = 0: Remainder does not equal “0”
Z32 Quotient, high word (15 bit + sign)
Z31 Quotient, low word (16 bit)
Z42 Remainder, high word (15 bit + sign)
Z41 Remainder, low word (16 bit)
Permitted operands
Permitted operands
EW, PW (in ST section only), DW, KF, KH, KM, MW, XW, ZW
A, M
AW, PW (in ST section only), DW, MW, XW, ZW
Parameters
Z11, Z12,Z21, Z22
OV, Z3=0,Z4=0, FEH
Z31, Z32,Z42, Z41
Predefined SBs
6-14 Programming Manual PSS WIN-PRO
Comparison
DescriptionStandard function block SB041 either compares two unsigned 32 bit fixedpoint numbers (0 ... 4.294.967.295) or two signed 32 bit fixed pointnumbers (-2.147.483.648 ... +2.147.483.647).SB041 is supplied with PSS WIN-PRO. It is stored in the“PSSBLOCKS\FS” (FS section) or “PSSBLOCKS\ST” (ST section) folder inthe installation path and must be imported into the project before it can becalled.The standard function blocks for the FS and ST section have the samenumber and function, but are not identical.
W: Word parameter; B: Byte parameter; X: Bit parameter
Parameters
Z12 Figure 1, high word (16 bit or 15 bit + sign)
Z11 Figure 1, low word (16 bit)
Z22 Figure 2, high word (16 bit or 15 bit + sign)
Z21 Figure 2, low word (16 bit)
VZ Sign
VZ = 1: Comparison is to be signed
VZ = 0: Comparison is to be unsigned
ERGE ResultERGE = 00000001: Figure 1 < Figure 2ERGE = 00000010: Figure 1 = Figure 2ERGE = 00000100: Figure 1 > Figure 2ERGE = 00001000: Figure 1 < Figure 2ERGE = 00010000: Figure 1 > Figure 2ERGE = 00100000: Figure 1 ≠ Figure 2
SB041
%�� ��$�
���"���� !�
%��%��%��
"����
&%)
6-15Programming Manual PSS WIN-PRO
Permitted operands
Permitted operands
AW, EW, PW (in ST section only), DW, KF, KH, KM, MW, XW, ZW
A, E, M
AB, DL, DR, MB
Parameters
Z11, Z12,Z21, Z22
VZ
ERGE
Predefined SBs
6-16 Programming Manual PSS WIN-PRO
Notes
7-1Programming Manual PSS WIN-PRO
Appendix
Operation execution times
The table contains the execution times for IL operations. If you wish toestimate the execution times for an LD or FBD block, have the blockdisplayed in IL (View -> Programming Language). You will then be able tosee which IL operations lie behind the graphic elements.
INFORMATIONInternal processes and the sequence of operations within the program maymean that the actual times deviate from those stated in the table.
Operation
Bit operations
L, L(, LN,
O, O(, ON,
U, U(, UN, ),
S, R, =, =N
Timers and counters
SE
L, when timer is
stopped
L, when timer is
running
ZV, ZR
Addressing
Direct
Set
Indirect
Direct
Set
Indirect
Direct
Set
Indirect
Direct
Set
Indirect
Direct
Set
Indirect
3rd generationPSSFS section [µs]
0.5
1.7
1.3
6.8
6.7
8.5
1.6
3.8
3.1
15.9
18.3
16.4
1.3
2.2
3.5
3rd generationPSSST section [µs]
0.5
1.2
1.1
6.8
6.5
8.5
3.9
3.9
6.3
5.2
4.7
7.8
1.3
1.9
1.7
Appendix
7-2 Programming Manual PSS WIN-PRO
Operation Addressing 3rd generationPSSFS section [µs]
3rd generationPSSST section [µs]
Byte/wordoperations
L, T
L, T from peripherybyte/word(PB/PW)
>, !=, <
D, I accumulator
D, I operand
+, -, *, :
AND, OR, XOR
RL, RR,SLV, SRV
Jump operations
SPA
SPB
Organisationaloperations
CAL w/o parameters
CAL with 10parameters
SEG
A
Direct
Set
Indirect
Direct
Direct
Set
Indirect
Accumulator
Direct
Set
Indirect
Direct
Set
Indirect
Direct
Set
Indirect
Accumulator
Label
Label
Direct
Direct
Direct
0.3
2.5
1.3
49.6
0.4
2.5
1.2
0.2
0.9
1.9
1.4
1.4
2.6
1.7
0.6
2.8
1.2
0.5
0.1
0.1
8.5
17.5
2.0
2.0
0.3
1.4
1.1
1.3
0.4
1.1
1.1
0.1
0.9
1.3
1.2
1.3
2.5
1.7
0.6
1.4
1.2
0.5
0.1
0.1
10.5
19.4
1.4
2.3
7-3Programming Manual PSS WIN-PRO
Changes in the documentation
Changes in Version 20 363-03
Changes in Version 20 363-04
Oldpage
2-1
2-7
2-8
2-25
-
5-15
5-18
5-19
-
Newpage
2-1
2-8
2-8
2-25
5-15
5-17
5-20
5-21
6-4
Change
FS and ST operand overview:Changes for PSS with FS operating system version ≥ 47and two SafetyBUS p interfaces, see entries withfootnote 6)
Diagnostic configuration
New SafetyBUS p OB in the FS section (OB133)
ST section: PSS does not switch to a STOP conditionafter an error OB has been run
Section on “Access to inputs and outputs” completelyrevised
neue Operationen: SR- und RS-Flip-Flop
“SD” operation: Reset input removed
“CU” operation: CU input and outputs Q and CV removed
“CU” operation: CU input and outputs Q und CV removed
Description of SB001 added
Oldpage
2-6
2-9
2-30
Newpage
2-6
2-9
2-30
Change
FS and ST overview of operands:Changes for PSS with FS operating system version ≥ 43,see entries with footnotes 4) and 5)
New STOP OB in the FS section (OB124)
New STOP OB in the ST section (OB024)
On PSS with an FS operating system version ≥ 43, flagsin the range 00 - 63 in the ST section and flags in therange 64 - 99 and 130 - 255 in the FS section can also beused as address indicators.
Appendix
7-4 Programming Manual PSS WIN-PRO
Changes in Version 20 363-05
Oldpage
2-32
Newpage
2-32
Change
Examples corrected: MB114.16 and MB114.24 mixed up.
Changes in Version 20 363-06
Changes in Version 20 363-07
Oldpage
-
-
6-4
Newpage
2-20
5-12
6-4
Change
FS and ST operand overview:New M113.08
New: Remanent data blocks in the FS section
Description added for the operations "Input" and "Invertedinput"
SB001: Permitted value range for STRT has beenchanged
Oldpage
2-20
2-21
3-144-105-14
Newpage
2-20
2-21
3-144-105-14
Change
General reset each time the ST section starts up, if the“Operate PSS without battery” option has been selectedwhen programming the PSS in the system software’sPSS Configurator.
Remanent data blocks can only be used if the PSScontains a battery.
“R” operation: Unlock a counter after a reset
8-1Programming Manual PSS WIN-PRO
Index
A
Access rightsFS to ST section 2-29ST to FS section 2-29
Accumulator 3-2decrement
IL 3-27increment
IL 3-26load
IL 3-20negate
IL 3-28one’s complement
IL 3-36rotate left
IL 3-37rotate right
IL 3-38shift left
IL 3-39shift right
IL 3-40store
IL 3-21transpose
IL 3-41two’s complement
IL 3-28Actual parameters 2-12Add
32 Bit 6-6Byte
FBD 5-34IL 3-29
WordFBD 5-34IL 3-29
Addresses 2-29Addressing 2-29
direct 2-31free
FS section 2-36ST section 2-37
indirect 2-32set 2-34
Address indicator 2-32
Alarm OBsFS section 2-7SafetyBUS p 2-5
Alarmsdisable
FBD 5-50IL 3-48LD 4-22
enableFBD 5-51IL 3-48LD 4-22
organisation blocksFS section 2-7SafetyBUS p 2-5
processingFS section 2-42ST section 2-43
AND operationBit
FBD 5-12IL 3-8
Bit negatedFBD 5-12IL 3-10
Bit, open parenthesisIL 3-9
ByteFBD 5-38IL 3-33
WordFBD 5-39IL 3-33
Approvalof blocks 2-23
Arithmetic operations32 Bit 6-6FBD 5-29IL 3-26
Auxiliary accumulator 3-2
B
Bit operationsFBD 5-12
AND operation 5-12OR operation 5-13reset 5-14set 5-13store 5-14
Index
8-2 Programming Manual PSS WIN-PRO
store NOT 5-14IL 3-6
AND NOT operation 3-10AND open parenthesis 3-9AND operation 3-8close parenthesis 3-13load 3-7load NOT 3-8load open parenthesis 3-7OR NOT operation 3-13OR open parenthesis 3-12OR operation 3-11reset 3-14set 3-14store 3-15store NOT 3-15
LD 4-8load 4-8reset 4-10set 4-10store 4-10store NOT 4-11
Block end 3-47Block header 2-4Block name 2-4Blocks 2-4
approved 2-23block end
IL 3-47conditional call
FBD 5-49IL 3-46LD 4-22
CRC sum 2-4encrypted 2-24header 2-4name 2-4nesting level 2-41short tag 2-4unconditional call
FBD 5-49IL 3-45LD 4-21
Block short tag 2-4Byte operations
FBD 5-22add 5-34AND operation 5-37convert byte to word 5-22decrement 5-31, 5-32
divide 5-37“equals” comparison 5-27EXCLUSIVE OR operation 5-41“greater than” comparison 5-26increment 5-29, 5-30invert 5-43“less than” comparison 5-28multiply 5-36negate 5-33one’s complement 5-43OR operation 5-40store 5-22subtract 5-35two’s complement 5-33
IL 3-20add 3-29AND operation 3-33convert BCD to binary 3-22convert binary to BCD 3-23decrement 3-27divide 3-32“equals” comparison 3-25EXCLUSIVE OR operation 3-35“greater than” comparison 3-24increment 3-26invert 3-36“less than” comparison 3-25load 3-20multiply 3-31negate accumulator 3-28one’s complement 3-36OR operation 3-34subtract 3-30two’s complement from accumulator 3-28
LD 4-16decrement 4-20“equals” comparison 4-18“greater than” comparison 4-16“less than” comparison 4-19
C
Check sum see CRC sumCheck sum calculation 6-4Close parenthesis
BitIL 3-13
CommentsFBD 5-2IL 3-2
8-3Programming Manual PSS WIN-PRO
LD 4-2Compare
32 bit 6-14Byte “equals”
FBD 5-27IL 3-25LD 4-18
Byte “greater than”FBD 5-26IL 3-24LD 4-16
Byte “less than”FBD 5-28IL 3-25LD 4-19
Word “equals”FBD 5-27IL 3-25LD 4-18
Word “greater than”FBD 5-26IL 3-24LD 4-17
Word “less than”FBD 5-28IL 3-25LD 4-19
Constants 2-26types 2-26
ConvertBCD to binary
FBD 5-24IL 3-22
Binary to BCDFBD 5-25IL 3-23
Byte to wordFBD 5-23
Word to byteFBD 5-23
Count backwardsFBD 5-20IL 3-19LD 4-15
Countersdecrement
FBD 5-20IL 3-19
LD 4-15increment
FBD 5-20IL 3-18LD 4-15
Count forwardsFBD 5-20IL 3-18LD 4-15
CRC calculation 6-4CRC sum
of blocks 2-4Current path 4-1Cycle OB
FS section 2-5ST section 2-8
D
Data blocks 2-19formats 2-19select
FBD 5-49IL 3-44LD 4-20
system data blocksFS section 2-19ST section 2-20
Data byteleft 2-19right 2-19
DB 2-19Deactivation OBs 2-8Decrement
FBD 5-31, 5-32IL 3-27
Definition of symbols 1-2Diagnostic configuration 2-2Direct addressing 2-31Disable
alarmsFBD 5-50IL 3-48LD 4-22
Divide32 Bit 6-12Byte
FBD 5-37IL 3-32
Word
Index
8-4 Programming Manual PSS WIN-PRO
FBD 5-37IL 3-32
DL 2-19DR 2-19DW 2-19
E
Enablealarms
FBD 5-51IL 3-48LD 4-22
Encryption 2-24Equals see StoreError OBs
FS section 2-7ST section 2-8
Error processingFS section 2-44ST section 2-44
EXCLUSIVE OR operationByte
FBD 5-41IL 3-35
WordFBD 5-42IL 3-35
F
FALSE 2-39FB 2-11FBD 2-3, 5-1Flags 2-25Flip-Flop
RS 5-16SR 5-15
Formal parameternames 2-11of function blocks 2-11types 2-11
Formatsof data blocks 2-19
Free addressingFS section 2-36ST section 2-37
Function Block Diagram 2-3, 5-1Function blocks 2-11
conditional callFBD 5-49
IL 3-46LD 4-22
from Pilz 2-16unconditional call
FBD 5-49IL 3-45LD 4-21
G
General reset OB 2-10Graphic elements
FBD 5-4LD 4-4
I
IL 2-3, 3-1Increment
FBD 5-29, 5-30IL 3-26
Indirect addressing 2-32Instruction list 2-3, 3-1Invert
accumulatorFBD 5-43IL 3-36
J
Jump operationsFBD 5-47IL 3-42LD 4-20
Jumpsconditional
FBD 5-47IL 3-43LD 4-20
unconditionalFBD 5-47IL 3-42LD 4-20
L
LabelsFBD 5-2IL 3-1LD 4-2
Ladder diagram 2-3, 4-1
8-5Programming Manual PSS WIN-PRO
LD 2-3, 4-1Load
BitIL 3-7LD 4-8
Bit negatedIL 3-8
Bit, open parenthesisIL 3-7
ByteIL 3-20
WordIL 3-20
Logic 2-39Logic operations
FBD 5-38IL 3-33
M
Multiply32 bit 6-10Byte
FBD 5-36IL 3-31
WordFBD 5-36IL 3-31
N
NegateFBD 5-33IL 3-28
Nesting level 2-38Networks 2-25
commentFBD 5-2LD 4-2
FBD 5-1LD 4-1
O
OBs 2-5One’s complement
FBD 5-43IL 3-36
Operands 2-25
IL 3-1Operations 2-25
execution times 7-1FBD 5-4IL 3-4LD 4-4structure
IL 3-1Operators
IL 3-1Organisation blocks 2-5
alarm OBsFS section 2-7SafetyBUS p 2-5
cycle OBFS section 2-5ST section 2-8
deactivation OBs 2-8error OBs
FS section 2-7ST section 2-8
FS section 2-5general reset OB 2-10OB001 2-8OB010 ... 073 2-5OB020 2-9OB022 2-10OB023 2-8OB024 2-10OB025 2-8OB027 2-8OB028 2-10OB029 2-8OB101 2-5OB120 2-6OB124 2-6OB125 2-7OB127 2-7OB128 2-6OB130 ... 133 2-7OB140 ... 171 2-7OB200 ... 231 2-8SafetyBUS p OBs 2-7start-up OB
FS section 2-6ST section 2-9
STOP OBsFS section 2-6ST section 2-10
ST section 2-8OR operation
Index
8-6 Programming Manual PSS WIN-PRO
BitFBD 5-13IL 3-11
Bit negatedFBD 5-13IL 3-13
Bit, open parenthesisIL 3-12
ByteFBD 5-40IL 3-34
WordFBD 5-40IL 3-34
Outputsshut down
FBD 5-51IL 3-49LD 4-23
P
Parametersof function blocks 2-11of standard function blocks 2-17
PB 2-10Periphery access 2-26PII 2-26PIO 2-26Process images 2-26Process interrupts see AlarmsProgram 2-2
stopFBD 5-52IL 3-49LD 4-23
Program blocks 2-10conditional call
FBD 5-49IL 3-46LD 4-21, 4-22
unconditional callFBD 5-49IL 3-45LD 4-21
Program cycle 2-40Programming
linear 2-40structured 2-41
Programming languages
FBD 5-1Function Block Diagram 2-3IL 3-1Instruction List 2-3, 3-1Ladder Diagram 2-3LD 4-1
Programming model 2-1Programming rules
IL 3-3Project 2-1PSS configuration 2-2
R
Read-onlyon data blocks 2-20
Read/Writeon data blocks 2-20
ResetBit
FBD 5-14IL 3-14LD 4-10
Result of logic operationFBD 5-3IL 3-2LD 4-3
RLOFBD 5-3IL 3-2LD 4-3
Rotateleft
FBD 5-44IL 3-37
rightFBD 5-45IL 3-38
RS Flip-Flop 5-16
S
SafetyBUS palarm OBs 2-5configuration 2-2organisation blocks 2-7
SB 2-17SB001 6-4SB003 6-4, 6-6
8-7Programming Manual PSS WIN-PRO
SB007 6-8SB011 6-10SB015 6-12SB041 6-14SB254
FUNK 180 2-38SB255
FUNK 50 2-22Segments
FBD 5-2LD 4-2Operation
IL 3-1, 3-47Select data block
FBD 5-49IL 3-44LD 4-20
SetBit
FBD 5-13IL 3-14LD 4-10
Set addressing 2-33Shift
leftFBD 5-45IL 3-39
rightFBD 5-46IL 3-40
Shut downoutputs
FBD 5-51IL 3-49LD 4-23
SR Flip-Flop 5-15Standard function blocks 2-17
call 2-18conditional call
FBD 5-49IL 3-46LD 4-22
from Pilz 2-18program 2-18unconditional call
FBD 5-48IL 3-45LD 4-21
Start-up OB
FS section 2-6ST section 2-9
Stopprogram
FBD 5-51IL 3-49LD 4-23
STOP OBFS section 2-6ST section 2-10
StoreBit
FBD 5-14IL 3-15LD 4-10
ByteFBD 5-22IL 3-21
WordFBD 5-22IL 3-21
Store NOTBit
FBD 5-14IL 3-15LD 4-11
Subtract32 bit 6-8Byte
FBD 5-35IL 3-30
WordFBD 5-35IL 3-30
Switch-on delayFBD 5-17IL 3-16LD 4-12
SymbolsFBD 5-2for operands 2-30IL 3-1LD 4-2
System data blocksFS section 2-19ST section 2-20
Index
8-8 Programming Manual PSS WIN-PRO
T
Tags 2-30Time
operation execution times 7-1Time base
FBD 5-17IL 3-16LD 4-12
Timerstart
FBD 5-17IL 3-16LD 4-12
Timer statusFBD 5-18IL 3-16LD 4-13
Time valueFBD 5-17IL 3-16LD 4-12
Transfer see StoreTranspose accumulator
IL 3-41TRUE 2-39Two’s complement
FBD 5-33IL 3-28
W
Word modulesaddress
FS section 2-36ST section 2-37
Word operations 3-20FBD 5-21
add 5-34AND operation 5-38convert BCD to binary 5-24convert binary to BCD 5-25convert word to byte 5-23decrement 5-31, 5-32divide 5-37“equals” comparison 5-26EXCLUSIVE OR operation 5-42“greater than” comparison 5-25increment 5-29, 5-30invert 5-43
“less than” comparison 5-27multiply 5-36negate 5-33one’s complement 5-43OR operation 5-40rotate left 5-44rotate right 5-45shift left 5-46shift right 5-47subtract 5-35two’s complement 5-33
ILadd 3-29AND operation 3-33convert BCD to binary 3-22convert binary to BCD 3-23decrement 3-27divide 3-32“equals” comparison 3-25EXCLUSIVE OR operation 3-35“greater than” comparison 3-24increment 3-26invert 3-36“less than” comparison 3-25load 3-20multiply 3-31negate accumulator 3-28one’s complement 3-36OR operation 3-34rotate left 3-37rotate right 3-38shift left 3-39shift right 3-40subtract 3-30two’s complement from accumulator 3-28
LD 4-16“equals” comparison 4-18“greater than” comparison 4-17“less than” comparison 4-19
X
XWFS section 2-36ST section 2-37
XW addressesFS section 2-36ST section 2-37
XW process imageFS section 2-36
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
E
EB
EW
A
AB
AW
PB
PW
DB
DB
DL
DR
DW
FB
KB
KC
KF
KH
KM
KY
M
00.00 - 23.312)
32.00 - 95.313)
132.00 - 195.316)
00.00 - 23.242)
32.00 - 95.243)
132.00 - 195.246)
00.00 - 23.162)
32.00 - 95.163)
132.00 - 195.166)
00.00 - 23.312)
32.00 - 95.313)
132.00 - 195.316)
00.00 - 23.242)
32.00 - 95.243)
132.00 - 195.246)
00.00 - 23.162)
32.00 - 95.163)
132.00 - 195.166)
00.00 - 23.242)
32.00 - 95.243)
132.00 - 195.246)
00.00 - 23.162)
32.00 - 95.163)
132.00 - 195.166)
000, 004 - 009
010 - 255
0000 - 1023
0000 - 1023
0000 - 1023
001 - 255
0-255
ASCII character set
-32768...+32767
0000 - FFFF
16 bit
0 - 255 per byte
000.00 - 063.31114.00 - 114.314)
Input bit (PII)
Input byte (PII)
Input word (PII)
Output bit (PIO)
Output byte (PIO)
Output word (PIO)
Periphery byte (periphery access)
Periphery word (periphery access)
System data block(DB000 is read-only)
Data block
Data byte left (bit 8 - 15)
Data byte right (bit 0 -7)
Data word (bit 0 - 15)
Function block
Constant Byte
Constant Character (2 characters)
Constant Fixed point number
Constant Hexadecimal figure
Constant Bit state
Constant 2 Byte
Flags
Writ
e
Rea
d
Dire
ct
Set
Indi
rect
DescriptionAddress rangeType Access Addressing
Overview of Operands: ST
Schnittmarke
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x1)
x1)
x1)
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x4)
x4)
Flags (FS)
Flag byte
Flag byte (FS)
Flag word
Flag word (FS)
Communication flag in bit mode
Communication flag in byte mode
Communication flag in word mode
FALSE flag (RLO-0)
TRUE flag (RLO-1)
Arithmetic carry flag
Arithmetic overflow flag
Arithmetic zero flag
Arithmetic sign flag
Status flag ST RUN/STOP (RUN = 1)
Status flag ST no error/error(error = 1)
Status flag ST STOP command (SThalted via STOP command = 1)
Warm start ST STOP > RUN (afterwarm start 1, active for one cycle only)
Cold start ST OFF > RUN (after coldstart 1, active for one cycle only)
ST general reset performed (after generalreset 1, active for one cycle only)
064.00 - 099.31130.00 - 255.314)
000.00 - 063.24114.00 - 114.244)
064.00 - 099.24130.00 - 255.244)
000.00 - 063.16114.00 - 114.164)
064.00 - 099.16130.00 - 255.164)
100.00 - 104.31105.00 - 109.314)
100.00 - 104.24105.00 - 109.244)
100.00 - 104.16105.00 - 109.164)
110.00
110.01
111.00
111.01
111.02
111.03
112.00
112.01
112.02
112.03
112.04
112.05
M
MB
MB
MW
MW
M
MB
MW
M
M
M
M
M
M
M
M
M
M
M
M
M
M
M
M
M
M
M
M
MB
MW
M
MB
MW
M
MB
MW
M
MB
113.00
113.01
113.02
113.03
113.04
113.05
113.06
113.08
114.00, 114.08,114.16, 114.24
114.00, 114.16
115.00 - 115.31
115.00 - 115.24
115.00 - 115.16
116.00 - 116.31
116.00 - 116.24
116.00 - 116.16
117.00 - 117.31
117.00 - 117.24
Status flag FS RUN/STOP (RUN = 1)
Status flag FS error/no error(error = 1)
Status flag FS STOP command (FShalted via STOP command = 1)
Warm start FS STOP > RUN (afterwarm start 1, active for one cycle only)
Cold start FS OFF > RUN (after coldstart 1, active for one cycle only)
Status flag SafetyBUS p 0 RUN/STOP(RUN = 1), only on PSS with an FSoperating system version > 35
Status flag SafetyBUS p 1 RUN/STOP(RUN = 1), only on PSS with an FSoperating system version > 47
Reset of the remanent DBs in the FSsection (after reset 1, flag must be resetthrough SB255, FUNK = 50), only onPSS with FS operating system version> 65
Flag byte, indirect addressing5)
Flag word, indirect addressing5)
Deactivation flag in bit mode (FS,selective shutdown)
Deactivation flag in byte mode (FS,selective shutdown)
Deactivation flag in word mode (FS,selective shutdown)
Status flag I/O-Groups in bit mode (FS,SafetyBUS p 0, I/O-Group in RUN = 1)
Status flag I/O-Groups in byte mode(FS, SafetyBUS p 0)
Status flag I/O-Groups in word mode(FS, SafetyBUS p 0)
Status flag I/O-Groups in bit mode (FS,SafetyBUS p 1, I/O-Group in RUN = 1)
Status flag I/O-Groups in byte mode(FS, SafetyBUS p 1)
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
Continued)➞
Writ
e
Rea
d
Dire
ct
Set
Indi
rect
DescriptionAddress rangeType Access Addressing
Writ
e
Rea
d
Dire
ct
Set
Indi
rect
DescriptionAddress rangeType Access Addressing
1) Only on 3rd generation PSS2) Depending on PSS and hardware (ST section has read-only access to inputs/outputs in the FS
section)3) Only on PSS with SafetyBUS p 0 (read-only access from ST section)4) Only on PSS with an FS operating system version ≥ 435) On PSS with an FSoperating system version ≥ 43, also flags in the range 00 - 636) Only on PSS with FS operating system version ≥ 47 and SafetyBUS p 1 (read-only access from ST
section)
... wwwwww.pilz.com
+49 711 3409-444
Pilz GmbH & Co. KGSichere AutomationFelix-Wankel-Straße 273760 Ostfildern, GermanyTelephone: +49 711 3409-0Telefax: +49 711 3409-133E-Mail: [email protected]
In many countries we arerepresented by our subsidiariesand sales partners.
Please refer to our Homepagefor further details or contact ourheadquarters.
Technical support
20 3
63-0
7, 2
008-
12 P
rint
ed in
Ger
man
y
MW
OB
PB
SB
T
T
XW
Z
Z
ZW
ZW
117.00 - 117.16
001, 019, 020, 023,0244), 025, 027,028, 029
001 - 255
001 - 255
000 - 063
064 - 127
00000-16383
000 - 063
064 - 127
000 - 063
064 - 127
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
Writ
e
Rea
d
Dire
ct
Set
Indi
rect
DescriptionAddress rangeType Access Addressing
Status flag I/O-Groups in word mode(FS, SafetyBUS p 1)
Organisation block (cannot be called up)
Program block
Standard function block
Timer
Timer (FS)
Word from a word module
Counters
Counter (FS)
Counter status (fixed point number)
Counter status (FS)