Ewon TechForum
Providing technical solutions to technical requests


Poll multiple serial Modbus networks with a Flexy.
FromTicket Offline
Junior Member
#1
Hi,

Can I set my eWON to poll multiple Modbus slave devices dispatched on two serial networks  (RS485/232) ?
Reply

simon Offline
eWON Support
#2
No, it cannot be done using the eWON Modbus IO Server.
Actually, this one can only be associated to a single serial port.
You could imagine to change the Modbus IOServer serial port thanks to a piece of BASIC but it makes it quite difficult to manage afterwards since you must use MEM tags to store the values of the different devices...

One solution I have is to use the attached JAVA Modbus IOServer I have developed in addition to the existing one. (One serial port with the existing Modbus IO Server, another one with the Modbus JAVA IO Server)

The compiled files and source code is available below.
Reply

polishglider Offline
Junior Member
#3
Hi all,

It's possible to use 5 Serial com port on a flexy but the Modbus IO server allow you to use only one of them. BUT, with basic script, it's possible to schedule a switching sequence between all com ports.

The simplest way is to have the same configuration for all ports (parity, speed, duplex) ... and not the same adresses ... and you have to use the basic function:

SETSYS SYS,"load"
SETSYS SYS,"IOSrvData0:ComPortNum",INT(next_com)
SETSYS SYS, Save

the tag "next_com" is the number of the next com port you want to use for the IOSrvData0 (modbus in this case).

When you switch com port, all other variables will keep their values, but will appear in default (in red in the tag value page) ...

I done that to read 4 equipments in 4 differents com port (flexy 202 + 2 serial cards), both RS232 and RS485 ... and i read all values in less than 20 seconds !!!

have a nice day !!
Reply

simon Offline
eWON Support
#4
Here is the link to the Modbus RTU Java IOServer : https://developer.ewon.biz/content/add-modbus-rtu

The zip file contains  the source and the compiled files.


If you just want to use it.  Unzip the files and copy the 3 files contained in /dist to the /usr directory of your eWON and then reboot it.
After the reboot, you'll have a new IO Server available named "MB_RTU"

Tell me if you need any help.
Simon
Reply

udayakumar Offline
Ewon Distributor
#5
Hi simon,

where should I define slave id in IO server tag address..
Reply

simo Offline
Junior Member
#6
Hi Simon,

I have used your JAVA Modbus IOServer (ModbusRTU_Compiled source) and I can read different types of registers on different devices. However, the writing function does not work for me in any of them.
Have a more updated version of the JAVA Modbus IOServer?

Thanks in advance.
Reply

simon Offline
eWON Support
#7
Hi,

Do your devices support the Writing Function 06 (write single register) ?
Can you set the loglevel to 2, try to write a new value to a Tag and then download and send me the realtime logs of you Flexy ?

Simon
Reply

simo Offline
Junior Member
#8
(24-04-2018, 04:54 PM)Simon Wrote: Hi,

Do your devices support the Writing Function 06 (write single register) ?
Can you set the loglevel to 2, try to write a new value to a Tag and then download and send me the realtime logs of you Flexy ?

Simon

Hi,

My devices only support functions 03, 04 and 16. JAVA Modbus IO Server doesn't work with Function 16?

Thanks.
Reply

simon Offline
eWON Support
#9
It follows the Modbus standard ;-)
It you update a Word register, you use the Single Write Function 06, if you update multiple Word registers or a single (or multiple) Float/DWORD register, you use the function 16.
I can update it if needed. Just tell me how urgent it is... ;-)
Reply

simo Offline
Junior Member
#10
(24-04-2018, 05:28 PM)Simon Wrote: It follows the Modbus standard ;-)
It you update a Word register, you use the Single Write Function 06, if you update multiple Word registers or a single (or multiple) Float/DWORD register, you use the function 16.
I can update it if needed.  Just tell me how urgent it is... ;-)

Hi,
I just tried to declare a tag like a DW and then when I change its value, changes the variable of the device. (So I understand that the Modbus JAVA IO Server uses Function 16 for this type of tag, and then my device realize this order).
The problem is that the registers of my device are only Words and Integers. So I would need to apply the Function 16 (as default MODBUS IO server in ewon) for the writing function. It would be a very hard job to change the program to use always Function 16 for writing?
Thanks.

Simo
Reply

simon Offline
eWON Support
#11
Simo,

Please, find above an updated version of the IOServer (v 1.0.3)
This one supports a new Tag Format (W16 or I16) that allows you to force the writing operations with function 16 (Tag address will then be for example : 40001,W16,10)
Let me know if it works better.

Simon
Reply

simo Offline
Junior Member
#12
(25-04-2018, 12:14 PM)Simon Wrote: Simo,

Please, find above an updated version of the IOServer (v 1.0.3)
This one supports a new Tag Format (W16 or I16) that allows you to force the writing operations with function 16 (Tag address will then be for example : 40001,W16,10)
Let me know if it works better.

Simon


Hi Simon,
I downloaded the files from ModbusRTU_Compiled.zip (25/04/2018) and I have copied them in the /usr directory of the eWON. After rebooting the ewon I have declared my tags with the new format (ex: 40001,W16,10). But I still can not change the variables of my device. If I change the variable on the device, also change the ewon tag. But if I change the value on the ewon tag, my device doesn't update the new value. (It happens the same as with the previous version)
Is it necessary to do anything else? Thanks.
Reply

simon Offline
eWON Support
#13
Can you set the loglevel to 2, simulate the problem and send me your real time logs (you can download them separately using the link http:/eWONIP/rcgi.bin/ParamForm?AST_Param=$dtRE)?
Reply

Chetan Offline
Junior Member
#14
(24-09-2016, 12:17 PM)simon Wrote: Here is the link to the Modbus RTU Java IOServer : https://developer.ewon.biz/content/add-modbus-rtu

The zip file contains  the source and the compiled files.


If you just want to use it.  Unzip the files and copy the 3 files contained in /dist to the /usr directory of your eWON and then reboot it.
After the reboot, you'll have a new IO Server available named "MB_RTU"

Tell me if you need any help.
Simon

Hi,
I have used the addon in the version 13.0 it works but in the version 8.0 it is not working,is it version related issue?

R,
Chetan.T
Reply

simon Offline
eWON Support
#15
Chetan,

Yes, this is normal. The JAVA IOserver has been implemented after the firmware 8.0 (I will check what version exactly)

Simon
Reply



Possibly Related Threads…
02-04-2020, 09:43 PM
Last Post: mfernquist
  4-20ma - Flexy 202 Started by martinf99
1 Replies - 95 Views
02-03-2020, 05:53 PM
Last Post: ziozetti
30-01-2020, 01:12 PM
Last Post: simon
12-11-2019, 02:52 PM
Last Post: AlexV
07-11-2019, 05:03 PM
Last Post: simon
30-10-2019, 11:01 AM
Last Post: LewisH304
18-10-2019, 09:32 AM
Last Post: simon
  Double Float via Modbus Started by alex barnaba
2 Replies - 2.857 Views
11-10-2019, 09:14 AM
Last Post: Diksha.Saxena
04-10-2019, 09:26 AM
Last Post: djonedd
23-08-2019, 11:56 AM
Last Post: ziozetti



Users browsing this thread:
1 Guest(s)



Theme © Ewon 2019 - Forum software by © MyBB - Cookie policy