LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Communication with Modbus RTU and Modbus over TCP

Solved!
Go to solution

Dear All,

a frequency inverter (Hitachi WJ200) is using a Modbus RTU Protocol on RS485. I want to use LabVIEW, running on a computer to communicate with the Inverter. The only way to communicate with the computer is Ethernet, so I bought an Ethernet to RS485 converter (ExpertDAQ EX9133C-RS485). The TCP connection to the converter works fine.

 

I use the "ni lib modbus library 1.1.5.38" for communication with Modbus.

 

I have a questions about:

1. How do I set the adress of the Modbus RTU (RS485) slave?

2. How can I read/write to the slave: I used several Modbus-functions on LabVIEW, but there was allways a time-out-error.

 

Thanks and Regards

0 Kudos
Message 1 of 8
(8,025 Views)
Solution
Accepted by topic author googler

Hi, firstly, have you instyalled the virtual Com port driver for Windows and checked this port appears in Device Manager?  Here you could also set the baud rate, just in case it is not set properly from VISA (i doubt this is a problem but it will do no harm).

You can set the modbus address from the modbus Initialise VI (new serial master), it is the Unit ID input.  Make sure you select Modbus RTU and the correct baud rate.

Modbus registers are sometimes 1 based and sometimes zero based, in addition to that LabVIEW wants each register group address to start at zero.  For some devices and registers I have to subtract 40001 from the specified address to get the address LabVIEW is expecting. IN this case 40000 is the offset of Holding Registers and the device uses 1 based addressing.

I hope that helps,

Michael.

 

 

0 Kudos
Message 2 of 8
(8,006 Views)

Hello, thank you for your help

The solution was, to set up the right Unit ID to the new seiral master and using the right protocol.

Thank you for your additional help about changing the offset of the Holding Registers. In my case, there is no need of changing.

0 Kudos
Message 3 of 8
(7,963 Views)

Hi googler.

 

I must work with a WJ200 Inverter too for one of my project. I have some bad issues with the download of the drivers from the Hitachi website.Have you some tips for helping me to download the right driver.

 

Moreover, can you share some exemple for the monitoring of the WJ200?

 

REally thank you.

 

Kind Regards

Gwendal Beauvois, PhD.
Développeur moyens d'essai
gwendal.beauvois@gmail.com
0 Kudos
Message 4 of 8
(6,779 Views)

Hello,

 

I did not use the direkt communication with the WJ200. I used a converter from RS485 to Ethernet from admost, so i could communicate through Modbus TCP/IP.

 

I made an LIB for my case (Modbus TCP/IP), maybe this could help you. I programmed in German, so there may be translation issues, some of the functions are described in the manual of the inverter.

The Programm is made in LV16, downgraded to LV15.

 

Hope, that this could help

0 Kudos
Message 5 of 8
(6,759 Views)

Hello my friend. Thank you very much for your exemple, i will work on it the next week.

 

For the moment, i try to use a converter too (ES-320 from Brainboxes). Its a Ethernet (PC Side) to RS485 (Half, WJ side). But when i connect the pin 1 and 2 from the converter to the slot SP SN respectively, i cannot see the WJ from my computer, even using Boost.LAN Manager sotware. Have u proceed to a specific protocol to succed a link from the computer to the WJ?

 

Thank you for all

Gwendal Beauvois, PhD.
Développeur moyens d'essai
gwendal.beauvois@gmail.com
0 Kudos
Message 6 of 8
(6,736 Views)

Hello,

 

I append a screenshot of my configuration of the converter, so you can try the values.

The other point, is to configure the WJ200 with the parameters for communication via Modbus RTU.

In the manual of the inverter is a topic about the parameters about communication with Modbus RTU to get the right parameters.

 

Kind regards

0 Kudos
Message 7 of 8
(6,713 Views)

Dear friend

Your message gave me some hope. I have almost same problem, I have power meter which have modbus rs485 protocol and I want it to communicate via Ethernet so I bought rs485 to Ethernet converter. I set all communication setting of converter as set in power meter like, baud rate, data bit, stop bit etc, the connection is like that power meter rs485 port connect with converter rs485 port and Ethernet port of converter connect to my laptop. 

I tried to communicate using Labview modbus library and also using modbus I/O server but not get success. 

 

May you please help me for this. 

Waiting for your response.

 

Thanks

Asif

0 Kudos
Message 8 of 8
(5,573 Views)