Lecture Number 5 Siemens S7
In this session… In this session, you will learn about the Siemens S7 system
Learning outcomes At the end of this session you should be able to: Describe more advanced features of the S7 system Understand the addressing system of the PLC
Tutorial Exercise 1 Feedback
Specialised Instructions Comparison, Mathematical etc. Data word 20 of Data Block 1 Contains second comparison value. Data word 3 of Data Block 1 Contains first comparison value. The Multiplication instruction example multiplies the value in word 2 of DB1 by the constant +50 and stores the result in word 10 of DB1.
Data Formats and Data Blocks Identifiers 2# = Binary Number 16# = Hexadecimal Number L# = Long Decimal Number (IEEE Floating Point) S5T# = Timer Value C# = Counter/BCD Value B# = Byte (8 Bit Value) W# = Word (16 Bit Value) DW# = Double Word (32 Bit Value) Examples Byte Hex B#16#FF Word Binary 2#1111 1111 1111 1111 Word Hex W#16#FFFF Double Word Hex DW#16#FFFF_FFFF Double Word Binary 2#1111 1111 1111 1111 1111 1111 1111 1111 Integer (16 Bit) -32768 to 32767 Long Integer Word (32 Bit) L#2147483647 ~ L#-2147483648 IEEE Floating Point +/-3.402823e+38 ~ +/-1.175495e-38 Timer Value S5T#0H_1M_0S_0MS Counter Value C#5 ASCII Character ‘A’
Data Block Example Data Block 10 (DB10) DB10.DBW8 =162 Byte Number Data Name Data Type Data
Data Usage Example Control of Motor Via 4-20mA Analogue Output Multiply [DB2.DBW0] by 276 and send to PQW 752. This scales the 0%~100% to 0~27600. This is within 0.2% of the maximum value of 27648. Ranges will be: 0% ~ 100% From HMI User 0 ~ 27600 Generated by user programme 4 ~ 20mA Produced by Analogue Output A scaling instruction could also be used. Data 0-100 to DB2.DBW0 Current 4-20mA PQW752 Frequency 0Hz-50Hz HMI sends percentage (0%-100%) Value to Word 0 of Data Block 2. PLC takes figure from HMI and scales it into the analogue range (0~27648) for the 4-20mA output. Value is sent to PQW 752 (analogue output). Inverter converts 4-20mA signal into 0%-100% speed. Motor speed is proportional to inverter output frequency.
Test Your Knowledge Three S7 controllers of the S7 family are?: S7 200, S7 300, S7 400 The three main formats of the S7 software are?: Ladder, Function Block, Statement List The address format of S7 is?: Byte/Bit Addressing The data format for a 32 bit numerical value in hexadecimal is?: DW#16# A Data Word, Word 6 in Data Block 3, would be referenced in S7 as?: DB3.DBW6