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.

VeriStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Shared Variables

Hello,

 

Is it possible to use Shared Variables between a Custom Device and VI ran on a pc? And if so, how exactly can you do it?

 

Thanks,

Kevin Key

0 Kudos
Message 1 of 7
(8,129 Views)

This should be possible, but there are some things to consider.

 

The one thing I don't think is possible is for your Custom Device to deploy the variables programmatically. So there are two possibilities I see:

 

1. Deploy the variables on the host and have the Custom Device on the target just connect to them. This, however, requires the host computer to always be running, or at least it requires the target to handle communication errors if the host computer isn't.

 

2. Use the LabVIEW Project to deploy the variables to your target. At this point, I believe you can reinstall NI VeriStand support from MAX and the variables will still be deployed. Then your Custom Device can connect to them.

Jarrod S.
National Instruments
0 Kudos
Message 2 of 7
(8,127 Views)

I don't think this works. From my initial attempts, I deploy the shared variables, reinstall VeriStand, and run the VI on my PC to get the value of the shared variable. When I run the VI on my PC it attempts to redeploy the shared variables and in doing so require me to reinstall VeriStand again.

0 Kudos
Message 3 of 7
(8,124 Views)

In the LV Project Explorer, right click your RT target and select Disable Autodeploy Variables. This should prevent the shared variables from deploying each time you run your VI.

 

 

0 Kudos
Message 4 of 7
(8,104 Views)

Thanks, I've moved on from shared variables and implemented the STM library instead.

0 Kudos
Message 5 of 7
(8,101 Views)

Hi Jarrod,

 

Are Shared Variables only used in Custom Devices ?

I try using them on a lvmodel but it doesn't work.

With the (almost) same code in LV I face no probs.

 

Thanks, BR,

 

Erwan LP

Alstom France

 

0 Kudos
Message 6 of 7
(3,685 Views)

Hi Alstom,

 

I would not expect Shared Variables to work inside of LabVIEW Models. Generally, I would only expect Inports, Outports, and Parameters to be updated and pass information to NI VeriStand. Perhaps, the help documentation below will be helpful.

 

Using LabVIEW VIs as Models: http://zone.ni.com/reference/en-XX/help/372846F-01/veristandmerge/model_from_lv/#prep

 

In the future, I would recommend posting a new thread instead of replying on a thread that is 7 years old. This will get more visibility to the community.

 

Thanks,

 

Andy 

Applications Engineer

National Instruments

0 Kudos
Message 7 of 7
(3,670 Views)