Wenglor ZAG45FN01 User manual

Operating Instructions
Fieldbus Gateway Fast Ethernet V. 1.3
ZAG45FN01
ZUB-CD-FB

2
Index
1. Information on CE marking of the module ........................................................................................... 5
1.1 EU Directive EMC ............................................................................................................................................................ 5
1.2 Scope of application........................................................................................................................................................ 5
1.3 Note installation guidelines ............................................................................................................................................. 5
1.4 Installation of the unit ..................................................................................................................................................... 5
1.5 Working on switch cabinets ............................................................................................................................................ 5
2. Information for the machine manufacturers......................................................................................... 5
2.1 Introduction...................................................................................................................................................................... 5
2.2 EU Machinery Directive .................................................................................................................................................. 5
3. Introduction ............................................................................................................................................ 6
3.1 Fieldbus Gateway software flow-chart ............................................................................................................................ 6
3.2 Fieldbus Gateway application diagram .......................................................................................................................... 7
4. Operation modes of the Gateway.......................................................................................................... 7
4.1 Configuration mode (config mode)................................................................................................................................. 7
4.2 Test mode ........................................................................................................................................................................ 7
4.3 Data exchange mode ...................................................................................................................................................... 8
5. RS-interface............................................................................................................................................ 8
5.1 RS-interfaces at the Fieldbus Gateway ........................................................................................................................... 8
5.2 RS232 Baud Rate ............................................................................................................................................................ 8
5.3 Buffer sizes at the Fieldbus Gateway.............................................................................................................................. 8
5.4 Framing Check ................................................................................................................................................................ 8
6. SSI-interface........................................................................................................................................... 9
6.1 Initiation of the SSI-interface ........................................................................................................................................... 9
6.2 Hardware-wiring ............................................................................................................................................................. 9
7. The Debug-interface ............................................................................................................................ 10
7.1 Overview of the Debug-interface................................................................................................................................... 10
7.2 Starting in the Debug-mode.......................................................................................................................................... 10
7.3 Communication parameter for the Debug-interface ..................................................................................................... 10
7.4 Possibilities with the Debug-interface ........................................................................................................................... 10
7.5 Commands of the Debug-interface............................................................................................................................... 10
8. Mode of operation of the system ........................................................................................................ 10
8.1 General explanation ...................................................................................................................................................... 10
8.2 Interfaces ....................................................................................................................................................................... 10
8.3 Data exchange............................................................................................................................................................... 10
8.4 Possible data lengths .................................................................................................................................................... 10
8.5 Startup phase ................................................................................................................................................................ 10
9. Generating a Script .............................................................................................................................. 11
9.1 What is a Script?............................................................................................................................................................ 11
9.2 Memory efficiency of the programs .............................................................................................................................. 11
9.3 What can you do with a Script device?......................................................................................................................... 11
9.4 Independence of buses................................................................................................................................................. 11
9.5 Further settings at the Gateway .................................................................................................................................... 11
9.6 The use of the Protocol Developer................................................................................................................................ 11
9.7 Accuracies of the baud rates......................................................................................................................................... 12
9.8 Script processing times................................................................................................................................................. 12
10. Implemented protocols in Fieldbus Gateway with ......................................................Universal Script
13
10.1 Protokoll: Transparent ................................................................................................................................................... 13
10.1.1 Data structure ................................................................................................................................................................ 13
10.2 Protocol: Universal 232 ................................................................................................................................................. 13
10.2.1 Data structure ................................................................................................................................................................ 14
10.2.2 Fieldbus parameters...................................................................................................................................................... 14
10.2.3 RS-232 parameter table ................................................................................................................................................ 14
10.2.3.1 Start character (232 Start character)............................................................................................................................. 14
10.2.3.2 Length 232 (232 Length) ............................................................................................................................................... 14
10.2.3.3 Data Area ....................................................................................................................................................................... 14
10.2.3.4 End character (232 End character)............................................................................................................................... 14

3
Sensoren für Ihren Erfolg www.wenglor.com Sensoren für Ihren Erfolg www.wenglor.com
10.2.4 Communication sequence ............................................................................................................................................ 14
10.3 Protocol: 3964(R) .......................................................................................................................................................... 15
10.3.1 Data structure 3964R..................................................................................................................................................... 15
10.3.2 Protocol definitions........................................................................................................................................................ 15
10.3.3 Data communication .................................................................................................................................................... 15
10.3.3.1 Initiation of data communication by the low-priority user............................................................................................. 15
10.3.3.2 Conflicts ........................................................................................................................................................................ 15
10.3.3.3 Timeout times ............................................................................................................................................................... 15
10.3.3.4 Retries ........................................................................................................................................................................... 16
10.3.3.5 Initiation of data communication by the high-priority user ........................................................................................... 16
10.3.4 Protocol type 3964 ........................................................................................................................................................ 16
10.4 Protocol: MODBUS-RTU ............................................................................................................................................... 16
10.4.1 Notes.............................................................................................................................................................................. 16
10.4.2 Fieldbus Gateway as MODBUS-Master ........................................................................................................................ 16
10.4.2.1 Preparation ................................................................................................................................................................... 16
10.4.2.2 Data structure ................................................................................................................................................................ 16
10.4.2.3 Communication sequence ........................................................................................................................................... 16
10.4.3 Fieldbus Gateway as MODBUS-Slave .......................................................................................................................... 17
10.4.3.1 Preparation .................................................................................................................................................................... 17
10.4.3.2 Data structure ................................................................................................................................................................ 17
10.4.3.3 Communication sequence ............................................................................................................................................ 17
10.4.4 Fieldbus Gateway as Modbus-ASCII Master ................................................................................................................ 17
10.5 The trigger byte ............................................................................................................................................................. 17
10.6 The length byte ............................................................................................................................................................. 17
11. Hardware ports, switches and LEDs................................................................................................... 18
11.1 Device labeling .............................................................................................................................................................. 18
11.2 Connectors .................................................................................................................................................................... 18
11.2.1 Connector to the external device (RS-interface)........................................................................................................... 18
11.2.2 Connector supply voltage and DEBUG-interface ......................................................................................................... 19
11.2.3 Ethernet 10/100 BASE/T-connector............................................................................................................................... 19
11.2.4 Power supply ................................................................................................................................................................. 19
11.3 LEDs .............................................................................................................................................................................. 19
11.3.1 LED "(Ethernet) Power".................................................................................................................................................. 19
11.3.2 LED "Link/Act. 10 MB".................................................................................................................................................... 19
11.3.3 LED "Link/Act. 100 MB" ................................................................................................................................................. 20
11.3.4 LED "(Ethernet) State" ................................................................................................................................................... 20
11.3.5 LED "Power"................................................................................................................................................................... 20
11.3.6 LED "State"..................................................................................................................................................................... 20
11.3.7 LEDs (Error No./Select ID) ............................................................................................................................................ 20
11.4 Switches ........................................................................................................................................................................ 20
11.4.1 Termination Rx 422 + Tx 422 (serial interface) ............................................................................................................. 20
11.4.2 Rotary coding switches S4 + S5 (serial interface) ....................................................................................................... 20
11.4.3 Rotary coding switch S6 (optional) ............................................................................................................................... 21
11.5 The Debug cable for Fieldbus Gateway SC.................................................................................................................. 21
12. Error handling ...................................................................................................................................... 21
12.1 Error handling at Fieldbus Gateway.............................................................................................................................. 21
13. Installation guidelines.......................................................................................................................... 22
13.1 Installation of the module .............................................................................................................................................. 22
13.1.1 Mounting........................................................................................................................................................................ 22
13.1.2 Removal ........................................................................................................................................................................ 22
13.2 Wiring............................................................................................................................................................................. 22
13.2.1 Connection systems...................................................................................................................................................... 22
13.2.1.1 Power supply ................................................................................................................................................................. 22
13.2.1.2 Equipotential bonding connection................................................................................................................................ 22
13.2.2 Ethernet communication interface ................................................................................................................................ 22
13.2.3 Line routing, shield and measures to combat interference voltage ............................................................................. 22

4
Disclaimer of liability
We have checked the contents of the document for conformity with the hardware and software described. Nevertheless, we are
unable to preclude the possibility of deviations so that we are unable to assume warranty for full compliance. The information
given in the publication is,
however, reviewed regularly. Necessary amendments are incorporated in the following editions. We would be pleased to receive
any improvement proposals which you may have.
Copyright
Copyright (C) wenglor sensoric gmbh 1997 – 2009. All rights reserved.
This document may not be passed on nor duplicated, nor may its contents be used or disclosed unless expressly permitted.
Violations of this clause will necessarily lead to compensation in damages. All rights reserved, in particular rights of granting of
patents or registration of
utility-model patents.
13.2.4 General information on line routing .............................................................................................................................. 23
13.2.4.1 Shielding of lines ........................................................................................................................................................... 23
14. Representation of the data in Ethernet-TCP/IP .................................................................................. 24
14.1 Network-addresses, network-connections.................................................................................................................... 24
14.2 TCP-connection setup ................................................................................................................................................... 24
14.3 Data exchange............................................................................................................................................................... 24
14.3.1 TCP or UDP? ................................................................................................................................................................. 24
14.4 Data exchange mode .................................................................................................................................................... 24
14.4.1 Direct data exchange .................................................................................................................................................... 25
14.4.2 MODBUS-TCP ............................................................................................................................................................... 25
14.4.3 E-mail ............................................................................................................................................................................ 25
14.4.4 Server............................................................................................................................................................................. 25
14.4.4.1 Webserver...................................................................................................................................................................... 25
14.4.4.2 FTP-server...................................................................................................................................................................... 25
14.4.4.3 File system..................................................................................................................................................................... 25
15. Technical data ...................................................................................................................................... 26
15.1 Device data ................................................................................................................................................................... 26
15.1.1 Interface data ................................................................................................................................................................ 27
16. Commissioning guide.......................................................................................................................... 28
16.1 Note ............................................................................................................................................................................... 28
16.2 Components.................................................................................................................................................................. 28
16.3 Installation ..................................................................................................................................................................... 28
16.4 Dimensional drawing Fieldbus Gateway - Fast Ethernet.............................................................................................. 28
16.5 Commissioning.............................................................................................................................................................. 28
16.6 Ethernet connection ..................................................................................................................................................... 28
16.7 Connection to the process device ................................................................................................................................ 28
16.8 Shield connection.......................................................................................................................................................... 29
16.9 Connecting the supply voltage ..................................................................................................................................... 29
17. Servicing............................................................................................................................................... 29
17.1 Returning a device......................................................................................................................................................... 29
17.2 Downloading PC software............................................................................................................................................. 29
18. Annex ................................................................................................................................................... 30
18.1 Hexadecimal table......................................................................................................................................................... 30

5
Sensoren für Ihren Erfolg www.wenglor.com Sensoren für Ihren Erfolg www.wenglor.com
1. Information on CE marking of the module
1.1 EU Directive EMC
The following applies to the module described in this User Manual:
Products which bear the CE mark comply with the requirements of EU Directive „Electromagnetic Compatibility“ and the harmo-
nized European Standards (EN) listed therein.
The EU Declarations of Conformity are available at the following location for perusal by the responsible authorities in accordance
with the EU Directive, Article 10:
wengor sensoric gmbh, wenglor Straße 3, DE-88069 Tettnang
1.2 Scope of application
The modules are designed for use in the industrial sector and comply with the following requirements.
Scope of
application
Requirement applicable
to Emitted interference
Requirement applicable
to Interference immunity
Industry EN 55011 Kl. 1 EN 61000-6-2
1.3 Note installation guidelines
The module complies with the requirements if you
1. comply with the installation guidelines described in the User Manual when installing and operating the module.
2. also follow the rules below on installation of the equipment and on working on switch cabinets.
1.4 Installation of the unit
Modules must be installed in electrical equipment rooms/areas or in enclosed housings (e. g. switch boxes made of metal or
plastic). Moreover, you must earth the unit and the switch box (metal box) or at least the top-hat rail (plastic box) onto which the
module has been snapped.
1.5 Working on switch cabinets
In order to protect the modules against static electrical discharge, the personnel must discharge themselves electrostatically
before opening switch cabinets or switch boxes.
2. Information for the machine manufacturers
2.1 Introduction
The Fieldbus Gateway module does not constitute a machine as defined by the EU "Machinery“ Directive. Consequently, the
module does not have a Declaration of Conformity in relation to the EU Machinery Directive.
2.2 EU Machinery Directive
The EU Machinery Directive stipulates the requirements applicable to a machine. The term "machine" is taken to mean a totality of
connected parts or fixtures (see also EN 292-1, Paragraph 3.1)
The module is a part of the electrical equipment of the machine and must thus be included by the machine manufacturer in the
Declaration of Conformity process.

6
3. Introduction
The Fieldbus Gateway Fast Ethernet module serves to adapt a serial port to Ethernet networks. The terminal unit’s protocol is
converted in the Fieldbus Gateway via a Script.
The module CL-Fast Ethernet essentially consists of the following hardware components:
•Electrically isolated 10/100 Base-T-interface to Ethernet
•Ethernet controller W3100A and REALTEK RTL8201CP
•Microprocessor 89C51 RD2
•RAM and FLASH
•Optionally electrically isolated on the RS-side
•Serial interface (RS-232, RS-485 and RS-422) to the device connected externally
3.1 Fieldbus Gateway software flow-chart
HW Reset
RAM test
Konfigmode
Switch = FF
?
j
j
j
n
Init
Start konfig msg
Read/write konfig data
Appl.
Testmode
Switch = EE
?
n
n
Test
Debugmode
Start test msg
Testmode
Debugmode

7
3.2 Fieldbus Gateway application diagram
The following graph shows a typical connection scheme.
4. Operation modes of the Gateway
4.1 Configuration mode (config mode)
The configuration mode serves to configure the Gateway. The following adjustments are possible in this mode.
•Loading a Script (e. g. by means of the software WINGATE with "Write Script" under "File")
•Updating the firmware (e. g by means of the software "FDT")
•Configuration of the Gateway (by means of the software WINGATE)
The Gateway will be starting in this mode in case both switches S4 as well as S5 are set on position "F" when switching on the
Gateway. Right after switching on the Gateway in the configuration mode it will be sending its starting message, that looks analog
with the following message:
"RS-FE-CL (232/422/485) V3.0 [29] (c)dA Switch=0xFF Script(8k)="Leer" Author="wenglor sensoric gmbh" Version="1.0"
Date=21.08.2001 SN=47110001 IP=0.0.0.0“.
In the configuration mode the Gateway always operates with the settings 9600 Bauds, no Parity, 8 Databits and 1 Stopbit, the
RS-State LED will always be flashing red, the "Error No/Select ID" LEDs are of no account for the user. All software revisions
contain the configuration mode.
4.2 Test mode
Setting of the test mode
The test mode is set by bringing the switches S4 and S5 in position "E". All other switches will not be taken into consideration for
the setting of the test mode. Now the Gateway has to be restarted with these settings (by a short disconnection from the power
supply).
In the test mode the Gateway always operates with the settings 9600 baud, no parity, 8 databits and 1 stopbit.
The test mode may be helpful to integrate the Gateway in the relevant environment, for instance to test the parameters of the
RS-interfaces.
Mode of operation of the test mode
After the restart in the test mode the Gateway will be sending the values 0…15 in hexadecimal representation ("0"…"F") in ASCII-
coding on the serial side every second. Simultaneously the same values are issued binary on the fieldbus-interface.
In this mode the State-LED on the RS-side will be flashing red, the "Error No/Select ID" LEDs will be displaying the value in a
binary way, that is issued that moment. Additionally each character that is received at one of the interfaces will also be output at the
same interface as a local echo. On the fieldbus-side only the first byte will be used for the local echo, that means on receiving as
well as on transmitting only the first byte of the bus data is looked at, the other bus data do not change compared to the last data.
24 V
RS-232
RS-485
RS-422 Fieldbus Gateway
Debug
RS-232
Industrial
Ethernet
Sensoren für Ihren Erfolg www.wenglor.com Sensoren für Ihren Erfolg www.wenglor.com

8
4.3 Data exchange mode
The Gateway has to be in the data exchange mode, so that a data exchange between the RS-side of the Gateway and the field-
bus is possible. As long as the Gateway is not in the configuration mode or the test mode, the data exchange mode is active. In
the data exchange mode the Gateway will execute the downloaded Script with the parameters, that have been preset through
WINGATE.
5. RS-interface
5.1 RS-interfaces at the Fieldbus Gateway
The Fieldbus Gateway - Fast Ethernet has the interfaces RS-232, RS-422 and RS-485 available. The hardware always features a
DEBUG-interface, see chapter 7.
5.2 RS232 Baud Rate
The baud rate for the RS 232 port can be set by means of the rotary selector switches. Transmission takes place with the para-
meters 8N1.
Schalterstellung Baudrate
1 115,2 k
2 57,6 k
3 38,4 k
4 19,2 k
5 9,6 k
6 4,8 k
Baud Rate
5.3 Buffer sizes at the Fieldbus Gateway
Fieldbus Gateway CL features at the serial side a buffer with the size of 1024 bytes for input data and output data each.
The FIFO of the application interface (RS-interface) can be changed in any Gateway form Script revision 26 on, that is capable for
Script. For it please check in the Protocol Developer under "Device Control" - "Hardware".
5.4 Framing Check
The length of the stop bit received by the Gateway is checked through the function "Framing Check". Here the stop bit generated
by the Gateway is always long enough, so that connected participants can evaluate the stop bit.
Please be aware that the function "Framing Check" becomes effective only in case of 8 data bit and the setting "No parity".
An error is detected and indicated by the Error LEDs in case the stop bit does not show the length 1 bit during the activated check.
The possible setting for this parameter can be controlled by the Script (see online help from Protocol Developer). The presetting
for the "Stop Bit Framing Check" is "enabled".

9
6. SSI-interface
The Fieldbus Gateway also supports the connection of applications or products, that communicate via SSI.
6.1 Initiation of the SSI-interface
The required Script (example_SSI), the firmware- (Cust0023) and Protocol Developer-extension (Cust_ssi.xml) are available free
of charge from our website at www.wenglor.com, as well as the softwaretool Protocol Developer and the configuration software
WINGATE.
•In the Protocol Developer (see chapter 7, The Debug-interface) the ConfigFile "Cust_ssi.xml" has to be added. At Options
Settings ConfigFiles.
•Load the Script "example_SSI.dss" into the Protocol Developer.
•The encoder type has to be defined in the Script itself under "Set number of bits" and "Set typ" (default = 12-Bit-Single-Turn-
Gray):
/// Set number of bits (1..16 = Single Turn, 17..32 = Multi Turn)
moveconst (bAnzBit, 12); // i. e. 12 Bit single turn
// Set typ
// Values of bTyp:
// 0 = Reserved
// 1 = Output-value without change (i. e. binary encoder)
// 2 = Output-value changed from Gray to Binary (i. e. Gray encoder)
// >2 = Reserved
moveconst ( wTyp, 2); // i. e. 12 Bit Gray
•Load the Script into the device. Open WINGATE and activate the device in the configuation mode (see chapter 4.1, Configurati-
on mode (config mode)) - an actuation message appears, that looks in line with the following (example CL-PB):
•Special Firmware (23) not loaded
•RS-PBV1-CL (232/422/485) V7.31[30] (c)dA Switch=0x02FF Script(8k)="SSI" Author="wenglor sensoric" Version="V 1.0"
Date=20.03.2008 SN=47110002 ID=2
•Konfigmode…
•The note "Special Firmware (23) not loaded" means that the firmware-extension is not yet loaded. The extension is loaded
through Extras Firmware Script Extension. Select the file "Cust0023 (Cmd 23 + 24 for SSI).hex" and choose "write extensi-
on".
•Re-start the device now only the device’s actual actuation message appears and not the note any more.
•Bring the device into the data exchange mode (see chapter 4.3, Data exchange mode) DONE!
6.2 Hardware-wiring
The clock wires of the SSI-interface are placed onto the Tx-wires of the RS-422-interface and the data wires onto the Rx-wires at
the Fieldbus Gateway.
X1 (3pin + 4pin screw-plug-connector):
Pin no. Name Function at SSI
1 Rx 232 n. c.
2 Tx 232 n. c.
3 AP-GND n. c.
4 RX 422+ SSI DAT+
5 Rx 422– SSI DAT–
6 Tx 422+ SSI CLK+
7 Tx 422– SSI CLK–
Sensoren für Ihren Erfolg www.wenglor.com Sensoren für Ihren Erfolg www.wenglor.com

10
7. The Debug-interface
7.1 Overview of the Debug-interface
The Fieldbus Gateway®IC features a Debug-interface, that allows a step-by-step processing of a Script. Normally this interface is
only required for the development of a Script.
7.2 Starting in the Debug-mode
When applying power to the Fieldbus Gateway®(power up) the firmware will output the binary character 0 (0x00) after a self-test
was carried out on this interface. If the Fieldbus Gateway®receives an acknowledgement via this interface within 500 ms, it is in
the Debug-mode. The acknowledgement is the ASCII-character O (0x4F).
With the start in the Debug-mode the further execution of Script commands will be put to a stop.
7.3 Communication parameter for the Debug-interface
The Debug-interface is always operating with 9600 baud, no parity, 8 data bit, 1 stop bit. It is not possible to change this parame-
ter in the Protocol Developer. Please consider the fact that these settings have to be in accordance with those of the PC-COM-
interface and that the flow control (protocol) has to be set on „none“ there.
7.4 Possibilities with the Debug-interface
Usually the Protocol Developer is connected to the Debug-interface. With it a step-by-step processing of a Script, monitoring
jumps and decisions and looking at memory areas is possible. Moreover breakpoints can be set. It basically possesses all cha-
racteristics a software-development tool is typically supposed to have. However, it is also possible to carry out a Scrip-update via
this interface.
From Script version [27] on you can also output data with the Script command "SerialOutputToDebugInterface". Please also pay
attention to the remark in the manual ’Protocol Developer’.
7.5 Commands of the Debug-interface
The commands for the use of the Debug-interface are described in the instruction manual Protocol Developer.
8. Mode of operation of the system
8.1 General explanation
Communication can be split into seven layers, Layer 1 to Layer 7, in accordance with the ISO/OSI model.
The wenglor sensoric Gateways convert Layers 1 and 2 of the customized bus system (RS-485/RS-232/RS-422) to the correspon-
ding Fieldbus system. Layers 3 and 4 are being covered by the UDP/IP-protocol, TCP/IP-protocol. The Layers 5 and 6 are empty.
Layer 7 is converted in accordance with chapter 8.3.
8.2 Interfaces
The Gateway features the RS-232-, RS-422- and RS-485-interfaces.
8.3 Data exchange
All data is transferred by the Gateway in dependence of the downloaded Script.
8.4 Possible data lengths
The table below shows the maximum transferable data:
Input data max. 1024 bytes Variable: maximum value in this case
Output data max. 1024 bytes Variable: maximum value in this case
8.5 Startup phase
The Master sets up a TCP/IP- or a UDP/IP-connection to the Gateway during the startup phase. Only after a correct termination of
the startup phase the data exchange with external devices will take place.

11
9. Generating a Script
9.1 What is a Script?
A Script is a sequence of commands, that are executed in that exact order. Because of the fact that also mechanisms are given
that control the program flow in the Script it is also possible to assemble more complex processes from these simple commands.
The Script is memory-oriented. It means that all variables always refer to one memory area. While developing a Script you do not
have to take care of the memory management though. The Protocol Developer takes on this responsibility for you.
9.2 Memory efficiency of the programs
A Script command can carry out e. g. a complex checksum like a CRC-16 calculation via data. For the coding of this command
only 9 byte are required as memory space (for the command itself). This is only possible when these complex commands are
contained in a library.
A further advantage of this library is, that the underlying functions have been in practical use for a couple of years and therefore
can be described as ’void of errors’. As these commands are also present in the native code for the controller, at this point also
the runtime performance of the Script is favorable.
9.3 What can you do with a Script device?
Our Script devices are in the position to process a lot of commands. In this case a command is always a small firmly outlined task.
All commands can be put into classes or groups. A group of commands deals with the communication in general. This group’s
commands enable the Gateway to send and receive data on the serial side as well as on the bus-side.
9.4 Independence of buses
Basically the Scripts do not depend on the bus, they are supposed to operate on. It means that a Script which was developed on
a Profibus Gateway can also be operated on an Interbus without changes, since the functioning of these buses is very similar. In
order to also process this Script on an Ethernet Gateway, perhaps further adjustments have to be made in the Script, so that the
Script can be executed reasonably.
There are no fixed rules how which Scripts have to operate properly. When writing a Script you should take into account on which
target hardware the Script is to be executed, so the necessary settings for the respective buses can be made.
9.5 Further settings at the Gateway
Most devices require no further adjustments, except for those made in the Script itself. However, there are also exceptions to it.
These settings are made by means of the software WINGATE. If you know our Fieldbus Gateway-series, you are already familiar
with the proceeding with it. An example is the adjustment of the IP-address and the net-mask of an Ethernet-Gateway. These
values have to be known as fixed values and are not available for the runtime. Another reason for the configuration of the values
in WINGATE is the following: After an update of the Script these values remain untouched, i. e. the settings that were made once
are still available after a change of the Script. Only this way it is also possible that the same Script operates on different Ethernet-
Gateways, that feature different IP-addresses.
9.6 The use of the Protocol Developer
The software tool Protocol Developer can be downloaded from our website http://www.wenglor.com
It is a tool for an easy generation of a Script for our Script Gateways. Its operation is exactly aimed at this use. After starting the
program the Script that was loaded the last time is loaded again, provided that it is not the first start.
Typical for Windows Script commands can be added by means of the mouse or the keyboard. As far as defined and required for
the corresponding command, the dialog to the corresponding command is displayed, and after entering the values the right text
is automatically added to the Script. The insertion of new commands by the Protocol Developer is carried out in a way that existing
commands will not be overwritten. Generally a new command is inserted in front of the one where the cursor is positioned. Of
course the commands can also be written by means of the keyboard or already written commands can also be modified.
Sensoren für Ihren Erfolg www.wenglor.com Sensoren für Ihren Erfolg www.wenglor.com

12
9.7 Accuracies of the baud rates
The baud rate of the serial interface is derived from the processor’s crystal frequency.
Meanwhile all Script-Gateways, except for the MPI-Gateway (20 MHz) are working with a crystal frequency of 40 MHz.
You can enter any desired integer baud rate into the Script. After that the firmware adjusts the baud rate, that can be derived the
most precisely from the crystal frequency.
The baud rate the Gateway is actually working with (BaudIst) can be determined as follows:
BaudIst = (F32/K)
F32 = Crystal frequency [Hz]/32
K = Round (F32/BaudSoll);
Round () is a commercial roundoff
Example:
The actual baud rate is to be calculated, when 9600 baud are pre-set, where the Gateway is operated with 40 MHz:
F32 = 40000000/32 = 1250000
K = Round(1250000/9600) = Round(130.208) = 130
BaudIst = 1250000/130 = 9615.38
I. e.: The baud rate actually adjusted by the Gateway is 9615.38 baud
The resulting error in per cent can be calculated as follows:
Error[%] = (abs(BaudIst - BaudSoll)/BaudSoll) * 100
In our example the following error results:
Error = (abs(9615.38 - 9600)/9600) * 100 = 0.16%
In practise errors below 2 % can be tolerated!
In the following please find a listing of baud rates at a 40 MHz-crystal frequency with the corresponding errors:
4800 baud: 0.16 %
9600 baud: 0.16 %
19200 baud: 0.16 %
38400 baud: 1.35 %
57600 baud: 1.35 %
62500 baud: 0 %
115200 baud: 1.35 %
312500 baud: 0 %
625000 baud: 0 %
9.8 Script processing times
The Script is translated by the Protocol Developer and the consequently generated code is loaded into the Gateway. Now the pro-
cessor in the Gateway interprets this code. In this case, there are commands that can be processed very fast (e. g. "Set Parame-
ter"). There are also commands, however, that take longer (e. g. copying 1000 bytes). Consequently, for one thing the processing
time differs due to the kind of Script command. But the processing time of the Script commands is considerably more determined
by the processor time that is available for this process. Since the processor has to carry out several tasks simultaneously (multi-
tasking system) only a part of the processor's capacity is available for the Script processing. The following tasks - in the order of
priority - are executed on the processor:
•Sending and receiving data at the Debug-interface (provided that the Protocol Developer has been started on the PC)
•Sending and receiving data at the RS-interface
•Sending and receiving data at the Fieldbus-interface
•Tasks controlled via internal clock (1 ms) (e. g. flashing of an LED)
•Processing of the Script

13
From experience approximately 0.5 ms can be calculated for each Script line. This value confirmed itself again and again in many
projects as a standard value. He is always quite right if the processor has enough time available for the Script processing.
By means of the tasks mentioned above, the following recommendation can be formulated in order to receive a rather fast Script
processing:
•Deactivate the Debug-interface (it is the normal case in the serial use)
•Keep the data length at the RS-interface as small as possible. The baud rate is not the problem here, but the amount of charac-
ters which are transferred per second.
•Do not unnecessarily extend the data length at the Fieldbus side. Especially at acyclic bus data, if possible do only send them
when changes were made. The data length at buses that are configured to a fixed length (e. g. Profibus) should not be longer
than absolutely necessary.
If the processing time should be too large in spite of these measures, there is the possibility to generate a customized Script com-
mand, that executes several tasks in one Script command.
Please contact our support department for this purpose.
10. Implemented protocols in Fieldbus Gateway with
Universal Script
Fieldbus Gateway is supplied with the Script “Universal Script wenglor“. The configuration of the protocols is carried out by means
of the software WINGATE.
Attention:
The "Universal Script" will get lost and has to be input again if a Reset Device is carried out.
The Script can be found on the wenglor Support-CD in the folder \Software\ProtocolDeveloper\Example\
Universal\
10.1 Protokoll: Transparent
The data is transferred bidirectional from the Fieldbus Gateway.
10.1.1 Data structure
10.2 Protocol: Universal 232
The protocol designation "Universal 232" and the relation to the "RS-232-interface" in the description
have eveloped over the years. The protocol also works with RS-422 and RS-485 though!
Trigger
(opt.)
LengthBus
(optional)
Data fieldFieldbus
Data fieldRS
Sensoren für Ihren Erfolg www.wenglor.com Sensoren für Ihren Erfolg www.wenglor.com

14
10.2.1 Data structure
10.2.2 Fieldbus parameters
Trigger byte: See "The trigger byte", Chapter 9.13‚ on page 24
Length byte: See "The length byte", Chapter 9.14‚ on page 25
10.2.3 RS-232 parameter table
10.2.3.1 Start character (232 Start character)
If this character is defined, the gateway evaluates only the data at the RS-232 interface following this start character. Each trans-
mission from the gateway via the RS-232 interface is initiated with the start character in this case.
10.2.3.2 Length 232 (232 Length)
If this byte is activated, the gateway, at the receive end, awaits as many bytes of useful data as specified in this byte by the RS-232
transmitter. At the transmission end, the gateway then sets this byte to the number of useful data items transmitted by it. If byte
"Length232" is not defined, the gateway, on reception at the RS-232 interface, waits for the end criterion if this is defined. If no
end criterion is defined either, as many characters as can be transferred in the fieldbus transmit buffer are read in via the RS-232
interface.
As a special case for this parameter also a length byte with additional Timeout monitoring can be set in WINGATE. In that case the
received characters will be discarded at a Timeout.
Attention:
If "Timeout“ is selected as end character, then this byte has no significance.
10.2.3.3 Data Area
In this data area the user data will be transferred.
10.2.3.4 End character (232 End character)
If this character is defined, the gateway receives data from the RS-232 interface up to this character. The "Timeout" criterion can
be defined as a special case. In this case, the gateway continues to receive characters until a defined pause occurs. In the special
case "Timeout" the "Length 232-byte" has no significance. At the transmit end, the gateway inserts the end character, if defined,
as the last character of a transmission.
10.2.4 Communication sequence
The useful data (data area) arriving via the fieldbus is copied in accordance with chapter 10.2.1 transparently into the RS-232
data field and transferred via the RS interface, whereby the protocol is supplemented in accordance with the configuration (start
character, end character…). NO acknowledgement is issued !
If the "Trigger byte“ (see chapter 10.5) is active, data is sent only on a change of this byte. If the "Length byte" (see chapter 10.6)
is active, only as many of the following bytes as specified there are transferred.
Trigger
(optional)
LengthBus
(optional)
Start signal
(optional)
Length232
(optional)
End signal
(optional)
Data fieldFieldbus
Data structure Universal 232 protocoll
Data fieldRS

15
Receive data at the RS interface is evaluated in accordance with the configured protocol, and the data field (data area (see chap-
ter 10.2.1)) is sent to the fieldbus Master. If more characters have been received than the fieldbus block length, the trailing bytes
are truncated and an Rx Overrun is indicated. If less have been received, padding with 0 occurs. If the "Length byte" is active, the
number of received useful data items is entered there. If the, "Trigger byte" is active, this is incremented by one after each complete
reception operation at the RS interface.
10.3 Protocol: 3964(R)
The 3964 protocol is used to transfer data between two serial devices. One partner must be a high-priority partner and the other
must be a low-priority partner in order to resolve initialisation conflicts.
10.3.1 Data structure 3964R
10.3.2 Protocol definitions
The telegram format is as follows:
•The received net data is forwarded (transparently) in both directions unchanged.
•Attention: The DLE-doubling is excluded from it; that means one DLE (10H) on the bus-side is sent on the RS-side twice. A
double DLE on the RS-side is only sent once to the bus-master.
•Data blocking is not scheduled.
•The net data length is restricted to 236 bytes per telegram.
•Communication always runs between high-priority and low-priority communication partners.
10.3.3 Data communication
10.3.3.1 Initiation of data communication by the low-priority user
If the low-priority user also receives an STX in response to a transmitted STX, it interrupts its transmit request, reverts to Receive
mode and acknowledges the received STX with DLE.
A DLE in the data string is duplicated and included in the checksum. The BCC is computed from XORing all characters.
10.3.3.2 Conflicts
10.3.3.3 Timeout times
The timeout times are preset by the definition of the 3964R protocol and cannot be overwritten !!!
tq = acknowledgement timeout time (2 s).
The acknowledgement timeout time is started after transmission of control character STX. If no positive acknowledgement arrives
within the acknowledgement timeout time, the job is repeated (max. 2×). If it has not been possible to complete the job positively
after two repetitions, the high-priority device nevertheless attempts to establish contact with the low-priority partner by transmitting
STX (cycle corresponds to tq).
tz = character timeout time (200 ms)
If the 3964 R driver receives data, it monitors arrival of the individual characters within period tz. If no character is received within
the timeout time, the protocol terminates transfer. No acknowledgement is sent to the coupling partner.
Triggerbyte
(optional)
FB-Lengthbyte
(optional)
STX DLE ETX BCC
DataFieldbus
Data
RS
STX DLE ETX BCCData
Sensoren für Ihren Erfolg www.wenglor.com Sensoren für Ihren Erfolg www.wenglor.com

16
10.3.3.4 Retries
In the event of negative acknowledgement or timeout, a telegram transmitted by the high-priority user is repeated twice. After this,
the gateway signals communication as disturbed but still attempts to re-establish the connection.
10.3.3.5 Initiation of data communication by the high-priority user
In the case of a negative acknowledgement or timeout, a telegram transmitted by the external device is repeated twice before a
fault is signalled.
10.3.4 Protocol type 3964
The difference to protocol type 3964R is:
1. tq = acknowledge monitoring time
2. The checksum byte BCC is missing.
10.4 Protocol: MODBUS-RTU
10.4.1 Notes
For reasons of simplicity, "MODBUS-RTU“ is referred to as "MODBUS“ in the text below.
The terms "input“ and "output“ are always viewed from the gateway’s point of view, i. e. fieldbus input data is the data sent by
the fieldbus Master to the gateway.
10.4.2 Fieldbus Gateway as MODBUS-Master
10.4.2.1 Preparation
Before data exchange is commenced, the parameters "Baud rate", "Parity", "Start bits", "Stop bits" and "Data bits" and, if applicable,
the "Trigger byte" and the "Length byte" must be set.
In addition, a "Response time" which corresponds to the maximum time up to which the Modbus Slave responds after a request
must be set. Fieldbus Gateway multiplies the value entered in WINGATE by 10 ms.
The user can choose whether the fieldbus requests are forwarded to the Modbus in an event-driven way (On Event) or on request
(On Trigger).
The mode "Modbus request on demand" necessitates the first byte in the fieldbus containing a trigger byte (see chapter 10.5).
This byte is not transferred to the Modbus and serves only to start a Modbus transmission. For this purpose, the gateway cons-
tantly monitors this trigger byte and sends data to the Modbus only when this byte has changed. In the reverse direction (to the
fieldbus), the gateway transfers the number of received Modbus data records in this byte, i. e. this byte is incremented by the
gateway after each data record.
If the "Length byte“ is activated (see chapter 10.6), the gateway transfers only the number of bytes specified there. The number of
received Modbus data items is saved in the direction of the fieldbus Master. The length always refers to bytes "Address" to "Dat n"
(inclusive in each case), always without CRC checksum.
10.4.2.2 Data structure
10.4.2.3 Communication sequence
he gateway always acts as the Slave with respect to the fieldbus and always acts as the Master at the Modbus end. Thus, data
exchange must always be started by the fieldbus Master. The gateway fetches this data which must be structured in accordance
with chapter "Data structure“, from the fieldbus Master, determines the valid length of the Modbus data if the length byte is not
activated, adds the CRC checksum and sends this data record as a request on the Modbus.
The response of the selected Slave is then sent to the fieldbus Master by the gateway - without CRC checksum. If no response
occurs within the stipulated "Response time", the gateway signals a "TIMEOUT ERROR".
Address Data field CRC-high CRC-low
Fieldbus
Function
Address
LengthBus
Trigger
(optional)(optional)
Dat fieldFunction
RS

17
10.4.3 Fieldbus Gateway as MODBUS-Slave
10.4.3.1 Preparation
Before data exchange is commenced, the parameters "Trigger byte" and "Length byte", "Baud rate", "Parity", "Start bits", "Stop bits"
and "Data bits" must be set.
At the rotary switch on the RS-side the MODBUS-ID has to be set, under which the gateway is addressed in the Modbus.
10.4.3.2 Data structure
10.4.3.3 Communication sequence
The gateway always acts as the Slave with respect to the fieldbus and also acts as Slave at the Modbus end. A data exchange is
always initiated by the MODBUS-Master via the RS-interface. If the Modbus-address (1st Byte) which is sent out by the Modbus-
Master is identical with the address set on the gateway, the gateway sends the received data (without Modbus-address and CRC-
check sum) to the fieldbus-master (look picture above). With it the gateway optionally completes as an introduction a Trigger byte
and a Length byte.
The fieldbus-master detects when it has to analyse a record via the Trigger byte which is incremented by the gateway at every
inquiry. The number of the following Modbus-data is to be found in the length byte.
Now the fieldbus-master has to analyse the Modbus-inquiry and it has to send back the answer in the same format (optionally with
the leading Trigger byte and Length byte) via the fieldbus to the gateway.
The gateway then takes this answer and completes the Modbus-address and the CRC and sends the data to the Modbus-Master
via the RS-interface. With it the data exchange is completed and the gateway waits for a new inquiry from the Modbus-Master.
10.4.4 Fieldbus Gateway as Modbus-ASCII Master
On request!
For the description see chapter 10.4.2 "Fieldbus Gateway as MODBUS-Master"
10.5 The trigger byte
In case the data records, that were supplied from the application to the gateway, do not change for a longer period, there is actu-
ally no need to send new data to the master.
The other way round, when it comes to a cyclical query of the gateway, a connected master has to be in the position to distinguish
whether the application constantly provides identical data or if no new data were provided by the application for a longer period.
For this reason, the user can set control of transmission via a trigger byte (data exchange On Trigger). In this mode, the gateway
always sends (and only then) when the trigger byte is changed.
Accordingly, the application program in the control in Normal mode cannot detect whether the gateway has received several iden-
tical telegrams. If Trigger-Byte mode is activated, the gateway increments the trigger byte each time a telegram has been received.
The first byte in the input/output data buffer is used as the trigger byte if this mode is activated.
10.6 The length byte
The user can configure whether the transmit length is also to be stored as a byte in the input/output data area (Fieldbus lengthbyte
active). In transmit direction, as many bytes as specified in this byte are sent. On reception of a telegram the gateway enters
the number of characters received.
Address Data field CRC-high CRC-low
Fieldbus
Function
LengthBus
Trigger
(optional)(optional)
Data fieldFunction
RS
Sensoren für Ihren Erfolg www.wenglor.com Sensoren für Ihren Erfolg www.wenglor.com

18
11. Hardware ports, switches and LEDs
11.1 Device labeling
Picture 1: Terminal labeling and termination
Picture 2: Front panel: Rotary switches and LEDs
11.2 Connectors
11.2.1 Connector to the external device (RS-interface)
The serial interface is available at the plug accessible on the upper side of the device.
Pin assignment X1 (3-pole and 4-pole screw-type plug connector)
Pin No. Name Function
1 Rx 232 Receive signal
2 Tx 232 Transmit signal
3 AP-GND Application Ground
4 Rx 422+ (485+) Receive signal
5 Rx 422– (485–) Receive signal
6 Tx 422+ (485+) Transmit signal
7 Tx 422– (485–) Transmit signal
For the operation at a 485-interface the two pins labeled "485-" have to be connected together.
Also the two pins "485+".

19
11.2.2 Connector supply voltage and DEBUG-interface
Pin assignment X2 (4-pole screw-plug connector, on the bottom side, at the back)
Pin No. Name Function
4 UB (Pwr) 10…33 V supply voltage/DC
3 0 V (Pwr) 0 V supply voltage/DC
2 Rx-Debug Receive signal Debug
1 Tx-Debug Transmit signal Debug
Attention:
At isolated devices (option GT) Ground for the DEBUG-Interface must be connected with pin 3 (AP-GND)
of the RS-interface!
At devices that are not isolated also the 0 V (Pwr)-signal can be used as reference.
11.2.3 Ethernet 10/100 BASE/T-connector
The plug (labeled: RJ45 Ethernet) for the connection to the Ethernet is available on the bottom side of the device.
Pin assignment X3 (RJ45)
Pin No. Name Function
1 TD+ (RD+*) Transmission line + (receive line +*)
2 TD– (RD−*) Transmission line – (receive line –*)
3 RD+ (TD+*) Receive line + (transmission line +*)
4
5
6 RD– (TD−*) Receive line – (transmission line –*)
7
8
*) The device supports "autocrossover"
11.2.4 Power supply
The device must be powered with 10…33 V DC, The voltage supply is made through the 4-pole screw-plug connector at the
device’s bottom side.
Please note that the devices of the series Fieldbus Gateway should not be operated with AC voltage.
11.3 LEDs
The Gateway Fieldbus Gateway - Fast Ethernet features 10 LEDs with the following significance:
LED (Ethernet/IP) Power green Supply voltage Ethernet
LED Link/Act. 10 MB green Ethernet-link pulse found/network data traffic
LED Link/Act. 100 MB green Ethernet-link pulse found/network data traffic
LED (Ethernet) State red/green State of the interface
LED Power green Supply voltage serial interface Ethernet
LED State red/green User-defined/general Gateway error
LED 1/2/4/8 (Error No/Select ID) green User-defined/general Gateway error
11.3.1 LED "(Ethernet) Power"
This LED is connected directly to the Ethernet supply voltage.
11.3.2 LED "Link/Act. 10 MB"
This LED is directly controlled by the Ethernet controller and it shines if the Gateway is located in a working 10 MB-network (link
pulses are being received) and it flickers when network data traffic takes place.
Sensoren für Ihren Erfolg www.wenglor.com Sensoren für Ihren Erfolg www.wenglor.com

20
11.3.3 LED "Link/Act. 100 MB"
This LED is directly controlled by the Ethernet controller and it shines if the Gateway is located in a working 100 MB-network (link
pulses are being received) and it flickers when network data traffic takes place.
11.3.4 LED "(Ethernet) State"
Lights green Connection established and active
Flashes green Gateway is waiting for connection establishment
Flashes green/red Gateway is waiting for Ethernet initialization
Lights red General network error
11.3.5 LED "Power"
This LED is connected directly to the (optionally also electrically isolated) supply voltage of the serial interface (RS-232/422/485).
11.3.6 LED "State"
Lights green Controllable via Script
Flashes green Controllable via Script
Flashes green/red Controllable via Script
Lights red General Gateway error (see LEDs Error No.), controllable via Script
Flashes red Fieldbus Gateway is in the configuration/test mode, controllable via Script
11.3.7 LEDs (Error No./Select ID)
If these 4 LEDs flash and LED “State“ simultaneously lights red, the error number is displayed in binary notation (conversion table,
see Annex) in accordance with the table in chapter "Error handling". Additionally these LEDs are controllable via Script:
11.4 Switches
The Gateway features 4 (optionally 5) switches with the following functions:
Termination Rx 422 switchable Rx 422-terminating resistor for the serial interface
Termination Tx 422 switchable Tx 422- or RS-485-terminating resistor for the serial interface
Rotary coding switch S4 ID High for serial interface i. e. configmode
Rotary coding switch S5 ID Low for serial interface i. e. configmode
Rotary coding switch S6 (optional) control mode-selection switch Ethernet controller
11.4.1 Termination Rx 422 + Tx 422 (serial interface)
If the Gateway is operated as the physically first or last device in an RS-485-bus or as 422, there must be a bus termination at this
Gateway. In order to do this the termination switch is set to position ON. The resistor (150 Ω) integrated in the Gateway is activated.
In all other cases, the switch remains in position OFF.
Please refer to the general RS-485 literature for further information on the subject of bus terminations.
If the integrated resistor is used, please allow for the fact that this also activates a pull-down resistor (390 Ω) to ground and a pull-
up resistor (390 Ω) to VCC.
Bei RS-485 darf nur der Tx 422-Schalter auf ON gestellt werden.
Der Rx 422-Schalter muss auf OFF stehen.
11.4.2 Rotary coding switches S4 + S5 (serial interface)
These two switches can be read out through the Script command "Get (RS_Switch, Destination)" and the value can be used for
further functions. This value is read in when the Gateway is switched on or always after a Script command has been executed. The
switch positions "EE" (testmode) and "FF" (config mode) are not possible for RS-422- or RS-485-operation.
Table of contents
Popular Gateway manuals by other brands

Smart Parking
Smart Parking SmartSpot Lite 915-US user manual

NeoGate
NeoGate TE200 user guide

AudioCodes
AudioCodes Mediant 600 installation manual

Comtrol
Comtrol IO-Link Master Series Initial Installation and Configuration

SMC Networks
SMC Networks FieldServer FS-8700-130 Driver manual

ZyXEL Communications
ZyXEL Communications P-2304R-P1 Series user guide

Kerlink
Kerlink Wirnet iFemtoCell Getting started guide

Donaldson
Donaldson iCue Sensor Integrated Gateway Installation, operation and maintenance manual

Orchid Telecom
Orchid Telecom GSM200 user guide

SharkRF
SharkRF openSPOT3 user manual

SMC Networks
SMC Networks SMC8414-2PD-SIP Specification sheet

Synway
Synway SMG Series user manual