<Figure 1> is read setting example of driver to communicate with SIEMENS S7 PLC TCP/IP module in Germany.
<Figure 1> Read setting example of SIEMENS_S7 TCP/IP protocol |
Importance) In order to communicate, you have to enter PLC Rack number(Default no.0) and CPU Slot number(Default 3 or 4) after completing communication protocol setting by using LADDER program.
Refer to SIEMENS S7 PLC Manual about communication module setting method of SIEMENS_S7 TCP/IP protocol.
Enter PLC Rack number and PLC CPU Slot number (Default 3 or 4) at setting dialog box which is shown by pressing button of <Figure 1>.
<Figure 2> is setting dialog box for PLC Rack of SIEMENS_S7 TCP/IP protocol and CPU Slot number.
<Figure 2> PLC Rack/CPU Slot number setting dialog box of SIEMENS_S7 TCP/IP protocol |
SIEMENS_S7 TCP/IP communication driver's read schedule
Read schedule setting parameters are as follows :
1) STATION – Don't care.
2) DB number and Data type to read – Input as DBxxx.Y format.
Always enter as DB at first 2 digits, enter DB number as number between 0 and 256 etc at xxx, enter data type to read of B, W, D and F at Y area.
Mean of data to read by type - B : BYTE data, W or Etc character : WORD data,
D : DWORD data, F : FLOAT data.
3) Read Start Address – Read start address in DB address. Start address is BYTE unit number.
4) Save Start Address for Communication Server - Position of ScanBuf to save read.
5) Read Size - Number of BYTE/WORD/DWORD/FLOAT to read. (It is possible to read maximum 462 BYTE/231 WORD/115 DWORD/115 FLOAT data, at a time. It can be difference according to model)
If you read data as WORD, DWORD and FLOAT format of SIEMENS_S7 TCP/IP communication protocol, it displays the read communication data to 2(WORD) or 4(DWORD, FLOAT) memory by ones.
Read schedule
READ, 1, DB20.B, 0, 0, 20,
READ, 1, DB20.B, 100, 50, 50,
READ, 1, DB10.W, 0, 100, 10,
READ, 1, DB11.W, 0, 120, 10,
FLOAT, 1, DB21.W, 0, 0, 115,
FLOAT, 1, DB21.W, 180, 600, 20,
DWORD, 1, DB22.W, 0, 0, 5,
DWORD, 1, DB22.W, 50, 20, 10,
Digital Write
Digital write setting parameters are as follows :
PORT |
Connected PORT number |
0 ~ 255 |
Station |
Don't care |
|
ADDRESS |
Digital output address |
0000 ~ xxx7, - High 3~7 digits are BYTE position - Sub 1digit is BIT postion |
Extra1 |
DB number |
DB00 ~ DB256 etc |
Extra2 |
Don't care |
|
Write example 1)
Port : 0 Station : 0 Address : 0127, Extra1 : DB20, Extra2 : Blank,
If you set as above and write digital value, you can ON/OFF 8th bit value of DB20 memory's 13th BYTE.
Write example 2)
Port : 0 Station : 0 Address : 12152, Extra1 : DB10, Extra2 : Blank,
If you set as above and write digital value, you can ON/OFF 3rd bit value of DB10 memory's 1215th BYTE.
Analog Write
Analog write setting parameters are as follows :
PORT |
Connected PORT number |
0 ~ 255 |
Station |
Don't care |
|
ADDRESS |
Analog output address |
Input BYTE address as decimal number |
Extra1 |
DB number and Data type to read |
Input as DBxxx.Y format. Always input high 2 digits as DB. xxx is DB number set at PLC (number between 0 and 256) Input B, W, D and F data type at Y area B : BYTE data W or Etc character : WORD data D : DWORD data F : FLOAT data. |
Extra2 |
Don't care |
|
Write example 1)
Port : 0 Station : 0 Address : 0011, Extra1 : DB21.B, Extra2 : Blank,
If you set as above and write analog value, you can change 12th(no.11 address) BYTE value of DB21 memory as designated input value(value between 0 and 255).
Write example 2)
Port : 0 Station : 0 Address : 0152, Extra1 : DB22.W, Extra2 : Blank,
If you set as above and write analog value, you can change 2 BYTE(WORD) value from 153 ~ 154th(no.152~no153 address : High + Low byte)BYTE of DB22 memory as designated input value(value between 0 and 65535).
Write example 3)
Port : 0 Station : 0 Address : 0035, Extra1 : DB23.D, Extra2 : Blank,
If you set as above and write analog value, you can change 4 BYTE(DWORD) value from 36 ~ 39th (no.35 ~ no.38 address : High + Low WORD)BYTE of DB23 memory as designated input value(in range of DWORD data).
Write example 4)
Port : 0 Station : 0 Address : 0176, Extra1 : DB24.F, Extra2 : Blank,
If you set as above and write analog value, you can change 4 BYTE value from 177 ~ 180th (no.176 ~ no.179 address)BYTE as designated input value(in range of FLOAT data).