06-17-2011 09:48 AM
Hello I am trying to use to LabView ModBus VIs to access data from a modbus slave over TCP, but I am having difficulties. The slave I have has an assigned device ID as 1 and I am trying to read register 400001 and the preceeding 36 registers. I am admittedly new to the ModBus protocol and not sure if I entered the parameters correctly for the VI I am using. I was also wondering would it just be easier if I just use TCP write and TCP Read instead of the ModBus VIs?
Any help is appreciated!
06-17-2011 10:16 AM
No, your parameters are incorrect. The '4' prefix is assigned when you select the Read Holding Registers instance so you just place the start of the addresses (i.e. 1 in your case) and then the number of addresses to read.
06-17-2011 01:22 PM
Ok Thanks I see my error there after re-reading the documentation on ModBus. Now I am still having trouble with the VI though. It keeps returning error code 56 when I try to run the VI. It's beginning to make me think I may have issue elsewhere. I have been using a ModBus utility (Simply ModBus) and it's returning sensible data when I try reading the register, but I can't get it to work in LabView.
I have assigned the slave with a slave ID of 1 so I opened the MB Ethernet Master Query VI and changed the Unit ID to 1 in MBAP Header. I believe this is correct, but I want to double check.