LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus RTU Slave

Solved!
Go to solution

Hi, I'm doing my first project with Labview. I need a simple example in which the Labview project is the slave of the Modbus RTU communication. My custom board is the master. Thank you.

0 Kudos
Message 1 of 7
(1,554 Views)

in the Modbus NI VIPM package there is an example :

Walker34_0-1706026806410.png

 

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

It is a TCP example. I changed from New TCP Slave to New Serial Slave and completed the connections to this block. Are there other modifications that I need to do? Thanks  

0 Kudos
Message 3 of 7
(1,459 Views)

Or does anyone know if there is an example of Modbus Slave RTU? 

I already have a project of a Master RTU software that I could use to test the Slave RTU.

0 Kudos
Message 4 of 7
(1,418 Views)
Solution
Accepted by topic author V.Life

 

In the slave example, just replace 'Create TCP Slave' by 'Create Serial Slave' in the polymorphic selector.

 

Walker34_1-1706172831577.png

 

You have now to set a few Serial options.

 Don't forget Unit ID (Serial adress).

Walker34_2-1706172906450.png

 

 

 

0 Kudos
Message 5 of 7
(1,380 Views)

Thanks. That's what I already did. The scope of the Slave RTU for my project is to receive write register command from the Master (and then save data on the Slave) and receive read register command from the Master (and then the Slave has to transmit to the Master the response message with the requested data). So many of the elements in the front panel are not necessary now.

When I execute the program I get the error 56 @RTU Data Unit.lvclass: Read ADU Packet.vi 5030001

 

 

 

0 Kudos
Message 6 of 7
(1,366 Views)

I solved by making a new project from zero. Thanks

0 Kudos
Message 7 of 7
(1,341 Views)