h1244g MODBUS PLC PS4 416

background image

Hardware and Engineering

PS 416-MOD-200
MODBUS/JBUS Slave

05/96 AWB-EM 27-1244-GB

1st edition 05/96

© Moeller GmbH, Bonn

Author:

Arno Dielmann

Editor:

Barbara Petrick

Translator:

Karin Weber

U1_d.fm Seite 1 Mittwoch, 28. April 1999 3:08 15

background image

Caution!

Dangerous electrical voltage!

Before commencing the installation

Disconnect the power supply of the
device.

Ensure that the device cannot be
accidentally restarted.

Verify isolation from the supply.

Earth and short circuit.

Cover or enclose neighbouring units that
are live.

Follow the engineering instructions
(AWA) of the device concerned.

Only suitably qualified personnel may
work on this device/system.

Before installation and before touching
the device ensure that you are free of
electrostatic charge.

Connecting cables and signal lines
should be installed so that inductive or
capacitive interference do not impair the
automation functions.

Install automation devices and related
operating elements in such a way that
they are well protected against
unintentional operation.

Suitable safety hardware and software
measures should be implemented for
the I/O interface so that a line or wire
breakage on the signal side does not
result in undefined states in the
automation devices.

Ensure a reliable electrical isolation of
the low voltage for the 24 volt supply.
Only use power supply units complying
with IEC 60 364-4-41 or HD 384.4.41 S2.

Deviations of the mains voltage from the
rated value must not exceed the
tolerance limits given in the
specifications, otherwise this may cause
malfunction and dangerous operation.

Emergency stop devices complying with
IEC/EN 60 204-1 must be effective in all
operating modes of the automation
devices. Unlatching the emergency-stop
devices must not cause uncontrolled
operation or restart.

Devices that are designed for mounting
in housings or control cabinets must only
be operated and controlled after they
have been installed with the housing
closed. Desktop or portable units must
only be operated and controlled in
enclosed housings.

Measures should be taken to ensure the
proper restart of programs interrupted
after a voltage dip or failure. This should
not cause dangerous operating states
even for a short time. If necessary,
emergency-stop devices should be
implemented.

IBM is a registered trademark of International
Business Machines Corporation.

All other brand and product names are
trademarks or registered trademarks of the
owner concerned.

All rights reserved, including those of the
translation.

No part of this manual may be reproduced in
any form (printed, photocopy, microfilm or
any otherprocess) or processed, duplicated
or distributed by means of electronic
systems without written permission of
Moeller GmbH, Bonn.

Subject to alterations without notice.

background image

The communications card PS 416-MOD-200 is
designed for industrial applications and fulfils the
requirements of the EMC regulations on the basis of
the following EMC standards:

– EN 50081-2 (Emitted interference)

– EN 50082-2 (Interference immunity)

Observe the engineering notes in chapter 2, section
Screening in order to meet the requirements of the
EMC regulations.

5/96 A

W

B-

EM 27-1244-GB

3

background image

Contents

About this manual

6

Procedure

7

1 About the card

8

Task of the PS 416-MOD-200

8

Hardware/software requirements

9

Setup of the PS 416-MOD-200

11

2 Engineering

14

Number of PS 416-MOD-200 in the rack

14

Power supply

14

Connection assignment interface modules

14

IFM 232.1

15

IFM 422.1

16

IFM TTY.1

17

Wiring

18

Potential equalisation

18

Screening

19

3 Configuration

20

General

20

Procedure

20

Interface parameters

21

Accept configuration

23

4 Installation

24

Fitting the PS 416-MOD-200 with modules

24

Install PS 416-MOD-200 into the rack

25

5/96 A

W

B-

EM 27-1244-GB

4

background image

5 Operation

26

Operation of the card

26

Startup behaviour

27

Shutdown behaviour

28

Marker field for the data exchange

29

Addressing the card via the user program

30

Structure of the MOD200 function block

31

Data exchange

34

Reset behaviour

36

Example

37

6 Test and commissioning

41

LEDs

42

Diagnostics

42

7 MODBUS/JBUS

45

General

45

Transfer parameters

46

Error recognition

46

Query/response sequence

47

RTU/BINAIRE mode

47

Telegram fields

50

Addressing the slave operands

54

MODBUS/JBUS function code

56

Exception/error messages

59

Communication counter
of the PS 416-MOD-200

61

Appendix

63

Response to the function code 08

63

Response to the function code 17

66

Technical data

67

Additional equipment

68

Index

69

Contents

5/96 A

W

B-

EM 27-1244-GB

5

background image

About this Manual

The manual describes the setup, engineering,
configuration, installation, operation as well as test
and commissioning of the PS 416-MOD-200
communications card. The card belongs to the
programmable logic controllers PS 416.

The documentation is written for design engineers,
programmers and commissioning personnel who
wish to connect MODBUS/JBUS master to a
PS 416 system.

General knowledge of the control and
communication technology is assumed.

This manual is to be used for the implementation of
the PS 416-CPU-400 with the Software S 40. If you
wish to operate the card with the PS 416-CPU-223
and the S 30-S316 software, please use the
following manuals which you can order separately.

Title

Type

Ordering
no.

Hardware and Engineering
of the MODBUS/JBUS
communications card

AWB 27-1098-GB

033982

System Description MODBUS/JBUS AWB 27-1139-GB

052016

Configuration of the
MODBUS/JBUS communications
card with the S 30-CFG-MOD1-D
configurator

AWB 27-1140-GB

033173

Data exchange between
communications card and
MODBUS/JBUS master with
MOD1 user module

AWB 27-1141-GB

033175

Commissioning of the
Communications Card
MODBUS/JBUS

AWB 27-1142-GB

033176

5/96 A

W

B-

EM 27-1244-GB

6

background image

Procedure

The following procedure is recommended for a
successful operation of the PS 416-MOD-200:

1. Start with the definition of all your requirements

placed on the communication with the
MODBUS/JBUS master. Detailed description
see chapter 1, About the card.

2. Select the interface module according to the

requirements placed on the MODBUS/JBUS
master. Important criteria are, for example,
transfer distance and high degree of interference
immunity. Detailed description see chapter 2,
Engineering.

3. Edit the interface parameters in the configurator

of Sucosoft S 40. Detailed description see
chapter 3, Configuration.

4. Fit the card with the selected interface and

memory module and install the card in the rack.
Detailed description see chapter 4, Installation.

5. In your user program

declare the marker field variables which can
be written by the master and those which can
be read by the master.

activate the function block MOD200 via the
Enable input.

observe the diagnostics outputs.

Detailed description see chapter 5, Operation.

The card is thus installed, programmed and
configured, and you can start with the
commissioning the card.

About this Manual –
Procedure

5/96 A

W

B-

EM 27-1244-GB

7

background image

1

About the Card

Task of the
PS 416-MOD-200 card

The communications card PS 416-MOD-200 is
used as a slave connection to a MODBUS/JBUS
network in a PS 416 system. Each communication
station which can operate as MODBUS/JBUS
master can be connected to the PS 416-MOD-200.
Normally this is the process control station with the
most applications of this bus system in production
and process controls .

The card has an own microcontroller with firmware
and thus processes the communication process in
the user program without stressing the PS 416
central unit. The card can be adapted to different
applications due to its modular structure. Three
plug-in interface modules are available. The
SM 3-EE 32 plug-in memory module on the
PS 416-MOD-200 is provided for retentive storing
of the interface parameters.

The communications card is also provided with the
MOD200 function block which carries out the entire
data exchange between the application and the
master via the PS 416-MOD-200.Depending on the
master requirements data is taken from the declared
marker field section and transferred to the master,
or send data is transferred from the master to the
declared marker field section.The MOD200 function
block is part of Sucosoft S 40.

5/96 A

W

B-

EM 27-1244-GB

8

background image

The main functions of the card are:

Data exchange with a MODBUS/JBUS master
that controls all activities where the declared
marker ranges can be read and/or written in
conjunction with the function block. The card
checks the validity of the slave address and the
data access via the information entered in the
configurator.

Support of different physical interfaces for the
serial data exchange with the bus system
concerned (network).

Accepting and tranferring the interface
parameters for retentive storing if a SM 3-EE 32
memory module is fitted.

Hardware/Software
Requirements

Table 1 and 2 give an overview of the hardware and
software requirements for the operation of the
PS 416-MOD-200 in the PS 416 automation system.

5/96 A

W

B-

EM 27-1244-GB

About the Card –
Hardware/Software
Requirements

9

background image

Table 1: Hardware/software requirements under S 40

Sucosoft

S 40-Manager from Version 1.1,
Additional module S 40-ZB 416 from
Version 1.2

Operating system

for PS 416-CPU-400 from Version 1.09

Rack

PS 416-BGT-400/410/420 or 421
with potential equalisation bar
PS 416-ZBX-401/402/403

Power supply card

PS 416-POW-4xx

Central unit

PS 416-CPU-400

Table 2: Hardware/software requirements under S 30

Sucosoft

S 30-S316 Version 2.31

Operating system

for PS 416-CPU-223 from Version 1.32

Rack

PS 416-BGT-400/410/420 or 421
with potential equalisation bar
PS 416-ZBX-401/402/403

Power supply card

PS 416-POW-4xx

Central unit

PS 416-CPU-223

5/96 A

W

B-

EM 27-1244-GB

About the Card –
Hardware/Software
Requirements

10

background image

Setup of the
PS 416-MOD-200

a

b

c

d

e

f

g

Figure 1: PS 416-MOD-200 elements

5/96 A

W

B-

EM 27-1244-GB

About the Card –
Setup of the
PS 416-MOD-200

11

background image

a Switch S1/S2
b Plug-in connection
c LED (Error)
d LED (RxD/TxD)
e Interface module
f Slot for memory module
g System EPROM

a Switches S1/S2
The switches S1/S2 for the bus terminating
resistors must be opened (see chapter 3,
Configuration).

b Plug-in connection
The 9-pole subminiature D-socket is used as data
connection. The pin assignment depends on the
used interface module (see chapter 2, Engineering).

c LED (Error)
The LED indicates error messages (see chapter 6,
Test and Commissioning).

d LED (RxD/TxD)
The LED indicates the operating status of the card
(see chapter 6, Test and Commissioning).

e Interface module
Three plug-in interface modules are provided which
enable a user-friendly adaptation to the MODBUS
master (see chapter 2, Engineering). The type of the
fitted interface module is indicated on the
InterfaceStatus output of the MOD200 function
block (see chapter 6, Test and Commissioning).

The data cables of each module are optically
isolated to ensure better interference immunity.
Each interface module is supplied potentially
isolated via DC/DC converters. The different
initialisation of the used interface module is carried

5/96 A

W

B-

EM 27-1244-GB

About the Card –
Setup of the
PS 416-MOD-200

12

background image

out in Sucosoft S 40. The following interface
modules can be used:

Table 3: Suitable interface modules

Module

Features

Ordering
designation

RS 232

Full duplex (without control and
signal lines)

IFM 232.1

RS 422

Full duplex

IFM 422.1

20 mA

Full duplex (passive current loop
receiver/driver)

IFM TTY.1

f Slot for memory module
The use of a plug-in memory module ensures a
parameterization of the interfaces via the software
and a user-friendly operation of the
PS 416-MOD-200. The memory module is used for
retentive storing of all interface parameters such as
baud rate, parity, slave address etc.

The interface parameters are edited and then
stored in the Sucosoft S 40 at the programming
device (see chapter 3, Configuration). The following
memory module is available:

EEPROM 32 Kbytes (SM 3-EE32)

g System EPROM
This EPROM contains the operating system of the
PS 416-MOD-200. It can be plugged and thus be
exchanged easily after possible functional
expansions.

5/96 A

W

B-

EM 27-1244-GB

About the Card –
Setup of the
PS 416-MOD-200

13

background image

2

Engineering

Number of
PS 416-MOD-200 in the
rack

The communications card only operates in the
basic unit. The number of PS 416-MOD-200 that
can be operated in a rack depends on the power
consumption. You therefore should carry out a
calculation of current requirements in any case.

Power supply

The power supply of the card is internally provided
by the PS 416-POW-4xx power supply card via the
PS 416 rack. You will find further information in the
appendix, Technical data.

Connection
assignment interface
modules

The PS 416-MOD-200 with its different interface
modules enables the connection to the interfaces
RS 232C, RS 422 and TTY (20 mA current loop).
Table 4 shows the pin assignment of the data
connection socket of a PS 416-MOD-200.

5/96 A

W

B-

EM 27-1244-GB

14

background image

Table 4: Pin assignment of the 9-pole data connection

socket with different interface modules

Pin

IFM 422.1
RS 422

IFM 232.1
RS 232

IFM TTY.1
20 mA passive

1

2

B

( (RA)

RxD

E

TxD+

3

B (TA)

TxD

A

TxD–

4

PGND

5

SGND –

6

A

( (RB)

RxD+

7

A (TB)

RxD–

8

PGND

9

Designations A, A

(, B, B( acc. ISO

IFM 232.1

The communications card operates as “data
terminal equipment” (DTE) with a RS 232 coupling.
Figure 2 shows the signal numbering acc. CCITT
recommendation V24, the signal designation
according to RS 232 C and the signal flow.

PS 416-MOD-200

RxD

TxD

SGND

TxD

RxD

SGND

2

3

5

I

O

MODBUS Master

I/O

Signal

Pin

(Sender)

(Receiver)

Signal

Figure 2: Basic connection of the

PS 416-MOD-200 with IFM 232.1

5/96 A

W

B-

EM 27-1244-GB

Engineering –
IFM 232.1

15

background image

A transfer distance of up to 15 m is possible with a
baud rate of up to 19200 Baud. It is a full duplex
interface, i.e. data can be sent and received at the
same time.

Table 5: Meaning of the signals

Signal

Meaning

TxD output

send data, idle

–3 V

RxD input

receive data

SGND

Signal Ground

IFM 422.1

This module is suitable for data transfer with higher
baud rates and long distances. A transfer distance
of up to 1200 m is possible with a baud rate of up
to 19200 baud. Full duplex operation is possible
with this interface module when using a four-wire
cable.

Pin 3 is positive with respect to pin 7.

A

B

A

B

PGND

PS 416-MOD-200

5

6

2

3

4/8

7

(RB)

(RA)

(TB)

(TA)

MODBUS Master

I/O

Pin

Signal

Screen

Receiver

Receiver

Sender

Sender

Figure 3: Basic connection of the

PS 416-MOD-200 with IFM 422.1

5/96 A

W

B-

EM 27-1244-GB

Engineering –
IFM 422.1

16

background image

Table 6: Meaning of the signals

Signal

Meaning

A

(/B(

Differential input receive data

A/B

Differential output send data

PGND,
Potential
Ground

Potential equalisation via a 100 Ohm resistance
against the interface reference point if the difference
between the power supply of the modules of both
cards exceed a value of

±

7 V (see chapter 2,

Screening/Potential equalisation).

IFM TTY.1

A transfer distance of up to 1000 m is possible with
a transfer rate of op to 9600 baud. A four-wire cable
must be implemented as transfer medium for full
duplex operation. The load in conjunction with the
qualitiy of the constant current source defines the
maximum cable length. The current loop must be
supplied externally (e.g. from MODBUS master)
since it is a passive module.

TxD+

TxD-

RxD+

RxD-

PS 416-MOD-200

2

3

6

7

20 mA

20 mA

MODBUS Master

I/O

Pin

Signal

Screen

Sender

Receiver

Figure 4: Basic connection of the

PS 416-MOD-200 with IFM TTY.1

5/96 A

W

B-

EM 27-1244-GB

Engineering –
IFM TTY.1

17

background image

Table 7: Meaning of the signals

Signal

Meaning

RxD+/RxD–

Input receive data

TxD+/TxD–

Output send data

Wiring

You will find cable data in the Appendix, Technical
data.

Special cables with double screening or with
magnetically effective screen must be used for
noise-polluted environments where high
electromagnetic field strengths influence the data
connection when switching off/on high-capacity
consumers. A consequent screening is very
important so that the inductive and capacitive
influence due to electromagnetic fields is reduced
to a minimum.

Potential equalisation

This section describes the potential equalisation
between the power supplies of the RS 422 driver
modules in the connected communications card(s)
and the corresponding master.

The data reference potential (0 V) of the RS 422
interface driver must not exceed a voltage
difference of

±

7 V between the potentially isolated

communication stations. If this cannot be ensured,
a data cable with an additional line (5-core) must be
used for the potential equalisation. In this case the
potential equalisation cable must be connected via
a 100 Ohm resistance to the Signal Ground (0 V) of
the interface concerned.

With the PS 416-MOD-200 pins 4 and 8 of the
D plug connector (designation PGND) are lead to
the interface reference point (0 V) via 100 Ohm.

5/96 A

W

B-

EM 27-1244-GB

Engineering –
Potential equalisation

18

background image

This equalisation line is not relevant for the signal to
be transferred.

Screening

Engineering instructions

Observe the following engineering instructions in
order to meet the requirements of the EMC
regulations:

E Connect the screening of the data cable to the

protection earth by laying the data line on a
potential equalisation bar.

E Fit a HF ferrite ring on the supply side of the

data cable before the screen connection.

Remember that the HF ferrite ring is not supplied
with the card, but which must be ordered
separately under the type PS 416-ZBX-405.

Screen

Potential equalisation bar

Data cable

Ferrite ring

Figure 5: Measures against EMC interferences on the

data line (example)

5/96 A

W

B-

EM 27-1244-GB

Engineering –
Screening

19

background image

3

Configuration

General

Configure each installed communications card via
the configurator of Sucosoft S 40 before starting
the first data traffic via the serial interface. The
interface parameters to be set are involved in this
process.

Procedure

E Call up the configurator in the Sucosoft S 40.
E Enter a “0” in the fields “Line” and “Rack/

Station” to configure the PS 416-MOD-200
since the card can only be operated in the basic
unit of the Sucocontrol PS 416.

E Enter the slot in the “Slot/Module” field where

you will find the card.

E Select in the option box “Selectable Types” the

option “Card”. Select the PS 416-MOD-200
from the available cards. Then click the
“Parameters” button. Now select the interface
parameters according to your communication
requirements:

5/96 A

W

B-

EM 27-1244-GB

20

background image

Interface parameters

Baud rate

600/1200/2400/4800/9600/19200: The maximum
baud rate also depends on the selection of the
interface module. The baud rate must be at least
600 baud. The otimum data throughput is obtained
with a transfer rate of 9600 baud.

Parity

without/even/odd: A parity bit can be added to
ensure a secure transfer. The sender can add a
character to obtain an even or odd value. This must
meet the parity setting where, however not each
combination of data format, stop bit number and
paraity bit is possible (see Table 8).

Figure 6: Parameter settings in the configurator

5/96 A

W

B-

EM 27-1244-GB

Configuration –
Interface parameters

21

background image

Stop bit

1/2 (see Table 8)

Character format combinations

Plausibility checks are carried out by the editor and
possible deviations are indicated.

Table 8: Permissible character format combinations

Start bit (fixed value) Data bit

Parity bit

Stop bit

1

8

0

1

1

8

0

2

1

8

1

1

SA

D0

D1

D2

D3

D4

D5

D6

D7

PA

S0

S0

SA

Start bit

D0–D7

Data bit

PA

Parity bit

SO

Stop bit

MODBUS/JBUS Mode

Select between a MODBUS and JBUS mode
according to the master used (see chapter 7,
MODBUS/JBUS).

Slave address 1...247

Each slave address must be assigned only once for
each bus and must be entered directly as numeric
value.

Figure 7: Character format

5/96 A

W

B-

EM 27-1244-GB

Configuration –
Interface parameters

22

background image

Status display Yes/No

If “Yes” is indicated, the PS 416-MOD-200 carries out
an update of the three 16-bit communication
counter “Message counter”, “BusyCounter” and
“ErrorCounter” of the function block MOD200
(see chapter 7, MODBUS/JBUS, Communication
counter of the PS 416-MOD-200 and chapter 5,
Operation, structure of the MOD200 function block).
The counter states are refreshed automatically by
the PS 416-MOD-200 each 60 s.

F

The status display should be used as a
commissioning aid and should therefore be
switched off during operation since the user
data exchange is decelerated by the status
refresh.

Accept configuration

Exit the menu by pressing the “OK” button in order
to accept the selected interface parameters for the
configuration. Confirm by clicking the “Add” button
to accept the card with its parameters to the
configuration of the PS 416. Save the configuration
file if you have accepted all cards with its
parameters into the configuration of the PS 416.

When transferring the user program, the
configuration data is automatically transferred to
the PS 416-MOD-200 where it is stored together
with the checksum in the SM 3-EE 32 memory
module.

5/96 A

W

B-

EM 27-1244-GB

Configuration –
Accept configuration

23

background image

4

Installation

F

Ensure that you are free of any electrostatic
charge to the rack or another earthed area in
order to prevent discharge of static electricity of
the components before having contact with the
PS 416-MOD-200, its elements on the front
plate or modules.

Fitting the
PS 416-MOD-200 with
modules

Beside the fitting of the PS 416-MOD-200, no
further initialisation works on the hardware are
necessary since the modules transfer their code to
the PS 416-MOD-200 and are initialised by the
code.

E Fit the interface module equipped with post

connectors at both sides in the base provided
behind the front plate.

E Fit the memory module equipped with a post

connector on one side in the base provided
directly beside the system EPROM and fix the
module by srewing.

Interface and memory module are protected against
faulty fitting and polarity reversal due to their
different plug connectors.

5/96 A

W

B-

EM 27-1244-GB

24

background image

Install
PS 416-MOD-200 into
the rack

!

Warning!
The card must only be removed or fitted with
the power supply switched off.

E Check whether interface and memory module

are fitted correctly on the PS 416-MOD-200.

E Ensure that the front plate switches S1/S2 are

opened.

E Fit the PS 416-MOD-200 in the rack from slot 4.

There is no address switch on the PS 416-MOD-200
card. Define the information of the slot in which the
communications card is fitted in the configurator of
the Sucosoft S 40.

Connect the PS 416-MOD-200 card to the master
via the 9-pole socket connector on the front plate of
the card.

5/96 A

W

B-

EM 27-1244-GB

Installation –
Install PS 416-MOD-200
into the rack

25

background image

5

Operation

Operation of the card

Data interface to the central unit

The data exchange between the communications
card and the central unit of the PS 416 is carried
out by the MOD200 function block if the Enable
input of the function block was set to signal
status 1 and the master then sends or receives data
telegrams.

The data is exchanged via a Dual-Port-RAM
(DPRAM). Each communications card provides an
own DPRAM via which the PS 416-MOD-200
receives data operating parameters from the
Sucosoft S 40 and data for the master.

Slave n

MODBUS/
JBUS

Master

Slave n+2

PS 416-MOD-200

DPRAM

RAM

Bus
connection

Slave n+1

Function
block
MOD 200

Central Unit

Marker (M)

Data section

Figure 8: Data interface to the central unit of the PS 416

5/96 A

W

B-

EM 27-1244-GB

26

background image

The card provides parameters confirmations, data
from the master and status information via the
DPRAM as return value.

The data exchange can be divided into two phases.

Initialisation phase:
In the initialisation phase the communications card
is configured via the DPRAM from the programming
device.

Operating phase:
The PS 416-MOD-200 can react to telegrams from
the master if the Enable input has signal status 1 on
the MOD200 function block. Data is exchanged via
the user-defined marker ranges.

Startup behaviour

Cold and warm start are the common start
procedures.

Cold start

Once the PS 416 has been switched on, the
communications card starts with the self test. The
PS 416-MOD-200 checks the size and functionality
of the memory module, the interface module and
the RAM modules.

The microprocessor enters an error message into
the DPRAM if one of the following errors occurs:

defect operating system EPROM (if it can be
recognised)

defect RAM

defect DPRAM (if it can be recognised)

memory module not fitted

5/96 A

W

B-

EM 27-1244-GB

Operation –
Startup behaviour

27

background image

In the event of an error an according error message
is output in the MOD200 function block when the
program is started.

If no error occurred, and no valid checksum has
been detected when checking the memory module
after the self test, stored interface parameters do
not exist for the card and the program logic
assumes a cold start. The PS 416-MOD-200 is now
waiting for a valid configuration.

Warm start

If no error occurred, and a valid checksum has been
detected when checking the memory module after
the self test, the program logic assumes a warm
start, i.e. an already initialised valid memory module.
The operating system of the PS 416-MOD-200 then
detects which interface parameters are stored,
carries out the corresponding settings and enters
the current configuration (used module ) in the
DPRAM. When calling up the MOD200 function
block, these entries are provided for the user on the
InterfaceStatus output or, if required, on the Error
output of the module.

Shutdown behaviour

A voltage dip is indicated to the communications
card via a control line and the send and receive
operation is interrupted via the serial interface. Data
still to be sent and already received data is rejected.

The retentively stored interface parameters are still
provided if the voltge supply is switched on again.
All data and messages which are temporarily stored
in the DPRAM are lost.

5/96 A

W

B-

EM 27-1244-GB

Operation –
Shutdown behaviour

28

background image

Marker field for the
data exchange

The PS 416-CPU-400 provides 2173 marker words.
The markers that you need for the communication
in the user program must be declared. The
connection between the PS 416-CPU-400 and the
user program is thus established.

As shown in Table 9 you can access the markers in
bit, byte, word and double word format from the
user program.

Table 9: Overview of the marker address ranges

Data type
(Number)

Marker start of range

Marker end of range

End of marker range accessible by

MODBUS telegram

bool
(34768)

%M0.0.2.0.0

%M0.0.2.4345.7

%M0.0.2.1248.7 with MODBUS
access to Discrete Output Coils via the
function codes 01, 05 and 15
(see Table 19)

byte
(4346)

%MB0.0.2.0

%MB0.0.2.4345

word
(2173)

%MW0.0.2.0

%MW0.0.2.4344

%MW0.0.2.4344 with MODBUS
access to Output Holding Register via
the function codes 03, 06 and 16
(see Table 19)

dword
(1086)

%MD0.0.2.0

%MD0.0.2.4340

F

Organise the PS 416 marker field so that
markers of, for example, Profibus or SUCOM A
communication cannot overlap accidentally.

The markers are updated via the image register.

5/96 A

W

B-

EM 27-1244-GB

Operation –
Marker field for the data
exchange

29

background image

If you activate the MOD200 function block via the
Enable input, and call it up at least once per cycle,
the operating system of the PS 416-CPU-400
provides the user-defined markers of the
PS 416-MOD-200 for data exchange at the end of
the cycle.

Data is only exchanged if it is initiated by the
MODBUS master. The master defines the offset on
the first marker via the operand address to which
the current telegram accesses. The offset is always
stated from MB0.0.2.0 and is converted into a
number of bytes by the PS 416-MOD-200.

The number of operands defines the size of the
marker field which is accessed. The master defines
via the function code whether the markers are read
or written, see chapter 7, Telegram fields and
Addressing the slave operands.

Addressing the card by
the user program

The PS 416-MOD-200 is addressed via the
MOD200 function block. The MOD200 function
block is the interface between the user and the
PS 416-MOD-200. In the user program of the
PS 416 the function block reacts to send and
receive jobs sent by the master if the Enable input
has the signal status 1.

The function block also enables the status of the
PS 416-MOD-200 to be checked via the
InterfaceStatus and Error outputs.

The user can check the connection to the master
via the diagnostics outputs MessageCounter,
BusyCounter and ErrorCounter of the MOD200
function block if Status display was switched on
during configuration.

5/96 A

W

B-

EM 27-1244-GB

Operation –
Addressing the card by the
user program

30

background image

Only one MOD200 function block must be
instantiated for each card.

Structure of the
MOD200 function block

The MOD200 function block is structured as
follows:

Enable

SlotNumber

BOOL

UINT

BOOL

UINT

UINT

UINT

UINT

UINT

UINT

UINT

UINT

UINT

Active

ReceiveNumber

ReceiveOffset

TransmitNumber

TransmitOffset

InterfaceStatus

Error

MessageCounter

BusyCounter

ErrorCounter

Figure 9: Structure of the MOD200 function block

5/96 A

W

B-

EM 27-1244-GB

Operation –
Structure of the MOD200
function block

31

background image

The displayed inputs/outputs have the following
meaning:

Inputs of the MOD200 function block

Table 10: Overview of the function block inputs

Name

Data type

Meaning

Enable

BOOL

The connection between application and PS 416-MOD200 is
established if the signal status of the Enable input is and remains 1
on the MOD200 function block. The communications card can now
react to telegrams of the master. The signal status 0 on this input
resets the connection between application and the
PS 416-MOD-200 if the function block was already active.

SlotNumber

UINT

Slot of the assigned PS 416-MOD-200
(4...20 in basic unit)

Outputs of the MOD200 function block

Table 11: Overview of the function block outputs

Name

Data type

Meaning

Active

BOOL

Acknowledges signal status 1 on Enable input with signal status 1 if
no error occurred. In this case the Error output indicates 0 for bits
0–7. The Active output changes to signal status 0 if the signal status
is 0 on the Enable input.

ReceiveNumber

UINT

Number of bytes received by the application in the marker section
from the PS 416-MOD-200 and the master. The display is reset to 0
when receiving a new master write job and updated after the
corresponding job has been processed. This number is displayed
until the next master write job is started.

1)

ReceiveOffset

UINT

The target address for the bytes received by the MODBUS master
are displayed on this output. The offset information is in byte format
starting from MB0.0.2.0. The output is updated after the
corresponding master write job has been processed

TransmitNumber

UINT

Number of bytes sent to the master. The display is reset to 0 when
receiving a new master read job and updated after the
corresponding job has been processed. This number is indicated
until the next master read job.

1)

TransmitOffset

UINT

The source address of the bytes requested by the master is

indicated on this output. The offset information has byte format

5/96 A

W

B-

EM 27-1244-GB

Operation –
Structure of the MOD200
function block

32

background image

InterfaceStatus

UINT

Display which interface/memory module is fitted

Error

UINT

Display whether the selected slot address is valid

MessageCounter

UINT

Number of messages from master

BusyCounter

UINT

Display how often the PS 416-MOD-200 had to answer the master
with the exception code 06 (busy).

ErrorCounter

UINT

Display how often the PS 416-MOD-200 has been addressed by the

master with an unpermissble request.

1) You can check the data exchange with the master due

to a permanent change between 0 and another
specified number of send and receive bytes while the
program is running.

Update of inputs/outputs

You should call up the MOD200 function block
once in each user program cycle in order to react
quickly to status modifications of the
communications card.

With time-critical data transfer you can call up the
MOD200 function block also several times in one
cycle. This should be prevented in order to ensure
clearer programming and shorter cycle time.

The update of the outputs is carried out with each
callup of the MOD200 function block. The
SlotNumber input is only read with the first
recognition of the signal status 1 on the Enable
input.

The InterfaceStatus output must only be checked
once after the Enable input has been set to signal
status 1. This value does not change during
operation.

5/96 A

W

B-

EM 27-1244-GB

Operation –
Structure of the MOD200
function block

33

background image

Startup behaviour

After switching on the power supply the
communication processor of the PS 416-MOD-200
requires approx. 6 seconds to get ready for
operation. An Enable input set during this time is
not recognised.

Setting parameters for MOD200 function block

Proceed as follows when setting parameters for
the MOD200 function block in order to enable the
data exchange between the PS 416-MOD-200 and
the master:

Assign exactly one MOD200 function block to each
card via the corresponding slot number
(SlotNumber) in the user program.

Data exchange

Enable data exchange

Activate the signal status 1 on the Enable input. The
function block checks whether a PS 416-MOD-200
is fitted on the stated slot and outputs an Error
message if required (see chapter 6, Diagnostics).

The master is able to read data from the declared
marker ranges or to write data into these marker
ranges if the operand address and the number of
operands is correct.

Monitoring data exchange

If the data exchange has been started on the
Enable input, the further process should be
monitored permanently. The following function
block outputs are available for this:

5/96 A

W

B-

EM 27-1244-GB

Operation –
Data exchange

34

background image

Active: As long as the Enable input has the signal
status 1 and no error occurred with the first setting
of this status on the Error output, the Active output
must also remain in signal status 1.

InterfaceStatus: This output must only be checked
once for the content 0 after setting the Enable input
to signal status 1. The value does not change
during operation.

Error: This output should be checked cyclically, i.e.
with each callup of the MOD200 function block for
the content 0. If error messages or warnings are
present, measures must be taken from the user
program. You will find the meaning of the error
codes in chapter 6, Error messages.

ReceiveNumber: If the master sends data, the
number of received data bytes can be read on this
output. Alternating indication of 0 and a number

M 1

indicates that the connection to the master
functions correctly.

ReceiveOffset: The evaluation of this offset in
conjunction with the number of received data bytes
on the ReceiveNumber output enables the direct
access to the currently received data.

TransmitNumber: The number of the sent data
bytes to the MODBUS master can be read on this
output if the master requests data. Alternating
indication of 0 and a number

M 1 indicates that the

connection to the master functions correctly.

TransmitOffset: The evaluation of this offset in
conjunction with the number of sent data bytes on
the TransmitNumber output enables the accurate
update of the marker field range which reads the
master.

5/96 A

W

B-

EM 27-1244-GB

Operation –
Data exchange

35

background image

MessageCounter, BusyCounter and ErrorCounter
should only be evaluated during the commissioning
phase since the update of these outputs
decelerates the data exchange with the master
considerably.

Abort data exchange

A data exchange can be interrupted by setting the
signal status from 1 to 0 on the Enable input if the
exchange does not occur in the time or way
expected (Reset).

Reset behaviour

If the Enable input is 0 after the MOD200 function
block has previously been called up with the Enable
input = 1, this means that the function block is reset
and the connection to the communications card is
reset to the initial status. The function block outputs
are reset except the Message/Busy and
ErrorCounter outputs. The Enable input does not
affect the PS 416-MOD-200 which is permanently
ready to receive and receives and stores possible
master telegrams. If the Enable input is set to “1” in
such a case, the PS 416-MOD-200 initiates the
stored master requests to be processed and sends
back up to 8 response telegrams.

Answering requests which are no longer valid can
be prevented if the data transfer is stopped by the
master before a Reset of a function block.

5/96 A

W

B-

EM 27-1244-GB

Operation –
Reset behaviour

36

background image

Example

Division of the marker range

ReadCoil 0–7

m0.0.2.0.0–m0.0.2.0.7

Marker byte 0

Offset 0

free

Marker byte 1

ReadRegister 1

mw0.0.2.2

Marker byte 2

Offset 2

Marker byte 3

ReadRegister 2

mw0.0.2.4

Marker byte 4

Offset 4

Marker byte 5

WriteCoil 0–7

m0.0.2.6.0–m0.0.2.6.7

Marker byte 6

Offset 6

free

Marker byte 7

WriteRegister 1

mw0.0.2.8

Marker byte 8

Offset 8

Marker byte 9

WriteRegister 2

mw0.0.2.10

Marker byte 10

Offset 10

Marker byte 11

Declaration section:

VAR
ModEnable at %i0.0.0.0.0 : bool;
ModActive at %q0.0.0.0.0 : bool;
ModError at %qw0.0.0.2 : uint;

(*********** Receive data from master, type bool ********** *)
(* 8 marker bits within a byte are declared

*)

(* for writing the master in bit format.

*)

(* Permissible ReceiveOffset = 0

*)

ReadCoil0 at %m0.0.2.0.0 : bool;
ReadCoil1 at %m0.0.2.0.1 : bool;

.

.

.

ReadCoil7 at %m0.0.2.0.7 : bool;

(*********** Receive data from master, type word ********** *)
(* 2 marker words are declared for writing the

*)

(* master in word format

*)

(* Permissible ReceiveOffset = 2 or 4

*)

ReadRegister1 at %mw0.0.2.2 : word;
ReadRegister2 at %mw0.0.2.4 : word;

(************ Send data to master, type bool *************)
(* 8 marker bits within a byte are declared for

*)

5/96 A

W

B-

EM 27-1244-GB

Operation –
Example

37

background image

(* reading the master in bit format

*)

(* Permissible TransmitOffset = 6

*)

WriteCoil0 at %m0.0.2.6.0 : bool;
WriteCoil1 at %m0.0.2.6.1 : bool;
.
.
.
WriteCoil7 at %m0.0.2.6.7 : bool;

(************ Send data to master, type word ************

*)

(* 2 marker words are declared for reading

*)

(* the master in word format

*)

(* Permissible TransmitOffset = 8 or 10

*)

WriteRegister1 at %mw0.0.2.8 : word;
WriteRegister2 at %mw0.0.2.10 : word;

(* Function block for recognition of the first cycle

*)

(* after a cold start

*)

firstcycle_cold : PS_Message;
(* Function block for recognition of the first cycle after *)
(* a warm start

*)

firstcycle_warm : PS_Message;

(****** Declaration of the function block MOD200****

*)

mod1 : MOD200;
END_VAR

5/96 A

W

B-

EM 27-1244-GB

Operation –
Example

38

background image

Program section:

CAL

first cycle_cold(MessageType := ICS |

:=Result)

CAL

firstcycle_warm(MessageType := ISA |

:=Result)
ld

firstcycle_cold.Result

or

firstcycle_warm.Result

jmpcn data
(* In the first cycle after cold/warm start the

*)

(* slot number is entered and checked for correctness

*)

ld

ModEnable

st

mod1.Enable

ld

6

st

mod1.SlotNumber

CAL

mod1

ld

mod1.Error

ne

0

jmpc

error

jmp

end

(* After error-free initialisation the MOD200

*)

(* function block is called up cyclically for update of the *)
(* send and receive data

*)

data:
CAL

mod1

ld

mod1.Error

ne

0

jmpc

error

ld

mod1.Active

st

ModActive

jmpcn end

ld

mod1.ReceiveNumber

ge

1

jmpcn write
read:
(* Master has sent data since the ReceiveNumber is

M 1

*)

(* Read receive data from the master for further processing
from

*)

(* Marker field

*)

5/96 A

W

B-

EM 27-1244-GB

Operation –
Example

39

background image

ld

mod1.ReceiveOffset

.

.

.

.

ld

ReadRegister1

st

...

.

.

.

.

write:

ld

mod1.TransmitNumber

ge

1

jmpcn end
(* Master has read data since the TransmitNumber is

M 1

*)

(* New send data to the master must be initialised

*)

ld

mod1.TransmitOffset

.

.

.

.

.

ld

...

st

WriteRegister1

.

.

.

.

.

error:
ld

mod1.Error

st

ModError

end:
ld mod1.MessageCounter
ld mod1.BusyCounter
ld mod1.ErrorCounter

END_PROGRAM

5/96 A

W

B-

EM 27-1244-GB

Operation –
Example

40

background image

6

Test and Commissioning

General

A PS 416 system requires at least a rack with
power supply, a central unit and a
PS 416-MOD-200 with an interface and memory
module each.

!

Warning!
Fit or remove the communications card only
with the voltage supply switched off.

The green “TxD/RxD” LED on the front plate is
permanently lit after switching on the voltage
supply and successful self test. The data transfer
can be started on the MOD200 function block if the
interface parameters of the PS 416-MOD-200 and
the master match, and the data cable connects the
required terminals. See chapter 5, Data exchange.

Data exchange between a communications card
and the connected master is enabled in the RUN
status of the central unit by calling up the MOD200
function block concerned. Exactly one
communications card must be assigned to each
MOD200 function block.

5/96 A

W

B-

EM 27-1244-GB

41

background image

LEDs

Table 12: Meaning of the LEDs

LED

Meaning

Green LED TxD/RxD: Permanent
light

communications card ok.

Green LED TxD/RxD: flashes

Indicates a functioning card which

exchanges data

Green LED TxD/RxD: off
Red LED ERR:

Permanent
light

An error or a faulty initialisation of
the card occurred.

Red Error LED ERR:

flashes

Permanent flashing in 2-Hz

rhythm means a faulty or
incorrectly initialised interface or
memory module.

Diagnostics

The communications card offers a diagnostic
possibility via the Error and InterfaceStatus outputs.

InterfaceStatus

The status of the card and the fitted modules is
indicated via the InterfaceStatus output. The
InterfaceStatus must only be checked once after
setting the Enable input to the signal status 1. The
value does not change during operation.

5/96 A

W

B-

EM 27-1244-GB

Test and Commissioning –
Diagnostics

42

background image

Bit

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

IFC

PAR

SPM

2

SPM

1

SPM

0

IFM

2

IFM

1

IFM

0

Table 13: Function block output InterfaceStatus:

Fitted interface modules

Interface module

Interface

IFM 2

IFM 1

IFM 0

IFM 422.1

RS 422

0

0

1

IFM 232.1

RS 232

0

1

0

IFM TTY.1

Current loop
20 mA

1

0

0

No module

Error recognition

1

1

1

Table 14: Function block output InterfaceStatus:

Fitted memory modules

Memory module

Type

SPM 2 SPM 1 SPM 0

SM 3-EE 8

EEPROM, 8 Kbytes

0

0

0

SM 3-EE 32

EEPROM, 32 Kbytes 0

0

1

No module

Error recognition

1

1

1

Table 15: Function block output InterfaceStatus:

Error messages

Bit No.

Type

Status

Meaning

11

PAR

1

PS 416-MOD-200 faulty parameters

12

IFC

1

PS 416-MOD-200 not ready for
operation

Figure 10: Function block output InterfaceStatus

5/96 A

W

B-

EM 27-1244-GB

Test and Commissioning –
Diagnostics

43

background image

Error

The function block output Error indicates whether
the selected slot address is valid, a
PS 416-MOD-200 card is fitted on this slot, the
communications card is operated correctly and
whether the card and the MODBUS master transfer
valid commands.

Bit

15

14

13

12

11

10

9

8

7

6

5

4

3

2

1

0

CMD

SYS

PAR MOD

TYP

SLN

Table 16: Function block output Error:

Possible error messages

Bit No.

Type

Status

Meaning

0

SLN

1

There is no card fitted under the stated
slot number.

1

TYP

1

There is no PS 416-MOD-200 fitted in
the stated slot.

2

MOD

1

Hardware error of the PS 416-MOD-200

3

PAR

1

Parameters of the PS 416-MOD-200 not
loaded or memory module is faulty.

7

SYS

1

Internal system error of the
PS 416-MOD-200.

8

CMD

1

The command transferred by the
PS 416-MOD-200 is invalid.

Figure 11: Function block output Error

5/96 A

W

B-

EM 27-1244-GB

Test and Commissioning –
Diagnostics

44

background image

7

MODBUS/JBUS

General

This chapter provides basic information about the
MDOBUS and JBUS protocol and the behaviour of
a PS 416 as slave in a MODBUS/JBUS network.

The MODBUS protocol was developed for the data
exchange between stations of a serial bus in
industrial environment. It defines the
communication process, i.e. the sequence of the
query and response telegram, the telegram
structure with its fields, the synchronisation times
and troubleshooting.

The telegram structure of the JBUS is mainly
identical with the telegram structure of a MODBUS.
Only in telegram elements which are organised as
byte pair (e.g. the CRC16 check character) the High
and Low byte are transferred in reverse order. See
Figure 13, Structure of a MODBUS-RTU/BINAIRE
telegram.

MODBUS/JBUS is a centrally polled bus system
where the master controls the entire data traffic on
the bus and no lateral communication between the
slaves is possible. Each data exchange is initiated
by the master via a query. A slave cannot initiate a
transfer but only response to a query.

The definitions of the MODBUS Protocol Reference
Guide, PI-MBUS-300 Rev. B, Edition January 1985,
of Gould Inc. Andover, Massachusetts, were taken
into consideration when developing the
PS 416-MOD-200.

The PS 416-MOD-200 supports the MODBUS-RTU
and the JBUS-BINAIRE mode (RTU = Remote
Terminal Unit). You will find a detailed description
on this mode in section RTU/BINAIRE mode.

5/96 A

W

B-

EM 27-1244-GB

45

background image

Transfer parameters

Some parameters are predefined by the protocol,
such as the telegram structure and the function
codes which inform the slave station about the type
of the master job.

Other parameters can be defined by the user and
must be identical with all network stations regarding
the transfer physics (interface selection, cables), the
transfer rate (baud rate) and the selection of parity
and stop bit.

These parameters for the PS 416-MOD-200 are
entered into the configurator before the operation
and stored retentively stored in the memory module
on the card. The parameters thus cannot be
modified anymore during operation.

Error recognition

As in every communication system, two basic error
types can occur also in the MODBUS/JBUS
communication:

Transfer error

Application/protocol error

Transfer error

Transfer errors can be recognised by the evaluation
of the paritiy bit and the testing character. These
errors mainly occur due to malfunctions affecting
the transfer line.

5/96 A

W

B-

EM 27-1244-GB

MODBUS/JBUS –
Error recognition

46

background image

The cyclic safety code CRC 16 (Cyclic Redundancy
Check) is used as check character in the
RTU/BINAIRE mode. If a transfer error is detected,
the PS 416-MOD-200 does not respond and the
received telegram is rejected. The communication
unit signals the malfunction on the master and
permits a new telegram output when the time-out
time has elapsed. On the slave a transfer error is
not indicated but a new master telegram is
expected.

Application/protocol error

An application/protocol error from the slave always
represents a wrong master access. In this case a
slave responds with a special code and an
exception response code. The reaction
(e.g. PS 416-MOD-200) to application and protocol
errors is described in this chapter in section
Exception/error messages.

Query/
response sequence

This protocol generally provides a query/response
sequence as shown in Figure 12 which can only be
initiated by the master in the centrally polled
MODBUS/JBUS system.

RTU/BINAIRE mode

In this mode the characters are transferred in binary
form where each of these 8 bit characters can have
a decimal value between 0 and 255.

5/96 A

W

B-

EM 27-1244-GB

MODBUS/JBUS –
RTU/BINAIRE mode

47

background image

Table 17: Features of the RTU/BINAIRE mode

Feature

RTU/BINAIRE (8 bits)

Coding

8 bits binary

Bit per character:
– Start bit
– Data bit
– Parity bit
(with parity even/odd)
(if no parity is selected)
– Stop bit

1
8
1
1
0
1 or 2

Check character

CRC 16

Start/end character

A quasi-synchronous transfer procedure must be
simulated since in the RTU mode a telegram is
transferred without start and end characters. The
receiver checks the pause between the individual
characters of the telegram. After a pause of more
than 3.5fold character length a telegram is
considered to be terminated and the internal
process is started.

Master

Slave

1. Station address (DA)
2. Function code (FC)
3. Data/Inform. (DU)

4. Check character (P)

Master telegram

Query

Response

Slave telegram

PS 416-MOD-200

1. Station address (DA)

2. Function code (FC)

3. Data/Inform. (DU)
4. Check character (P)

Figure 12: Query/response sequence with

MODBUS/JBUS

5/96 A

W

B-

EM 27-1244-GB

MODBUS/JBUS –
RTU/BINAIRE mode

48

background image

Check character

Cyclic safety code, CRC 16
(Cyclic Redundancy Check).

Synchronisation pause

If a pause of more than 3.5fold character length has
passed after having received the last character, the
receiver rejects the received characters if the
telegram is not complete. The receiver assumes
that the next received character is an address in a
new telegram.

Telegram structure

Station

address

Function

code

Data/

Information

CRC 16

HO

LO

3

×

T

1 Byte

1 Byte

n Byte

2 Byte

3

×

T

T = Duration of a character transfer

The following example shows the telegram
structure in the RTU/BINAIRE mode with
QueryFC = 08 (Loopback Diagnostic Code).

Station Addr.

FC

Diag. Code

Data

CRC 16

Hex

01

08

00 00

61 61

08 73

Figure 14: Example of a MODBUS-RTU/BINAIRE

telegram

Figure 13: Structure of a MODBUS-RTU/BINAIRE

telegram

5/96 A

W

B-

EM 27-1244-GB

MODBUS/JBUS –
RTU/BINAIRE mode

49

background image

Telegram fields

Master and slave telegram have the same frame,
only the data/information field and thus the content
of the check character is modified with the slave
response.

Table 18 shows the four types of fields of a
MODBUS/JBUS telegram. The errors are then
explained in detail.

Table 18: MODBUS/JBUS telegram fields

Slave station address
(1 byte)

The master exactly addresses each slave via
the address. The address of the slave is
reflected in the response. The master
addresses all slaves via address 0
(Broadcast), these do not respond.

Function code (FC)
(Command)
(1 byte)

The master sends the job to the addressed
slave via the function code (reading, writing
bits or words). The FC is reflected in the
response of the slave.

Data/information
(n byte)

The data/information field contains the
parameters depending on the FC: operand
address, binary or word value

Check characters
(Error Check)
(2 bytes)

The receiver can detect transfer errors by
creating an independent checksum and
comparing it with the received check
character.

Address field

The address field always contains the station
number of a slave in the direction of the callup and
the response. A request can clearly be assigned to
a slave since each address must only be assigned
once in a network.

A MODBUS/JBUS master station can manage
station numbers from 1 to 247. The actual number
of slave stations in the network is restricted
physically by the interface drivers of the master.

5/96 A

W

B-

EM 27-1244-GB

MODBUS/JBUS –
Telegram fields

50

background image

The master sends a “Message to All” (Broadcast)
by transferring the station number 0. A Broadcast
message is only permitted in conjunction with
function codes where the slave must not respond to.

Function code field

In query telegram (from master)

The master sends his request, the command to the
slave station via the function code (FC). Generally, a
query means that data contents of operands (bits or
words) must be modified in the slave address
section or that data must be sent back to the
master. The master is also able to carry out a
remote diagnosis of the slave station via the
function code 08.

In the MODBUS/JBUS telegram it is defined via the
function code whether a bit memory (Discrete
Output Coil), a bit input (Discrete Input Coil), an
input register (Input Register) or a memory register
(Output/Holding Register) is to be accessed. The
access to one of these four possible reference
types (0xxxx, 1xxxx, 3xxxx and 4xxxx) is
preselected indirectly via the function code. See
section Addressing of the slave operands in this
chapter.

F

The PS 416-MOD-200 supports the reference
types 0xxxx and 4xxxx.

The individual operands are addressed via
reference numbers within such a reference type.
These reference numbers are transferred as
operand address in the data/information field of the
MODBUS/JBUS telegram described in the
following. This type of addressing is carried out by

5/96 A

W

B-

EM 27-1244-GB

MODBUS/JBUS –
Telegram fields

51

background image

the MODBUS/JBUS stations itself and must not be
observed by the user at any time.

Tables 20, 21 and 22 in the section MODBUS/JBUS
function codes of this chapter show a list of the
function codes which are supported by the
PS 416-MOD-200. These tables also show which of
these function codes causes which action from the
PS 416, and which reference numbers are basically
permitted, i.e. which operand address may be sent
by the master in the data/information field
described in the following. Table 21 shows which
combinations of function code and reference
number (operand address) must be generated to
permit the master to access certain PS 416
operands.

In response telegram (from slave)

The slave reflects the function code of the query
telegram in its response telegram, except in the
event of an error. See section Exception/error
messages.

Data/information field

In query telegram (from master)

This field contains information required for the
execution of a specified job. The field can contain
operand addresses, data and information about the
number of data. Length and content are defined by
the previous function code.

5/96 A

W

B-

EM 27-1244-GB

MODBUS/JBUS –
Telegram fields

52

background image

In response telegram (from slave)

In the response telegram content and length of this
field depend on the received function code. After a
master read request (e.g. FC = 03, Read
Output/Holding Register) the slave first transfers the
number of the following data bytes in this field and
then the register contents. The values are always
tranferred as pair of bytes where the first transferred
byte contains the most significant bit of a register
(b15 – b8) in the MDOBUS telegram.

The operand address in the data/information field of
the MODBUS telegram is always reduced by 1
compared with the reference number to be
addressed. The third register (reference number
40003), for example, is always addressed via the
operand address “2” (40002).

Check character field

In query telegram (from master)

This field contains a pair of bytes which contains
the check character for the receiver. By means of
this character the receiver is able to recognise
multiple bit errors which cannot be detected only
with the parity bit.

A PS 416 slave does not respond to the master
telegram if a check character error occurs. Due to
the telegram error the slave must assume that the
error possibly occurred in the address byte and the
slave itself is not addressed. A timer must monitor
the response time of the addressed slave in the
master station.

5/96 A

W

B-

EM 27-1244-GB

MODBUS/JBUS –
Telegram fields

53

background image

In response telegram (from slave)

The check character is created in the same way as
in the query telegram. The slave station on the
MODBUS/JBUS must guarantee response times.
The response time is measured from the receipt of
a complete message until the start of the response
where the tranfer time is not included. The response
times depend on the command and the requested
number of data.

Addressing the slave
operands

In the master station the operands of the connected
slave stations are managed via a master-dependent
configuration table which can be divided into four
sections:

Discrete Output Coils

1)

(bit memory)

Discrete Input Coils

(bit inputs)

Input Register

(16 bit input register)

Output/Holding Register

1)

(16 bit memory register)

1) Are supported by the PS 416-MOD-200

Such a section is called reference type. When
addressing the slave operands the master
preselects a reference type via the function code of
the query telegram.

The master station manages the operand values via
the numbered table position (see Table 19), the
so-called reference number, which are provided by
each connected slave station and are to be sent to
the slave stations. Within one reference type the
reference number can be from 1 up to 9999
depending on the master type.

5/96 A

W

B-

EM 27-1244-GB

MODBUS/JBUS –
Addressing the slave
operands

54

background image

Table 19: MODBUS/JBUS references and PS 416 marker

operands

Bit number

0

1

2

... 13

14

15

Discrete
references

00001
(m0.0.2.0.0)

00002
(m0.0.2.0.1)

00003
(m0.0.2.0.2)

... 00014

(m0.0.2.1.5)

00015
(m0.0.2.1.6)

00016
(m0.0.2.1.7)

000017

000018

000019

...

Discrete Output Coils (bit memory), Ref. tye 0xxxx, Ref.-Nr. 1–9992

... 09990 09991 09992

(m0.0.2.1248.5) (m0.0.2.1248.6) (m0.0.2.1248.7)

Register
references

............................................................... 40001 .............................................................................

(mw0.0.2.0)

............................................................... 40002 .............................................................................

(mw0.0.2.2)

Output/Holding Register (16 bit memory register), Ref.type 4xxxx, Ref.number 40001–42172

................................................................ 42172 .............................................................................

(mw0.0.2.4344)

The number of reference numbers to be assigned to
each slave station depends on the application
concerned. Generally, a reference number is only
assigned once to a slave station so that the
operands of all connected slave stations ordered
subsequently for the master. An unambiguous
assignment of the operand to the corresponding
slave station is thus ensured.

The reference numbers to be addressed (operand
address ranges) must be free for the master access
in the connected slave sations. The operand type
Marker is provided for a PS 416-MOD-200 for the
data exchange with the MODBUS master. The
Reference numbers are enabled by declaring a
marker field for send and/or receive data in the user
program. See also chapter 5, Operation, Table 9.

5/96 A

W

B-

EM 27-1244-GB

MODBUS/JBUS –
Addressing the slave
operands

55

background image

The entire bit ememory of 9992 coils addressable
via MODBUS or a part of the 9999 possible
registers (16 bit memory register) can be covered
via the 2173 marker words or the 34768 marker
bits. This marker range addressable via MODBUS
telegram is reduced by the markers which are
reserved for other communication tasks.

!

Warning!
The entire PS 416 marker field for read/write
access is available for the MODBUS master via
the PS 416-MOD-200. Organise the reference
numbers at the MODBUS master very carefully
so that no marker access can occur on the
slave of the PS 416. The PS 416-MOD-200 can
only recognise that the reference number given
by the MODBUS master exceeds the limit of
2173 marker words and thus responds with the
corresponding exception code 02.

MODBUS/JBUS
function codes

The following tables 20 to 22 show the
MODBUS/JBUS function codes which are operated
by the PS 416-MOD-200.

The reaction of the PS 416-MOD-200 to the master
telegram defined by the function code (FC) is
shown in the “PS 416 Action”. The possible number
of user data transferred in query and response
direction and the maximum user data-dependent
time until the start of the response telegram are
stated.

5/96 A

W

B-

EM 27-1244-GB

MODBUS/JBUS –
MODBUS/JBUS
function codes

56

background image

Table 20: Meaning of the MODBUS/JBUS read function

code of the PS 416-MOD-200

FC dez

hex

01

03

14
OE

MODBUS/JBUS
Query

Read Coil (Output)
Status

Read Holding Registers

Poll General

Efficiency

Reading the status (1/0)
of a group of connected
bit memories

Reading the current
content of one or several
memory registers

Short telegram to the
slave due to the Busy
exception code send by
the slave. Is used to
repeat the previous
master job.

PS 416 action

PS 416 operands

Sending the status of of
the requested bit
memory from:
– Marker range
m0.0.2.0.0–
m0.0.2.1248.7

Sending one or several
PS 416

– Marker words
mw0.0.2.0–
mw0.0.2.4344

Sending data to a previous
read job if the data is
prepared

Transferred user data

1–2000 bits

1–125 words

Max. response time

0.2 s

0.2 s

First possible reference
number

00001

40001

5/96 A

W

B-

EM 27-1244-GB

MODBUS/JBUS –
MODBUS/JBUS
function codes

57

background image

Table 21: Meaning of the MODBUS/JBUS write function

codes of the PS 416-MOD-200

FC dez

hex

05*

06*

15*
OF

16*
10

MODBUS/JBUS
query

Force Single Coil

Preset Single Register Force Multiple Coils

Preset Multiple

Registers

Efficiency

Setting the status of a
single bit memory to
0 or 1

Overwriting the
content of a complete
memory register
(16 bits)

Setting the status of
connected bit
memories to the value
0 or 1

Overwriting the
complete content of
connected memory
registers (16 bits each)

PS 416 action

PS 416
Operands

Modifying the status
(0/1) of an individual
bit memory with:

Marker bit
m0.0.2.0.0–
m0.0.2.1248.7

Modifying the
contents of th
individual memory
register with :
Marker word
mw0.0.2.0–
mw0.0.2.4344

Modifying the status
of connected bit
memories with:

Marker bit
m0.0.2.0.0–
m0.0.2.1248.7

Modifying the
contents of connected
memory registers with:

Marker word
mw0.0.2.0–
mw0.0.2.4344

Transferred
user data

1 bit

1 word

1–800 bits

1–100 words

Max. response
time

0.4 s

0.2 s

0.4–1.6 s

0.2–1.6 s

First possible
reference number

00001

40001

00001

40001

* Function codes which are processed as Broadcast message by the PS 416-MOD-200.

5/96 A

W

B-

EM 27-1244-GB

MODBUS/JBUS –
MODBUS/JBUS
function codes

58

background image

Table 22: Meaning of the MODBUS/JBUS diagnostics

function codes of the PS 416-MOD-200

FC dez.

hex.

08

17
11

MODBUS/JBUS
query

Loopback Diagnostic Test

Report Slave ID

Efficiency

Telegram with different
diagnostics codes for testing the
communication interface of the
slave station

Telegram for scanning the type

PS 416 action

Sending data or executing the job
according to the diagnostics code
from the master

Sending:
– Slave identification (984)
– Program memory size (always 0)
– Data memory size (always 0)
– Number of program segments (always 32)
– Machine status (always 0)
– Machine stop code (always 0 since the

PS 416-MOD-200 can only communicate
with CPU-RUN)

Transferred user data

depending on the code

9 bytes

Max. response time

0.2 s

0.2 s

Exception/error
messages

A protocol error recognised by the slave always
means a faulty master access, e.g. a function code
is sent in a master query which the slave cannot
process, operand address ranges (reference
numbers) are addressed that are not enabled for
access or wrong data contents are sent.

In this case a slave responds with a special code.
The most significant bit in the function code byte of
the response telegram is then set to signal status 1.
The function code FC = 08, for example, changes
to FC = 88 (hex). In the data byte of this response
telegram the exception code is transferred which
shows the cause of the faulty access to the master.

5/96 A

W

B-

EM 27-1244-GB

MODBUS/JBUS –
Exception/error messages

59

background image

The exception codes generated by the
PS 416-MOD-200 are then listed with the
generated faulty access.

Table 23: Exception/error messages

Exception
code

Name

Meaning

01

Invalid function
max. response time: 0.2 s

A FC is sent in the query telegram which the slave does
not support.

02

Invalid data address in the
information field
max. response time: 0.2 s

A not enabled data byte is addressed in the query
telegram.

03

Invalid data value in the
data/information field
max. response time: 0.2 s

A data value is sent in the query telegram which exceeds
the process capacity of the slave.

04

reserved

05

Acknowledge ACK

not assigned

06

Busy
max. response time: 0.6 s

The slave processes a comprehensive telegram and
cannot transfer the previously received telegram. The
master must repeat the last sent telegram or sent a
“poll” command until the slave responds as expected.

07

Negative Acknow. NAK

not assigned

The PS 416-MOD-200 manages a 16 bit counter
which registers such faulty master requests and
provides them to the user via the ErrorCounter
output on the function block. The bus master can
read this counter via the function code Loopback
Diagnostic Test (FC = 08).

This error counter is incremented when responding
with one of the first three exception codes
mentioned above. This does not apply if the
PS 416-MOD-200 was switched to the Listen Only
Mode (LOM) via telegram from the master.

5/96 A

W

B-

EM 27-1244-GB

MODBUS/JBUS –
Exception/error messages

60

background image

Communication
counter of the
PS 416-MOD-200

The operating system of the PS 416-MOD-200
manages the three 16 bit counters
“MessageCounter”, “BusyCounter” and
“ErrorCounter”. Each of them provides a specific
information on the bus of the . If the status display
was activated in theS 40 configurator and this
configuration is loaded into the PS 416-MOD-200,
the PS 416-MOD-200 transfers the counter
contents via the outputs “MessageCounter”,
“BusyCounter” and “ErrorCounter” on the function
block. See chapter 3, Configuration. The contents
are refreshed in an interval of 60 s.

MessageCounter

This counter is incremented with each query
received correctly by the master that could be
answered in a valid form. The counter is increased
in the Listen Only Mode (LOM).

BusyCounter

The Busy counter is incremented if the
PS 416-MOD-200 has received a valid query but
had to respond with the exception code 06. The
query could not be transferred to the user module
since a previously received query is still being
processed. The next master query can be a
shortened poll command (FC = 14 dez) or the
repetition of the previous telegram.

Busy messages occur if the program processing
cycle is extremely long compared with the poll
cycle on the bus, or the communication between
the central unit of the PS 416 and the
PS 416-MOD-200 is faulty.

5/96 A

W

B-

EM 27-1244-GB

MODBUS/JBUS –
Communication counter of
the PS 416-MOD-200

61

background image

ErrorCounter

The Error counter is incremented if the
PS 416-MOD-200 responds to a wrong master
query with one of the first three exception codes.
This can be a query with a function code which is
not supported by the PS 416-MOD-200
(e.g. FC 07).
It can also be an invalid data address in the
information field which was not enabled for this
access, or an invalid data value in the information
field of the master telegram.

The three communication counters are managed by
the PS 416-MOD-200, are incremented up to 65535
each, and start with 0 when starting counting again.

The counter can be reset via the master telegram
“Loopback Diagnostic Code” (command FC = 08
with the diagnostic code 00 01 or 01 0A (hex)) by
switching off the PS 416 or by switching from Halt
to Run together with PS 416-MOD-200 parameter
modifications. A quantitive evaluation of the counter
content is only useful in the RUN status during the
Test/Commissioning phase.

5/96 A

W

B-

EM 27-1244-GB

MODBUS/JBUS –
Communication counter of
the PS 416-MOD-200

62

background image

Appendix

Response of the
PS 416-MOD-200 to
the function code
FC 08 Loopback
Diagnostic Code

This function code enables the test by the master of
the slave station by modifying the diagnostics code.
Data contents are not modified.

The master can, for example, test the functionality
of the slave by requesting an echo on his query
telegram via the diagnostics code 00 00.

Query from MODBUS/JBUS master:

Addr

FC

Diagnostics code

Information field

Check

1 Byte

1 Byte

Byte 1

Byte 2

Data byte 1

Data byte 2

2 Byte

08

HO

LO HO

LO

Diagn. Code

Byte

Meaning

Information field

Data byte

1

2

1

2

00

00

RETURN QUERY DATA (Echo test). The PS 416-MOD-200 sends the
entire unmodified telegram back to the master.
RESPONSE in the information field: xx xx

xx

xx

00

01

RESTART COMM. OPT. (Reset the communication counter and
switching to the response mode). If the PS 416-MOD-200 was set in
the LISTEN ONLY MODE (LOM) the PS 416-MOD-200 executes the
switch but does not respond the query telegram. In the response
mode the PS 416-MOD-200 sends this query telegram back without
modifications.
RESPONSE in the information field: 00 00

00

00

5/96 A

W

B-

EM 27-1244-GB

63

background image

Diagn. Code

Byte

Meaning

Information field

Data byte

1

2

1

2

00

02

RETURN DIAGNOSTIC REGISTER (read diagnostic register).
The PS 416-MOD-200 does not use this register and responds
with 00 00.
RESPONSE in the information field: 00 00

00

00

00

04

FORCE SLAVE TO LISTEN ONLY MODE (LOM) (suppress response of a
slave). In “LOM” the PS 416-MOD-200 does not respond to a query
telegram but executes write commands.
RESPONSE in the information field: not present

00

00

00

0A

CLEAR COUNTERS AND DIAGNOSTIC REGISTERS
(Delete communication counter and register of a slave). The
PS 416-MOD-200 deletes te communication counters that the
master can read.
RESPONSE in the information field: 00 00

00

00

00

0B

RETURN BUS MESSAGE COUNT (signalling back the contents of the
bus message counter). The PS 416-MOD-200 signals the number of
the messages which were received after the last “Restart/Clear”
command or “Power-Up”,

00

00

0C

RETURN BUS CRC ERROR COUNT (signalling back the contents of the
error counter). The PS 416-MOD-200 signals the number of the
faulty master accesses which were received after the last
“Restart/Clear” command or “Power-Up”, identical with the MOD200
output “MessageCounter”.
RESPONSE in the information field: <Message counter>, identical
with the MOD200 output “ErrorCounter”
RESPONSE in the information field: <Error counter>

00

00

0D

RETURN BUS EXCEPTION ERROR COUNT (signalling back the contents
of the response exception counter). The PS 416-MOD-200 signals
this counter after receiving the diagnostic codes 00 10 or 00 11.
RESPONSE in the information field: 00 00

00

00

00

10

RETURN SLAVE NAK COUNT (signalling back the contents of the
counter of the negative slave responses). The PS 416-MOD-200
signals the number of “Busy” responses which were sent after the
last “Restart/Clear” command or “Power-Up”, identical with the MOD
output “BusyCounter”.
RESPONSE in the information field: <Busy counter>

00

00

11

(As Diagnostic code 00 10)

Appendix

5/96 A

W

B-

EM 27-1244-GB

64

background image

F

The contents of the bus communication
counters match with the contents of the
MOD200 outputs “Message/Error/BusyCounter”
which are availabe for the user program with
activated status display.

Response of the PS 416 via the PS 416-MOD-200
(RTU query executed):

Addr

FC

Diagnostic code

Information field

Check

1 Byte

1 Byte

Byte 1

Byte 2

Data byte 1

Data byte 2

2 Byte

08

HO

LO HO

LO

Appendix

5/96 A

W

B-

EM 27-1244-GB

65

background image

RTU query from the MODBUS/JBUS master:

Addr

1 Byte

FC 17
(11 hex)
1 Byte

Check

2 Byte

11

HO

LO

Response of the PS 416 via the PS 416-MOD-200
(RTU query executed):

Addr

FC

Number of
sent bytes

Slave
ID

RUN
Light

Information field

Check

I

II

III

IV

V

VI

VII

11

09

09

FF

7 Byte

HO

LO

Byte

Length
(Byte)

Value

Slave ID
RUN Light

Information field
I
II
III

IV + V
VI + VII

1
1

1
1
1

2
2

Slave identification = 9
PS 416 Central Unit (CPU) RUN/
READY code (always FF since the
PS 416-MOD-200 only sends in the
CPU-RUN status)

Program memory size (always 0)
Data memory size (always 0)
Number of segments in the program
(always 32)
Machine status (always 00,64)
Machine stop code (always 0 since
the PS 416-MOD-200 only sends in
the CPU-RUN status)

Appendix

Response of the
PS 416-MOD-200 to the
function code FC 17
Report Slave ID

5/96 A

W

B-

EM 27-1244-GB

66

background image

Technical Data

Number of data interfaces

1

Interface type

Selectable modules: RS 232, RS 422 and TTY (20 mA)

Transfer procedure

asynchronous, Procedures selectable

Transfer rate

600, 1200, 2400, 4800, 9600 or 19200 Baud

Transfer distance

RS 232: 15 m
RS 422: 1200 m
TTY (20 mA): 1000 m with 9600 Baud

Cables

RS 232: Three-wire cable, screened
RS 422, TTY: Four-wire cable, two-pair
(e.g. 2

×

2

×

0.35 mm

2

, AWG 22, screened in pairs and total

screening. With total cable lengths > 200 m a 2

×

2

×

0.5 mm

2

,

AWG 20, cable should be used

Memory module

EEPROM SM 3-EE 32
Storage life > 10 years
Recording life > 10.000 cycles

Current consumption

(5 V DC) maximum value PS 416-MOD-200 with memory module

and an:
RS 232.1 interface module

0.80 A

RS 422 interface mdoule

0.80 A

TTY.1 interface module

0.72 A

max. power dissipation

4.7 W

Ambient temperature

0 to +55 °C

Transport and storage temperature

–20 to +70 °C

Card width

4 space units (1 slot)

Format

Europe (160 mm

×

100 mm)

Weight

approx. 180 g

Appendix –
Technical Data

5/96 A

W

B-

EM 27-1244-GB

67

background image

Accessories

Memory module

SM 3-EE32, EEPROM 32 Kbytes

Interface modules

IFM 232.1, RS 232, full duplex (without control and
signal cables)

IFM 422.1, RS 422, full duplex (without control and
signal cables)

IFM TTY.1, 20 mA, full duplex (passive current loop
receiver/driver)

Plugs

PS 416-ZBS-410, 9-pole Sub-D data plug

Components

PS 416-ZBX-405, HF ferrite ring

Appendix –
Accessories

5/96 A

W

B-

EM 27-1244-GB

68

background image

Index

A
Access behaviour of the master

61

Address field

50

Address switch

25

Addressing the card

30

Application/protocol error

47

B
Baud rate

21

Broadcast

51

Bus terminating resistors

12

C
Character format combinations

22

Check character field

53

in query telegram

53

in response telegram

53

Cold start

27

Configuration

accept

23

procedure

20

Connection assignment

14

D
Data exchange

26, 34

abort

36

enable

34

monitoring

34

Data interface to central unit

26

Data terminal equipment

15

Data traffic on the bus

45

Data/information field

52

in query telegram

52

in response telegram

52

Dual-Port-RAM

26

5/96 A

W

B-

EM 27-1244-GB

69

background image

E
Error

44

Error diagnostics

42

F
Function code field

51

in query telegram

51

in response telegram

52

H
Hardware/software requirements

10

I
Initialisation phase

27

Interface module

12

Interface parameters

21

storing

13

InterfaceStatus

42

J
JBUS

45

L
LED

12

LEDs

42

M
Markers

28

Memory module

13

MOD200 function block

30

inputs

32

setting parameters

34

structure

31

MODBUS application

8

MODBUS protocol

45

MODBUS Protocol Reference Guide

45

MODBUS/JBUS telegram

50

Mode

22

Index

5/96 A

W

B-

EM 27-1244-GB

70

background image

O
Operating phase

27

P
Parity

21

Pin assignment data connection socket

15

Plug-in connection

12

Power supply

14

Procedure

7

Protocol error

59

PS 416-MOD-200

install into the rack

25

number in the rack

14

operation

26

setup

12

PS 416-MOD-200 main functions

9

R
Reference number

55

Reference type

54

References

55

Reset input

36

RTU/BINAIRE mode

features

48

Start/End character

48

telegram structure

49

check character

49

synchronisation pause

49

S
Screening/potential equalisation

18

Self test

27

Shutdown behaviour

28

Slave address

22

Slot

25

Slot address

44

Software requirements

10

Startup behaviour

27

Status display

23

Index

5/96 A

W

B-

EM 27-1244-GB

71

background image

Stop bit

21

Storing all interface parameters

13

System EPROM

13

T
Transfer error

46

Transmission security

21

U
Update inputs/outputs

33

W
Warm start

28

Wiring

18

Index

5/96 A

W

B-

EM 27-1244-GB

72


Wyszukiwarka

Podobne podstrony:
h1239g PLC PS4 416
h1239g PLC PS4 416
h1184g PLC PS4 201
PS4 Opis programu S40 do programowania PLC PS4 h1300d0400
MODBUS RTU, PLC Fatek -HMI Weintek, Fatek
PS4 PS 416 NET 440, Master h1330g
PS4 PS 416 TCS 200 h1298g Telecontrol Card
Prezentacja PLC
W 5g PLC LICZNIKI
Sterowniki PLC
overview simatic controllers 04 2007 en plc
pytania i odpowiedzi 2, PLC, plcc, PLC I
Realizacja układu sterowania logicznego na?zie sterownika PLC sprawozdanie
Sterownik PLC
416
programowanie plc 793

więcej podobnych podstron