Discussion:
Shared Variable Initialization
(too old to reply)
Mellobuck
2007-04-05 14:10:07 UTC
Permalink
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
Tak321
2008-08-08 20:10:05 UTC
Permalink
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
Jeremy_B
2008-08-11 15:40:04 UTC
Permalink
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.&nbsp; It does sound like it is possible that the shared variables are routing through the other network.&nbsp; You could try disabling that network adapter to be sure.&nbsp; It is also possible to bind shared variables to a specific network card: <a href="http://digital.ni.com/public.nsf/allkb/D358BABAE2F61F1A862571570056867D?OpenDocument" target="_blank">http://digital.ni.com/public.nsf/allkb/D358BABAE2F61F1A862571570056867D?OpenDocument</a>
Tak321
2008-08-13 15:40:08 UTC
Permalink
Hi Jeremy_B,&nbsp;I tried binding the shared variables to&nbsp;the&nbsp;right&nbsp;network card as explained in your link, but the delay's still there. It's about 1-1&frac12;min for&nbsp;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 &quot;autodeploy shared variables&quot; too, I'll do it manually from now on, but it didn't&nbsp;do much&nbsp;for the initialization delay.&nbsp;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&nbsp;clear the question about the data passing through the building network.&nbsp;Any ideas?&nbsp;Tak321
Stephen_S.
2008-08-14 20:40:07 UTC
Permalink
Hi Tak321,&nbsp;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?&nbsp;What version of the Shared Variable Engine do you have? You can check this by going to Tools&gt;&gt;Shared Variable&gt;&gt;Variable Manager. Then Help&gt;&gt;About Variable Manager... to view the version. &nbsp;Regards,Stephen S.
Tak321
2008-08-15 14:40:20 UTC
Permalink
Hi Stephen_S&nbsp;Shared variable engine is 8.2.1. &nbsp;It's not a &quot;VI problem&quot;, it's more of a &quot;project problem&quot;. The project is pretty big so I attach a minimal Project to show the principle.&nbsp;I use network published shared variables because two computers are involved, the PC and the PXI. I don't have other computers to test this.&nbsp;The project is located on the building network (this might be part of the problem?), both computers can access to the project (the exact same file location, there isn't two copies of the project, this might be part of the problem?), they each open the project and execute the proper program (PC program.vi for the PC and PXI program.vi for the PXI so each computer only uses its own library).When the execution starts, each library deploys the network SV it has, it does so only on the computer which executed the program in that library. Now &quot;PXI variable&quot; is deployed on the PXI and &quot;PC variable&quot; is deployed on the PC (and bound to the PXI variable using the PXI IP address through the Cross cable network card).Then, the execution goes on, data is sent from the PXI to the PC. That's how I can describe the attachment. If anything seems wrong in my interpretation, please say so.&nbsp;In the real project, data goes both ways, some variables a written and read on both computers. As I said, about 50 shared variables, with their 50 bound counterpart are involved in this project.&nbsp;Thanks,Tak321


Network published SVs initialization problem.lvproj:
http://forums.ni.com/ni/attachments/ni/170/349588/1/Network published SVs initialization problem.lvproj


PC Library.lvlib:
http://forums.ni.com/ni/attachments/ni/170/349588/2/PC Library.lvlib


PC program.vi:
http://forums.ni.com/ni/attachments/ni/170/349588/3/PC program.vi
Tak321
2008-08-15 14:40:20 UTC
Permalink
..and the other files.


PXI Library.lvlib:
http://forums.ni.com/ni/attachments/ni/170/349589/1/PXI Library.lvlib


PXI program.vi:
http://forums.ni.com/ni/attachments/ni/170/349589/2/PXI program.vi
Continue reading on narkive:
Loading...