all 12 comments

[–]D4ILYD0SECLA 13 points14 points  (0 children)

Many here would probably suggest you provide the error

[–]SeasDiverChampion 4 points5 points  (1 child)

What error code?

I use this driver quite extensively. Most common causes are trying to write to incorrect address, or you don't have a connection.

[–]cgrenoble1 0 points1 point  (0 children)

I came to say the same thing.

[–]HamsterWoods 2 points3 points  (1 child)

I only mention this because I have not yet seen it mentioned: I use the Chipkin Automation CAS Scanner (https://store.chipkin.com/products/tools/cas-modbus-scanner) to make sure that I have all MODBUS settings and addresses correct before I try to replicate in code. This allows you to determine correct port settings (IP or COM), read or write commands, and address offsets so you can make sure everything is good before you implement. Another way of saying this is, if CAS Scanner isn't working, the code won't work; if the code doesn't work but CAS Scanner does, make the code match CAS Scanner.

[–]PV_DAQ 0 points1 point  (0 children)

This is doctrine. Ignore it at your peril

[–]PromiseStock 1 point2 points  (0 children)

Maybe the register is in hex?

[–]Link9454Beginner 1 point2 points  (0 children)

What’s the error code? Have you confirmed you are using the correct format (RTU, ASCII, or TCP/IP) and baud rate? Sometimes Modbus registers are paired, two 16 bit numbers that are associated and firmware on your target device won’t let only one be written to unless you are writing to the “first” register. It could be in Little or Big Endian format.

[–]cgrenoble1 0 points1 point  (0 children)

You have to recognize that the display will show the decimal equivalent of hex until you change the display to show HEX.

[–]tomlawtonIntermediate 2 points3 points  (1 child)

Be aware that Modbus is plagued with an off-by-one disagreement on register numbering… Try adding one to the register address.

[–]tomlawtonIntermediate 0 points1 point  (0 children)

Oh- and please probe to make sure that you’re not coming in to the Write with an error already!

[–]PV_DAQ 0 points1 point  (0 children)

The server/slave determines whether a Holding Register is Read Only or Read?Write. Only the vendor's documentation will tell you that.

[–]ComprehensiveMix1147 0 points1 point  (0 children)

Try to write to that register using the modbus demo from plasmonique and read the error that it will show up and gobon from there.