LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

modbus RTU via RS485

Hi, I want to control two motor drivers that use Modbus RTU control via RS-485 communication.

 

The drivers are connected in a chain with via Ethernet cables with the computer.

 

The computer acts as a master, the the drivers as slaves, and the drivers are not addressed by IP addresses but via by a device number (which i can set with a switch on the device).

 

What I would like to know is how I can set up this kind of communication and which VIs I have to use.

0 Kudos
Message 1 of 7
(2,188 Views)

Hi GMAch,

 

how do you do Modbus/RTU via RS485 using an Ethernet cable?

 

RS485 is a standard describing a serial port, Modbus/RTU is a protocol using such a serial port.

With "Ethernet cables" you would use Modbus/TCP…

Best regards,
GerdW


using LV2020 on Win8.1+cRIO
0 Kudos
Message 2 of 7
(2,184 Views)

Thats one of my problems.

 

The manual of the driver says clearly Modbus/RTU and RS485 and shows that the connection has to be done via a Ethernet cables (or at least something that looks like an Ethernet cables) and the driver doesn't have any serial ports.

 

The can see the driver (or at least a very similar one) here beginning from page 43.

0 Kudos
Message 3 of 7
(2,162 Views)

Hi GMAch,

 

why do you even think of "Ethernet" when the datasheet clearly mentions RS485?

Just because the connector socket looks similar to the LAN port of your computer?

 

the driver doesn't have any serial ports.

Yes, these are serial ports!

These are RS485 connectors and you need to use them as described in the manual for those devices!

Best regards,
GerdW


using LV2020 on Win8.1+cRIO
0 Kudos
Message 4 of 7
(2,156 Views)

Thanks for the clarification, I was under the impression that the serial RS485 port would look similar to a RS432 port.

 

But how do I include it in labview? Via the usual VIs for serial connection?

 

 

0 Kudos
Message 5 of 7
(2,152 Views)
There are several Modbus-APIs available on ni.com. All use VISA for Modbus/RTU.

Regards, Jens
Kudos are welcome...
0 Kudos
Message 6 of 7
(2,149 Views)

Search the NI website for Modbus Library.  That does all the work for handling the modbus protocol.  They use the NI-VISA VI's under the hood.  Make sure you look at the example VI's within the library so you understand how they are used.

0 Kudos
Message 7 of 7
(2,134 Views)