Modbus RTU Writing Multiple Registers CCW

Relay0828

Member
Join Date
Feb 2023
Location
Ohio
Posts
3
Platform: CCW, 2080-LC50-24QBB, Using 2080-SERIALISOL card

Task: Writing Multiple Registers Using Modbus RTU (RS485)
Problem:


I am attempting to read and write to a Gefran GFX4 heat controller using Modbus RTU in CCW. I am currently able to read multiple holding registers without any problem. I have my addresses, and my slave ID correct, but I keep getting error 137 within the Modbus command (A non-standard reply). I had this issue when I did not have the read statement correctly set up and I can not figure out what I am doing wrong with the write statement. I am able to use CAS Modbus Scanner on my PC to write to the device and then read the changed address back to verify that it isn't a problem with the GFX4 controller.



Here are all of the parameters for how I set my Modbus write statement up:


LOCAL_CFG.Channel: 6 (slot 2 on the 850 for the serial card)
LOCAL_CFG.TriggerType: 1
LOCAL_CFG.Cmd: 16 (write multiple registers [4XXXX])
LOCAL_CFG.ElementCnt: 2


TARGET_CFG.Addr: 1040
TARGET_CFG.Node: 1


LOCAL_ADDR[1]: 100
LOCAL_ADDR[2]: 0
The rest of the array has all 0s.


The Gefran GFX4 unit works over standard Modbus, and I believe that the issue is something I am doing wrong with my Modbus messaging statement (or CCW in general). If I can use a different program to write successfully, then the problem has to be here. Any help on Modbus would be appreciated as well. Thank you.
 
never touched CCW, but is something like hex vs decimal, for instance "write multiple registers" should 10 (hex) instead of 16 decimal? Or the 1040 address should be the opposite of whatever it is?
 
Check your serial port settings and make sure you’re set to Modbus RTU driver and baud rate, parity, master, and various media settings are correct.

Another possibility is you might have to change the target address by one. Some devices use 1040 as 41040. Some devices use that as an offset from 1, so 1040 would reach 41041 or 40139 depending on the devices used.
 
The issue was that I was writing to an address that could not be written to. I didn't know that you can't write to an address even when there isn't anything actually being sent to the address that can't be written to. You can read addresses that do not have anything there, but can not write to them. My write statement included an address that could not be written to, so I have to be careful in what I write to, but can read anything I want without an issue.
 
You can read addresses that do not have anything there, but can not write to them.
Frequently, but not always. Depends on the sophistication of the server/slave. Every Modbus implementation is its own 'work'.
 

Similar Topics

Dear All, i am trying to connect Danfoss inverter with s7 200 cpu 226.but microwin shows following error at DATA Ptr.i assigned different VB...
Replies
1
Views
48
I'm trying to control a device via MODBUS RTU and the ModbusRtuMasterV2_PcCOM in Twincat 3. I've configured a device with the right com port and...
Replies
7
Views
223
Hi all, Currently having trouble getting a speed reference to write over modbus to an Omron M1... I can successfully write a run command and...
Replies
6
Views
259
Hi, I'm having an issue with a mircologix not transmitting out. The current setup is a mircologix 1400 connected to a Guardian 100 Radio...
Replies
1
Views
116
If a device has Modbus RTU over serial and Modbus RTO over TCP and Modbus TCP then there is a difference between Modbus RTU over TCP vs Modbus TCP...
Replies
7
Views
500
Back
Top Bottom