Slave device not responding, modbus RTU
I am having a problem with communication to my slave device, I am using the PM860 PLC and my slave device is a ABB circuit breaker equiped with the pr 120/D-M module.
My program should work just fine, im having no errors there, but on the MBread/write block i get error code 30 or 4929 (4929 is timeout, no answer from slave).
At the moment im just trying to read some input registers (function code 04) and my starting adress is 'IW04#30xxx'. But i am having no success, i get the same error codes when i try to write registers 'QX06#40xxx'.
I have checked the settings, and they are the same on both master and slave, poll time is set to zero.
>"My program should work just fine, im having no errors there,"
Then why isnt it working :)
If the poll time is set to zero, then the Modbus device is not "polled" - or checked to see if it is there - by the MBConnect Block. So the MBConnect block is simply telling you that the connection in the PM860 is configured correctly. It is NOT telling you that the complete link to the device is tested and working.
The Status Code -4929 is telling you that the slave is not repsonding at all. If you send the slave a bad address ('IW04#30xxx'.) then it ~should~ respond with an error code. Which means you get a different error code on the MBRead.
So either the slave is ignoring your request for data, ( eg wrong slave identity) or theres a physical fault ( eg broken cable ). Firstly check the send / receive lights on the AC800M serial port. Re-check all your settings like slave identity, adresses, speed, parity, baud rate etc. Check the configuration of the cable ( or use the AC800M programming cable ).
If you dont find anything obvious, then check the messages by connecting the PLC to your PC serial port and using Hyperterm (http://digitizor.com/2009/08/29/install-winxp-hyperterminal-client-on-windows-v
ista-or-windows-7-free/) or puTTY (http://www.putty.org/) to look at the messages you receive from the PM860 - or you can use a modbus test client. You should see the PM860 sending requests to the slave.
If you understand the modbus message protocol you can also send Modbus requests to the slave using Hyperterm or PuTTY, but its obviously much easier to use a modbus tester. (use google and choose your favourite )
Thanks for you reply Denis.
The good news is that i have managed to connect to my slave device in 2 different ways, using software from my computer and using a modbus library on my arduino uno card.
Bad news is im still not able to communicate with my controller, and i think it is the adressing and the data fields in control builder that is causing the trouble, the LED for TX on the controller is blinking, but there is no response from the slave, still have the same error code 4929 (timout no response from slave)
If i understand it correctly it is the "%QX", "%IW" etc that is the reference to the function code? What i dont understand is the number that follows it, i see in the picture you posted in table 24 it says %IX10#64, so that means it is %read input status (FC2) and behind the #is the relative adress of the register, in this case 64.
The RD input on the MB read function block is the where the data returned from the slave device is read, here i need to make sure the variable connected to it has the same data type as in the register?
So if i want to read register 717, number of days from 1999, it will be "%IW10#718"?
The variable connecte to the RD input will be the data returned?
Well ive tried using a sofware called "Modscan" and succesfully connected with my slave device, but no luck getting it to communicate with my PLC.
At the moment when i try to run my program i either get status code 30 on the MBRead block and no RX LED flashing on com 3 port, or status code 4929 Timeout, no answer from slave and the LED at RX on com port 3 is flashing.
This is the register for reading the value of "seconds" on the internal clock of the slave device, and i can see it updating when im reading cyclicly.
I have tried multiple different start adresses in control builder 'QW10#103' / 'MW10#103' / 'IW10#103', but still no response or indication on the LED lamps on my slave device that it is even receiving anything at all.
As you can see i am using a single control module for my program in control builder, with only parameters and variables within that program, i have no global variables connected to the program, could it be that it is something like this that is causing the problem?
I am having trouble finding any usefull information about my problem, so any information at all that might help me at this stage is appreciated.
IW, QW etc are adresses only, and not function codes. The Modbus serial interface decides which function code to use depending on the adress you are reading/writing and the number of addresses You want to read.
I = Input - read only
Q = Output - read/write
W = word
X = Byte
10# = address is in base 10 (decimal)
16# = address is in base 16 (hex)
xxxx = small adress model. 0001, 1001, 3001, 4001
xxxxx = large adress model 00001, 10001, 30001, 40001
In addition, the first digit of the address also tells the interface what sort of data to read / write. 0 and 1 are booleans, 3 and 4 are integers. 0 and 4 are read / write addresses, 1 and 3 are read only registers.
If you disable polling and no LEDs flash on the AC800 then something is wrong in your configuration and the AC800 never requests data from the PLC at all.
If polling is enabled, then the transmit LED will flash every poll cycle and the PLC should respond. If you see a recieve light on the aC800 but the connection still shows an error status, then the PLC responded with an exception code. Which means something on the poll rquest was bad. The poll request is really simple - basically a function code 8 plus the slave address. But the baud rate, parity, char len, stop bits etc must all be set correctly. Check also you are not confusing Modbus RTU ( binary messages ) and Modbus ASCII ( ascii character mesages ).
Since you say your PLC supports the Poll request then concentrate on getting this to work. Does your copy of Modscan work in slave mode ? If so, use it to simulate your PLC and see what messages the AC800 is sending. Modscan may also be able to sniff the messages so yo can see comms in both directions.
Modbus messages really are very simple. Google a description of the modbus protocol, sniff the messages and you should very quickly see what is wrong.
I have now tried with software to setup a modbus slave on my PC, and with a fluke 125 wich can read modbus signals. And it seems as if there is no data coming out of the PLC even though the LED for TX is blinking. (I tried the fluke 125 also connected to my PC while running Modbus master software, can i could see that i had signal out so i know the fluke125 works, and that it reads signals).
I could try getting a CI853 module and see if it works with that, but i find it strange that there seems to be no data coming out of TX on COM3 on the PM860 even though the LED is blinking.
I have followed a step by step guide on how to make the program, i used the same variables, same data types same function blocks, still no results.
I am realy running out of options, i was hoping there was just something with my adressing syntax that caused the problem, but i should atleast notice some data traffic regardless of a wrong adressing syntax.