SOS button ................................. 10 3 Quick start ................................12 Changing IP address ............................12 4 Controlling 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) ....................
Page 5
27.08.10 - Correction of Inputs and Outputs Since 1.8 Since 1.2 Since 3.6 registers address in their description. 10.06.11 - Update for Fmod-TCP BOX 2 Since 2.0 Since 2.0 Since 3.7 device specs. 02.11.11 - Registers addresses correction. Since 2.0 Since 2.0...
Package 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.
Overview 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.
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.
Page 9
There is an error. See Warning register to know the source of the error. Red-Green Another device with the same IP address was found on blinking the network. Disable the other device and reboot the FMod-TCP BOX 2. Left side Pin 39 Pin 1 GND Vdd Pin 40...
Inputs Outputs 3-16 Outputs 1-2 Vdd (Power) ~57kΩ 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 !).
Page 11
EEPROM. In this case, you do not need to send the Save Parameters command.
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.
Page 13
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.
Controlling 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.
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).
Page 16
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.
Page 17
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 16 bits 0x1B34 demand) 0x04 Number of bytes in answer 16 bits 0x0019 0x06 Register address 8 bits 0x02...
Page 18
The I2C protocol can access a device by three different manners: Write (Start, AddW, Byte1, Byte2, …, Stop) AddW Bytes to W A Sp Read (Start, AddR, Byte1, Byte2, …, Stop) AddR Bytes to R nA Sp Read After Write (Start, AddW, ByteW1, ByteW2, …, ReStart, AddR, ByteR1, ByteR2, …Stop) AddW Bytes to W...
Page 19
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 16 bits 0x1254 demand) 0x04 Number of bytes in answer 16 bits 0x0005 0x06 Answer bytes Y bytes...
Page 20
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...
IP address and subnet mask. Procedure: Send a UDP broadcast message (using a local or direct broadcast IP address) to your network (inside which the FMod-TCP BOX 2 is connected) with the following command: Byte# Number of bits...
Page 22
Sequence: 1. Clear accumulator Loop x. Only if last word is not made of two bytes, the data byte is the upper byte (big endian) 2. Compute 1’s complement of each 16bits word, result is 16bits 3. Convert last result from 16 bits to 32 bits, result is 32bits: 0x0000+last result 4.
Page 23
if (AddHighByte==false) Sum+= 0xFF; ChecksumCalculated = ((Sum>>16)&0xFFFF)+(Sum&0xFFFF); ChecksumCalculated = ((ChecksumCalculated>>16)&0xFFFF) +(ChecksumCalculated&0xFFFF); return ChecksumCalculated; This function needs a Byte array (ByteTab) containing the command sequence and this array’s length (Size) as input, it returns the checksum as an int.
Java A pplet A specific Java Applet is provided with the module to control any of its ports without having to write any specific code. Beware: Since year 2015, internet browsers providers are removing Java Applet support from their software. Nowadays (Q2 2017), Only MS Internet Explorer and Apple Safari still support java applets! Use of Java applet in your application is so no more recommended.
Main Config The Main panel shows the general information related to the device. • The first part allows the user to change the main settings of the device. Don't forget to use the "Save user parameters" button to make changes permanent! •...
Test A/D and I/Os This page can be used to access Inputs state and voltage and change Outputs state. The Inputs state and voltage are regularly updated automatically (20 kHz). You can change the low to high threshold of the inputs between 0 and 24V. This page displays also the device supply voltage and warnings (Too low/high supply voltage, Outputs driver over current or temperature).
Test RS232 This page can be used to access RS232 bus. If you click on the "Connect to RS232 TCP Port" you can send ASCII data to RS232 bus and receive data from it (only ASCII is visible in this application). You can check "Add LF", "Add CR"...
You should first check if you want a read or a write. Then you have to write hex data to write to the device in the "Hex data to write" field (if you checked the "Read" box, the FMod-TCP BOX 2 will use the read after write I2C feature).
Win32 A pplication A specific application is provided with the module to control any of its ports without having to write a specific code. Overview IP address of the module Open or close TCP port TCP port number Depends on port Connection status To open a TCP port on the module, the user has to set the correct IP...
Page 30
This application uses the IP address of your computer and its subnet mask to find the scan broadcast address. When you click on scan, a broadcast message will be sent to all devices in your subnet and answers will be listed. : it only works with devices in your subnet! WARNING How does it work?
RS232 interface chain to Send send ASCII, Hex, or Decimal chain Bytes received from RS232 The RS232 interface is easy to use. Just write the ASCII, HEX or decimal string in the dedicated text box and click corresponding "Send" button. The received bytes are displayed into the "Data received"...
“Load web files” interface File(s) list List of files to operations load Number of bytes in list Create file for factory upload Load files into module This option allows users to load their personal web files (html, java, jpeg, gif, txt …) into the flash memory.
Main port interface Change RS232 baud rate Outputs and flow state control Change Inputs state disconnection and voltage timeout Change IP address of the module Change subnet mask Scan I2C of the module Number of Module MAC bytes to address read from Change module...
Page 34
The I2C interface is an easy way to test the I2C connection between the module and the user's electronic. The bytes to write (in hexadecimal like 41 42 45 separated by spaces!) must be written in the dedicated line and the I2C address in the dedicated Address space (in hexadecimal or in decimal).
Registers management Memory Organization The user must know that a new register value sent through the communication port is loaded to the running parameters in RAM and used for the current process. All these parameters are lost upon power-down. It is required to save them to “User Parameters”...
Full Register Description List of registers Address Bytes Access type Name General Information 0x00 (00) TYPE VERSION 0x01 (01) 0x02 (02) 0 (fct) RESET 0x03 (03) 0 (fct) SAVE USER PARAMETERS 0x04 (04) 0 (fct) RESTORE USER PARAMETERS 0x05 (05) 0 (fct) RESTORE FACTORY PARAMETERS SAVE FACTORY PARAMETERS...
Page 37
Product identifier composed with a Type and Model number. It defines which kind of peripheral it is. Normally different modules TYPE are not software compatible. Example: TYPE = 0x00080000 means Type=8, Model = 0 (FMod-TCP BOX) TYPE = 0x00080000 means Type=8, Model = 2 (FMod-TCP BOX 2)
Page 38
VERSION Register Address Register Name Function Read/Write Control Hardware & 0x01 VERSION Read only Firmware rev Register Size Register structure 4 Bytes Hardware Version (8bits.8bits) Firmware Version (8bits.8bits) Description: Hardware and firmware version are composed with a Version and Revision number.
Page 39
RESET Function Address Function Name Function Read/Write Control 0x02 Restart device Write only RESET Register Size Register structure Unit 0 Byte none none Description: Reboot the device. The communication will be lost.
Page 40
SAVE USER PARAMETERS Read/Write Function Address Function Name Function Control SAVEUSERPARAMETERS 0x03 Saves all in EEPROM Write only Register Size Register structure Unit 0 Byte none none Description: Saves the following parameters to user EEPROM space: 0x12 IPADDRESS SUBNETMASK ...
Page 41
RESTORE USER PARAMETERS Function Address Function Name Function Read/Write Control Restores saved 0x04 RESTOREUSERPARAMETERS Write only values Register Size Register structure Unit 0 Byte none none Description: Restores the following parameters from user EEPROM space: 0x12 IPADDRESS 0x13 SUBNETMASK ...
Page 42
RESTORE FACTORY PARAMETERS Function Function Name Function Read/Write Control Address RESTOREFACTORYPARAMETERS 0x05 Factory default Write only Register Size Register structure Unit 0 Byte none none Description: Restores the following parameters from factory EEPROM space: 0x12 IPADDRESS SUBNETMASK 0x13 ...
Page 43
SAVE FACTORY PARAMETERS Function Address Function Name Function Read/Write Control Save factory 0x06 SAVEFACTORYPARAMETERS Write only default Register Size Register structure Unit 0 Byte none none Description: Saves the following parameters to factory EEPROM space: 0x12 IPADDRESS 0x13 SUBNETMASK ...
Page 44
VOLTAGE Register Address Register Name Function Read/Write Control 0x07 Power input voltage Read only VOLTAGE Register Size Register structure Unit 4 Bytes Signed (2’s cplt) Int 16 (HH-HL) +16 bits fixed point (LH-LL) Volt Description: Input Voltage Limits: 0x7FFFFFFxx = 32’767.996 0x000000xx = 0.0 Step 0x000001xx = 0.004...
Page 45
WARNING Register Address Register Name Function Read/Write Control 0x08 Bit to bit state WARNING Register Size Register structure Unit 4 Byte Unsigned Int 32 bits, each bit independent none Description: Each information/warning/error is contained in 2 bits: the first one (from LSB to MSB) shows the actual state, the next one shows if this state appeared previously.
Page 46
NB POWER UP Register Address Register Name Function Read/Write Control 0x0B Number of boot NBPOWERUP Register Size Register structure Unit 4 Byte Unsigned Int 32 bits none Description: This register counts device power ups. Each time that device initialization is done, this register is incremented by one.
Page 47
TIME IN SERVICE Register Address Register Name Function Read/Write Control 0x0C Usage time TIMEINSERVICE Register Size Register structure Unit 4 Byte Unsigned Int 32 bits none Description: This register counts the service time of the device in seconds. Since it is saved every 2 hours to EEPROM, a bias compensation of 1 hour is added at each power-up.
Page 48
COM OPTIONS Register Address Register Name Function Read/Write Control Communication 0x10 COMOPTIONS Read/Write options Register Size Register structure Unit 4 Bytes 32 individual bits none Description: This register is reserved for future use.
Page 49
ETHERNET MAC Register Address Register Name Function Read/Write Control Hardware network 0x11 ETHERNETMAC Read only Register Size Register structure Unit 6 Bytes 6 x Unsigned Bytes none Description: A standard hardware unique identifier (worldwide) for each device on an Ethernet network. Note: If the user writes into this register, the MAC address will not be modified.
Page 50
IP ADDRESS Register Address Register Name Function Read/Write Control 0x12 IP network ID Read/Write IPADDRESS Register Size Register structure Unit 4 Bytes 4 x Unsigned Bytes none Description: Network identifier used for TCP/IP and UDP/IP. The values 255 (0xFF) and 0 (0x00) are reserved for broadcast and network addresses and should not be used in this register.
Page 51
SUBNET MASK Register Address Register Name Function Read/Write Control 0x13 IP subnet mask Read/Write SUBNETMASK Register Size Register structure Unit 4 Bytes 4 x Unsigned Bytes none Description: Network IP subnet mask used for TCP/IP and UDP/IP. Notes: The module will change for a new subnet mask only when all of its communications ports are closed.
Page 52
TCP TIMEOUT Register Address Register Name Function Read/Write Control Timeout for TCP 0x14 TCPTIMEOUT Read/Write connection Register Size Register structure Unit 1 Byte Unsigned Int 8 bits Description: The TCP timeout is a value (in seconds) after which the user will be disconnected if the device has not been accessed in the meantime.
Page 53
MODULE NAME Register Address Register Name Function Read/Write Control Module’s ASCII 0x15 MODULENAME Read/Write name Register Size Register structure Unit 16 Bytes 16 (only) x Unsigned Bytes (CHAR) none Description: Name and/or description of the module. Example: For the name “Hello Module”; extend to 16 byte the name: “Hello Module”+5x space=16 Byte.
Page 54
RS232 CONFIG Register Address Register Name Function Read/Write Control RS232 baud rate and 0x16 RS232CONFIG flow control Read/Write configuration Register Size Register structure Unit 1 Byte Unsigned Int 8 bits none Description: RS232 baud rate and flow control configuration. Bits 0-2 Baud rate configuration : 4800 bds 9600 bps (default)
Page 55
I2C SPeeD Register Address Register Name Function Read/Write Control 0x18 I2C speed setting Read/Write I2CSPD Register Size Register structure Unit 1 Byte Unsigned Int 8 bits none Description: I2C speed setting between ~39kHz and 400kHz. The value of this parameter must be computed with the following formula based on the wanted speed: CSPD −...
Page 56
TCP CONNECTIONS OPENED Register Address Register Name Function Read/Write Control Number of TCP 0x1A TCPCONNECTIONSOPENED connections that Read only are opened Register Size Register structure Unit 1 Byte Unsigned Int 8 bits none Description: Number of users connected to the device using TCP. Value can be 0 to 4.
Page 57
ANALOG INPUTS THRESHOLD Read/Write Register Address Register Name Function Control AD converter 0x20 ANALOGINPUTSTHRESHOLD threshold on Read/Write inputs Register Size Register structure Unit 4 Bytes Signed (2’s cplt) Int 16 (HH-HL) +16 bits fixed point (LH-LL) Volt Description: Defines the threshold used by the AD converter on inputs pins to define input state as low or high (0 or 1).
Page 58
OUTPUTS Register Address Register Name Function Read/Write Control 0x21 Sets outputs states Read/Write OUTPUTS Register Size Register structure Unit 2 Bytes Unsigned Int 16 bits, each bit independent none Description: Controls the state of each of the output pins. Bit 0 OUTPUT#1 (Relay A) Bit 1 OUTPUT#2 (Relay B)
Page 59
INPUTS Register Address Register Name Function Read/Write Control 0x23 16 inputs states Read only INPUTS Register Size Register structure Unit 2 Bytes Unsigned Int 16 bits, each bit independent none Description: Show digital state of each inputs pin. The state is defined by comparing actual input voltage with the ANALOG INPUTS THRESHOLD.
Page 60
INPUT VOLTAGE x VALUE Registers Register Name Function Read/Write Control Addresses Last INPUTVx A/D 0x30 to 0x3F INPUTVOLTAGExVALUE Read only conversion result Register Size Register structure Unit 4 Bytes Signed (2’s cplt) Int 16 (HH-HL) +16 bits fixed point (LH-LL) Volt Description: Voltage value of the 16 inputs pins between -12V and 12V.
Need help?
Do you have a question about the FMod-TCP BOX 2 and is the answer not in the manual?
Questions and answers