LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MODBUS RTU with Comm port Labview Projecy

Hi guys, Thank you for taking time out to look at this. I'll keep it short, trying to a very simple project with Modbus and Labview. I followed the NI tutorial here:http://www.ni.com/tutorial/13911/en/    This tutorial is for Modbus TCP but I adapted to RTU. I am just trying to set up a very simplistic gui as a master to write a bool to a coil, then read that coil value on a slave device. The slave will be physical but for now(testing) I have set up the populare simplymodbus slave gui found here: http://www.simplymodbus.ca/RTUslave.htm

 

I virtually paired comm ports to get my labview project to talk to the simlpy modbus slave VI. It works but I am having some apparent trouble. I think the challenge is fundamental to understanding what exactly is happening. I am able to write to the slave, change the value etc. However the value keeps flip flopping between read and write. For eg. when the VI starts, the first thing it does it READs the value, then writes 0 (bool switch is off). It keeps flip flopping between them until I write a 1. Now it will WRITE a 1 but then go back to READ, then WRITE. I have changed access modes to write accordingly, not sure whats happening. Please check attached screenshots. 

Any help is appreciated. Thanks!Block diagram.pngScreenshot_2.pngScreenshot_3.pngSettings.png

0 Kudos
Message 1 of 3
(1,886 Views)

Attach some VI's.  Your images don't seem to be related to each other.

 

I hope you realized that in your first image, only one of those loops run at a time because you have them in different frames of a flat sequence structure.

 

As for the later images, where did you get that VI from?

 

Your second paragraph, I have no idea what you are trying to tell us as it doesn't seem to correlate with anything in any of your pictures.

0 Kudos
Message 2 of 3
(1,862 Views)

Hi, I am sorry. I read that again and it does seem confusing.

I made that VI myself. If you're asking about the simplymodbus software, it can be found here: http://www.simplymodbus.ca/RTUslave.htm

I am trying to get one loop at a time. If i do a simple while loop like the tutorial suggests, it reads and writes constantly. 

I am trying to do the first frame to write. Then exit the while, and then read in the second frame.
Attaching the project with this one. 

 

 

0 Kudos
Message 3 of 3
(1,853 Views)