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.

Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Shared Variable between PC and myRIO

Solved!
Go to solution

Hi All,

 

I have a shared variable generated on a PC VI and I want to read this variable on a myRIO VI. I've simplified it down to a simple random number generator on my PC which updates every 1 second and writes to a shared variable node. I then have a random number receiver (shared variable read node) on my myRIO which should read this varable as it updates. However when I run both VIs the random number receiver on the myRIO does not update from a 0 value. Any thoughts on how to troubleshoot this problem?

 

The issue only seems to be happening when I try and share a variable between the PC and the myRIO. If I have the random number generator and receiver communicating through shared variable nodes on the same hardware, for instance both on the PC or both on the myRIO the shared variable is transmitted and updated perfectly. I have also made sure that the shared variable engine is installed on my myRIO and the variable is set to network published.

 

I've attached some screenshots of the block dagram and I am happy to upload the VIs if that makes it easier for you guys.

 

Thanks in advance!

 

Ben

0 Kudos
Message 1 of 8
(9,950 Views)

Hi Ben,

 

Did you definitely deploy the variable? If you haven't make sure that you right click on the library (Random Number.lvlib) and select deploy all. This will push the variable to the network. If you have already done this and it still is not working I would try putting code on the myRIO that checks if the value is 0 and if it isn't turns on a user LED so you can be sure that it is not working.

 

Hopefully this helps!

Scott B.
AE NI
0 Kudos
Message 2 of 8
(9,927 Views)

Hi Scott,

 

Yup, I've definitely deployed the variable but still no solution unfortunately. I'll have a go linking it to the LED to try and pinpoint the problem and get back to you.

 

Cheers,

Ben

0 Kudos
Message 3 of 8
(9,916 Views)

Ben,

 

You should also monitor the error out terminals of both the read and write shared variable nodes.

Matt J | National Instruments | CLA
0 Kudos
Message 4 of 8
(9,901 Views)

First, break the right to left habit.  Now.  With a VI that small, it simply doesn't make sense to bring your wire backwards.  As things get more complex, that will make your code impossible to manage.

 

The most important thing you could have shown us was the settings for your SV.  We can assume you're reading and writing the variable.  Those images are mostly useless.  What is your SVs scope?  Is it target scoped?  Is it network shared?  Have you tried hosting it on the myRIO to see if you can read it on the PC?

0 Kudos
Message 5 of 8
(9,888 Views)

Thanks for the tips natasftw, i'll keep that in mind for the future.

 

I managed to solve this issue this afternoon. It ended up being a firewall problem. I had previously allowed  the NI variable engine through the firewall but that did not solve the problem. I visited this page (http://digital.ni.com/public.nsf/allkb/0D7B86F4B4D19A5E86256F9A006EECB1) and unblocked these three items.

 

  • C:\Windows\SysWOW64\lkads.exe
  • C:\Windows\SysWOW64\lktsrv.exe
  • C:\Program Files\National Instruments\Shared\Tagger\tagsrv.exe

Thank you all for your help, it's been much appreciated!

0 Kudos
Message 6 of 8
(9,854 Views)
Solution
Accepted by topic author bsia5466

Thanks for the tips natasftw, i'll keep that in mind for the future.

 

I managed to solve this issue this afternoon. It ended up being a firewall problem. I had previously allowed  the NI variable engine through the firewall but that did not solve the problem. I visited this page (http://digital.ni.com/public.nsf/allkb/0D7B86F4B4D19A5E86256F9A006EECB1) and unblocked these three items.

 

C:\Windows\SysWOW64\lkads.exe

C:\Windows\SysWOW64\lktsrv.exe

C:\Program Files\National Instruments\Shared\Tagger\tagsrv.exe

 

Thank you all for your help, it's been much appreciated!

Message 7 of 8
(9,854 Views)

The link has been moved to the new place, it can be found here....!

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019KlxSAE

 

Thank you all!

0 Kudos
Message 8 of 8
(5,723 Views)