LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Communication error using myRIO executable with shared variables

Hi, I'm trying to read a network-published shared variable from a myRIO-1900 (LV 2018 32-bit).  The code is contained in two different projects, and the variables are deployed onto the myRIO.  The PC sends a request to read data from the myRIO using a network-published shared variable, and waits for a response on another network-published shared variable (both of type string, from flattened data.  When running both the PC and myRIO from code (i.e. hitting play on the PC and myRIO main VIs), communication works fine, the myRIO receives the requests and sends data back to the PC.  However, when running code on the myRIO as a RT executable, this doesn't work properly.  The PC reports warning 180121602 (empty buffer) when trying to read from the receiving shared variable, and when I hit refresh in DSM, it says that it is trying to connect to both variables despite having statuses as "good."  Any advice is appreciated! 

0 Kudos
Message 1 of 6
(2,116 Views)

I had tried creating a new library on the PC side containing variables aliased to the psp url of the variables on the myrio.  Again, this works fine when running the myrio code from within its project, but when compiled to a RT executable set to run at startup, the PC is not able to communicate with the variables on the myrio.  I also tried adding a delay on the myrio during startup to allow SVE to begin, but this hasn't changed anything.  Is there anything related to the shared variables being accessed from an executable on the myrio that is different from them being accessed from a VI?

0 Kudos
Message 3 of 6
(2,074 Views)

I should clarify, it does seem that the PC can communicate with the variables, but the myrio cannot.  The PC sends a request, and that registers in DSM on the appropriate variable, but it would seem the myrio does not receive the request.

0 Kudos
Message 4 of 6
(2,068 Views)

My personal opinion, Network Published Shared Variables are nothing but trouble.  Deployment issues, weird timing issues, connection issues, etc.

 

Use a simple TCP/IP communication to send the updates back and forth.  I am a fan of the STM library.  Look for it in VI Package Manager.  There are a couple of examples the come with that library.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 6
(2,061 Views)

Thanks for the suggestion, I have implemented STM instead of shared variables for communication between the myrio and PC using TCP/IP on port 5555.  This works fine when run as VIs on both the myrio and PC, however, I'm running into the same issue.  When the myrio code is compiled to an exe and set to run at start, the myrio does not seem to receive the commands, and if it does, it does not respond.  Is there some permission or firewall issue that arises when the myrio code is compiled as an executable?

0 Kudos
Message 6 of 6
(2,054 Views)