Modbus TCP Client configuration example: Difference between revisions
Modbus TCP Client configuration example (view source)
Revision as of 00:26, 12 April 2022
, 12 April 2022Better photos
No edit summary |
(Better photos) |
||
Line 2: | Line 2: | ||
Modbus TCP Master section is used for configuring your router as a master device and other routers configured in this section as slave devices. A Modbus TCP master device can then request data from these Modbus TCP slaves. | Modbus TCP Master section is used for configuring your router as a master device and other routers configured in this section as slave devices. A Modbus TCP master device can then request data from these Modbus TCP slaves. | ||
[[File:ModbusTcpMasterSchemeTopology.png| | [[File:ModbusTcpMasterSchemeTopology.png|border|class=tlt-border|center|Topology]] | ||
First, let’s configure our second router which will be acting as a slave device. | First, let’s configure our second router which will be acting as a slave device. | ||
Line 9: | Line 9: | ||
In this example, we would be configuring our slave device to have a 192.168.1.2 internal IP address. This can be done by changing the IP address parameter on Network->WAN page: | In this example, we would be configuring our slave device to have a 192.168.1.2 internal IP address. This can be done by changing the IP address parameter on Network->WAN page: | ||
[[File: | [[File:ExampleModSlave1Edit.png|border|class=tlt-border|center|Slave Device WAN configuration]] | ||
[[File: | [[File:ExampleModSlave2Edit.png|border|class=tlt-border|center|Slave Device WAN config]] | ||
Now we need to enable Modbus service for this slave device as we will open a specific port for letting through TCP communications (it is also possible to 'Allow remote access' if we wish to access this router from external WAN using its public IP). This is done on Services->Modbus page: | Now we need to enable Modbus service for this slave device as we will open a specific port for letting through TCP communications (it is also possible to 'Allow remote access' if we wish to access this router from external WAN using its public IP). This is done on Services->Modbus page: | ||
[[File: | [[File:ExampleModSlave3Edit.png|border|class=tlt-border|center|Slave Device Modbus Config]] | ||
<table class="nd-mantable"> | <table class="nd-mantable"> | ||
Line 67: | Line 67: | ||
On the master device (in this example master device has 192.168.1.1 internal IP address) open Services->Modbus->Modbus TCP Master. To add a new slave, first, click the add button. | On the master device (in this example master device has 192.168.1.1 internal IP address) open Services->Modbus->Modbus TCP Master. To add a new slave, first, click the add button. | ||
[[File: | [[File:ExampleModSlave4Edit.png|border|class=tlt-border|center|Master device Modbus Slave devices menu.]] | ||
Once you have clicked that button, enter the following configuration so we can add the slave device: | Once you have clicked that button, enter the following configuration so we can add the slave device: | ||
[[File: | [[File:ExampleModSlave5Edit.png|border|class=tlt-border|center|Master devies Add Slave Config]] | ||
<table class="nd-mantable"> | <table class="nd-mantable"> | ||
Line 119: | Line 119: | ||
Scroll down and click “Save and Apply” | Scroll down and click “Save and Apply” | ||
[[File:Picture6.png| | [[File:Picture6.png|border|class=tlt-border|center|Save and Apply]] | ||
After this, this is how your main Modbus Master panel should look: | After this, this is how your main Modbus Master panel should look: | ||
[[File: | [[File:ExampleModSlave7Edit.png|border|class=tlt-border|center|Master Device Modbus Slave menu]] | ||
==Testing== | ==Testing== | ||
For testing, if the functionality is working we can configure a request. A Modbus request is a way of obtaining data from Modbus slaves. The master sends a request to a slave specifying the function code to be performed. The slave then sends the requested data back to the Modbus master. You can create a maximum of 64 request configurations for each slave device.First, click the edit button: | For testing, if the functionality is working we can configure a request. A Modbus request is a way of obtaining data from Modbus slaves. The master sends a request to a slave specifying the function code to be performed. The slave then sends the requested data back to the Modbus master. You can create a maximum of 64 request configurations for each slave device.First, click the edit button: | ||
[[File: | [[File:ExampleModSlave7Edit.png|border|class=tlt-border|center|Master Device Modbus Slave menu]] | ||
Scroll down to the “Request configuration” section. | Scroll down to the “Request configuration” section. | ||
[[File: | [[File:ExampleModSlave9Edit.png|border|class=tlt-border|center|Request Configuration]] | ||
Write a name for the request and click the “Add” button. | Write a name for the request and click the “Add” button. | ||
[[File: | [[File:ExampleModSlave10Edit.png|border|class=tlt-border|center|Add new request.]] | ||
And enter a data type, a function, first register, number of registers, if you need brackets or don’t and enable the request. In this case we are trying to get System uptime information so configure the next options: | And enter a data type, a function, first register, number of registers, if you need brackets or don’t and enable the request. In this case we are trying to get System uptime information so configure the next options: | ||
[[File: | [[File:ExampleModSlave11Edit.png|border|class=tlt-border|center|Configuring new request]] | ||
<table class="nd-mantable"> | <table class="nd-mantable"> | ||
Line 208: | Line 207: | ||
Under the “Request Configuration” section there will be another section called “Request Configuration Testing” this is where you can test that the parameters that you set work properly. Just select the request that you want to test and click the test button and you should get and output. | Under the “Request Configuration” section there will be another section called “Request Configuration Testing” this is where you can test that the parameters that you set work properly. Just select the request that you want to test and click the test button and you should get and output. | ||
[[File: | [[File:ExampleModSlave12Edit.png|border|class=tlt-border|center|Testing request.]] | ||
==Alarms== | ==Alarms== | ||
Alarms are a way of setting up automated actions when some Modbus values meet user-specified conditions. To configure these alarms, scroll to the end of the menu and click the “Add” button. | Alarms are a way of setting up automated actions when some Modbus values meet user-specified conditions. To configure these alarms, scroll to the end of the menu and click the “Add” button. | ||
[[File: | [[File:ExampleModSlave13Edit.png|border|class=tlt-border|center|Add new alarm.]] | ||
After clicking the “Add” button the next menu should come up: | After clicking the “Add” button the next menu should come up: | ||
[[File: | [[File:ExampleModSlave14Edit.png|border|class=tlt-border|center|Alarm configuration.]] | ||
<table class="nd-mantable"> | <table class="nd-mantable"> |