S5 Item Syntax

Home  Back  Next

 

The S5 item syntax is set up as shown below:

<Area><Data type><Start address>[.Array size][Suffix]

 

If the data type is BOOL, the bit number is required:

<Area><Data type><Start address><.Bitnr.>[.Array size]

 

If the data type is STRING, the string length is required:

<Area><Data type><Start address><.String length>[.Array size][Suffix]

Legend: <> mandatory        [ ] optional

<Area>

 

Syntax

Orientation1

Access rights

Notes

Data block

DBx

WORD

Read / write

With blocks, the specification of a block number x is required (x = 1 to 65535). After the block number no dot is required.

Extended data block

DXx

WORD

Read / write

Flag

M oder F

BYTE

Read / write

 

Timer

T

WORD

Read

 

Counter

Z oder C

WORD

Read

 

Input

E oder I

BYTE

Read

 

Output

A oder O oder Q

BYTE

Read / write

 

Periphery

P

BYTE

Read / write

 

Extended Periphery

OB

BYTE

Read / write

 

System area

 

WORD

Read

 

Absolute memory cells

AS

WORD

Read


1BYTE-oriented means that a byte is addressed for each physical address.

WORD-oriented means that a word (16 bits) is addressed for each physical address.

<Data type> for Data blocks and extended Data blocks

Type

VT_Type

Syntax

Sample

with Array

useful

Suffixes

BIT

VT_BOOL

D

DB5D4.12

---

---

BYTE

VT_UI1

DB

DB5DB3

DB5DB3.5

KF, BCD

LEFT BYTE

VT_UI1

DL

DB5DL4

DB5DL4.2

---

RIGHT BYTE

VT_UI1

DR

DB5DR2

DB5DR2.5

---

WORD

VT_UI2

DW

DB5DW4

DB5DW4.5

KF, BCD, KT, S5T, TR, SWAP

DOUBLE WORD

VT_UI4

DD

DB5DD3

DB5DD3.2

KF, BCD, KG, T, TOD, SWAP

QUAD WORD

VT_UI8

DQ

DB5DQ3

DB5DQ3.2

KF, BCD, SWAP

STRING

VT_BSTR

S

DB5S2.3

DB5S2.80.3

KA 1

 

S7-STRING

VT_BSTR

SS

DB5SS2.3

DB5SS2.80.3

---

S5-STRING

VT_BSTR

SF

DB5SF2.3

DB5SF2.80.3

---

<Data type> for all other areaes

 

Syntax

M or F

I/O

P / OB

C / T / RS / AS

with Array

useful

Suffixes

BIT

VT_BOOL

 

M4.3

F4.3

E4.3

I4.3

A4.3

Q4.3

---

---

---

---

BYTE

VT_UI1

B

MB4

FB4

EB4

IB4

AB5

QB5

PB4

OB4

---

MB4.3

FB4.4

EB4.4

IB4.5

AB5.2

QB5.5

PB4.2

OB4.3

KF

BCD

WORD

VT_UI2

W

MW4

FW4

EW4

IW4

AW5

QW5

PW2

OW2

C5

T5

RS4

BS4

AS5

MW4.2

FW4.4

EW4.5

IW4.2

AW5.5

QW5.2

PW2.10

OW2.3

C5.5

T5.3

RS4.2

BS4.7

AS5.2

KF

BCD

KT

S5T

TR

SWAP

DOUBLE WORD

VT_UI4

D

MD4

FD4

ED4

ID4

AD5

QD5

PD5

OD5

---

 

MD4.4

FD4.2

ED4.6

ID4.2

AD5.6

QD5.2

PD5.4

OD5.9

 

KF

BCD

KG

T

TOD

SWAP

QUAD WORD

VT_UI8

Q

MQ4

FQ4

EQ4

IQ4

AQ5

QQ5

PQ5

OQ5

---

MQ4.4

FQ4.2

EQ4.6

IQ4.2

AQ5.6

QQ5.2

PQ5.4

OQ5.9

KF

BCD

SWAP

STRING

VT_BSTR

S

MS4.80

FS4.80

---

---

---

MSS4.80.3

FSS4.80.3

KA 1

S7-STRING

VT_BSTR

SS

MSS4.80

FSS4.80

---

---

---

MSS4.80.3

FSS4.80.3

---

S5-STRING

VT_BSTR

SF

MSF4.80

FSF4.80

---

---

---

MSF4.80.3

FSF4.80.3

---

1   KA Suffix is not possible with string arrays

 

Notes on counters and timers

Counters and timers are always addressed by words. For this reason, the specification of a data type is not required!

The start address directly follows the “T” or “C/Z” area. Timers can only be read! Counters can be read and written.

Timer values are indicated in seconds (e.g., T = 0.7 => T = 0.7 s = 700 ms).

Counters are represented in decimals (0 to 999).

<Start address>

The start address specifies the addresses starting at which can be read or written.

Example: DB5.DW6: Double word 6 of the data block 5 is the start address.

Example: MB17: Flag byte 17 is the start address.

If the start address is a certain bit, the bit number must also be specified.

<.Bit number>

The bit number must always be specified when the data type is BOOL.

Example: I4.3: bit 3 of input byte 4 – an input bit is addressed here.

Example: FX12.1: Bit 1 of flag byte 12 – a flag bit is addressed here.

Note:

Writing to bits of a S5 PLC is not permitted. Please read the byte/word, set the bit and write the byte/word back.

[.Array size]

An array (i.e., field, row, data area) is a series of equal elements. An array combines several units of one data type into a field. If, for example, several words are read out from a data block, this is called an array of words. To create an array, the length of the array is added to the standard syntax separated by a dot.

Example: DB10DW2.5.

For more information on arrays, see also Arrays.

[Suffix]

A value can be represented in another format with the aid of a suffix.

For more information on suffixes, see also Suffixes.