title: LabVIEW Shared Variables cannot be programmatically accessed from cRIO Real-Time
body: <p>I would like to use programmatic access to manipulate shared variables on a computer and an NI cRIO 9033, but cannot get programmatic access to shared variables on the cRIO.</p>
  
  <p>I have boiled the situation down to a very simple example to try to explain what I am seeing. The shared variables are hosted on the cRIO. I am using the same VI to perform the accesses on the computer and the cRIO.
  On the computer, access to the shared variable via a shared variable node and programmatic access both work.
  On the cRIO, access to the shared variable via a shared variable node is functional, but programmatic access to the shared variable does not work.</p>
  
  <p>The error code received when trying to to a Read Variable or Open Variable Connection on the cRIO to the shared variable is -1950678943.
  The error text reads "Timed out while attempting to open a connection to the variable."</p>
  
  <p>I'm quickly becoming confused as to why the cRIO should have trouble reading a shared variable programmatically that is hosted on itself.
  The web searches I have done haven't turned up such a simple scenario causing this error, so I'm wondering if I've stumbled into a beginner mistake.</p>
  
  <p>Back Panel of the VI for accessing the shared variables:</p>
  
  <p><img src="https://i.stack.imgur.com/W7AOJ.jpg" alt="Block diagram"></p>
  
  <p>Result of running VI on the computer (all shared variable accesses - via shared variable nodes or programmatic access work):</p>
  
  <p><img src="https://i.stack.imgur.com/cJWJx.jpg" alt="Computer result"></p>
  
  <p>Result of running VI on the cRIO (all attempts at shared variable programmatic access do not work):</p>
  
  <p><img src="https://i.stack.imgur.com/cuoTo.jpg" alt="cRIO result"></p>
  
  <p><strong>EDIT:</strong> I appreciate the help troubleshooting this, but in the end I couldn't get shared variables to work for my application of programmatic access from a CompactRIO. I instead chose to use <a href="http://www.ni.com/white-paper/12267/en/" rel="nofollow noreferrer">Network Streams</a>, which seem to function fairly well. Upside: Connection details between my client and server can be better encapsulated, since shared variables no longer need to be given to them to allow communication. Downside: a bit more book-keeping to ensure that both reader and writer to the Network Stream are connected correctly (I found this dissection <a href="http://forums.ni.com/t5/LabVIEW/How-to-clear-error-314101/m-p/1919513#M642721" rel="nofollow noreferrer">at National Instrument's forum</a> useful when formulating that logic).</p>