Siemens

Last modified by Joe on 2024/04/30 15:38

S7-200 Smart Serial

V-BOX setting

ItemsSettingsNote
ProtocolSiemens S7-200 CPU22x/Smart PPI 
ConnectionRS485 
Baud rate9600 
Data bit8 
ParityEVEN 
Stop bit1 
PLC station No.2 

西门子200串口.png

Address List 

TypeDevice registerFormatRangeNote
BitII ddddd.o0.0~99999.7 
QQ ddddd.o0.0~99999.7 
VVWbit ddddd.o0.0~99999.7 
VV ddddd.o0.0~99999.7 
MM ddddd.o0.0~99999.7 
SMddddd.o0.0~99999.7 
Sddddd.o0.0~99999.7Read only
Tddddd0~99999Timer state, read only
Cddddd0~99999Counter state, read only
WordIIW ddddd0~99999 
QQW ddddd0~99999 
AIAIW ddddd0~99999 
AQVB ddddd0~99999 
VVW ddddd0~99998

VW0=VB (0~1)

VW2=VB (2~3)

Address value is a multiple of 2

VVD ddddd0~99998

VD0=VB (0~3)

VD2=VB (4~7)

Address value is a multiple of 4

MMB ddddd0~99999 
MMW ddddd0~99999

MW0=MB(0~1)

MW2=MB(2~3)

Address value is a multiple of 2

MMD ddddd0~99999

MD0=MB(0~3)

MD4=MB(4~7)

Address value is a multiple of 4

TTW ddddd0~99999Value of timer
CCW ddddd0~99999Value of counter
WSW ddddd0~99999 

PLC setting

西门子软件版本.png

485通讯配置.png

Connect and Download

以太网 PC和PLC连接.png

以太网下载.png

Cable Wiring

485接线.png

S7-200 Smart Ethernet 

V-BOX setting

ItemsSettings
ProtocolSiemens S7-200 Smart(Ethernet)
ConnectionEthernet
Port No.102
PLC station No.2

西门子200smart 以太网.png

PLC setting

西门子软件版本.png

以太网通讯配置.png

Connect and Download

以太网 PC和PLC连接.png

以太网下载.png

Cable Wiring

V-Box : RJ45 Ethernet interface

PLC : RJ45 Ethernet interface

以太网连接.png

S7-300 Ethernet 

Supported Series: Siemens S7-300 series PLC

V-BOX setting

ItemsSettingsNote
ProtocolSimens S7-300 Ethernet 
ConnectionEthernet 
Port No.102 
PLC station No.2Need to be same as the PLC setting

Address List

TypeDevice registerFormatRangeNote
BitII ddddd.o0.0~99999.7 
QQ ddddd.o0.0~99999.7 
MM ddddd.o0.0~99999.7 
DB0.DB~DB99.DBDBxDB nndddd.o0.0~99999999.7

nn: block number;

dddd: address;

WordIIW ddddd0~99999 
QQW ddddd0~99999 
MMB ddddd0~99999 
MW ddddd0~99999

MW0=MB(0~1)

MW2=MB(2~3)

Address value is a multiple of 2

MD ddddd0~99999

MD0=MB(0~3)

MD4=MB(4~7)

Address value is a multiple of 4

DB0.DB~DB99.DBDBxDBB nndddd0~99999999

nn: block number;

dddd: address

DBxDBW nndddd0~99999999
DBxDBD nndddd0~99999999

Configure the communication protocol

image-20220824161345-1.png

Cable Wiring

image-20220824161450-2.png

S7-1200 Ethernet 

download link

V-BOX Setting

ItemsSettingsNote
ProtocolSiemens S7-1200 
ConnectionEthernet 
Port No.102 
PLC station No.2 

西门子1200协议参数.png

Address List

TypeDevice registerHMI registerFormatRangeNote
BitIIM d.o

d:0--9999

o:0-7

 
QQQ d.o

d:0--9999

o:0-7

 
MMM d.o

d:0--9999

o:0-7

 
DB0.DB-DB99.DBDBxDBDBxDBnndddd.o

nn:0-9999,

dddd:0-9999,

o:0-7

nn:DB No.

dddd:address value

o: digit address

WordMMBMB dd:0-99999 
MMWMW dd:0-99999

MW0=MB(0~1)

MW2=MB(2~3)

Address value is a multiple of 2

MMDMD dd:0-99999

MD0=MB(0~3)

MD4=MB(4~7)

Address value is a multiple of 4

IIWIW dd:0-99999 
QQWQW dd:0-99999 
DB0.DB-DB99.DBDBxDBBDBxDBBnndddd

nn:0-9999

dddd:0-9999

nn:DB No.

dddd:address value

DB0.DB-DB99.DBDBxDBWDBxDBWnndddd

nn:0-9999

dddd:0-9999

nn:DB No.

dddd:address value

Address value is a multiple of 2

DB0.DB-DB99.DBDBxDBDDBxDBDnndddd

nn:0-9999

dddd:0-9999

nn:DB No.

dddd:address value

Address value is a multiple of 4

✎Note:

  • The S7-1200 supports simultaneous connection of three devices.
  • V-BOX access PLC, use S7 protocol, access PLC TSAP 02.01 (S7-1200 PROFINET interface only supports three connections, the default support), detailed reference to the system manual of S7-1200.
  • S7-1200 String type, the default first two bytes are used to store the maximum character and valid characters, so the text data will be shifted back one word address. When interacting with the data, what way this address plc is displayed with is unknown. And because of an extra word of data causes us to display the wrong. The solution is if we use String, then the actual data address we want to operate on is actually shifted back two bytes, so as long as the address on the project is shifted back 2 bits to correspond with the actual data address.

PLC Settings

Add BD

  • Please uncheck [Symbolic access only] option;

xwiki_PIStudio_12.PLC+protocols_WebHome_872ec32d12b55aa.png

Address settings, using BD2 as example.

  • DB×DBB2xxxx, DB×DBW2xxxx, DB×DBD2xxxx for accessing data of DB2 in B1.
  • 2 represent DB block number
  • xxxx represent address

Such as:

  • DBxDBB20000 = DB2.DBB0
  • DBxDBW20004 = DB2.DBW4

xwiki_PIStudio_12.PLC+protocols_WebHome_8ee8d3ac3637bfc4.png

How to setting String in PLC and V-net
PLC configuration

choosing Data type--String→add"[]" after String and input data length

yUYuRVmMcL.png

V-box configuration

BSRBeEWL0O.png

choosing Word and DBxDBW →input  Register Main No. →Data format is String →input data length you want to use → choosing Byte order--Little-endian 

Note: Register Main No. = offset in PLC + 2
For example, the image above has an offset of 4, so the register Main No. is 10006
If an offset is 8, the register Main No. is 10010

How to connect with S7-1200 Firmware V4.0

PLC configuration

  • Double click [device configuration] in Siemens via software
  • Double click [protection] to enter protection configuration screen

xwiki_PIStudio_12.PLC+protocols_WebHome_664a826cd356c830.png

  • Check [Permit access with PUT / GET communication from remote partner (PLC, HMI, OPC, ...)]

xwiki_PIStudio_12.PLC+protocols_WebHome_78026942a88f0fdb.png

DB settings

  • Right click [DB], select [properties]
  • Uncheck [optimized block access]

Cable Wiring

xwiki_PIStudio_12.PLC+protocols_WebHome_ac8ece9a26719fda.png

S7-XXX Ethernet

Supported Series: Siemens S7-400, S7-1200 and S7-1500

V-BOX setting

ItemsSettingsNote
ProtocolSiemens S7-XXX 
ConnectionEthernet 
Port No.102 
Device No.Slot (Default 1 for S7-1500/ 2 for S7-1200/ 3 for S7-400) 
HMI No.Rack (Default as 0) 

Slot from TIA Portal is equal to Device No. of V-net

Rack from TIA Portal is equal to HMI No. of V-net

image-20220824162459-3.png

image-20220824163305-2.png

Address List

TypeDevice registerFormatRangeNote
BitIM d.o

d:0--9999

o:0-7

 
QQ d.o

d:0--9999

o:0-7

 
MM d.o

d:0--9999

o:0-7

 
DB0.DB-DB99.DBDBxDBnndddd.o

nn:0-9999,

dddd:0-9999,

o:0-7

nn:DB No.

dddd:address value

o: digit address

WordMMB dd:0-99999 
MMW dd:0-99999

MW0=MB(0~1)

MW2=MB(2~3)

Address value is a multiple of 2

MMD dd:0-99999

MD0=MB(0~3)

MD4=MB(4~7)

Address value is a multiple of 4

IIW dd:0-99999 
QQW dd:0-99999 
DB0.DB-DB99.DBDBxDBBnndddd

nn:0-9999

dddd:0-9999

nn:DB No.

dddd:address value

DB0.DB-DB99.DBDBxDBWnndddd

nn:0-9999

dddd:0-9999

nn:DB No.

dddd:address value

Address value is a multiple of 2

DB0.DB-DB99.DBDBxDBDnndddd

nn:0-9999

dddd:0-9999

nn:DB No.

dddd:address value

Address value is a multiple of 4

Configure the communication protocol

image-20220824163448-3.png

✎Note:

  • The S7-1200 supports simultaneous connection of three devices, so the driver supports simultaneous access to PLC by three V-BOX.
  • V-BOX access PLC, use S7 protocol, access PLC TSAP 02.01 (s7-1200 PROFINET interface only supports three connections, the default support), detailed reference to the system manual of S7-1200.

Cable Wiring

image-20220824162342-2.png

LOGO Ethernet 

Supported Series: Siemens Logo 0BA0, 0BA1 series

V-BOX Settings

ItemsSettingsNote
ProtocolSiemens LOGO 
ConnectionEthernet 
Port No.102 
PLC station No.2 

Address List

NumberAddress TypeData TypeRangeDB AddressPLC Address
1RTCWord1-7DB1.DBX984.00x001ec0
2VBByte0-1469DB1.DBX0.00x000000
3VDDouble Word0-1466DB1.DBX0.00x000000
4VWWord0-1468DB1.DBX0.00x000000
5NAQWord1-32DB1.DBX1406.00x002bf0
6NAIWord1-64DB1.DBX1262.00x002770
7AMWord1-64DB1.DBX1118.00x0022f0
8AQWord1-16DB1.DBX1072.00x002180
9AIWord1-16DB1.DBX1032.00x002040
10IBit1-64DB1.DBX1024.00x002000
11QBit1-64DB1.DBX1064.00x002140
12MBit1-112DB1.DBX1104.00x002280
13NIBit1-128DB1.DBX1246.00x0026f0
14NQBit1-128DB1.DBX1390.00x002b70
15VBit0-14697DB1.DBX0.00x000000

PLC Settings in LOGO Software:

Click [Tools]--[Ethernet Connections],shown as below.

12.PLC Protocol_html_8b9d2322edf89519.png

Set Ethernet connection parameter. IP, Subnet Mask, shown as below.

hXadxkZTuR.png

TSAP set: The value set by local TSAP is the remote TSAP set in HMI. PLC's remote TSAP is the opposite,shown as below.

image-20221228143047-5.png

 Download Project: Click "Address book" to add the IP address to be downloaded (fi."Detect" to check whether the IP address can be detected. Then click “ok”, and the system will prompt that PLC will be "STOP" mode. Click “YES” to start download.

image-20221228143246-6.png

V-BOX Communication Settings

Set PLC IP in [IP Address] settings;

V-NET_Client logo.png

TSAP setting

  • The initialization script needs to set the source TSAP address and the target TSAP address, otherwise the communication will not be successful.

You can copy the following script into V-net directly.

function init.main()
 addr_setword("@W_0#HSW1200",8192) -- Set the source TSAP address
 addr_setword("@W_0#HSW1201",4096) -- Set the destination TSAP address
end

Note:
The name of the test script must be “init”, 8192 and 4096 are the data used for the test, there is no HSW address in the register option, but you can directly set the value of the corresponding address through the code.

✎Note:

  • Communication port configuration: 
    • Continuous length needs to be set to 0.
    • Integration interval needs to be set to 1. (no change may result in data errors)
    • Set Port and Device Station NO.
    • Other set as defaulted.
  • Notes on the use of registers:
    • Register VD: Use only registers that are multiples of 4, such as 0, 4, 8, etc.
    • Register VW: Use only registers they are multiples of 2, such as 0, 2, 4 etc. (Using an odd-length register may result in data errors, such as 2 3 4 )