A Bit Stuck on Writing Multiple MODBUS Registers
-
Hi Dan
Regarding the address, I think you are correct. Well since other address work you are correct. If 4104 is not working I would try 4103.
I think @MattFox is correct regarding the ones's compliment that needs to be written to address 9. I get a different number tho.
-
I think your answer is right here craig, something is amiss with how I did it, but looking at it now, I think we're all starting to break the back of it.
-
Hey Guys, thanks again for helping out. That's a big number. I'll give that one a go, I'll try it into 4104 and 4103.
Cheers
Dan -
Interestingly I get a timeout message if I try writing the whole decimal number to either data point register.
If I change back to a hex value it just comes up with the top blue error again.
-
although might actually currently be a timeout in the network, as it's on the top of a mountain in NZ. at the end of a Mimomax link :/
I do believe it's snowing up there currently.. -
Bugga, still same timeout message when network is responding better.
com.serotonin.modbus4j.exception.ModbusTransportException: java.net.SocketTimeoutException: connect timed out
If I interrogate a standard read point it works fine.
-
although might actually currently be a timeout in the network, as it's on the top of a mountain in NZ. at the end of a Mimomax link :/
I do believe it's snowing up there currently..@dan Sounds like I need to make a roadtrip! Haha
-
With a bloody big hammer.
-
Seems like perfect troubleshooting conditions :)
ye so basically no response from the command. Only thing I can suggest is checking if the actual number is causing the "no response" by sending a different digit. is the modbus request going over the network or do you have a local mango instance there ? -
Yeh the Mango instance is a few hundred ms away. It seems to work fine reading in voltages and RPM's and the like. Just been playing up a little today probably due to the weather.
Even when it was working fine the write function still didn't seem to be the correct syntax. -
If I was troubleshooting I would create data points instead of using the modbus tool. It looks like you are using quite an old version of mango and I have had issues with the modbus tool in older versions. I think it would be worth cancelling that out of the troubleshooting.
-
OK, thanks Craig. I have a data point I made earlier which I will go back to and see what it does.
Thanks -
So I emailed DSE from their website contact form for shits and giggles, not really expecting to hear back... A nice fella from the UK emailed back almost immediately with all the official docs on the thing. I thought that was awesome.. Anyway, here's a more explanatory version of what I had found originally...
So looking at that, I should be sending 35702 to 4104 and 29833 to 4105
:)
I'll give that a go.. -
I may be wrong here but I am pretty sure that the only way that mango will write them in the same command is if you use 1 x 4-byte data point.
-
ok sweet as, thanks for that I'll give it a go
-
You should capture the command with Wireshark and see if it matches what you are expecting.
-
I tried a little bit of script magic to see if it would do it at the same time, but I think still not quick enough..
I guess I need to combine the two 16 bit values into one 32 bit value, then write that to the single register, which should extend to the second yeh?
-
exactly