LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Shared Variable Initialization

For whatever reason if I use shared network variables over the network they take 20 seconds each to initialize... after all of them initialize they are very fast.  Does anyone know why it would take exactly 20 seconds for this to occur?  If i look at the variables in variable manager i can see the update values and they are exactly 20 seconds apart.  This occurs weather i'm using a library with 20 variables or one with only 1 variable. 
0 Kudos
Message 1 of 12
(4,455 Views)

Zorro, does this delay occur when you start/deploy the program? What you might be seeing is the delay as the variable library is deployed. Communication delays between different modules on a network can slow this deployment down (I personally saw it very slow on a PC to Fieldpoint connection with a bad network). If it is critical to your application to have access to the Shared variables immediately on startup, you can have an initialize case where you can deploy the variabled explicitly using an invoke node, rather than waiting on the auto-deploy from the project, and then start the main case of your VI.

-Mello


Data Science Automation

CTA, CLA, CLED
SHAZAM!
0 Kudos
Message 2 of 12
(4,446 Views)
I am explicitly deploying from the invoke node.  It's a really odd problem.  It takes 20 seconds for it to start updating any variable.  If I stop the Vi that reads the variable, it takes 20 seconds for that computer to start reading the variable again while looking at the variable manager.  I just don't understand what could be causing this.
0 Kudos
Message 3 of 12
(4,426 Views)
Hi zorro349,

This may be a long shot, but I have heard of something similar happening due to the fact that the gateway was not specified correctly. Can you please confirm if this setting is set appropriately? Thanks!

Best regards

Steven
Message 4 of 12
(4,399 Views)
These computers were at one point on a network with a gateway.  Now they are just on a switch with no gateway to the outside world.  Should I set all the gateways and DNS servers to blank in the network configuration?
0 Kudos
Message 5 of 12
(4,390 Views)
This was the problem.  At one point I had these computers on our network and they still had the gateway address in there.  Now everything is working great.  Thank you.
0 Kudos
Message 6 of 12
(4,387 Views)
I have the same problem. I'm happy to know someone has found a solution for it. My problem is that I don't know much about network stuff so the solution given isn't complete to me. How do I change a gateway address? What should I change it to?
 
My SVs are written and read by two computers, directly connected by a cross Ethernet cable. They are also part of the building network through some other network wiring. Is it possible that my problem would be that the two computers are communicating through the big network and not the cross cable?
 
Thanks for your help
0 Kudos
Message 7 of 12
(3,861 Views)
Hi Tak321,

You can change the gateway address in the network properties on Windows (if that is the operating system you are using), however, doing so could disrupt your communications to your building network.  It does sound like it is possible that the shared variables are routing through the other network.  You could try disabling that network adapter to be sure.  It is also possible to bind shared variables to a specific network card: http://digital.ni.com/public.nsf/allkb/D358BABAE2F61F1A862571570056867D?OpenDocument
Regards,

Jeremy_B

Applications Engineer
National Instruments
0 Kudos
Message 8 of 12
(3,824 Views)

Hi Jeremy_B,

 

I tried binding the shared variables to the right network card as explained in your link, but the delay's still there. It's about 1-1½min for 50 shared variables on the first computer, with their 50 bound counterpart on the other computer. I may have just too many shared variables for the startup to be fast, it's a pretty big project. I have disabled the "autodeploy shared variables" too, I'll do it manually from now on, but it didn't do much for the initialization delay.

 

Usually, I can't disable the building network for security purposes. I'll check if it would be possible to make an exception for the test. It would clear the question about the data passing through the building network.

 

Any ideas?

 

Tak321

0 Kudos
Message 9 of 12
(3,799 Views)

Hi Tak321,

 

Can you post your VI? That might make it easier to reproduce the problem. Also do you have another computer on or off your building network that you could run this VI on to check this behavior against?

 

What version of the Shared Variable Engine do you have? You can check this by going to Tools>>Shared Variable>>Variable Manager. Then Help>>About Variable Manager... to view the version.

 

Regards,

Stephen S.

National Instruments
Applications Engineering
0 Kudos
Message 10 of 12
(3,776 Views)