From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ModBus Varibles don't work until over VarMan

Hi everyone,
 
I have a .vi that uses global varibles linked to modbus channels. The .vi wont work untill I open up the Varibles Manager. Once the Varibles Manager is loaded, the .vi starts working. Does anybody have any ideas on why this might work this way and how to correct it so that I don't have to open up the Varibles Manager evertime?
 
Thanks for any input,
Matt
0 Kudos
Message 1 of 4
(2,436 Views)
Hi Matt,

I'm assuming you're working with LabVIEW 8.0, but please correct me if I'm wrong.  Also, it is useful to know how your variables are linked to the Modbus channels.  Are they shared variables with the 'bind to source' option chosen, are they linked on the front panel via DataSocket, etc? 

Typically, we would have a set of shared variables in a project library bound to the ModBus items.  We can set options for the project library containing the variables by right-clicking on the library and choosing the "Autodeploy Variables" option to ensure that you do not have to manually deploy the variables for use in your VI.  Make sure that you have this setting selected for each variable library and that you have all of the shared variables you wish to communicate with included in your project. 
Cheers,

Matt Pollock
National Instruments
0 Kudos
Message 2 of 4
(2,425 Views)

Hi Matt,

Thanks for the info, Yes I'm using Labview 8 and I have linked the varibles using the 'bind to source option' and the Autodeploy is checked. Thats what made it so funny. I'm at a compleate lose here!

Thanks again for the help

Matt

0 Kudos
Message 3 of 4
(2,417 Views)
Matt,

Have you tried waiting about 4-5 seconds after starting the VI before running it again?  Sometimes the modbus I/O server can take a few seconds to deploy before it returns data.  What error is being returned from the variables when it's not working?

Also, if you don't re-deploy the variables, is it still taking a long time to initialize when you run?  I have a feeling the variable manager bit may be just a coinidence and that the real problem is that it takes a while for the variables to deploy.  How many variables are you using?


--Paul Mandeltort
Automotive and Industrial Communications Product Marketing
0 Kudos
Message 4 of 4
(2,408 Views)