LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HELP:Reading Modbus Registers using Shared Variables Library

Solved!
Go to solution

Background

2017sp1 LabVIEW 32bit,DSC, Windows 10

LabVIEW VI (Master)

2 Acromag ES2153 I/O units (Slave)

8 sensors.

 

Good Morning NI Forum Boards, 

This website has been especially helpful for me in learning a new programming language. I have been lurking on the forums for a while now and I have an issue. I am writing a VI which acts as the Master and queries information from two slave devices (Acromag ES2153 I/O unit) over modbus TCP in the field.

 

The VI is pretty straightforward it reads the slave's device holding register values using shared variable library and displays the values on an indicator on the front panel. However, when I generate a signal on my device in the field the indicators on my front panel display 0. I am sure that my addresses are set up correctly because in the NI distributed systems manager I notice that when there is fluctuating values on each channel. Which means that the Modbus registers are being read by the program. When I apply a 4-20mA signal to the input of my Acromag I/O unit, I see changes in the value. For example, in the screen shot below I apply a signal at 12mA and 20mA which corresponds to the value 14977 and 29969 respectively.  Not sure why it’s not displaying. I have attached my entire project and my VI. Thank you for all your help!

 

-Paul

Download All
0 Kudos
Message 1 of 4
(2,184 Views)

Put probes or indicators on your error wires.  Perhaps there is an error being generated when you do the read and that is why you are getting a zero.

 

Be consistent in you numerics.  Some graphs are orange double floating point.  Others are blue I16's.  It seems they should all be the same.

 

Your last two frames of the sequence, close connection and undeploy libraries will never run.  Because you have an infinite while loop, the only way to stop your VI is to hit the abort button.  If you had a Stop button on your front panel to stop that loop, then the last two frames will get a chance to execute.

0 Kudos
Message 2 of 4
(2,157 Views)
Solution
Accepted by topic author 2011TRDTXpro4WD

Hey RavensFan, Thanks for the insight, and good catch with the numerics. Since changing them I am getting an error 7 with probes. The error message is posted below including a screenshot. I can't seem to figure out whats going on. Thank for replying and helping me out, Ravens played heck of a game against the Patriots!

 

Error 7 occurred at Invoke Node in PRC_Deploy.vi->NI_DSC.lvlib:Deploy Library.vi->IHF_CMS_Master.vi

Possible reason(s):

LabVIEW: File not found. The file might be in a different location or deleted. Use the command prompt or the file explorer to verify that the path is correct.
=========================
Nonexistent GPIB interface.

Method Name: Library:Deploy Library

Message 3 of 4
(2,050 Views)

Put a probe or indicator on the path wire going into Deploy Libraries.  Apparently the library isn't located on disk where you are saying it is.

 

(And that game against the Patriots was a lot of fun to be at!  😄)

0 Kudos
Message 4 of 4
(2,039 Views)