LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus RTU problems

Solved!
Go to solution

Hi,

 

I try to communicate with a stepper motor controller via RS485. The device is functional for sure because it was shipped with an app which can operate the device. Whenever I change a setting in this software it displays the bus communication at the bottom of the app:

1984_1-1691570856743.png

 

 

If I use simple VISA serial nodes and send out the same message what I see in the TX line, then I receive the same response with labview as what I receive in the app, so I certainly can communicate with the controller.

 

I dont necessarily want to write my own modbus driver though so I wanted to use what comes with (I guess) the NI-RT module. I couldnt make it work though and I'm wondering if I made a mistake, or if there is some sort of a hidden knowledge what I dont know about. 

 

I assume the VI below should receive a similar response than what I see in the app:

 

modbus_snippet.png

 

Instead: the VI finishes without an error. It returns an array with only zeros. Also from this point I can't connect to the device via the application because it says the serial port is busy. I need to run a VISA close VI first, so the VI shown in the snippet actually doesnt close the serial port. I have tried to read the individual coils, tried to read different addresses, and did some other experiments, but all of them has the same result: no response at all from the device.

 

Pls let me know if you have any ideas.

Thx!

 

 

0 Kudos
Message 1 of 3
(488 Views)
Solution
Accepted by topic author 1984

You need to create a master. The master initiates communication and the slave responds.

Message 2 of 3
(483 Views)

Oh shoot... that, plus I had to set the parity to "none" instead of the default "even".

 

Thanks mate 🙂

0 Kudos
Message 3 of 3
(466 Views)