LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modbus DSC point not reading correctly

Solved!
Go to solution

   I'm using LV 2013 32bit on W7-64bit.  I'm talking to an industrial controller using Modbus over Ethernet.  My current software uses the DSC modbus interface, in which I define the Modbus bus itself within a library in the project, then define each Modbus point as an address inside that modbus definition.  Inside LabVIEW, you can then get to the Modbus data via Shared Variables.  I am currently using the dynamic shared variable calls, rather than static shared variables.  I have points that are Boolean (coils) and Reals, with some Read Only and some Read/Write.  In general, all of this works.

   However, there is one Read/Write Real that acts funny.  If I set it to a new value or if the industrial controller sets it to a new value, the industrial controller gets the new value.  The shared variable engine on my computer even gets the new value, as can be verified by opening the Distributed System Manager.  But LabVIEW continues to read the old value, with no errors.  Other Read/Write points work fine, and I've looked over the address definition several times and can't find any reason why this point should be any different than the others.

    Does anyone have any ideas why the DSM can see a new value of a shared variable, but LabVIEW continues to get the old value?  I've looked at the init case for the dynamic SV's, and I can't see any options there that I can tweak to try to resolve this.  My next attempt will be to rewrite the entire sub-system so that it uses NI's latest Modbus library and skips the whole DSC thing.  That will probably be much better for other reasons as well.  I've noticed that with DSC and Shared Variables, the first time the program runs it gets started pretty quickly, but subsequent runs can take up to two minutes to connect to all the SV's.

 

Thanks,

   DaveT

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 1 of 4
(3,021 Views)
Solution
Accepted by topic author Dave_Thomson

Never mind.  I think I found the issue.  A minor configuration bug in my own code...

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 2 of 4
(2,973 Views)
Dave,
What was the config error? I have the same setup except for a serial setup. Once a day one of the six controllers "will just check out." Then the next day it and the rest are fine. For a few hours, then a different one will decide to take a vacation. It is maddening.
0 Kudos
Message 3 of 4
(2,808 Views)

Sorry, I can't help you in this case.  The config error was within my own software configuration.  I was just telling it to do the wrong thing.  Nothing that could be useful for anyone else.

I hope you figure out your issue.  I know how maddening that can be.

 

DaveT

-------------------------------------------------------------
David Thomson Original Code Consulting
www.originalcode.com
National Instruments Alliance Program Member
Certified LabVIEW Architect
Certified Embedded Systems Developer
-------------------------------------------------------------
There are 10 kinds of people: those who understand binary, and those who don't.
0 Kudos
Message 4 of 4
(2,803 Views)