Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Shared variable not getting updated in host VI

Solved!
Go to solution

Hi all 

 

I recently purchased a myRIO board and have started working with it. I would like to use shared variable for getting the loop rates while porting my labview code later. However, I am not able to use the shared variable feature at all, even for a simple code. I created a shared variable in the host pc, and used it in both RT and host VI. I assume that when I run the RT VI and the host VI, the value given to the variable from the RT VI should be displayed in the host VI. However, this is not happening. The indicator at the host VI remains to be zero itself. I went through all the related myRIO threads, but could not get any guidance. Thanks in advance.

 

Arya

Download All
0 Kudos
Message 1 of 6
(9,081 Views)

Hey arya1,

 

For troubleshooting purposes can you try hosting the shared variable on the target (myRIO).  Make sure that you deploy the variable after you move it to the myRIO context in the LabVIEW Project (just right click >>deploy all on the shared variable under the myRIO).

 

Try running your code again and let us know if that works.

 

-Sam K

LabVIEW Hacker

Join / Follow the LabVIEW Hacker Group on google+

 

0 Kudos
Message 2 of 6
(9,078 Views)

Hi Sam

 

I had already tried that. I tried it again, after restarting, but it is not getting updated. I wonder if it is due to some missing installation. The myRIO has network variable engine and network streams installed. Is there anything else that is required? When I open the NI distributed system manager, the library name is given there, under myRIO, but not the variable name.

 

My system runs on Windows 8, I made sure that all the NI apps are allowed by firewall. I even tried turning the firewall off, but of no use.

 

Arya

0 Kudos
Message 3 of 6
(9,066 Views)

Another update:

 

My single process shared variable works on the target VI. It is the network published that is creating the problem, but the network published variable correctly identifies its callers when the 'find callers' option is selected.

0 Kudos
Message 4 of 6
(9,061 Views)
Solution
Accepted by topic author arya1

Hi Sam

 

The program works now. I find it strange because I had not done even a single modification on my system, not even a reboot. All I did was opening and running the shared variable example shipped with labview. It worked well, then I tried my code again, and it also started updating the loop counts. Quite strange!! Thanks for the reply.

 

Arya

0 Kudos
Message 5 of 6
(9,054 Views)

i had the same issue. Shared variables in a VI on my cRIO9075 were not updating. I tried stopping and starting the Shared variable engine in the distributed system manger, rebooting, recreating the VI. These did not work. i got it to work on another computer. Then it magically worked on my laptop. The next morning it did not work on my laptop. i spent 2 hrs today & got it to work after relocating the network published shared variable from a PC-hosted .lvlib to a cRIO hosted .lvlib. 

0 Kudos
Message 6 of 6
(6,698 Views)