Home
RECOMMENDED FOR YOU:
SMS Gateway software
Ozeki brings you outstanding
SMS Gateway technology. Use our SMS Server products on Windows,Linux, or Android

C# SMS API
Developers can use our C# SMS API to send SMS from C#.Net. The C# SMS API comes with full source code

PHP SMS API
The ozeki PHP SMS gateway software can be used to send SMS from PHP and to receive SMS usig PHP on your website

SMPP SMS Gateway
SMS service providers use our SMPP gateway solution, that offers a high performance SMPP server and SMPP client gateway with amazing routing capabilities
Ozeki Modbus Gateway

Quick Start Guide - Modbus Gateway

In this tutorial, we will show you the functions of the Ozeki Modbus Gateway. We will talk about communicating with a DHT device, an electricity meter device, a Modbus relay device and how to talk to those with HEX messages. It will be a step-by-step guide so you will have no hard time following it. There is a thorough video explanation on all the topics. Let’s start with the Modbus DHT device

How to chat with Modbus DHT device

To start communicating with the DHT device, you need to launch the Modbus Gateway. The icon for it is located on the desktop of the Ozeki 10 and titled “Modbus Gateway”, as you can see on Figure 1. To open the application, click on the icon.

open modbus gateway
Figure 1 - Open Modbus Gateway

The first thing you will se when you open the gateway is the home screen of it. To operate a device through the application, you need to add a new connection first. To do that, you need to click on the “Add new connection” button on the left side of the screen, as it is shown on Figure 2.

add new connection
Figure 2 - Add new connection

To operate a DHT device, you will need a Modbus TCP connection. This connection will allow you to manage Modbus devices through a TCP or an IP network link. To setup this kind of a connection, you need to click on the blue “Install” button next to the Modbus TCP connection title, as it can be seen on Figure 3.

install modbus tcp connection
Figure 3 - Install Modbus TCP connection

You need to setup a Modbus connection to make it work properly. To do that, you will need the hostname or IP address and the port number of the remote server. Type them in the adequate field in the “Connect to server” panel. You can find it in Figure 4.

setup modbus connection
Figure 4 - Setup Modbus connection

After you configured the connection, you will need to manually enable it, by switching an option on the left side of the screen, titled: “Connection”. You will find it with the help of Figure 5.

enable modbus connection
Figure 5 - Enable Modbus connection

To create the device which you will be communicating with, you will need to head over to the device panel, located within the selectable panels on the top of the main working area of the window gateway window. Figure 6 will help you find it.

create new modbus device
Figure 6 - Create new Modbus device

Next up, you need to choose the DHT sensor device from the multiple devices that you can operate with the Modbus Gateway. You can choose it on the right side of the window, as it is show on Figure 7.

create dht sensor device
Figure 7 - Create DHT sensor device

Now in this panel on the right side of the window, as shown on Figure 8, you will need to set the details of the Modbus device. The “Connection name” will serve as a help of spotting the connection inside the Modbus Gateway application. The “Device address” will identify the device on the Modbus line. This should be in the range of 1 – 247.

modbus device details
Figure 8 - Modbus device details

To modify anything in the settings of the DHT sensor, you will need to open the device details panel. To do this, you need to click the “Details” button next to the name of the connection you wish to modify. You can find it easily with the help of Figure 9.

open device details
Figure 9 - Open device details

To get more information about the working of your device, send a message which only contains the word “help”. To do this, you need to go to the "chat" panel which is on the top of the main panel. You can find it easily on Figure 10.

send help message
Figure 10 - Send help message

If you send the “help” message, the device will send back a list of every command you can use to operate the DHT sensor, and some details about each command. You can see it in Figure 11.

available dht commands
Figure 11 - Available DHT commands

To use these commands, all you need to do is to type them in the bottom of the chat panel and hit the “send” button. You will see a demonstration on Figure 12.

chat with dht sensor
Figure 12 - Chat with DHT sensor

How to chat with Modbus Electricity meter device

To start configuring your Modbus Electricity meter device, you need to open the Modbus Gateway application. To do that, you need to click the icon of the program on the desktop of Ozeki 10. You will find it easily with the help of Figure 13.

open modbus mateway
Figure 13 - Open Modbus Gateway

To create your new device, open the Modbus TCP connection which we already configured. You can do this by clicking at the name of the connection on the left side of the screen, as you can see on Figure 14.

open modbus tcp connection
Figure 14 - Open Modbus TCP connection

Now you can create your new Modbus device by clicking on the “device” tab and then the “Create new Modbus device” button. You can find them with the help of Figure 15.

create new modbus device
Figure 15 - Create new Modbus device

Now you can create the electricity sensor which you will communicate with. To setup the device, click in the button which says “electricity”, on the right side of the screen as shown on Figure 16.

create electricity sensor
Figure 16 - Create electricity sensor

After you have created, you will need to set the device details. You must choose a name for your device which can be anything you like, and a device address which will identify the device on the Modbus line. The value should be in the range of 1-247. You can find it on Figure 17.

modbus device details
Figure 17 - Modbus device details

Next up, you need to open the device details tab, by clicking the “details” button on the right side of the screen next to the name of your device, as you can see on Figure 18.

open device details
Figure 18 - Open device details

If you want to know more about the commands you could use with your device, you could send the “help” message to the device as you can see in Figure 19.

send help message
Figure 19 - Send help message

It will send back all the info you need to know about the commands that your device accepts and understands, as it is represented in Figure 20.

available electricity commands
Figure 20 - Available Electricity commands

To operate the device, you need to send commands in the “chat” panel by typing them and clicking send. The device will send back the data you asked for as in Figure 21.

chat with electricity sensor
Figure 21 - Chat with Electricity sensor

How to chat with Modbus Relay device

To chat with a Modbus Relay device, first you will need to open the Modbus Getaway application. You can find it on the Ozeki 10 desktop. You will need to search for an icon called “Modbus Getaway”. You will find it easily on Figure 22.

open modbus gateway
Figure 22 - Open Modbus Gateway

Next up, you need to open the Modbus TCP connection tab, by clicking the name of the connection which you already configured. You will find the button you will need to click on Figure 23

open modbus tcp connection
Figure 23 - Open Modbus TCP connection

Here, you have to head over to the “Devices” tab and click the “Create new Modbus device” button. It is located next to the “Modbus devices” title, as it is shown on Figure 24.

create new modbus device
Figure 24 - Create new Modbus device

Now you need to choose the “Relay” from the six different Modbus connection types. To do that, just click on the button saying “Relay” as demonstrated on Figure 25.

create relay device
Figure 25 - Create Relay device

After it, you must set you device details in the right side of the screen. You will need a connection name, which can be whatever you want, a device address which will identify the device on the Modbus line and it should be in the range of 1-247 and a channel count which must be the number of channels on the relay board. You can see it on Figure 26.

modbus device details
Figure 26 - Modbus device details

To communicate with your device, you must open the device details tab. To do that, you need to click on the “Details” button next to the name of your device as it is shown on Figure 27.

open device details
Figure 27 - Open device details

To learn about the commands that you can use to operate your device, just send a “help” message to it. To do it, just type in “help” and click send, as it is shown on Figure 28.

send help message
Figure 28 - Send help message

You will receive a message from your device with all of the usable commands. You can use those to operate the device in order to your preferences. You can read all the commands in Figure 29.

available relay commands
Figure 29 - Available Relay commands

As you can see in Figure 30, if you type in any of the commands and send them to the device, it will read them and behave the way you need it to.

chat with relay sensor
Figure 30 - Chat with Relay sensor

How to chat with Modbus device by HEX messages

To chat with a Modbus device by HEX, or hexadecimal format, first you will need to open the Modbus Getaway application. You can find it on the Ozeki 10 desktop. You will need to search for an icon called “Modbus Getaway”. You will find it easily on Figure 31.

open modbus gateway
Figure 31 - Open Modbus Gateway

The first thing you will see when you open the gateway is the home screen of it. To operate a device through the application, you need to add a new connection first. To do that, you need to click on the “Add new connection” button on the left side of the screen, as it is shown on Figure 32.

add new connection
Figure 32 - Add new connection

To chat with a Modbus device by HEX, you will need a Modbus TCP connection. This connection will allow you to manage Modbus devices through a TCP or an IP network link. To setup this kind of a connection, you need to click on the blue “Install” button next to the Modbus TCP connection title, as it can be seen on Figure 33.

install modbus tcp connection
Figure 33 - Install Modbus TCP connection

You need to setup a Modbus connection to make it work properly. To do that, you will need the hostname or IP address and the port number of the remote server. Type them in the adequate field in the “Connect to server” panel. You can find it in Figure 34.

setup modbus connection
Figure 34 - Setup Modbus connection

After you configured the connection, you will need to manually enable it, by switching an option on the left side of the screen, titled: “Connection”. You will find it with the help of Figure 35.

enable modbus connection
Figure 35 - Enable Modbus connection

Now you can start chatting with the device using hexadecimal codes. To do this, you need to head over to the chat tab on the top of the main working area, as you can see on Figure 36, and type in your HEX message.

send hex message
Figure 36 - Send HEX message

As it is shown on Figure 37, the machine will understand de hexadecimal code and answer it with a hexadecimal code as well.

response from the device
Figure 37 - Response from the device

We hope that you have managed to follow the tutorial. If you have any problem with any of the steps, feel free to contact us at info@ozeki.hu.