Description of the PLC data area parameter values

The parameter values to be used for the write/read command differ depending on the type of external control used, the adapter or the communication protocol. Some data areas may not be available, or the data have to be read/written word by word instead of byte by byte . Further information can be found in the documentation for the external control.

Format conversion necessary

Read access to word variables in the S5/S7 controller returns data in Motorola format (Hi and Lo bytes interchanged). For the evaluation the read data first have to be converted to the common Intel format used in the TwinCAT system. Data to be written from the TwinCAT system to the S5/S7 controller must be converted to the Motorola format before the write access. The BCD number system is used in the S5/S7 controller for representing the counter/timer variables. The data may have to be converted, if necessary.

Description of the PLC data area parameter values 1:

The TwinCAT PLC library TcUtilities.Lib offers functions for conversion between Motorola and Intel format (e.g. BE16_TO_HOST, HOST_TO_BE16...).

The following table provides an overview of the available communication paths:

Control

LAN adapter

Transport protocol

LAN adapter communication protocol

Description

S5

IBH Link S5++

TCP/IP

IBH S5 LAN link protocol = FETCH/WRITE telegrams

No connection parameterization required in the external control.

S7

IBH Link S7++

TCP/IP

NetLink MPI protocol (NL-MPI) from Hilscher

No connection parameterization required in the external control.

IBH S5 LAN link protocol = FETCH/WRITE telegrams

Data area (eArea)

Start address (nOffset)

Permitted data length (cbBuffer)

DB

Data word offset: 0..2047

read/write 1..2048 words

M

Flag byte offset: 0..255

read/write 1..256 bytes

I

Input byte offset: 0..127

read 1..128 bytes

Q

Output byte offset: 0..127

write 1..128 bytes

P

I/O peripheral byte offset: 0..127 (digital I/Os), 128..255 (analog I/Os)

read/write 1..256 bytes

C

Counter start offset: 0..255

read/write 1 word

T

Timer start offset: 0..255

read/write 1 word

DX

Data word offset

read/write 1..2048 words

NetLink MPI protocol (NL-MPI) from Hilscher

Data area (eArea)

Start address (nOffset)

Permitted data length (cbBuffer)

DB

Data byte offset: 0..65534

Read: max. 222 bytes, write: max. 216 bytes

M

Flag byte offset: 0..65534

I

Input byte offset: 0..65534

Q

Output byte offset: 0..65534

C

Counter start offset: 0..65534

Read: max. 111 word counters, write: max. 108 counters

T

Timer start offset: 0..65534

Read: max. 111 word timers, write: max. 108 timers

OS

Operating state: irrelevant

1 word (0=STOP, 1=START, 2=RUN, 3=UNKNOWN)