WAGO User's Guide
WAGO User's Guide
2 MODBUS Coupler/Controller................................................... 9
2.1 Hardware...................................................................................................... 9
2.2 Power supply ................................................................................................ 10
2.2.1 Electronic supply voltage............................................................................... 11
2.2.2 Supply voltage of the field side...................................................................... 12
2.3 Station address ............................................................................................. 13
2.4 Mode switch.................................................................................................. 14
2.5 Fieldbus connection ..................................................................................... 15
2.5.1 RS 485............................................................................................................ 15
2.5.2 RS 232............................................................................................................ 18
4 MODBUS ..................................................................................... 23
5 Configuration .............................................................................. 25
5.1 Coupler ......................................................................................................... 25
5.1.1 Settings........................................................................................................... 25
5.1.1.1 Standard settings ............................................................................................ 26
5.1.1.2 Baud rate setting ............................................................................................ 26
5.1.1.3 Error detection, length of the character string................................................ 27
5.1.1.4 End of Frame Time ........................................................................................ 28
5.1.1.5 ASCII-/RTU mode......................................................................................... 28
5.1.1.6 Error Check.................................................................................................... 29
5.1.1.7 Extended Functions........................................................................................ 29
5.1.1.8 Watchdog ....................................................................................................... 30
5.1.1.9 Update Firmware ........................................................................................... 30
5.1.2 Data exchange between MODBUS master and I/O modules ........................ 31
5.1.3 Addressing the I/O modules........................................................................... 32
5.1.4 Application examples .................................................................................... 33
MODBUS / Introduction ix
15.12.99
x MODBUS / Introduction
15.12.99
1 WAGO-I/O-SYSTEM
1.1 Components
The WAGO-I/O SYSTEMÿcomprises of various components which allow the creation
of modular and user specific fieldbus nodes for various fieldbusses.
General:
In all cases a fieldbus node comprises of a fieldbus coupler (1) or a programmable
fieldbus controller (1) as head station, a number of I/O modules (2) and an end module
(3), which forms the end of the system.
In the following description the term Coupler is used for the fieldbus coupler and the
term Controller for the programmable fieldbus controller.
1 – Coupler/Controller:
With its I/O functions the coupler/controller forms the logic operation between the
fieldbus used and the field area. All control tasks necessary for the perfect operation of
the I/O are performed by the coupler/controller. The connection to different fieldbus
systems is made using the corresponding coupler/controller e.g. for PROFIBUS,
INTERBUS, CAN, MODBUS etc. A retrofitting to a different fieldbus system by
changing the coupler is possible.
As opposed to the coupler the controller is fitted with additional PLC functions. This
permits signal pre-processing, which can considerably reduce the data quantity in the
network. In the case of a fieldbus failure the controller can process the control program
independently. Alternatively the controller can guide the node into a defined condition.
Plant modules become independent testable units due to the controller. In the delivered
condition, in other words without the user program, the controller behaves as a coupler.
MODBUS / Introduction 1
15.12.99
The user can program the controller in accordance with international standards for
controller programming, IEC 1131-3 or the corresponding European standard
EN 61131-3, in all five languages, IL, LD, FBD, ST and SFC.
2 – I/O modules
The input and output of the process data is made at the I/O modules. I/O modules are
available for various tasks in accordance with varying requirements. Available are
digital and analog input and output modules, I/O modules for angle and path
measurement as well as communication modules.
The individual I/O modules are described in detail in the following registers.
3 - End module
The node end module is indispensable. It is always fitted as the last module, to
guarantee the internal node communication. The end module has no I/O function.
_________________________________
1
WAGO-I/O-PRO User manual, English, Order No. 759-120/000-002
2 MODBUS / Introduction
15.12.99
1.2 Installation
All system components can be snapped directly on a carrier rail in accordance with the
European standard EN 50022 (TS 35). Installation is simple and space saving. All
modules have the same shape to minimise the project commitment.
It is not necessary to observe the order of analog and digital modules when engaging on
the rail. The reliable positioning and connection of the coupler/controllers and the
individual I/O modules is made using a tongue and groove system. Due to the
automatic locking the individual components are securely seated on the rail after
installing.
Please note that in this manner the power supply to the field level and the data transfer
is interrupted. Ensure that an interruption of the PE will not result in a condition which
could endanger a person or equipment!
MODBUS / Introduction 3
15.12.99
Conductors with a cross section of from 0.08 to
2.5 mm² can be connected using a CAGE
CLAMP® to achieve a vibration resistant, fast
and maintenance free connection. To actuate the
CAGE CLAMP® enter a screw driver or an
actuation tool in the opening below the
connection. Following this enter the conductor in
the corresponding opening. the conductor is
Fig. 1.4: Inserting conductor end clamped securely with the removal of the
actuation tool.
The clamping force is automatically adapted to the cross section. The full surface of the
cage clamp pressure is applied against the conductor without damaging it. Conductor
deformation is compensated for and self-loosening is avoided. The transition point
between the conductor and the CAGE CLAMP® is protected against corrosive
influences. The connection can be made quickly and is also maintenance free, saving
the costs for a periodic checking of terminal connections.
4 MODBUS / Introduction
15.12.99
Do not connect the I/O module to gold spring
contacts in order to avoid soiling and scratches!
MODBUS / Introduction 5
15.12.99
1.3 Methods of decentralisation
By using the coupler or the controller it is possible to realise various methods for the
decentralisation of control tasks.
6 MODBUS / Introduction
15.12.99
Decentral control with controller (3)
The on site controller controls an assigned function area, e.g. a machine unit or
components of a transport system. The unit test can be made independently, i.e. without
higher ranking controls.
The higher ranking controls transmit data to the controller via the bus system, e.g. the
operating mode, set point values or the current production program (recipe). The
controller transmits local operating data to the higher ranking controls, such as operating
and control messages, actual values, counter readings etc. The complete linking for
actuator triggering is made in the controller, in other words directly on site. This permits
a fieldbus independent reaction of the controls.
In the case of a fieldbus failure the control program can be independently further
processed and the node put into a defined status.
MODBUS / Introduction 7
15.12.99
8 MODBUS / Introduction
15.12.99
2 MODBUS Coupler/Controller
2.1 Hardware
The illustration above applies both to the MODBUS coupler as well as for the
MODBUS controller.
left: enclosure for the electronics for bus connection and processing
right: a fixed installed power supply module as connection and distribution for the
power supply to the electronics in the coupler/controller enclosure, the
assembled I/O modules and the power supply in the field area.
MODBUS / Coupler/controller 9
15.12.99
2.2 Power supply
The power supply on the field side is electrically isolated from the electronic supply. In
this manner sensors and actuators can be supplied and fused by a separate voltage
source.
ATTENTION!
Under no circumstances connect a voltage supply other than 24 V DC on the + and –
power supply modules of the coupler/controller. A power supply voltage of max.
230 V AC can only be supplied via the power supply modules 750-609, 750-611 and
750-612!
ATTENTION!
Disconnect the PE lead wires prior to undertaking an insulation test, otherwise this will
result in incorrect results or destruction of the I/O module.
1
Back-up capacitor module, Order No. 288-824
10 MODBUS / Coupler/controller
15.12.99
2.2.1 Electronic supply voltage
The electronic supply voltage (24 V DC) is adapted using a voltage regulator and led to
the coupler/controller electronics as well as to the internal bus. The electrical isolation
of the external fieldbus system is made via a DC/DC converter and via an optocoupler
in the fieldbus interface.
The internal bus includes the internal communication between the coupler/controller
and the I/O modules as well as the power supply for the I/O modules. The maximum
power supply is 1.65 A. If the sum of the internal power consumption of all I/O modules
exceeds this value it is necessary to fit additional internal system supply modules2.
The control electronics in the I/O modules are supplied by snap-fit mounting the
I/O modules using the internal bus contacts. A reliable contact is assured by gold plated,
self cleaning slide contacts. The removal of a I/O module will cause an interruption of
the connection to the following I/O modules. The coupler/controller localises the
interruption point and sends a corresponding fault message via the red LED ‘I/O ERR’.
ATTENTION!
Removing or inserting the I/O modules with the voltage applied can lead to undefined
conditions. For this reason only undertake work on the I/O modules when isolated from
the power supply!
2
Internal system supply modules, order No. 750-613
MODBUS / Coupler/controller 11
15.12.99
2.2.2 Supply voltage of the field side
Fig. 2.4: Power contact for the power supply to the field side
The power is supplied to the field side automatically by snap-fitting the individual
I/O modules via self-cleaning power contacts (Fig. 2.4). These contacts are arranged on
the right hand side of the coupler/controller and the I/O modules, protected against
accidental contact, as spring contacts. On the left hand side of the I/O modules are
corresponding male contacts as counter pieces. Ensure that the current of the power
contacts does not permanently exceed 10 A.
ÿþýüûúùýø Please note that some I/O modules do not have any, or only individual power contacts
(dependent of the I/O function). This configuration is intended to interrupt the power
supply. If a field supply is required for the following I/O modules, it is necessary to use
a power supply module. Take note of the individual terminal/module data sheets! The
design of some modules does not physically allow assembly them in rows as the grooves
for the male contacts are closed at the top.
By fitting an additional power supply module the field supply is always interrupted by
the power contacts. From this point a new power supply is made, which can also include
a potential change (see Fig. 2.2). This possibility guarantees a high degree of system
flexibility.
12 MODBUS / Coupler/controller
15.12.99
2.3 Station address
The station address is set using both coding switches. The settable address is within the
01 and 99 range. The value 00 is reserved for the programming and configuration mode.
The lower coding switch serves for setting the address tens digit, the upper coding
switch for setting the units digit. The address is only read in and saved when switching
on. Changes made during operation have no effect.
MODBUS / Coupler/controller 13
15.12.99
2.4 Mode switch
The mode switch is only available in the controller and permits a manual Run/Stop-
status change.
Mode switch setting Function
From Stop to Run: Activate program processing
From Run to Stop: Stop program processing
(Bootstrap:) To bootstrap the firmware, not required by user
Hardware reset: Mode switch e.g. push down with screwdriver
All outputs are reset, variables are set to 0 or FALSE or to their initial value.
Flags remain in the same status.
Reset can be made with both Stop as well as Run.
Table 2.1: Mode switch, controller Stop = Program processing stopped
Run = Program processing running
ATTENTION!
If when changing over the mode switch from ‘Run’ to ‘Stop’ outputs are still
activated, these will remain in this status! Switching off on the software side, e.g.
by initiators is then ineffective because the program will no longer be processed!
14 MODBUS / Coupler/controller
15.12.99
2.5 Fieldbus connection
2.5.1 RS 485
One transmission medium for the MODBUS is RS485, whereby, 2 or 4 wire can be
used. The following figure shows an example for a 2 wire version:
As opposed to the above the 4 wire connection offers the advantage that it can use
simpler repeaters and converter. The following illustration is a corresponding example:
MODBUS / Coupler/controller 15
15.12.99
Connect the D-SUB connection plug as follows:
The connection point is mechanically lowered so that fitting into a 80 mm deep switch
cabinet is possible following the plug-in connection.
The pin assignment is 2 wire operation conforms with the Profibus assignment. Thus the
Profibus wiring components can be used.
16 MODBUS / Coupler/controller
15.12.99
The enclosure prevents unintentional changes of the settings during later operation. If,
however, access to the settings is required in the case of a fault, ensure that the previous
settings are marked on a label.
After changing the settings push the enclosure back onto the coupler/controller. Note
that it may be necessary to lightly push the wide side of the coupler/controllers to the
side when the metal plate does not easily slide into the enclosure. In addition it may be
necessary to push the rotary switches into the cut-outs provided.
The switch on the interface printed circuit board for setting 2 and 4 wire connections or
for the matching resistors can be found in the following illustration:
For 2 wire connections RxD and TxD are short circuited. By the termination, a series
circuit comprising of 3 resistors is connected to the bus conductor terminations.
The standard setting for the supplied coupler/controller is a 2 wire connection and a
switched off matching resistor.
MODBUS / Coupler/controller 17
15.12.99
2.5.2 RS 232
The MODBUS can also be operated directly on an RS 232 interface. The D-SUB
connection plug is connected in this case as follows:
The pin assignment permits the use of commercially available 9 pole 1:1 sockets/ plug
lines for direct connection to a PC.
18 MODBUS / Coupler/controller
15.12.99
3 Technical Data
3.1 Dimensions
TECHNICAL DATA:
750-312, 750-314, 750-315, 750-316
TECHNICAL DATA:
750-812, 750-814, 750-815, 750-816
Bus conflicts do not occur because only one node is sending. The master makes a query
for communication. This query can be sent to a specific node or to all nodes as a
broadcast message. The nodes receive the query and return a response to the master,
depending on the kind of query.
This bus topology is only valid for the variants with the RS 485 interface. With RS 232
it is only possible to have a peer-to-peer connection.
5.1 Coupler
750-312,
750-314,
750-315,
750-316
5.1.1 Settings
The factory set coupler configuration can be changed using the DIP switches FR and P.
The setting is made prior to start-up. Changes to switch settings during running
operation does not affect the configuration. This is only read in when switching on the
coupler power supply.
The ‘MODBUS coupler/controller’ chapter describes how to remove the enclosure from
the coupler to permit settings to be made.
Fig. 5.1: DIP switch arrangement on CPU printed circuit board, coupler
The following is a description of the coupler settings. Here the term ‘Frame’ is
frequently used. A ‘Frame’ is a data transmission block.
MODBUS / Configuration 25
15.12.99
5.1.1.1 Standard settings
The coupler is supplied with the following standard settings:
Designation Setting FR FR FR FR FR FR P1 P2 P3 P4 P5 P6 P7 P8 Chapt.
1 2 3 4 5 6
Baud rate 9600 Bd off on on 5.1.1.2
Byte Frame No Parity, 8 Bit off off off 5.1.1.3
1 Stop Bit
End of Frame 3 x Frame Time off off off 5.1.1.4
Time
Mode RTU mode on 5.1.1.5
Error Check to be processed on 5.1.1.6
Extended without off 5.1.1.7
Functions
Watchdog switched on off 5.1.1.8
Update normal off 5.1.1.9
Firmware operation
Table 5.1: Standard settings, coupler
750-312/314 750-315/316
19200 Bd 19200 Bd on on on
26 MODBUS / Configuration
15.12.99
5.1.1.3 Error detection, length of the character string
A parity bit can additionally be transmitted with each byte. Data transfer faults are
detected with the help of the parity bit. A differentiation is made between parity checks
for even parity, odd parity and no parity.
For this the number of set bits (=1) are counted in the transmitted data bytes. For
example, with the transmission of the character string 1100 0101 the number of set bits
is even, namely 4. If the setting of an even parity bit is selected, then in this case it is set
to 0, so that the number of set bits still remains even. Analog to this, the odd parity bit 1
would be selected so that the number of set bits will be odd.
This type of error detection is assured with one error, with several errors under certain
circumstances this may no longer be assured. If the coupler recognises a parity error, the
frame is ignored and a new frame can only be received following a renewed ‘Start of
Frame’.
If the slave receives faulty frames, this will not be replied to. The master detects this
error in that after the preset time (Time-out) no corresponding frame was received.
In the MODBUS coupler 750-312 a parity bit can be attached to each byte. The data
length can be selected for 7 or 8 bit. In addition it is possible to add 1 to 3 stop bits.
No Parity 8 2 on on off
No Parity 7 3 on on on
The standard setting is no parity, 8 bit data length and 1 stop bit.
During transmission in RTU mode the DIP switch FR6 is ignored, as the format is set to
8 bit in this mode.
MODBUS / Configuration 27
15.12.99
5.1.1.4 End of Frame Time
The end of frame time is the pause time following a frame, which is required to switch
over the repeater in slave. This time must permit gaps during a frame which will not
result in a faulty recognition of the end of frame time. The setting of the
end of frame time is made with DIP switches P1 to P3.
500 ms on on off
1s off off on
1 ms on off on
10 ms off on on
50 ms on on on
The standard setting is 3 x frame time. The settings 1 ms, 10 ms and 50 ms are only
implemented as from firmware version 2.5 of the MODBUS coupler.
Mode P4
ASCII off
RTU on
28 MODBUS / Configuration
15.12.99
5.1.1.6 Error Check
A check sum (CRC) is calculated from the frame to be transmitted in the sender (higher
ranking controls). This check sum is transmitted in the frame to the receiver (coupler).
Once the error check is activated, this check sum is compared with the check sum
calculated in the coupler on the basis of the same instruction. An error is signalled by a
red LED ‘CRC’.
ATTENTION:
Do not set this option during operation!
ignored off
being processed on
Extended Functions P6
without off
available on
MODBUS / Configuration 29
15.12.99
5.1.1.8 Watchdog
The watchdog serves for monitoring the data transfer between the higher ranking
controls and the coupler. If no communication has occurred after a default time, the
node is set into a secured status, i.e. the digital outputs of the node are set to 0 and the
analog outputs are set to the minimum value (e.g. with 4...20 mA to 4 mA).
The watchdog is switched on with DIP switch P7.
Watchdog P7
switched on off
switched off on
Update Firmware on
30 MODBUS / Configuration
15.12.99
5.1.2 Data exchange between MODBUS master and I/O modules
The data exchange between the MODBUS master sand coupler is made by bit or byte
reading and writing.
In the coupler are 4 different types of process data:
• Input words
• Output words
• Input bits
• Output bits
The addresses of the data words in the process illustration of the inputs and outputs are
shown in the next illustration:
Fig. 5.2: Data exchange between MODBUS master and I/O modules
MODBUS / Configuration 31
15.12.99
Access word for word to the digital input and output modules is made in accordance
with the following table:
Process data word Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
D1 D0
Table 5.10: Allocation of digital inputs/outputs for process data word, coupler
32 MODBUS / Configuration
15.12.99
5.1.4 Application examples
The following figure is an example for a process input image. The configuration
comprises of 10 digital and 8 analog inputs. The process image thus has a data length of
8 words for the analog and 1 word for the digital inputs, i.e. 9 words.
MODBUS / Configuration 33
15.12.99
The following configuration comprises of 2 digital and 4 analog outputs. This is an
example for a process output image. It comprises of 4 words for the analog and one
word for the digital outputs.
34 MODBUS / Configuration
15.12.99
5.2 Controller
750-812,
750-814,
750-815,
750-816
5.2.1 Settings
As opposed to the MODBUS coupler the factory configuration of the controller change
is not made by DIP switch, but is changed using a PC. The communication between the
controller and PC is described in the ‘Start-up and diagnosis’ chapter.
The controller is set on the software side using the ‘Fieldbus configuration’ function
block of the WAGO-I/O-PRO library. If this module is taken up in the control program,
the setting is made automatically even after changing the controller. The settings are
taken over into the controller parameter block. If the desired values are not already set, a
firmware reset is automatically made in bus operation and the controller restarts with the
selected settings.
The coupler settings are described as follows. Here the term ‘Frame’ is frequently used.
‘Frame’ is a data transfer record.
MODBUS / Configuration 35
15.12.99
5.2.1.1 Standard settings
The controller is delivered with the following standard values:
Input function block Setting Value Chapter
FieldbusConfiguration
150 Bd 38400 Bd 0
300 Bd 57600 Bd 1
600 Bd 115200 Bd 2
1200 Bd 1200 Bd 3
2400 Bd 2400 Bd 4
4800 Bd 4800 Bd 5
9600 Bd 9600 Bd 6
19200 Bd 19200 Bd 7
36 MODBUS / Configuration
15.12.99
5.2.1.3 Error detection, length of the character string
A parity bit can additionally be transmitted with each byte. Data transfer faults can be
recognised with the help of the parity bit. A differentiation is made between parity
checks for even parity, odd parity and no parity.
For this the number of set bits (=1) are counted in the transmitted data bytes. For
example, during the transmission of the character string 1100 0101 the number of set
bits is even, namely 4. If the setting of an even parity bit is selected, then in this case it
is set to 0, so that the number of set bits still remains even. Analog to this, the odd parity
bit 1 would be selected so that the number of set bits will be odd.
This type of error detection is assured for one error, for several errors under certain
circumstances this error detection may no longer be assured. If the coupler recognises a
parity error, the frame is ignored and a new frame can only be received following a
renewed ‘Start of Frame’.
If the slave receives faulty frames, these will not be replied to. The master detects this
error in that after the preset time (Time-out) no corresponding frame is received.
In the MODBUS coupler 750-812 a parity bit can be attached to each byte. The data
length selected can be 7 or 8 bit. In addition it is possible to add 1 to 3 stop bits.
Value Value
No Parity 8 1 FALSE 0
No Parity 8 2 FALSE 3
No Parity 7 2 TRUE 0
No Parity 7 3 TRUE 3
The standard setting is no parity, 8 bit data length and 1 stop bit. This setting is ignored
when transferring data in RTU mode, as the format of this mode is set to 8 bit.
MODBUS / Configuration 37
15.12.99
5.2.1.4 End of Frame Time
The end of frame time is the pause time following a frame which is required to switch
over the repeater in slave. This time must permit gaps during a frame without resulting
in a faulty detection of the end of frame time.
The setting of the end of frame time is made with the input ENDOFFRAMETIME.
End of Frame Time ENDOFFRAMETIME
Value
3 x Frame Time 0
100 ms 1
200 ms 2
500 ms 3
1s 4
1 ms 5
10 ms 6
50 ms 7
Mode ASCIIRTUMODE
Value
ASCII FALSE
RTU TRUE
38 MODBUS / Configuration
15.12.99
5.2.1.6 Error Check
A check sum (CRC) is calculated from the frame to be transmitted in the sender (higher
ranking controls). This check sum is transmitted in the frame to the receiver (controller).
Once the error check is activated, this check sum is compared with the check sum
calculated in the coupler on the basis of the same instruction. An error is signalled by a
red LED ‘CRC’.
Value
ignored FALSE
Extended EXTENDEDFUNCTIONS
Functions
Value
without FALSE
available TRUE
MODBUS / Configuration 39
15.12.99
5.2.1.8 Watchdog
The watchdog serves for monitoring the data transfer between the higher ranking
controls and the controller. If no communication occurs after a preset time, the
controller can be run into a secured status.
The watchdog is switched on via the NOWATCHDOG input.
Watchdog NOWATCHDOG
Value
switched on FALSE
40 MODBUS / Configuration
15.12.99
5.2.2 Data exchange between MODBUS master and controller
The controller mainly comprises of PLC functionality as well the interface to the
I/O modules and to the MODBUS. Data is exchanged between the PLC functionality,
I/O modules and the MODBUS master. This system operates with two different address
formats.
MODBUS / Configuration 41
15.12.99
5.2.2.1 Data exchange between MODBUS master and I/O modules
The data exchange between the MODBUS master and the I/O modules is made by
reading and writing in bits or bytes.
The controller handles four different types of process data:
• Input words
• Output words
• Input bits
• Output bits
The following figure shows the data word addresses in the process illustration of the
inputs and outputs:
Fig. 5.7: Data exchange between the MODBUS master and I/O modules
42 MODBUS / Configuration
15.12.99
The word for word access to the digital input and output modules is made in accordance
with the following table:
Process data word Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit Bit
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
D1 D0
MODBUS / Configuration 43
15.12.99
5.2.2.2 Data exchange between MODBUS master and PLC functionality
The fieldbus data in the MODBUS master and in the PLC functionality have different
address formats. The addresses of the MODBUS master are displayed hexadecimal or
decimal. The PLC functionality uses absolute addresses.
Fig. 5.8: Data exchange between MODBUS master and PLC functionality
44 MODBUS / Configuration
15.12.99
5.2.2.3 Data exchange between I/O modules and PLC functionality
Fig. 5.9: Data exchange between I/O modules and PLC functionality
MODBUS / Configuration 45
15.12.99
5.2.2.4 Address review
46 MODBUS / Configuration
15.12.99
5.2.3 Absolute addresses for inputs, outputs and flags
The direct display of individual memory cells (absolute addresses) in accordance with
IEC 1131-3 is made using special character strings in accordance with the following
table:
2 I Input
Q Output
M Flag
B Byte (8 Bits)
4 Address
Bit 0.0 ... 0.15 1.0 ... 1.15 ..... 254.0 ... 254.15 255.0 ... 255.15
Bit 256.0 ... 256.15 257.0 ... 257.15 ..... 510.0 ... 510.15 511.0 ... 511.15
Byte 512 513 514 515 ..... ..... 1020 1021 1022 1023
MODBUS / Configuration 47
15.12.99
Address range for flags (retain):
Data width Address
Bit 0.0 ... 0.15 1.0 ... 1.15 ..... 4094.0 ... 4094.15 4095.0 ... 4095.15
%IW14 %IW15
%IDW7
%QW5 %QW6
%MW11 %MW12
48 MODBUS / Configuration
15.12.99
5.2.4 Addressing the I/O modules
• The arrangement of the I/O modules in a node is optional.
• Addressing of the I/O modules relates to the attendant controller.
• Addressing is organised word for word and starts both for inputs as well as outputs
with word address ‘0’.
• The I/O module addressing corresponds to the arrangement order behind the
controller. Addressing starts with the I/O module, which occupy one or more words
per channel. The I/O module addresses which occupy one or two bits per channel
then follow. For the number of input and output bits or bytes please refer to the
corresponding I/O module data sheets.
• Addressing of the I/O modules which occupy one or two bits per channel is also
made word for word. 16 inputs or outputs each are arranged in one word. If less
channels are available the remaining bits of the word remain free or are reserved for
extensions.
• If a node is extended by additional I/O modules for which one or more words are
assigned per channel, the I/O module addresses are displayed accordingly by one or
two bits per channel.
MODBUS / Configuration 49
15.12.99
5.2.5 Application example
The following figure is an example of a process input image. The configuration
comprises of 10 digital and 8 analog inputs. The process image thus has a data length of
8 words for the analog and 1 word for the digital inputs, i.e. 9 words in total.
50 MODBUS / Configuration
15.12.99
The following example for the process output image comprises of 2 digital and 4 analog
outputs. It comprises of 4 words for the analog and one word for the digital outputs.
MODBUS / Configuration 51
15.12.99
5.2.6 Controller operating system
52 MODBUS / Configuration
15.12.99
5.3 Common coupler/controller functions
0x01 Read Coil Status Read input bits and output bits as an octet string.
Functions are
identical
0x02 Read Input Status Read input bit as an octet string.
0x0B Fetch Comm Event Ctr Read status word and event counter.
MODBUS / Configuration 53
15.12.99
5.3.1.1 Use of the MODBUS functions
The graphical review shows the MODBUS functions which have access to process
illustration data.
54 MODBUS / Configuration
15.12.99
5.3.1.2 Read Coil Status (function code 0x01):
This function reads the status of the input and output bits (coils) in slave, whereby
broadcast is not supported. With coupler/controller the number of I/O points is limited
to 256.
Inquiry:
The Inquiry determines the starting address and the number of bits to be read.
ÿþýüûúùýø
The first point is addressed with 0. With Modicon the addressing starts with 1 (0x01).
The following table shows an example for an inquiry, with which the bits 0 to 7 of the
slaves 11 are to be read:
Reply:
The current values of the interrogated bits are packed in the data field. A 1 corresponds
to the ON status and a 0 to the OFF status. The lowest value bit of the first data byte
contains the first bit of the inquiry. The others follow in an ascending order. If the
number of inputs are not a multiple of 8, the remaining bits of the last data byte are
filled with zeroes. If the number of bits interrogated exceed the number of inputs or
outputs present in the node, the remaining input bits are set to zero and the outputs
contain the last valid value.
MODBUS / Configuration 55
15.12.99
The status of the inputs 7 to 0 is shown as byte value 0x12 or binary 0001 0010. Input 7
is the bit having the highest valency of this byte and input 0 the lowest value.
The assignment is thus made from 7 to 0 with OFF-OFF-OFF-ON-OFF-Off-ON-OFF.
Bit: 0 0 0 1 0 0 1 0
Coil: 7 6 5 4 3 2 1 0
56 MODBUS / Configuration
15.12.99
5.3.1.3 Read Input Status (function code 0x02):
This function reads the input bits in the slave, whereby broadcast is not supported. With
the coupler/controller the number of points is limited to 256.
Inquiry:
The inquiry determines the starting address and the number of bits to be read.
ÿþýüûúùýø The first point is addressed with 0. With Modicon addressing starts with 1 (0x01).
The following table shows an example of an inquiry with which the bits 0 to 7 of the
slaves 11 are to be read:
Reply:
The current value of the inquired bit is packed into the data field. A 1 corresponds to
the ON status and a 0 the OFF status. The lowest value bit of the first data byte contains
the first bit of the inquiry. The other follow in an ascending order. If the number of
inputs are not a multiple of 8, the remaining bits of the last data byte are filled with
zeroes. If the number of bits interrogated exceed the number of inputs present in the
node, the remaining input bits are set to zero.
MODBUS / Configuration 57
15.12.99
The status of the inputs 7 to 0 is shown as a byte value 0x12 or binary 0001 0010. Input
7 is the bit having the highest valency of this byte and input 0 the lowest value.
The assignment is thus made from 7 to 0 with OFF-OFF-OFF-ON-OFF-Off-ON-OFF.
Bit: 0 0 0 1 0 0 1 0
Coil: 7 6 5 4 3 2 1 0
58 MODBUS / Configuration
15.12.99
5.3.1.4 Read Holding Register (function code 0x03)
The binary contents of holding registers are read out in the slave using this function.
Broadcast is not supported. The maximum number is limited to 128 registers in one
frame.
Inquiry:
The inquiry determines the start word address (start register) and the number the register
to be read.
ÿþýüûúùýø The addressing starts with 0. The Modicon address starts with 1 (0x01).
Reply:
The reply register data is packed as 2 bytes per register. The first byte contains the
higher value bits, the second the lower values. A reply to the above inquiry appears as
follows:
The contents of register 0 is displayed hexadecimal by two byte values: 0x3F and 0xFB
or 16379 decimal. The contents of register 1 are 0x00 and 0x00 or 0 decimal.
MODBUS / Configuration 59
15.12.99
5.3.1.5 Read Input Register (Function code 0x04)
This function serves to read a number of input words (also ”input register”). Broadcast
is not supported and the maximum number is limited to 128 registers in one frame.
Inquiry:
The inquiry determines the address of the start word (start register) and the number of
the register to be read.
ÿþýüûúùýø Addressing starts with 0. The Modicon address starts with 1 (0x01).
Replay:
The register data of the answer is packed as 2 bytes per register. The first byte has the
higher value bits, the second the lower values. A reply to the above inquiry appears as
follows:
The contents of register 0 are shown hexadecimal by two byte values: 0x3F and 0xFB or
16379 decimal. The contents of register 1 are 0x00 and 0x00 or 0 decimal.
60 MODBUS / Configuration
15.12.99
5.3.1.6 Force Single Coil (Function code 0x05):
With the aid of this function a single output bit is written. This function can also be sent
as a broadcast, in which case the same bit is set in all slaves. With coupler/controller the
number of I/O points is limited to 256.
Inquiry:
The required ON or OFF status is specified in the data field of the inquiry. A value of
0xFF00 sets the output bit to 1, a value of 0x00 on 0. Other values are not specified and
have no effect on the output condition. In this example the bit 0 is set to 1 in slave 11:
Reply:
The reply is an echo of the inquiry and will be or is returned when the bit is set.
MODBUS / Configuration 61
15.12.99
5.3.1.7 Preset Single Register (Function code 0x06):
This function writes a value in one single output word (also ”Output register”). This
function can also be sent as a broadcast, in which case the same output word is set in all
slaves.
Inquiry:
ÿþýüûúùýø Addressing starts with 0. The Modicon address starts with 1 (0x01).
The inquiry determines the address of the first output word to be set.
The value to be set is determined in the inquiry data field.
Reply:
The reply is an echo of the inquiry and is sent after setting the register.
62 MODBUS / Configuration
15.12.99
5.3.1.8 Fetch Comm Event Counter (Function code 0x0B):
This function returns a status word and an event counter from the communication event
counter of the slave. With this counter the master can determine whether the slave has
treated the slave without a fault.
Following each successful news processing the counter counts up. This counting
process is not performed in the case of exception replies, poll commands or counter
inquiries.
The event counter can be reset using the diagnosis function (Code 0x08), the restart sub-
function communications option (Code 0x01) or clear counters and the diagnosis
register (Code 0x0A).
Inquiry:
In the example the communication counter of the slave 11 is read:
Reply:
The reply contains a 2 byte status word and a 2 byte event counter. The status word only
contains zeroes.
MODBUS / Configuration 63
15.12.99
5.3.1.9 Force Multiple Coils (Function code 0x0F):
Using this function a number of output bits are set to 1 or 0. With a broadcast
transmission the same bits are set in all activated on slaves. The maximum number is
256 bits.
Inquiry:
ÿþýüûúùýø The first point is addressed with 0. The Modicon address starts with 1 (0x01).
The inquiry news specifies the bits to be set. The requested 1 or 0 states are determined
by the contents of the inquiry data field.
In this example 16 bits are set, starting with the address 0 in slave 11. The inquiry
contains 2 bytes with the value 0xA5F0 in other words 1010 0101 1111 0000 binary.
Bit: 1 0 1 0 0 1 0 1 1 1 1 1 0 0 0 0
Coil: 7 6 5 4 3 2 1 0 15 14 13 12 11 10 9 8
The first byte transmits the 0xA5 to the addresses 7 to 0, whereby 0 is the lowest value
bit. The next byte transmits 0xF0 to the addresses 15 to 8, whereby the lowest value bit
is 8.
Field name Example RTU ASCII
Start of frame - t1-t2-t3 ”:” 0x3a
Slave address 0x0B 0x0B ”0B” 0x30, 0x42
Function code 0x0F 0x0F ”0F” 0x30, 0x46
Coil address high 0x00 0x00 ”00” 0x30, 0x30
Coil address low 0x00 0x00 ”00” 0x30, 0x30
Quantity of coils high 0x00 0x00 ”00” 0x30, 0x30
Quantity of coils low 0x10 0x10 ”10” 0x31, 0x30
Byte Counter 0x02 0x02 ”02” 0x30, 0x32
Force data high (coils 7 ... 0) 0xA5 0xA5 ”A5” 0x41, 0x35
Force data low (coils 15 ... 8) 0xF0 0xF0 ”F0” 0x46, 0x30
Error Check (LRC / CRC) - 0xE7 ”3F” 0x33, 0x46
0x94
End of frame t1-t2-t3 - 0xD, 0xA
Table 5.44: Example inquiry, Force Multiple Coils
Reply:
The reply is the address of the slave, the function code, the starting address and the
number of set bits.
Fieldname Example RTU ASCII
Start of frame - t1-t2-t3 ”:” 0x3a
Slave address 0x0B 0x0B ”0B” 0x30, 0x42
Function code 0x0F 0x0F ”0F” 0x30, 0x46
Coil address high 0x00 0x00 ”00” 0x30, 0x30
Coil address low 0x00 0x00 ”00” 0x30, 0x30
Quantity of coils high 0x00 0x00 ”00” 0x30, 0x30
Quantity of coils low 0x10 0x10 ”10” 0x31, 0x30
Error Check (LRC / CRC) - 0x54 ”D6” 0x44, 0x36
0xAD
End of frame t1-t2-t3 - 0xD, 0xA
Table 5.45: Example reply, Force Multiple Coils
64 MODBUS / Configuration
15.12.99
5.3.1.10 Preset Multiple Registers (Function code 0x10):
This function writes values in a number of output words (also ”Output register”). With a
broadcast transmission the values are written in all slaves. The maximum register
number per frame is 128.
Inquiry:
ÿþýüûúùýø The first point is addressed with 0. The Modicon address starts with 1 (0x01).
The inquiry message determines the registers to be set. The data is sent as 2 bytes per
register.
The example shows how data is set in the two registers 0 and 1 in slave 11:
Field name Example RTU ASCII
Start of frame - t1-t2-t3 ”:” 0x3a
Slave address 0x0B 0x0B ”0B” 0x30, 0x42
Function code 0x10 0x10 ”10” 0x31, 0x30
Starting address high 0x00 0x00 ”00” 0x30, 0x30
Starting address low 0x00 0x00 ”00” 0x30, 0x30
Number of register high 0x00 0x00 ”00” 0x30, 0x30
Number of register low 0x02 0x02 ”02” 0x30, 0x32
Byte Counter 0x04 0x04 ”04” 0x30, 0x34
Data high (register 0) 0x12 0x12 ”12” 0x31, 0x32
Data low (register 0) 0x34 0x34 ”34” 0x33, 0x34
Data high (register 1) 0x56 0x56 ”56” 0x35, 0x36
Data low (register 1) 0x78 0x78 ”78” 0x37, 0x38
Error Check (LRC / CRC) - 0xA9 ”CB” 0x43, 0x42
0x43
End of frame t1-t2-t3 - 0xD, 0xA
Table 5.46: Example inquiry, Preset Multiple Registers
Reply:
The reply returns the slave address, the function code, the start address and the number
of the set register.
MODBUS / Configuration 65
15.12.99
5.3.2 Watchdog - Fieldbus failure
The watchdog serves for monitoring the data transfer between the higher ranking
ÿþýüûúùýø
controls and coupler/controller. For this the higher ranking controls cyclically actuate a
time function (Time-out) in the coupler/controller. In the case of fault free
communication this time cannot reach its end value, because prior to this it is restarted
again and again. If this time has elapsed a fieldbus failure has occurred.
In the coupler/controller special registers are present for the selection and status inquiry
of the watchdog by the higher ranking controls (Register addresses 0x1000 to 0x1008).
After switching on the supply voltage the watchdog is not yet activated. First lay down
the time-out value (Register 0x1000). The watchdog can be activated by writing a
function code in the mask register (0x1001), which is unequal 0. A second activation
possibility is to write a value in the toggle register (0x1003) deviating from 0.
Reading the minimum trigger time (Register 0x1004) reveals whether the watchdog
fault reaction was activated. If this time value is 0, a fieldbus failure is assumed. The
watchdog can be restarted in accordance with the previously mentioned two possibilities
or using the register 0x1007.
If the watchdog is started once it can only be stopped by the user for safety reasons via a
certain path (register 0x1005 or 0x1008).
66 MODBUS / Configuration
15.12.99
Watchdog register:
The table below shows the registers for the Watchdog/Supervisor function.
Register Designation Access Length Default Description
address (word)
0 x 1000 Watchdog/ read/ 1 pu/co This register saves the value for time exceeded
Supervisor write 0x0000 (Time-out). To be able to start the watchdog default
time value must have a value which is not equal to zero.
WD_TIME The time is set as a multiple of 100 ms, 0x0009
means a time out time of 0.9 s. This value cannot be
changed when the watchdog is running.
0 x 1001 Watchdog/ read/ 1 pu/co Using this mask the function codes can be set to
Supervisor write 0x0000 trigger the watchdog function. The function code can
Coding mask, be selected via a ‘1’ to
(Function code-1)
Function code 1...16, (=2 + ....)
WDFCM_1_16
Bit 1001.0 corresponds to function code1,
Bit 1001.1 corresponds to function code2...
0 x 1002 Watchdog function read/ 1 pu/co Same function as above, however, with the function
Coding mask, write 0x0000 codes 17 to 32. These codes are not supported, for
Function code this reason the default value of this register should
17...32, not be changed. It is not possible do modify this value
WD_FCM_17_32 while the watchdog is running.
0 x 1003 Watchdog trigger, read/ 1 pu/co This register is used for an alternative trigger method.
WD_TRIGGER write 0x0000 The watchdog is triggered by writing different values
in this register. Values following each other must
differ in size. Writing of a value not equal to zero
starts the watchdog. In case of a watchdog fault this
register is reset to zero.
0 x 1004 Minimal actual trigger read/ 1 pu/co Using this value the current watchdog status can be
time, write 0xFFFF read. If the watchdog is triggered the saved value is
WD_AC_TRG_TIME compared with the current value. If the current value
is smaller than the saved value this is replaced by the
current value. The unit is 100 ms/digit. The saved
value is changed by writing new values, which does
not affect the watchdog. 0x000 is not permissible.
0 x 1005 Stop watchdog, read/ 1 pu/co The watchdog is stopped if here the value 0xAAAA is
WD_AC_STOP_MASK write 0x0000 written first, followed by 0x5555. The watchdog fault
reaction is blocked. A watchdog fault is reset and
writing on the process data is possible again.
0 x 1007 Restart watchdog, read/ 1 pu Writing 0x1 into the register starts the watchdog
WD_RESTART write 0x001 again.
0 x 1008 Simplified watchdog Read/ 1 pu The watchdog is stopped by writing the value
stop write 0x0000 0x0AA55 or 0X55AA (as from V2.5), if it was already
WD_AC_STOP_SIMPLE active. The watchdog fault reaction is deactivated. An
existing watchdog fault is reset and it is possible to
write in the watchdog register again.
MODBUS / Configuration 67
15.12.99
In all registers the length is 1, i.e. with each access only one word can be written or read.
Examples:
68 MODBUS / Configuration
15.12.99
Fieldbus failure on the coupler:
The evaluation of the watchdog register is made by the coupler firmware. The internal
bus is interrupted. The digital outputs are set to 0 and the analog outputs are set to the
minimum value (e.g. with 4...20 mA to 4 mA).
The nodes can set to a safe status in the case of a fieldbus failure using these outputs and
a corresponding control program.
MODBUS / Configuration 69
15.12.99
5.3.3 Configuration function
The following registers can be read, in order to determine the configuration of the
connected modules:
0 x 1023 CnfLen.AnalogInp read 3++ pu Number of I/O bits with the process
data words of the inputs
0 x 1024 CnfLen.DigitalOut read 2++ pu Number of I/O bits with the process
data bits of the outputs
Table 5.49: Configuration function pu: Default value when switching voltage on
70 MODBUS / Configuration
15.12.99
5.3.4 Firmware information
These registers are used to read out information about the coupler or controller
firmware.
0x2013 Major sub item code, read 1 pu/co - Extended WAGO order number.
INFO_MAJOR Is used for special firmware versions or
settings:
0xFFFF for coupler/controller.
0x2014 Minor sub item code, read 1 pu/co - Extended WAGO order number.
INFO_MINOR Is used for special firmware versions or
settings:
0xFFFF for coupler/controller.
0x2023 Description, read 32 pu/co - Details of the company and user of the
INFO_LOADER_INFO firmware programming unit, max. 63
characters. If not available the value
0xFF appears.
Table 5.50: Firmware information pu: Default value when switching voltage on, co: Constant
MODBUS / Configuration 71
15.12.99
5.3.5 General registers
The constants saved here can be used to test the communication with the master.
0x2001 Units, GP_ONES read 1 pu/co Constant with units. Is -1 if declared as ”signed
0xFFFF int” or MAXVALUE if ”unsigned int”.
0x2002 1,2,3,4, GP_1234 read 1 pu/co Constant value to test whether high and low
0x1234 bytes are changed over (Intel/Motorola format).
Should appear in the master as 0 x 1234. If
0 x 3412 appears the high and low byte must be
changed over.
0x2003 Mask1, GP_AAAA read 1 pu/co Constant to see if all bits are present. Is used
0xAAAA together with register 0 x 2004.
0x2004 Mask2, GP_5555 read 1 pu/co Constant to see if all bits are present. Is used
0x5555 together with register 0 x 2003.
Table 5.51: General registers pu: Default value when switching on voltage ; co: constant
72 MODBUS / Configuration
15.12.99
6 Start-Up and Diagnosis
1st flash sequence 1st pause 2nd flash sequence 2nd pause 3rd flash sequence
Node is ready for communication ON shining The node is working normally. The LED is out for a short time
when the receiver receives an incomplete frame or a frame for
another node.
Node receives data RXD shining The node receives a frame with own slave-address or
broadcast.
Node detects an frame with error CRC blinking The received error code differs from the calculated code. The
code information in the received frames when Error Check is
activated.
Only controller:
Flash CRC shining The user programme is transferred from RAM to Flash
You have access to the diagnosis functions via the following register too:
Table 6.3: Register for diagnosis functions pu: standard value in case of voltage connection
The WAGO-I/O-PRO specific test and starting-up functions are explained in the
corresponding manual2. All the following functions marked with ‘Online’ will be
carried out via PC with WAGO-I/O-PRO.
ÿþýüûúùýø Before you log in, the station address switch must be set to ‘00’! The modified
address will be taken over for the controller when you reconnect the supply
voltage.
Before loading the programme, the operating mode switch should be set to Stop or the
cycle should be stopped with ‘Online’ ‘Stop’.
1
Communication cable, Order No. 750-920 (part of the programming tools IEC 1131-3)
2
WAGO-I/O-PRO manual, English, Order No. 750-120/000-002
ATTENTION!
In case of ‘Online’ ‘Stop’ or when you set the operating mode switch from run to stop,
the outputs (e. g. for motor contactors or valves) which are still set remain set!
Switching-off commands coming from the software, e. g. via sensors, are then
ineffective because the program is not executed any more !
(The change in operating mode is taking place internally at the end of the program cycle).
Free fall ≤ 1m
For stronger impulses and oscillations, the acceleration and the amplitude should be
reduced by suitable actions.
The following table shows the kind of test for the mechanical conditions.
Degree of protection
Degree of protection
acc. to IEC 529: IP 20
(protection against direct contact with standard probes)
Protec. against foreign bodies: Diameter > 12 mm
Protection against water: No particular protection
We offer enclosures made of aluminium die-cast, polyester or stainless steel with the
IP 65 degree of protection to protect against water infiltration (see
WAGO-I/O-SYSTEM catalogue).
Conformity marking: CE
EN 61000-4-4 2 kV (3/4) B
37 dBµV/m