LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Network shared variables does not update after RT deployment

Solved!
Go to solution

Hardware setup:

  • Windows 10 Laptop running HMI SW in .exe built with LabVIEW 16
  • cRIO-9030 (LV 16 installed) running RT+FPGA built with LabVIEW 16 + RT + FPGA module (both 16)

The SW is pretty standard. The cRIO FPGA acquires the input signal and the RT target does some computation and passes some values to the HMI SW via network shared variables (NSV). The use of HMI is optional for our use case.

Case 1

  • During development I always used the interactive launch of the RT target. The project explorer would connect to the target and everything worked fine. The HMI properly retrieves the value of the NSV.

Case 2

  • During deployment we want for the RT to start up as power goes on. For that we built the project and set it via the project explorer to run at start up. Everything work fine except that some NSV are only updated once.

I tried several built options, updating the cRIO SW, deploying the NSV during the start of windows HMI SW (using the built options in the HMI build specification), but always without success.

Any help would be much appreciated.
Thank you.

0 Kudos
Message 1 of 4
(3,939 Views)
Solution
Accepted by topic author thermaltech

Hi,

 

Thanks for posting on the NI Forum. Even though it might be very generic article, did you go trough this : http://digital.ni.com/public.nsf/allkb/6E37AC5435E44F9F862570D2005FEF25 ?

 

Moroever, how do you deploy your library ? Do you do that manually or programmatically ? What kind of information do you update ? How do you update them ?

 

Could you post a glimpse of your code to check how do you use the NPSV ?

 

Sckanda,

0 Kudos
Message 2 of 4
(3,897 Views)

Is the Shared Variable library hosted on the windows target or the RT one? Typically, you would want the library to be hosted on the RT target so that it is always available to the target even if the windows software/target is not running or disconnected.

 

There is an option in the build specification to include/deploy the shared variable library with the RT Executable - you probably want to select this.

 

Finally - there is a small issue with NSVs that the shared variable engine may not have started by the time your RT executable starts running. You should add some initialisation code to your RT VI which initialises the values of the NSVs and then waits to try and read the values to ensure the shared variable engine is running. Otherwise - you you might get an error out of the NSV node which might be propagating to other parts of your code, causing it to fail (afaik, an NSV node will not return data if there is an error in).

 

There's more information about using NSVs here: http://zone.ni.com/reference/en-XX/help/370622J-01/lvrtbestpractices/rt_bp_svars/


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 3 of 4
(3,894 Views)
Solution
Accepted by topic author thermaltech

I solved the problem. I think it has related to the front panel objects in the RT main code.

From Troubleshooting Network-Published Shared Variables:

"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."

There has some local variables of the front panel objects used to compute the value to send to the shared-variable.

Thank you.

Message 4 of 4
(3,881 Views)