Siemens S7 MPI


The following applies to Siemens S7 PLC Communications using the S7 MPI Protocol.

Details on the device address can be found in the Device Properties Information Topic

 

External Address Format

External Address is an ascii string which exactly references an item of data within the PLC. It can be entered at configure time as a text string, and will be validated by the system before use. For this protocol the external address has the following format: 

 

N - dec number 0 - 9

 

Type

Delimiter

Offset

I

 

NNNNN

Q

 

NNNNN

F

 

NNNNN

C

 

NNNNN

T

 

NNNNN

DB001

.

NNNNN

DB002

.

NNNNN

DB003

.

NNNNN

DB004

.

NNNNN

DB005

.

NNNNN

DB006

.

NNNNN

DB007

.

NNNNN

DB008

.

NNNNN

DB009

.

NNNNN

DB010

.

NNNNN

 

Offset Format

The software also allows an item of data within the PLC to be referenced by means of a table selection and an offset. The following table shows the offset and table formats for S7 PLC Communications.

 

Table

External Address Type

Type

Offset Format

Offset Range

Privilege R = Read W = Write

Description

I

I

Byte

NNNNN

00000-65535

RW

Inputs

Q

Q

Byte

NNNNN

00000-65535

RW

Outputs

F

F

Byte

NNNNN

00000-65535

RW

Flags

C

C

Word

NNNNN

00000-65535

R

Counters

T

T

dWord

NNNNN

00000-65535

R

Timers

DB001

DB001

Word

NNNNN

00000-65535

RW

Data Block Table

DB002

DB002

Word

NNNNN

00000-65535

RW

Data Block Table

DB003

DB003

Word

NNNNN

00000-65535

RW

Data Block Table

DB004

DB004

Word

NNNNN

00000-65535

RW

Data Block Table

DB005

DB005

Word

NNNNN

00000-65535

RW

Data Block Table

DB006

DB006

Word

NNNNN

00000-65535

RW

Data Block Table

DB007

DB007

Word

NNNNN

00000-65535

RW

Data Block Table

DB008

DB008

Word

NNNNN

00000-65535

RW

Data Block Table

DB009

DB009

Word

NNNNN

00000-65535

RW

Data Block Table

DB010

DB010

Word

NNNNN

00000-65535

RW

Data Block Table

 

Property Pages

The following device advanced properties page exists for a Siemens S7 device:

 

S7Prop.gif

 

This property page allows further data blocks to be configured. By default blocks 1-10 are available. Other data blocks are added by entering a block number from 0-999 and clicking ‘add’. It is only possible to remove data blocks that have been added to the system, the default ones cannot be removed.

The local station address parameter is the address of the PC or Panel on a Siemens network. The maximum station address that can be used on the network is configurable, and is either 15, 31, 63 or 126. If the PC or Panel is the only master on the bus the check box for this setting should be checked.

 

Protocol Compatibility

The byte, word and dword type tables all support the configuration of smaller or bigger point types. All larger point types will read the required number of data units to fill the point. Smaller type points will scale down the data to fit it into the point. Bit type points allow the selection of a bit offset to reference the required bit from the data unit. In the case of bit selection points, drive outs will perform a 'bitset' operation through the protocol without having to perform a read/modify/write operation on the whole data unit.

 

Port Settings

 

RS232

 

Baud Rate

19200/38400

 

Data Bits

8

 

Stop Bits

1.0

 

Parity

Odd

 

Wiring Information

Connection of the PLC to a panel will be via either COM1 or COM2, using RS232 communications. The panel pin out diagram is shown below:

Generate/Panelpind.gif

Connection of the PLC to a PC running OPC Server will be via any available COM port, which may be either 25 pin or 9 pin depending on what is available. OPC Server will require RTS flow control to be enabled as ‘always set’ on the PC. The COM port pin out is shown below:

 

Generate/25&9pind.gif

Connection to the PLC is through a 9 pin d-type connector, into a comms module. This port has the following pin out:

Generate/9pind.gif

Connection to the S7 PLC requires the following wiring:

S7_1.gif

Examples

Data Block 7, First Word

 

DB007.00000

 

Data Block 3, Tenth Word

 

DB003.00009   

 

Tenth Flag

 

F00009

 

Last Timer

 

T65535