LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview MODBUS modules problem

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!

0 Kudos
Message 1 of 3
(2,345 Views)

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.

0 Kudos
Message 2 of 3
(2,340 Views)

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.

0 Kudos
Message 3 of 3
(2,329 Views)