Switch to desktop version  
Poll multiple serial Modbus networks with a Flexy. - Printable Version

+- Ewon Technical Forum (https://techforum.ewon.biz)
+-- Forum: Development (https://techforum.ewon.biz/forum-50.html)
+--- Forum: Ewon Embedded Technology (https://techforum.ewon.biz/forum-51.html)
+---- Forum: Field Data Acquisition (https://techforum.ewon.biz/forum-2.html)
+---- Thread: Poll multiple serial Modbus networks with a Flexy. (/thread-82.html)



Poll multiple serial Modbus networks with a Flexy. - FromTicket - 23-05-2016

Hi,

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


RE: Poll multiple serial Modbus networks with a Flexy. - simon - 23-05-2016

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.


RE: Poll multiple serial Modbus networks with a Flexy. - polishglider - 01-06-2016

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 !!


RE: Poll multiple serial Modbus networks with a Flexy. - simon - 24-09-2016

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


RE: Poll multiple serial Modbus networks with a Flexy. - udayakumar - 07-01-2017

Hi simon,

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


RE: Poll multiple serial Modbus networks with a Flexy. - simo - 24-04-2018

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.


RE: Poll multiple serial Modbus networks with a Flexy. - simon - 24-04-2018

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


RE: Poll multiple serial Modbus networks with a Flexy. - simo - 24-04-2018

(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.


RE: Poll multiple serial Modbus networks with a Flexy. - simon - 24-04-2018

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... ;-)


RE: Poll multiple serial Modbus networks with a Flexy. - simo - 24-04-2018

(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


RE: Poll multiple serial Modbus networks with a Flexy. - simon - 25-04-2018

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


RE: Poll multiple serial Modbus networks with a Flexy. - simo - 25-04-2018

(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.


RE: Poll multiple serial Modbus networks with a Flexy. - simon - 26-04-2018

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)?


RE: Poll multiple serial Modbus networks with a Flexy. - Chetan - 03-02-2019

(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


RE: Poll multiple serial Modbus networks with a Flexy. - simon - 04-02-2019

Chetan,

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

Simon