Modbus Relay Modules

RXE002 - 4 Channel RTU/TCP Modbus Relay Modules With Analog and Digital Inputs

0 views December 20, 2022 aryakrishna 0

Introduction

Numato Lab’s RXE002 – 4 Channel DIN Rail compatible Modbus RTU/TCP Relay Module with Digital Outputs, Digital Inputs and Analog Inputs which offers great flexibility at a lower cost. Ease of use and wider operating system compatibility are the primary goals behind this product’s design. Built-in USB to serial conversion allows the module to be used without any USB specific knowledge. Industry-standard Modbus protocol support allows this product to be used with most automation software that supports Modbus. For power users, this module can be controlled by writing programs in various programming languages of their choice.

Features:

  • Industry-standard Modbus protocol support
  • DIN Rail compatible
  • 4 Mechanical Relay with contact rating up to 250V/10A each
  • 8 Digital Inputs supports Maximum Input Voltage of 30V
  • 8 Digital Outputs supports Internal voltage of 24V and External Voltage Upto 30V
  • 4 analog inputs with 16-bit resolution and supports 4 to 20mA current-loop
  • USB interface with CDC support. As easy as using a serial port, no USB knowledge required
  • Fully isolated design with optocouplers and built-in DC-DC converter
  • Relay contacts available on easy to access screw terminals
  • 24V external power supply (included)
  • Can be controlled by using industry-standard automation applications or custom applications

Some of the possible uses of this module include

  • Home Automation
  • Lighting Control
  • Garden Equipment Control
  • Industrial Automation
  • Test Fixtures
  • DIY and Hobby

This product is compatible with the following operating systems:

  • Windows XP and later versions (Windows 7, 8/8.1, 10 and future versions)
  • Windows 7 Embedded and later
  • Linux
  • Mac OS X
  • Android
  • Or any other operating system that supports USB CDC devices.

And these are some of the languages and softwares that can be used for programming:

  • C/C++
  • Visual Basic (VB6, VB2008, VB2010 express and other editions)
  • Visual Basic for Applications (Microsoft Office VBA)
  • Perl
  • Python
  • JAVA
  • Android
  • JavaScript (Node.js)
  • LabVIEW
  • And many more…

This product has 4 onboard relays and associated drivers capable of controlling a variety of devices including lamps, motors, locks, etc… (Please see recommendations for using this product with inductive loads elsewhere in this document). This module also includes digital inputs, digital outputs and analog inputs that can be accessed over the USB interface for extended functionality. All the Analog Inputs have polarity and support 4 to 20mA Current-Loop, which makes this device more useful in industries. The module communicates with host PC over a full-speed USB link, RS485, and Ethernet interface. When connected to PC using USB/RS485, the module will appear as a serial port in Windows Device Manager (or a serial tty device in Linux and Mac). RXE002 supports several features such as Relay Timer, Safety Timer (Watchdog), Programmable Power-On State, etc.

How to Use RXE002 Module

Using this product is very easy,  thanks to supporting industry-standard Modbus protocol, the RTU and the TCP/IP network interface that allows the device to be used with most readily available Data Communication Test Software like QModMaster.  This document has more information about using this device with the following software. But in no way limited to this software though.

  • Windows
    • QModMaster
    • Radzio! Modbus Master Simulator
  • Linux
    • Coming soon
  • Mac OS X

    • Coming soon

Using this product with RTU involves the following simple steps.

  1. Connect the device using a USB A to B cable or a USB to RS485 converter to the host system
  2. Install driver if applicable
  3. Open the COM port corresponding to the device using software that supports Modbus
  4. Read/Write Coils and Registers
  5. Optionally write a script or custom application to automate your task

Using this product with TCP/IP Network interface involves the following steps.

  1. Connect the device using a CAT 5e Ethernet Cable(Straight through cable) to the host system
  2. Connect to the IP corresponding to the device using software that supports Modbus TCP
  3. Read/Write Coils and Registers
  4. Optionally write a script or custom application to automate your task

All aspects of the above steps are covered in the following sections including step by step demonstration.

Components/Tools Required

Along with your RXE002 device, you will need the items in the list below for easy and fast installation.
1. USB A to B cable (Included)For USB Interface.
2. CAT 5e Ethernet Cable(Straight through cable)For Ethernet Interface.
3. USB to RS-485 ConverterFor RS485 Interface.
4. 24V Power Supply (Included).
5. Medium size Philips screwdriver.

Connection Details

IMPORTANT! Please exercise the utmost caution while working with electrical mains or other high voltages. Failure to comply with safety regulations may result in injury and or death.

Use a USB A to B cable to connect the unit to a PC. It is important to make sure that the wires used to connect loads are sufficiently rated to handle the expected load current. Exercise caution while working with high voltages. Short circuits can cause damage to the module and the PC. The following sections identify individual connections in detail.

USB Interface

The onboard full-speed USB controller helps a PC to communicate and control this module seamlessly. Use a USB A to B cable to connect the unit to a PC. The device can be connected directly to the host PC or connected through a compatible USB hub. For high-performance system integration, it is recommended to connect the device directly to one of the root ports.

RS485 Interface

A USB to RS485 converter helps a PC to communicate and control this module seamlessly. Use a USB to RS485 converter to connect the unit to a PC. The device can be connected directly to the host PC or connected through a compatible USB hub. For high-performance system integration, it is recommended to connect the device directly to one of the root ports.

Ethernet Interface

32 Channel Ethernet GPIO Module Ethernet PortThe onboard Ethernet port supports Ethernet 10Mbps transmission speed that helps a computer to communicate and control this module easily. There are two basic network configurations for this board/can be used in two ways.

 

  1. Direct connection to Local Area Network(LAN) via common straight-through Ethernet cable.
    Eg: Connecting the module to a switch in a network.
  2. Direct connection to a PC through a cross over Ethernet cable. Eg: Connecting the module directly to the PC. Some PC/Laptops can detect and adapt to the cable type. In such situations, a straight-through cable also can be used.

Relay Contacts

RXE002 has 4 mechanical relays that can switch up to 10A of current. IN and OUT connections to the relays are available externally on screw terminals for easy user access. The relays are rated for AC and DC supply voltages. Please see the electrical parameter table for more details. Each relay has two contacts(IN, OUT. The contacts IN and OUT will be connected when the relay is turned ON and will be disconnected when the relay is turned OFF.  The table below summarizes possible relay contact positions.

Relay State Connection between IN and OUT
OFFOpen
ON Close

Digital I/Os and Analog Inputs

In addition to the onboard relays, this RXE002 device has 8 Digital Output pins, 8 Digital Input pins and 4 Analog Input pinsAll Digital Input pins support 30V signals and the ADC input range is -10.24V to +10.24V and also supports 4 to 20mA in current loop mode. All Digital Outputs support Internal +24v Supply and External Upto +30v Supply. The ADC can acquire the analog signal at the resolution of 16 bits per sample. It is recommended to use a series resistor to protect the input from stray voltages and spikes.

All the Analog Inputs have a polarity that makes this device more useful in industries.

The table below summarizes the Digital Inputs, Digital Outputs and Analog to Digital Converter input positions of RXE002 on the screw terminals.

Digital Inputs
D_GNDGND
D_24V+24V
DI_0Digital Input 0
DI_1Digital Input 1
DI_2Digital Input 2
DI_3Digital Input 3
DI_4Digital Input 4
DI_5Digital Input 5
DI_6Digital Input 6
DI_7Digital Input 7
Digital Outputs
GNDGND
VBBUpto +30V External
DO_0Digital Output 0
DO_1Digital Output 1
DO_2Digital Output 2
DO_3Digital Output 3
DO_4Digital Output 4
DO_5Digital Output 5
DO_6Digital Output 6
DO_7Digital Output 7
Analog Inputs
AIN_0Analog Input 0 (Positive)
AIN_0_NAnalog Input 0 (Negative)
AIN_1Analog Input 1 (Positive)
AIN_1_NAnalog Input 1 (Negative)
AIN_2Analog Input 2 (Positive)
AIN_2_NAnalog Input 2 (Negative)
AIN_3Analog Input 3 (Positive)
AIN_3_NAnalog Input 3 (Negative)
A_5V0+5V
A_GNDGND

DC Power Supply

This product requires an external 24V power supply to function. The power supply unit required is included with the product. Connect the power supply to the connectors on the product marked as 24V power. This product uses a single power supply for the digital circuitry and the relay coils. An internal isolated DC-DC converter and a set of optocouplers ensure galvanic isolation between the digital circuitry and the relay coil driver circuitry.

Driver Installation

Installing Numato Lab CDC Driver - Windows Desktop and Server Editions

The driver package for Numato Lab’s RXE002 can be downloaded from the product page at https://numato.com. To install the driver, unzip the contents of the downloaded driver package to a folder. Attach the USB cable to the PC and when asked by Windows device installation wizard, point to the folder where driver files are present. When the driver installation is complete, the module should appear in Windows Device Manager as a serial port. The picture below shows an RXE002 visible in Windows Device Manager.

Device Manager

 

Note down the name of the serial port (COM1, COM2, etc..). This information is required to control the module from the PC.

You may notice that the driver package does not come with a .sys or .exe file as most driver packages do and are expected to be that way. The driver binary necessary in this case is shipped with all copies of Windows Desktop/Server editions and gets installed automatically while Windows is installed for the first time. The .inf and .cat files present in the driver package downloaded from http://numato.com merely associate this pre-existing driver with the attached Numato Lab device.

The following video demonstrates how to install the driver on Windows 10.

Installing on Windows Embedded Editions

Windows Embedded editions do not install the infrastructure necessary for USB CDC by default in favor of a smaller footprint. This will cause the driver install to fail unless the necessary files are manually installed prior to installing the driver. Please follow the steps below to install the prerequisites and driver correctly. These steps are tested on Windows 7 Embedded Edition. The installation procedure may vary for other versions of Windows Embedded. Please contact Microsoft for more information.

  1. Locate winemb-inf-mdmcpq.cab on Win 7 Embedded DVD/ISO image
  2. Copy winemb-inf-mdmcpq.cab to a folder Ex: C:Temp
  3. Run command DISM.exe /online /Add-Package /PackagePath:C:Temp
  4. Wait for Windows to restart (Restart machine manually if DISM does not restart the machine automatically)
  5. After the reboot is complete, plug the device to a USB port and install driver normally (Driver is available for download at the product page)
For more information or for additional help on Windows Embedded editions, please contact Microsoft or your Windows Embedded reseller

Installing on Linux

To use any device that uses USB CDC protocol with Linux, USB CDC driver needs to be compiled into the kernel. Fortunately, most Linux distributions (Ubuntu, Redhat, Debian etc..) has this driver pre-installed. The chances of you requiring to rebuild the kernel to include the USB CDC driver is very slim. When connected to a Linux machine, this product should appear as a serial port under /dev directory. Usually, the name of the device will be ttyACMx or similar. The name may be different depending on the Linux distribution you have. The image below shows the result of ls /dev command on a Linux Mint system with a USB GPIO/Relay device attached.

Device Listing on Linux

In this particular case, the device shows up as ttyACM0 (highlighted in orange color) but it could be ttyACM1 or ttyACM2, etc… depending on the specific system and other connected devices. Once the device is visible under /dev directory, it can be treated just like any other serial device. Commands can be sent to the device using any mechanism that is valid for regular serial ports such as screen command or Serial Terminal Emulation applications. If there is more than one device connected to the same host computer, each device will be displayed as separate serial devices with unique names. These separate serial devices can be used to control individual devices attached.

Installing on Mac OSX

Mac OSX is usually shipped with USB CDC driver pre-installed. When connected to a Mac computer, this product should appear as a serial port under /dev directory. Usually, the name of the device will be tty.usbserialportx or tty.usbmodemx or similar. The name may be different depending on the Mac OSX version you have. The image below shows the result of ls /dev/*usb* command on a Mac OSX Yosemite system with a USB GPIO/Relay device attached.Listing USB GPIO Devices on Mac OSX

In this particular case, the device shows up as tty.usbmodem141141 (highlighted on orange color) but it could be any name starting tty.usbmodem  or even a completely different name depending on the exact version of operating system and other connected devices. Once the device is visible under /dev directory, it can be treated just like any other serial device. If there are more than one device connected to the same host computer, each device will be displayed as separate serial devices with unique names. These separate serial devices can be used to control individual devices attached.

The Modbus Interface

RXE002 –  Modbus Relay Modules use Modbus protocol for its primary interface. Modbus is a simple yet powerful industry-standard protocol that was originally developed by Modicon systems for transmitting/receiving information over serial links. RXE002 uses USB/RS485 and TCP/IP as physical interfaces. Since the device uses the USB interface, it represents itself to the operating system as a classic serial device which makes Modbus a very suitable protocol for this product. This also completely hides the complexities of using USB protocol and thus making the devices as easy to use as a normal serial device.

When working with Modbus, there are two important aspects of the protocol that the user may need to understand. 1) How to send and receive Modbus packets 2) The Modbus Register Map. One needs to learn details on building, sending and receiving Modbus packets only if he/she is engaged in low-level library or application development (and thus not covered in this document). For an end-user who wishes to use RXE002 devices with an off the shelf software, understanding of Modbus register map would be sufficient.

IMPORTANT! Working with a single interface at a time is recommended.

Modbus Register Map

Coils

Coils are a single bit data type that represents the output state of a single bit entity such as Relay or a Digital Output. Please note that Coils are always used to represent an output quantity. Writing to a coil will update the output quantity with the value written. Reading a coil will return the data that was previously written. For example, writing “1” to a coil that represents a relay will turn ON the relay and writing “0” to a coil that represents a relay will turn OFF the relay.  The Address in the table below shows the position of each coil within the Modbus register map. There are 4 coils corresponding to the 4 Relays, and 8 coils corresponding to the 8 Digital Outputs on RXE002. The data address of the Coils can be used to access the corresponding Relays and Digital Outputs.

No.NameCoil NumberData AddressSizeComments
Digital Outputs
1Digital Output 0101Digital Output 0 High/Low
2Digital Output 1211Digital Output 1 High/Low
3Digital Output 2321Digital Output 2 High/Low
4Digital Output 3431Digital Output 3 High/Low
5Digital Output 4541Digital Output 4 High/Low
6Digital Output 5651Digital Output 5 High/Low
7Digital Output 6761Digital Output 6 High/Low
8Digital Output 7871Digital Output 7 High/Low
Relays
9Relay 065641Relay 0 ON/OFF
10Relay 166651Relay 1 ON/OFF
11Relay 267661Relay 2 ON/OFF
12Relay 368671Relay 3 ON/OFF

Discrete Inputs

Discrete Inputs are a single bit data type that represents the input state of a single bit entity such as a Digital Input. For example, by reading the Input bit corresponding to a Digital Input Pin, the user can get the state of the logic (HIGH/LOW) externally applied to that Digital Input Pin.

No.NameInput NumberData AddressSizeComments
Digital Inputs
1Digital Input 01000101Digital Input 0 Status High/Low
2Digital Input 11000211Digital Input 1 Status High/Low
3Digital Input 21000321Digital Input 2 Status High/Low
4Digital Input 31000431Digital Input 3 Status High/Low
5Digital Input 41000541Digital Input 4 Status High/Low
6Digital Input 51000651Digital Input 5 Status High/Low
7Digital Input 61000761Digital Input 6 Status High/Low
8Digital Input 71000871Digital Input 7 Status High/Low

Holding Registers

No.NameInput NumberData AddressSize                AccessComments
Relay Related Registers
1Relay Timer Registers 40001012WR3*4=12 Relay timer registers for 4 relays
2Relay Fail safe Value Registers402572561WRFail Safe value registers for relays.
3Relay Power ON value Register402612601WRPower ON value registers for relays.
Digital Output Related Registers
4Digital Output Fail safe Value Registers405975961WRFail Safe value registers for digital outputs.
5Digital Output Power ON value Register406056041WRPower ON value registers for digital outputs.
6Digital Output Configuration Register407017001WRConfiguration register for internal/external voltage for digital outputs.
Watchdog Configuration Area
7Watchdog Holding Registers406136123WRWatchdog Config, timer, timeout value registers
ADC Configuration Registers
8Current Loop/ Voltage Loop 408018001WRCurrent Loop/ Voltage Loop selection for Analog Inputs
9ADC Channels' Range Select Registers408028014WR4 Range Select Registers for 4 Analog Inputs
10ADC Channels' Offset Registers408108054WR4 Offset Value Register for 4 Analog Inputs
Device Configuration Area
11User ID4805180502WRTwo registers (4 bytes) for storing custom user data.
12USB Configuration Area4810181002WRSlave ID & protocol config value registers for USB Interface
13RS485 Configuration Area4816581642WRSlave ID, Baud rate value registers for RS485 Interface
14Ethernet Configuration Area48229822823WR & ROHost name, IP address, MAC etc... for Ethernet Interface

Input Registers

No.NameInput NumberData AddressSize                
AccessComments
Device Info Area
1Vendor ID3800180001 RO
2Product ID3800280011RO
3OEM Vendor ID3800380021RO
4OEM Product ID3800480031RO
5HW major version and Minor version3800580041ROHardware revision information.
6Firmware major, minor version3800680051ROFirmware revision information
7Register Map major, minor version3800980081ROMajor and Minor versions for Modbus register map
Analog Inputs Registers
8AIN_03000101ROADC Channel 0 Input Registers
9AIN_13000211ROADC Channel 1 Input Registers
10AIN_23000321ROADC Channel 2 Input Registers
11AIN_33000431ROADC Channel 3 Input Registers
★ RO – Read Only ★ WO – Write Only ★ WR – Write/Read

Register Formats

Let’s look at how to write values to each register.

Holding registers and its format are explained in the table below:-

No.RegisterRegister FormatComments
Relay Related Registers
1Relay Timer Value Registers- 2*16 bit registers for 32 bit timer value for relays.Register 1 - Lower Bytes of Timer value.
Default Value - 0
Minimum Value to be written - 500h
Register 2 - Higher Bytes of Timer Value.
Default Value - 0
2Relay Timer Config Register- 16 bit register

- Bit 0 - Enable Timer

- Bit 1:2 - Timer Type

- Bit 3:4 - Timer Action
Bit 0 :-
0 - Stops Timer
1 - Starts Timer
Default Value - 0
------------------------
Bit 2:1 :-
00 - Single shot Timer
01 - Periodic Timer
Default Value - 0
------------------------
Bit 4:3 :-
00 - Relay OFF
01 - Relay ON
10 - Relay Toggle
11 - Reserved
Default Value - 0
3Relay Fail Safe Value Register- 16 bit register for 4 Relays.
- 0-3 bit for 4 relays
Bit 0-3 represents relay status.
0 - Relay OFF
1 - Relay ON
Default Value - 0
------------------------
Bit 4:15 :-Reserved
Default Value - 0
4Relay Power ON Value Register- 16 bit register for 4 Relays.
- 0-3 bit for 4 relays
Bit 0-3 represents relay status.
0 - Relay OFF
1 - Relay ON
Default Value - 0
------------------------
Bit 4:15 :-Reserved
Default Value - 0
Watchdog Holding Registers
5Watchdog config Register -16 bit register to Enable/Disable watchdog timer
- Bit 0 - ON Bit
- Bit 1 - Mode Select Bit
- Bit 2:15 - Reserved
Bit 0 :-
0 - Disable Watchdog Timer
1 - Enable Watchdog Timer
Default Value - 0
------------------------
Bit 1 :-
0 - Default Mode
1 - Manual Mode(Reserved)
Default Value - 0
------------------------
Bit 2:15 :-
XX - Reserved
Default Value - 0
6Watchdog timer Value Register - 16 bit register for watchdog timer value.Fail safe occurs when this value reaches the timeout value.
Default Value - 0
7Watchdog timeout Value - 16 bit register for watchdog timeout value. Represents at what time the fail safe should occur.
Default Value - 0
ADC Configuration Holding Registers
8ADC Channels' Current / Voltage Input Selection Registers- 16 bit register for selection of Current or Voltage input option for ADC
- Lower byte in the register is used.
Bit 0:3 :-
0 - Voltage Loop
1 - Current Loop
Default Value - 0
------------------------
Bit 4:15 :-Reserved
Default Value - 0
9ADC Channels' Range Select Registers- 16 bit register for Range Select for ADCRegister Values & Voltage Ranges
---------------------------------------------
0x00 - ±10.24V
0x01 - ±5.12V
0x02 - ±2.56V
0x03 - ±1.28V
0x0B - ±0.64V
0x05 - 0 to +10.24V
0x06 - 0 to +5.12V
0x07 - 0 to +2.56V
0x0F - 0 to +0.64V
Default Value - 0
10ADC Channels' Offset Registers- 16 bit register for Range Select Registers for ADC
- MSB defines whether the offset value should be added or subtracted.
Bit 0:14 :-
Offset Value
Default Value - 0
------------------------
Bit 15 :-
0 - Add Offset Value
1 - Subtract Offset Value
Default Value - 0
Digital Output Holding Registers
11Digital Output Fail Safe Value Register- 16 bit register
0-7 Bit for 8 Digital Outputs
Bit 0-7 represents Digital Output status.
0 - Digital Out LOW
1 - Digital Out HIGH
Default Value - 0
------------------------
Bit 8:15 :-Reserved
Default Value - 0
12Digital Output Power ON Value Register- 16 bit register
0-7 Bit for 8 Digital Outputs
Bit 0-7 represents Digital Output status.
0 - Digital Out LOW
1 - Digital Out HIGH
Default Value - 0
------------------------
Bit 8:15 :-Reserved
Default Value - 0
13Digital Output Configuration Register- 16 bit registerBit 0 : Power Supply Select
0- Internal Source
1- External Source
Default Value - 0
------------------------
Bit 1-15:-Reserved
Default Value - 0
Common Configuration Holding Registers
14User ID Holding Register- 2*16 bit registers for User ID
4 bytes for User ID.
Default Value - 0
USB Configuration Holding Registers
15Slave ID- 16 bit register for USB Slave IDDefault Value - 1
16Protocol Configuration- 16 bit register for swap between protocols(RTU,JSON,XML)
- Bit 0:2 - Config Bit
Bit 0 :-
0 - Disable RTU
1 - Enable RTU
Default Value - 1
------------------------
Bit 1 :-
0 - Disable JSON
1 - Enable JSON
Default Value - 0
------------------------
Bit 2 :-
0 - Disable XML
1 - Enable XML
Default Value - 0
RS485 Configuration Holding Registers
17Slave ID- 16 bit register for RS485 Slave IDDefault Value - 1
18Baud Rate- 16 bit register for RS485 baud rateBaud rates - Values
----------- ---------
9600 - 10 or 0x000A
19200 - 11 or 0x000B
38400 - 12 or 0x000C
57600 - 13 or 0x000D
115200 - 14 or 0x000E
Default Value - 10 or 0x000A
Ethernet Configuration Holding Registers
19Host Name- 8*16 bit registers for host nameHost name length is limited to 16 characters
20IP address- 2*16 bit registers for IP AddressIP V4 properties of Ethernet interface.
21IP Mask- 2*16 bit registers for IP Mask
22Default Gateway- 2*16 bit registers for Default Gateway
23Primary DNS- 2*16 bit registers for Primary DNS
24Secondary DNS- 2*16 bit registers for Secondary DNS
25DHCP Enable-16 bit register for DHCP
Enable
- Bit 0 - Enable Bit
- If enabled, Get IP address automatically, or static IP configuration.
- Disable DHCP to write IPV4 properties.
Bit 0 :-
0 - Disable DHCP
1 - Enable DHCP
Default Value - 1
------------------------
Bit 1:15 :-
X -Reserved
Default Value - 0
26TCP Port- 16 bit registers for TCP PortTCP port for Ethernet connection.
Default value - 502
27MAC Address- 3*16 bit Read Only registers for MAC AddressMAC address of Ethernet interface

★ IP V4 properties of the Ethernet interface will be writable only if the DHCP is disabled.

Similarly, input registers’ format is as follows:-

No.RegisterRegister FormatComments
1Vendor ID- 16 bit Register for Vendor IDDefault Value - 0x2A19
2Product ID- 16 bit Register for Product IDDefault Value - 0x2504
3OEM Vendor ID- 16 bit register for OEM Vendor IDDefault Value - 0
4OEM Product ID- 16 bit register for OEM Product IDDefault Value - 0
5HW major version and Minor version- 16 bit register for Hardware major and minor versionHardware revision information.
Default Value - 1
6Firmware major, minor version- 16 bit register for Firmware major and minor versionFirmware revision information.
Default Value - 1
7Firmware bugfix/patch level- 16 bit register for Firmware bugfix/patch levelFirmware bugfix/patch level
Default Value - 0
8PNV data format major, minor version- 16 bit register for PNV data format major, minor versionPNV data format major, minor version
Default Value - 1
9Register Map major, minor version- 16 bit register for Register map major and minor versionMajor and Minor versions for Modbus register map
Default Value - 1

Controlling RXE002 using off the shelf software

RXE002 support for Modbus protocol makes it easier to use with virtually any software that supports Modbus. This section of the document demonstrates how to use this module with some of the software that is available in the market.

Windows

qModMaster

QModMaster is free software that emulates Modbus master and can be used to access any device that is Modbus compatible. QModMaster can be downloaded for free at https://sourceforge.net/projects/qmodmaster/. Follow the steps below to see how to use RXE002 with QModMaster using RTU and TCP.

Download and install QModMaster.

To control the device via Modbus RTU, follow the simple steps given below:

Step 1:

Run QModMaster and select “Modbus RTU” from the Options menu. Enter Serial Port name and other settings as in the image below and click OK. Serial Port name must match the port name assigned to the device by the Operating System.
qModMaster Settings for ZRXxx

Step 2:

  1. Select RTU as Modbus mode.
  2. Select the proper Slave ID of the device.
  3. Then, click the “Connect” button to connect to the device.

qModMaster Open Port

Step 3:

  1. Select the “Write Single Coil” function code in the Function Code combo box, enter the Data Address of the first Relay (Relay Index 0) in the Start Address box.
  2. Enter value 1 (corresponds to Relay ON state) in the data cell.
  3. Now click the Read/Write button to send the new value to the device.

If everything works fine, you will hear the relay clicks and any circuitry connected to the relay will be activated. To read the status of a Relay, the same sequence applies but select the “Read Coils” function code instead.

qModMaster Turn Relay ON

Similarly, to control the device via Modbus TCP, follow the steps below:

Step 1:

Run QModMaster and select “Modbus TCP” from the Options menu. Enter the IP Address of the device and TCP port number as in the image below and click OK.
qModMaster TCP Settings for ZGXxx
Step 2:

  1. Select TCP as Modbus mode.
  2. Then, click the “Connect” button to connect to the device.

qModMaster TCP Open Connection
Step 3:

  1. Select the “Write Single Coil” function code in the Function Code combo box, enter the Data Address of the first Relay (Relay Index 0) in the Start Address box.
  2. Enter value 1 (corresponds to Relay ON state) in the data cell.
  3. Now click the Read/Write button to send the new value to the device.

If everything works fine, you will hear the relay clicks and any circuitry connected to the relay will be activated. To read the status of a Relay, the same sequence applies but select the “Read Coils” function code instead.

qModMaster Turn Relay ON

Additional Information

Using relay modules with inductive loads

Snubber Diode

Diode As Snubber

It is important to take additional care when using relays with inductive loads. An inductive load can be pretty much anything that has a coil and works based on magnetic principles like Motors, Solenoids, and transformers. But in practice, even a wire longer than a few feet can display substantial inductance. Inductive loads produce back emf when the magnitude of the load current changes. The back emf can be in the order of tens or even hundreds of voltage (See this Wikipedia article http://en.wikipedia.org/wiki/Counter-electromotive_force). This effect is most severe when power is disconnected from the inductive load because the rate of change of current is maximum at that point. Even though the back emf lives only for a very short time (a few milliseconds) it can cause sparks between the relay contacts and can deteriorate the contact quality over time and reduce the life span for the relays considerably.

So it is important to take countermeasures to suppress the back emf to acceptable levels to protect relay contacts. Usually, this requires connecting electronic devices in parallel with the load such that they absorb the high voltage components generated by the load. For solenoids, connecting a diode (fast switching diode is recommended) in parallel to the load (in the reverse direction to the load current) is very effective. A diode used for this purpose is usually called a freewheeling diode. Please see the diagram on the right for connection details.

Capacitive Snubber

Capacitor As Snubber

A capacitor with a proper rating is recommended for protecting the relay contacts when a motor is used as a load. The capacitor should be rated enough to withstand the back emf that is generated by the motor. Please see the diagram below for connection details.

Please note that the relay modules are NOT shipped with back emf suppression devices pre-installed. The exact kind of suppression device and the parameters of the selected device can vary depending on the load itself. Some of the parameters that affect the suppression device selection are the inductance of the load, power supply voltage, load current, physical size/structure of the load, etc.. It is obvious that it is impossible for us to predict these parameters and design required back emf suppression device and incorporate that on the board. So we believe this is a task best left to the module user. There is an excellent article on designing back emf suppression on Wikipedia at http://en.wikipedia.org/wiki/Flyback_diode

Technical Specifications

ParameterValueUnit
Number of relays 4
Number of digital inputs8
Number of digital outputs8
Number of analog inputs4
Power supply voltage (External)24V
Digital Input Specifications
Minimum Digital Input Voltage 0.8V
Maximum Digital Input Voltage 30V
Start-Up Threshold8V
Shutdown Threshold4.5V
Digital output Specifications
Current Rating1.2A
Voltage SourceInternal, External
Maximum Output Voltage (External)30V
Maximum Output Voltage (Internal)24V
ADC Specifications
Resolution16bits
Full scale range-10.24 to +10.24V
Reference voltage3.3V
Current-Loop4 to 20mA
Relay Specifications
Nominal relay coil voltage 12V
Nominal coil power consumption (per relay)120mW
Relay contact material Silver Alloy
Contact rating 10A/ 250V AC
10A/ 30V DC
Maximum switching voltage 277VAC
Maximum switching current10A
Maximum switching power2770VA
Contact resistance (initial)100mΩ
Insulation resistance1000MΩ
Life expectancy (Electrical) 50,000 Operations
(5A 250VAC/24VDC, Resistive load)
Life expectancy (Mechanical) 20000000Operations
Maximum switching on response time≤8mS
Maximum switching off response time≤5mS
Shock resistance (Functional)294m/s2
Shock resistance (Destructive)980m/s2
Vibration resistance10Hz to 55Hz 1.5mm DA
Other Information
USB Vendor ID0x2A19
USB Product ID0x2605

Frequently Asked Questions (FAQs)

Q. What are the serial parameters I need to use when communicating with this board?
A. Since this module uses USB as the underlying transport mechanism, most of the serial parameters do not affect the communication. You can leave all parameters to any legal value (Eg: 2400, 4800, 9600, etc… for baud rate) except Flow control. Flow control needs to be set to “None”.

Q. Where do I find the driver for this product?
A. Visit http://numato.com and navigate to the product page. There will be a link to download windows driver. Linux does not require driver installation since in most cases they are shipped with the driver pre-installed.

Q. Why there is no .sys or .exe file in the Windows driver package I downloaded?
A. This product uses the USB CDC driver binary which is already present on Windows. All Windows versions (with the exception of Embedded Editions) has this driver binary installed by default. The .inf and .cat files present in the zip file helps Windows identify the device properly and associate the appropriate driver (.sys) to the device

Q. Does this product work with Linux?
A. Yes, this product works with Linux. Please see more details on how to use this product with Linux elsewhere in this document.

Q. Does this product work with Mac OSX?
A. Yes, this product works with Mac OSX. Please see more details on how to use this product with Mac elsewhere in this document.

Q. What is the software that this product work with?
A. This product works with almost any software that has support for standard Modbus. Some examples can be found elsewhere in this document. Different software is written by different developers with different purposes in mind. So you may encounter some software that may not work with this product. But usually, alternatives are available in most if not all cases.

Q. I’m using x language for programming. How do I find out if this language can be used to program and control the GPIO module?
A. Find out if the language of interest supports some kind of APIs/Functions/Components for serial communication. If it does, most likely you should be able to use that language with this module. It may also be possible to find libraries such as libModbus that offers high-level APIs. Using such libraries can speed up development quite a bit.

Q. I need a customized version of this product, can Numato Lab do the customization for me?
A. Yes, we can definitely do customization but there may be minimum order requirements depending on the level of customization required. Please write to [email protected] for a quote.

Q. Where can I buy this product?
A. All Numato products can be ordered directly from our web store http://www.numato.com. We accept major credit cards and Paypal and ship to almost all countries with a few exceptions. We do have distributors in many countries where you can place your order. Please find the current list of distributors at http://numato.com/distrib.

Suggest Edit