There are several things that can prevent network-published shared variables from updating on other network machines. Depending on your system (general or real-time), you can choose to follow either set of the troubleshooting steps listed below.
- Make sure that the shared variable is set to Network-Published. To check this right-click on the variable and select Properties.
- If you are shared variables are bound, make sure the path is correct. To check this right-click on the variable, select Properties, and check the Bind to section.
- Make sure that shared variables are initialized sequentially and not in a parallel way.
- Make sure that the library containing the shared variable has been deployed. To check this right-click on the library hosting the shared variable and select one of the deploy options. You can use the Distributed System Manager to check if the variables have been deployed by navigating to Tools >> Distributed System Manager. If you're using LabVIEW 8.5 or earlier, you can use the Variable Manager, which can be accessed by selecting Tools >> Shared Variable >> Variable Manager.
- From the Distributed System Manager, you will be able to check the status of your shared variable. You will also be able to check the timestamp to determine if the variable is being written at the correct times. This can help you determine if a write is failing or if it is being written more often than expected.
- Please note that variables that use the array and cluster data type do not display the values of individual components.
- If your computer is using a firewall make sure you configure it according to the following documentation: Configuring Firewalls and Network Address Translating Routers for Shared Variables. A quick test you can perform is to disable the firewall temporarily to see if this might be the cause of the issue. If you are able to read the shared variables after disabling it, then it means the firewall configuration is blocking them and needs to be configured to allow NI-PSP packets. You can check the status of the firewall by going to the Security Center in Control Panel. For more information on potential firewall problems please see Configuring Software and Hardware Firewalls to Support NI Products. Firewall-related issues would result in Error -1950679034: The shared variable has no value.
- If your antivirus software has a firewall, make sure to disable it or include exceptions there as well.
- Ensure the target you are deploying the variables to has the correct IP address in the LabVIEW project. For example, if you have multiple network interfaces, right-click My Computer >> Properties and ensure the IP address on it is the IP address of the network interface you expect to be using. If it isn't, manually change it to the correct IP address.
- Check to see whether the shared variable is hosted on a computer that is on the same IP subnet. If it is not, you can register the remote computer by going to Tools >> Shared Variable >> Register Computer...
- If there are multiple network cards on the PC attempting to access the shared variable try disabling the network cards not being used. Also, check that the appropriate network card is set as the primary network by referring to How do I Connect to Ethernet Targets with Multiple Network Cards in the Host?
- Ensure the Shared Variable Engine is running. Navigate to Windows Services and check that the NI Variable Engine process is present and running. If it is not present, install the LabVIEW Run-Time. If it is present and not running, right-click the process and start it. To ensure it starts automatically, enter the properties for the services, and ensure the Startup Type is set to Automatic. On the Recovery tab of the service properties, you can also set the Variable Engine to retry on the first, second, and all subsequent attempts if starting the shared variable engine fails.
- Restart your NI Services and restart the NI MAX database.
- Use a LabVIEW shipping example to test the connection between the client and server using the different methods. The example related to NSV can be accessed from Help >> Find Examples... >> Networking >> Shared Variable. Using the example can help narrow down the issue and identify if it is something specific to the code or other settings.
- If the variable value is not updating, displaying incorrect values, or changing its value without command, try recreating the network shared variable with a different name and replacing the original one.
- Remove the VIs that utilize shared variables from your project and restart LabVIEW. Then, proceed to open your project and re-add the VIs.
- If you experience the issue when using the LabVIEW development environment after a software update, repair the LabVIEW installation by following the steps in this article: Repair Software In NI Package Manager (NIPM).
Troubleshooting for a Real-Time (RT) System
- Verify that the dip switches are set correctly on your real-time target. If shared variables work when running from the development environment, but not when setting a startup executable, make sure that the dip switch for No Startup App is switched OFF.
- Ensure the variables are deployed to the real-time system by right-clicking the library and selecting Deploy All.
- Check the DNS IP on the RT target. If this IP is set to something that is not a valid DNS server, the shared variables will update slowly due to DNS timeouts that occur. By changing this entry to 0.0.0.0, the shared variables should update at the appropriate rate.
- Adjust the timing or add a Wait to the Timed Loops that write to the shared variables. If the Timed Loop runs at a high frequency and starves other processes, the variable will seem like it is updating very slowly or not at all.
- If using shared variables with a real-time executable, make sure that no front panel objects are bound to shared variables. Front panel objects are removed when you build a real-time executable, causing the shared variables not to update. If you are intending to deploy your application as an executable, use shared variable nodes on the block diagram.
- If you are trying to read a shared variable from a real-time target, ensure that Variable Client Support has been installed on the target. This can be checked in Measurement & Automation Explorer by expanding the [+] next to the real-time target under Remote Systems and expanding the [+] next to Software. If the shared variable is being hosted by the real-time target, ensure that the Network Variable Engine is installed by using the same method. The Network Variable Engine will not work correctly on FieldPoint 2000, 2010, and 2015 controllers because they do not have sufficient memory.
- If your shared variable lives in the RT target, and you are not able to see the updated value of the variable using your host VI nor the Distributed System Manager, try moving it from the RT target to the Host. A hint could be if you run the Distributed System Manager and the variable is not showing on the host deployed variables and the value is 'No known value'.
- If the variable value is not updating, displaying incorrect values, or changing its value without command, try recreating the variable with a different name and replacing the original one for it.