LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus Serial Simulator

Hi All,

 

Am new to labview, I want to create modbus slave simulator. I have connected through serial port to the master and treid to read the holding registers, the VI is executed succesfully but it doesnot show the expected register values read. Can you guide me with any of the examples to create Modbus Slave simulator.

 

Thanks in advance.

SS

0 Kudos
Message 1 of 8
(7,396 Views)

You need to provide your code. There are also several examples if you search for Modbus under NI Example Finder.

0 Kudos
Message 2 of 8
(7,384 Views)

Are you using the MODBUS Library for LabVIEW ?

 

That has VI's for a slave daemon.

 

Otherwise you will need to show us some code and more specific details as to what is working wrong.

Message 3 of 8
(7,377 Views)

Hi All,

 

 

Thanks for your response, Yes I did use some of the VI's from Modbus Library : MB Serial Example Slave VI and MB Serial Example Master VI, but upon modifying registers in slave its not updating on Master. PFA VI's am using. I have cross connected the two ports but still its not updating. Please advice

 

 

 

 

 

 

Thanks,

Savi

Download All
0 Kudos
Message 4 of 8
(7,356 Views)

You can also try out this library:

https://decibel.ni.com/content/docs/DOC-30140

there is a master and a slave example on the palette which will have similar behavior to the examples in the library you're using, but the newer library is more efficient if thats going to be a concern for your application.

 

In either case, the code should work. Are you sure the cable you're using to connect the two ports is a null modem cable?

 

You can also completely emulate the connection using com0com: http://com0com.sourceforge.net/

0 Kudos
Message 5 of 8
(7,344 Views)

Can you attach the code that you are using?

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

I have attached the screenshots of  VI's that I was using from Modbus Library in previous posts, those VI's still don't read or write from slave or Master. But I found another example VI's which works good from Modbus Library.

 

The VI names are MB Serial Exmpale Slave.VI

and MB Serail Master.VI

 

Previously I was trying to run MB Serial Example Slave(legacy). vi

 and MB Serial Example Master (legacy).vi (these still don't read or write the registers from slave or master, and I suppose the issue is with slave demon.vi).

 

Thanks everyone for the help.

 

Am still working on simulating Modbus slave by using these example VI's.

 

 

0 Kudos
Message 7 of 8
(7,293 Views)

The pictures are missing.

0 Kudos
Message 8 of 8
(7,286 Views)