Write successive registers in Modbus in one Modbus exchange - 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: Write successive registers in Modbus in one Modbus exchange (/thread-324.html) |
Write successive registers in Modbus in one Modbus exchange - simon - 06-06-2017 Hi if you want to specifically write 6 successive registers in Modbus, you can only do it by using BASIC scripting. Indeed if you try to do it by simply writing values into Modbus Tags as quick as possible (through BASIC, OPCUA,...), the eWON will perform the writings one by one. Here is an example using the BASIC functions IOSend/IORcv to trigger a modbus writing to multiple sucessive registers (here 6 registers) : Code: Write6Regiter: RE: Write successive registers in Modbus in one Modbus exchange - insyncs - 10-06-2017 Hi Simon, Thanks that will be useful. Can flexy read multiple registers into an array, can't find info in the manuals? Cheers Marcus RE: Write successive registers in Modbus in one Modbus exchange - insyncs - 11-06-2018 Hi Simon, Can this be adapted to read data from a RTU slave using the serial port, then write to another slave device via the same serial port ? Cheers M RE: Write successive registers in Modbus in one Modbus exchange - simon - 15-06-2018 Marcus, 1. I guess you mean reading multiple register by bloc ? Yes, eWON does that automatically (Default 10 registers in a bloc) and you can customize it using the advanced parameter "MaxDeltaRagX" where X must be replaced by the topic letter. 2. Yes you can do that. Just define the Tags for reading and then adapt the script (replace the 65535 by the Tag value) to write all the Tags in once in the other slave. RE: Write successive registers in Modbus in one Modbus exchange - lgn@ltr@n - 06-11-2018 Hi, Is it possible to write several holding registers, followed by a coil write (in this order), in JAVA, while still using integrated ModBus IO/server for other various reads ? Other option, I only need to ensure the holding registers are written to ModBus slave before trying to write to coil, how long shall I wait before writing to coil, using the ModBus IO server tags ? In other words, how often the IoServer/Modbus agent process the write requests ? Is this somehow linked to the Modbus polling frequency ? Rgds Laurent RE: Write successive registers in Modbus in one Modbus exchange - simon - 07-11-2018 Laurent, Write operation are executed spontaneously when you update the Tag, independently of the polling cycle. So if you do : HoldingTag1 = 123 HoldingTag4 = 1234 CoilTag1 = 1 The write requests will then be processed in the same order. Simon |