5five FMod-TCP BOX 2 User manual

FMod-TCP BOX User Manual v.2.1
Ethernet Converter Device
FMod-TCP BOX 2
User Manual
Version 2.4
See page 12 for
quick start


3 / 61
FMod-TCP BOX User Manual v.2.4
Version: 2.4
Last revision: March 18, 2019
Printed in Switzerland
© Copyright 2002-2019 FiveCo Sàrl. All rights reserved.
The contents of this manual may be modified by FiveCo without any warning.
Trademarks
Windows® is a registered trademark of Microsoft Corporation.
Ethernet® is a registered trademark of Xerox Corporation.
Java® is a registered trademark of Oracle Corporation.
Philips® is a registered trademark of Koninklijke Philips Electronics N.V.
I2C is a registered trademark of Philips Semiconductors Corporation.
Borland® is a registered trademark of Borland Software Corporation.
Safari® is a registered trademark of Apple Inc.
Warning
This device is not intended to be used in medical, life-support or space products.
Any failure of this device that may cause serious consequences should be prevented by implementation of
backup systems. The user agrees that protection against consequences resulting from device system failure
is the user's responsibility. Changes or modifications to this device not explicitly approved by FiveCo will
void the user's authority to operate this device.
Support
Web page: http://www.fiveco.ch/product-fmod-tcp-box-2.html
e-mail: support@fiveco.ch

Table of Contents
1Package and operating conditions..............................................................................................................6
Starter Kit contents............................................................................................................................................6
Electrical characteristics ...................................................................................................................................6
2Overview.................................................................................................................................................................7
Applications............................................................................................................................................................7
Software operating principle.........................................................................................................................7
Hardware description.......................................................................................................................................8
SOS button ......................................................................................................................................................... 10
3Quick start ........................................................................................................................................................... 12
Changing IP address........................................................................................................................................ 12
4Controlling the FMod-TCP BOX 2 by TCP or UDP................................................................... 14
General Information....................................................................................................................................... 14
RS232 (TCP # 8000) .................................................................................................................................... 14
Device parameters and I/O, A/D and I2C features (TCP # 8010 or UDP # 7010). 15
Easy IP address config (UDP # 7010) .................................................................................................. 21
Checksum calculation .................................................................................................................................... 21
5Java Applet........................................................................................................................................................... 24
Overview.............................................................................................................................................................. 24
Main Config ......................................................................................................................................................... 25
Test A/D and I/Os........................................................................................................................................... 26
Test RS232 .......................................................................................................................................................... 27
Test I2C................................................................................................................................................................. 28
6Win32 Application.......................................................................................................................................... 29
Overview.............................................................................................................................................................. 29
RS232 interface................................................................................................................................................. 31
“Load web files” interface ........................................................................................................................... 32
Main port interface.......................................................................................................................................... 33
7Registers management................................................................................................................................... 35
Memory Organization................................................................................................................................... 35
Full Register Description .............................................................................................................................. 36

Revision history
Revision
Date
Author
Note
Firmware
version
Applet
version
Win32 app
version
1.0
05.05.06
AG
- First version
Since 1.0
Since 1.0
Since 3.0
1.1
09.06.06
AG
- Update specifications
- Text corrections
Since 1.0
Since 1.0
Since 3.0
1.2
14.08.06
AG
- I2C speed correction.
- Warning register bits correction.
Since 1.0
Since 1.0
Since 3.0
1.3
10.01.08
AG
- Text corrections
Since 1.0
Since 1.0
Since 3.0
1.4
02.06.08
AG
- Specifications correction.
- Text corrections.
Since 1.0
Since 1.0
Since 3.0
1.5
30.06.08
AG
- Relays pin out correction.
Since 1.0
Since 1.0
Since 3.0
1.6
28.10.08
AG
- AD resolution correction
Since 1.0
Since 1.0
Since 3.0
1.7
15.07.10
AG
- Add I2C error answer message.
- Small text corrections
- Add comments about EEPROM
registers saving.
Since 1.8
Since 1.2
Since 3.6
1.8
27.08.10
AG
- Correction of Inputs and Outputs
registers address in their
description.
Since 1.8
Since 1.2
Since 3.6
2.0
10.06.11
AG
- Update for Fmod-TCP BOX 2
device specs.
Since 2.0
Since 2.0
Since 3.7
2.1
02.11.11
AG
- Registers addresses correction.
Since 2.0
Since 2.0
Since 3.7
2.2
23.03.17
AG
- Corrections and enhancements in
overview chapter.
Since 2.0
Since 2.0
Since 3.7
2.3
01.05.17
AG
- Swap IO1 & IO2
- Add Java Applet deprecation info.
Since 2.0
Since 2.0
Since 3.7
2.4
18.03.19
AG
- DIN con pinout clarification.
Since 2.0
Since 2.0
Since 3.7

1Package and operating conditions
Starter Kit contents
The FMod-TCP BOX 2 “Starter kit” should contain:
FMod-TCP BOX 2 device
RS232 DSub cable
DIN 41651 40 lines cable
CD-Rom with dedicated software and Java applet sample
This manual
Please note that the female connector for the power supply is always
provided with the device.
Electrical characteristics
Damage may occur if the device is operated using values beyond those
mentioned below.
Parameter
Conditions/Remarks
Min
Typ
Max
Unit
Supply voltage (Vdd)
12
24
33
V
Supply current
Internal
100
mA
All outputs and supply pins of
extension connector altogether.
3.7 A
Inputs voltage
-15
28
V
Outputs 1, 2 current
Relays.
1
A
Outputs 1, 2 voltage
Max voltage to GND.
50
V
Outputs 3-14 current
0.15
A
Outputs 15, 16 current
0.3
A
Outputs 3-16 voltage
Vdd-0.5
V
+5V current
Voltage drops if max is exceeded.
0.3
A
Power output current
Voltage drops if max is exceeded.
1
A
Power outputs voltage
Vdd-0.5
V
Operating temperature
0
70
°C
Storage temperature
-40
120
°C
All external pins are protected against destruction by ESD (2kV).
The power supply input is protected against over voltage by a 33V Zener
diode (max 3A for 10ms) and against inverted voltage by a serial Schottky
diode.
Damages to the device due to over or inverted voltage are not covered by
the warranty.

2Overview
Applications
The FMod-TCP BOX 2 is a TCP/IP server that allows system integrators to
connect different devices such as home appliances, industrial sensors and
industrial control systems directly to the Ethernet network, (10Mbits
10BaseT) and to remotely monitor and control those using standard
protocols.
It can either be accessed through a TCP socket connection, from a
computer, or through a simple Web Page in a standard browser which can
be directly loaded to the device (max 108kb). The module is delivered with
a default web page including a Java Applet that enables the controlling of the
device.
The connection between this device and the user's product can be done
through the following interfaces:
Qty
Type
Description
Port
1
RS232
Up to 115200 bps with or without
hardware flow control
TCP 8000
2
Relays
Cut up to 50V 1A
TCP 8010
UDP 7010
14
24V Outputs
High side drivers
16
24V Inputs
Digital 24V inputs or analog -15 V
to +28 V on 10 bits A/D
1
I2C bus
2 wires serial bus
Note:
Some examples of applications illustrating the use of the FMod-TCP family
with serial, I2C, I/O and A/D devices can be found on the FiveCo's website:
http://www.fiveco.ch/prod_products.php?getcatid=1
Software operating principle
The operating principle for PC softwares that must exchange data with an
FMod-TCP BOX 2 device depends on which interface is used.
In case of RS232 use, the operation is really simple. Any byte sent to port
TCP #8000 will be redirected to the serial bus and any byte received from
the serial bus will be redirected to the TCP connection.

In the other cases (I/O, A/D and I2C), the software has to use a dedicated
protocol layer on top of the TCP Layer (see chapter 4). This protocol is
"Question & Answer" oriented. The PC should send a Question, wait for the
Answer and so on.
To configure the device's parameters and to access I/O and A/D features,
the protocol uses an Internal Registers Access routine (see chapter 4 and 7).
The code samples available on the FiveCo's web site can help programmers
get started with development.
Hardware description
Beware:
Before connecting any cable to the device, shut down power supply!
RS232 connector
Inputs, Outputs, I2C bus,
Supply voltage, 5V and GND
SOS button
Power connector
12 – 32 VDC
Ethernet connector
Dimensions in mm

Front view
See page 10 to know how the SOS button works.
Two LEDs illuminate the SOS button and the displayed color as the
following meanings:
Green
Everything is normal.
Red
There is an error. See Warning register to know the
source of the error.
Red-Green
blinking
Another device with the same IP address was found on
the network. Disable the other device and reboot the
FMod-TCP BOX 2.
Left side
Here are the equivalent electrical specifications of I/O pins (illustrated by
black dots):
Power connector
12 – 33 VDC
(Female connector PTR AKZ950
is provided with the device)
Inputs, Outputs, I2C, Supply voltage, 5V and GND
1
Input 1
21
Output 16
2
Input 2
22
Output 15
3
Input 3
23
Output 14
4
Input 4
24
Output 13
5
Input 5
25
Output 12
6
Input 6
26
Output 11
7
Input 7
27
Output 10
8
Input 8
28
Output 9
9
Input 9
29
Output 8
10
Input 10
30
Output 7
11
Input 11
31
Output 6
12
Input 12
32
Output 5
13
Input 13
33
Output 4
14
Input 14
34
Output 3
15
Input 15
35
Output 2 A (relay 2)
16
Input 16
36
Output 1 A (relay 1)
17
+5V output (0.3A max) a
37
Output 2 B (relay 2)
18
GND
38
Output 1 B (relay 1)
19
I2C clock (SCL)
39
Supply GND
20
I2C data (SDA)
40
Supply voltage output (max 1A) a
aDo not supply the device through these pins. You can use this pin to power your application.
Pin 1
GND Vdd
Pin 2
Pin 39
Pin 40
RJ45 Ethernet connector
SOS button

Inputs are seen from the outside as 57kΩloads.
Relay outputs 1-2 are only switches and are not connected to any
internal power lines. You can so cut/connect any line of your
application by using both side of the relay (beware: respect the
maximum voltage gap between your line and the device GND !).
Outputs 3-16 either provide Vdd power when they are HIGH or
sink a current of 2mA when LOW.
The I2C pins are provided through a Philips PCA9514AD driver
chip. 10kΩpull-ups are connected to SCL and SDA.
WARNING: The capacitance of the I2C cable must be lower as
possible to avoid errors dues to cross talk. Use also shorter cable as
possible.
Right side
The RS232 connector is the same as the ones found on any computer.
SOS button
A button is dedicated to restore default IP address or factory settings.
There are tow possible scenarios:
If you press it while the device is running, the IP address will be
restored as soon as all TCP connections are closed. Warning: you
have to send the Save Settings command to the device in order to save it
into EEPROM.
If the button is pressed during startup, the default IP address and
factory settings of all parameters will be restored AND saved into
Standard RS232 DSub 9 connector
(male like on a computer)
1
NC
6
NC
2
Receive data
7
Request To Send
3
Transmit data
8
Clear To Send
4
NC
9
NC
5
GND
Inputs
Outputs 3-16
Outputs 1-2
Vdd (Power)
~57kΩ
A
B
2mA

EEPROM. In this case, you do not need to send the Save Parameters
command.

3Quick start
This section is intended to help users to quickly plug the module into their
system and establish a connection between the computer and the device.
You can find the device’s factory communication settings on the following
label.
The Ethernet MAC Address is fixed and cannot be changed. The IP Address
can be changed. The complete procedure is described below.
Note: If the device has already been configured and the IP address has been
changed to an unknown value, you can retrieve an SOS IP address (the one on
label) by pressing the “SOS button” during the normal operation of the device.
(See page 10).
Changing IP address
To easily change the factory IP address, use the Win32 software provided on
the CD-Rom.
1. Plug your new device on your PC network.
2. Start the Win32 application.
3. Click on "File->Easy change IP address".
4. The software will scan the network and display a list of all FiveCo's
devices found.
5. Select the MAC address corresponding to your new device.
6. If you have more than one network adapter on your PC, the
software will ask you to select the one which is connected to the
same network as the FMod-TCP BOX 2.
7. The software will suggest a new IP address with the last byte left
open. Choose a new IP (Not already used on your network!!) and
click the "Change IP address" button.
That’s it! The device has a new address and a new subnet mask (the same as
your PC). They are automatically saved into EEPROM.
FMOD-TCP BOX 2
INPUT(supply) : 12-32V DC, max 3A
MAC: 00-50-C2-30-xx-xx / IP : 169.254.5.5
This device is not intended to be used in a medical, life-support or space product. Any failure
of this device that may cause serious consequences should be prevented by implementation
of backup systems. The user agrees that protection against consequences resulting from

You can now connect the device with the Win32 software or open its web
page by typing its new IP address into a web browser.
Notes:
The IP address won't be changed if a TCP connection exists with the
device.
The protocol used to change the IP address is described later in this
manual.

4Controlling the FMod-TCP BOX 2 by TCP or UDP
General Information
All the device's parameters (configuration registers) and features can be
accessed through a TCP or UDP port.
In addition, an HTTP-TCP port is available for web pages downloading and
another TCP port for RS232 bus access.
Those ports are:
TCP Port #80 for HTTP communication.
TCP Port #8000 for RS232 transceiver.
TCP Port #8010 to access I/O registers (see chapter 7) and I2C bus.
UDP Port #7010 to access I/O registers (see chapter 7) and I2C bus.
With regards to TCP connections, the device allows up to 4 simultaneous
connections.
These ports are described below.
RS232 (TCP # 8000)
The RS232 bus of the microcontroller is accessible through the TCP port
number 8000. The module acts simply as a transceiver for this port. Any
byte sent from the network (ex: TCP-IP from a PC) to the module will be
sent to the other side’s RS232 bus, and vice versa. Thus there is no particular
protocol dedicated to this feature. See later chapters to know how to
change parameters such as baud rate and hardware flow control.
Note: This port supports only one user at a time.
RS232 fixed settings: No parity / 1 Start Bit / 8 Data Bits / 1 Stop Bit
Important note about baud rate greater than 9600bds:
Common TCP/IP stacks (on PC, Unix station …) use a delay of 200ms for
the acknowledgement of the TCP received data packets. This is done to
reduce traffic on the network because TCP allows the acknowledgement of
several packets at one time.
Unfortunately, the FMod-TCP BOX 2 device needs this acknowledgement
to remove the data from its internal RS232 receive buffer (if no
acknowledge is received from the PC, the module will resend those data
after a timeout).

So, with speeds greater than 9600bds, the buffer may be filled faster than
data can be sent by TCP and part of those will be lost if no RS232 hardware
flow control is used between the FMod-TCP BOX 2 and the RS232 device
(CTS and RTS lines).
If you cannot use hardware flow control on RS232 bus and you have to get
more than 2048 bytes at one time, the solution is to reduce the TCP
acknowledgement delay on your computer.
For WindowsTM 2000/XP users, you can add/change the following value in
the registry. BEWARE: improperly changes done in the Windows registry can
results in a system crash! Such changes are the user’s full responsibility!
Entry:
HKey_Local_Machine\SYSTEM\CurrentControlSet\Services\
Tcpip\Parameters\Interfaces\Interface-name
Key:
TcpDelAckTicks
Value:
DWORD with value 0x00
The interface-name is the registry name (32 digits number) of your Ethernet
card which you use to access the module.
The following web page describes this feature in details:
http://www.microsoft.com/resources/documentation/Windows/2000/server/reskit/en-
us/regentry/58801.asp?frame=true
Device parameters and I/O, A/D and I2C features (TCP # 8010 or UDP # 7010)
The main TCP port number 8010 or UDP port number 7010 can be used
to change some important parameters of the module:
TCP timeout value
IP address
Subnet mask
Module name
Baud rate and flow control
I2C speed
The user should use the Win32 application enclosed in the package or the
default java applet loaded in the module to change those parameters. If the
user wants to change the parameters by himself, the protocol is defined
below.
This port is also used to access Inputs and Outputs value, A/D conversion
result registers (see page 35 for a complete description of those registers)
and I2C bus. The I2C feature is described after “registers access feature”.

The last feature accessible through this port is the "Easy IP config" that is used
in the "Quick start" chapter of this document.
Registers access feature
TCP/IP works in big endian: most significant byte first, followed by least
significant byte.
The access to the data is done through an easy (6 byte header) protocol
over TCP.
Structure of each packet:
1. Function ID (2 bytes),
2. Transaction ID (2 bytes)
3. Length of the parameters (2 bytes)
4. Parameters (X byte)
5. Checksum (2 bytes) (described later in this chapter)
The user (sender) defines the values of the Transaction IDs himself. The
module that receives a command sends back an answer (for every
command). The answer contains the same Transaction ID as the
corresponding command sent. The user is also able to check execution of
each command.
Warning: The maximum length of parameters is 172 on this board! Pay
attention to not exceed this value in question AND answer frame. This
implies that the maximum registers that can be read at one time are almost
30 (depending on registers size). If the number of registers is too big, the
FMod-TCP DB will answer only with the value of some of them. It is also
mandatory that the command has to be transmitted within one TCP
packet. Otherwise, the FMod-TCP DB will ignore it.
Read register(s) command:
Byte#
Number of bits
Example
0x00
Read (0x0021)
16 bits
0x0021
0x02
TransactionID
16 bits
0x1B34
0x04
Number of registers to
read (X)
16 bits
0x0001
0x06
X * Registers Addresses
X * 8 bits
0x02
0x06+X
Checksum
16 bits
0x…

Read register(s) answer:
The device answers with the following sequence:
Byte#
Number of bits
Example
0x00
Read Answer (0x0023)
16 bits
0x0023
0x02
TransactionID (same as
demand)
16 bits
0x1B34
0x04
Number of bytes in answer
16 bits
0x0019
0x06
Register address
8 bits
0x02
…
Register value
8–128 bits (16B)
0x12345
The two previous entries are replicated for every register that has been asked for reading
…
Checksum
16 bits
0x…
Write register(s) command:
Byte#
Number of bits
Example
0x00
Write (0x0022)
16 bits
0x0022
0x02
TransactionID
16 bits
0x1B34
0x04
Number of bytes in
command
16 bits
0x0003
0x06
Register Addresses
8 bits
0x02
0x07
Register value
8 – 64 bits
0x1234
The two previous entries are replicated for every register that has been asked for reading
…
Checksum
16 bits
0x…
Write register(s) answer:
The device answers with the following sequence:
Byte#
Number of bits
Example
0x00
Write Answer (0x0024)
16 bits
0x0024
0x02
TransactionID (same as
demand)
16 bits
0x1B34
0x04
0x0000
16 bits
0x0000
0x06
Checksum
16 bits
0x…
I2C feature
The Inter-IC bus, commonly known as the I²C bus, is a control bus that
provides the communications link between integrated circuits in a system.
Developed by Philips in the early 1980’s, this simple two-wire bus has
become the de facto worldwide standard for system control, finding its way
into everything from temperature sensors and voltage level translators to
EEPROMs, general-purpose I/O, A/D and D/A converters, CODECs, and
microprocessors of all kinds.
You can find the I2C’s specifications on the Philips web site at the following
link: http://www.semiconductors.philips.com/

The I2C protocol can access a device by three different manners:
Write (Start, AddW, Byte1, Byte2, …, Stop)
Read (Start, AddR, Byte1, Byte2, …, Stop)
Read After Write (Start, AddW, ByteW1, ByteW2, …, ReStart,
AddR, ByteR1, ByteR2, …Stop)
I2C Read/Write with ack command:
To be able to do all of these 3 sequences, use this command:
Byte#
Number of bits
Example
0x00
I2CRWwithAck (0x0007)
16 bits
0x0007
0x02
TransactionID
16 bits
0x1B34
0x04
LengthOfParameters (X + 3)
16 bits
0x0005
0x06
7 bits Address (bit 7 = 0)
8 bits
0x28
0x07
X (number of bytes to write)
8 bits
0x02
0x08
xBytes
X bytes
0xAF1D
….
Y (number of bytes to read)
8 bits
0x05
The four previous entries can be replicated to access the same or other I2C slaves within this
command sequence.
Checksum
16 bits
0x…
The FMod-TCP DB translates automatically those commands to I2C
sequences:
If X = 0, the Read method is used.
If Y = 0, the Write method is used.
If X & Y ≠0, the Read after Write method is used.
Warning: Please check that
240
32 ≤
+YX
. In other case, the command will
be ignored by the board.
Note: the max length of parameters is 172 bytes on this board.Pay close
attention to building sequences that do not exceed this and not to ask too
much byte in answer! It is also mandatory that the command has to be
transmitted within one TCP packet. Otherwise, the FMod-TCP DB will
ignore it.
St
AddW
Bytes to W
A
nA
Sp
AddR
Bytes to R
A
A
R
St
AddR
Bytes to R
A
nA
Sp
St
AddW
Bytes to W
A
A
Sp

I2C Read/Write with ack answer:
The answer sequence is the following one:
Byte#
Number of bits
Example
0x00
I2CReadAnswer (0x0008)
16 bits
0x0008
0x02
TransactionID (same as
demand)
16 bits
0x1254
0x04
Number of bytes in answer
16 bits
0x0005
0x06
Answer bytes
Y bytes
0x1A25…
…
Ack state of the I2C com.
1 byte
0x87
If the same or other I2C slave have been accessed in the command, the answer bytes and ack
state is added here.
…
Checksum
16 bits
0x…
The "Ack state" byte is composed of the following bits:
0
Address ack in write sequence
0 = No answer to this address
1 = ack received
1
Bytes written ack (each byte was acked)
0 = Bytes not acknowledged
1 = ack received
2
Address ack in read sequence
0 = No answer to this address
1 = ack received
3-6
Reserved
-
7
Must be always 1
1
The user can use these bits to check for the presence of his I2C devices and
monitor hardware issues.
I2C Read/Write with ack error answer:
If an error occurred, the answer sequence is the following one:
Byte#
Number of bits
Example
0x00
I2CRWwithAckError
(0x0009)
16 bits
0x0009
0x02
TransactionID (same as
demand)
16 bits
0x1254
0x04
Number of bytes in answer
16 bits
0x0001
0x06
Error code
1 byte
0x01
0x07
Checksum
16 bits
0x…
The error code can be:
0x01
The I2C bus is not ready.
0x02
A timeout occurred when waiting answer from the I2C slave.
0x03
2X + 3Y > 240 in I2CRWwithAck received.

I2C Bus scanning
The following command allows user to ask an I2C bus scanning to list which
addresses answer with an acknowledge.
I2C scan command:
Byte#
Number of bits
Example
0x00
I2CScan (0x0005)
16 bits
0x0005
0x02
TransactionID
16 bits
0x2001
0x04
Number of addresses to scan
16 bits
0x0001
0x08
X Addresses
X bytes
0x1A
Checksum
16 bits
0x…
Note: If there is no address in the I2C Scan command, the FMod-TCP BOX
2 will scan all addresses between 1 and 127!
I2C scan answer:
The FMod-TCP BOX 2 answers with the following sequence:
Byte#
Number of bits
Example
0x00
I2CScanAnswer (0x0006)
16 bits
0x0006
0x02
TransactionID (same as
demand)
16 bits
0x2001
0x04
Number of valid addresses
16 bits
0x0001
0x06
Valid addresses list
n bytes
0x1A
Checksum
16 bits
0x…
I2C speed change (advanced features)
The I2C bus speed can be changed at any time by changing the content of
the I2CSPD parameter.
Beware:
1. Do not change I2C speed if it is not mandatory. Speed greater than
100kHz are not supported by all I2C slaves.
2. Do not change I2C speed during I2C communication.
3. The I2C controller does not match all I2C specifications at speed
higher than 100kHz. This feature will therefore not work with all I2C
slaves.
4. The FMod-TCP BOX 2 does not support speed greater than
400kHz.
The value of the I2CSPD parameter must be computed with the following
formula:
Table of contents
Popular Media Converter manuals by other brands

RC Electronics
RC Electronics Finch Jeti manual

Crosley
Crosley Crosley Queen Anne Console Stack-O-Matic... instruction manual

Panasonic
Panasonic WJ-GXE100 operating instructions

Runco
Runco ViViX PIXEL FOR PIXEL PFP-7 Owner's operating manual

Comnet
Comnet CNGEMC4+2/M Installation and operation manual

Perle
Perle C-1000MM-XXXXXX installation guide