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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Shared Variables Time Out When Accessed Programmatically from NI cRIO 9033 (Error Code: -1950678943)

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.

 

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.

 

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."

 

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.

I have attached the code to this post, so if someone could take a look it would be much appreciated.

 

Back Panel of the VI for accessing the shared variables:

Back Panel - cRIO and computer.jpg

 

Result of running VI on the computer (all shared variable accesses - via shared variable nodes or programmatic access work):

Front Panel Result - computer.jpg

 

Result of running VI on the cRIO (all attempts at shared variable programmatic access do not work):

Front Panel Result - cRIO.jpg

0 Kudos
Message 1 of 14
(6,246 Views)

An update. I tried some suggestions given to me in this Stack Overflow thread, but it's still not possible to access the shared variable programatically from the cRIO.

I have attached the update source code. Please take a look!

I'm running out of ideas and it seems strange to not be able to programmatically access shared variables from the cRIO that are hosted on the cRIO.

 

Updated block diagram:

Block Diagram.jpg

 

Result of running VI on computer (shared variable access via shared variable node and programmatically work):

Front Panel - Computer.jpg

Result of running VI on cRIO (shared variable access via shared variable node works, programmatic access does not work):

Front Panel - cRIO.jpg

0 Kudos
Message 2 of 14
(6,144 Views)

It looks like another forum post dealt with a similar issue - take a look: http://forums.ni.com/t5/LabVIEW/Shared-Variable-Programmatic-Read-Open-Timeout-Bug/m-p/2749116#M8116...

0 Kudos
Message 3 of 14
(6,137 Views)

Thanks for the link, scotia673. I had checked this post out previously. It seemed to be discussing another issue, namely that the Read Variable VI seemed to not honor the timeout specified for it.

Does anyone have any ideas as to how to accomplish this (seemingly) simple task of programmatic access to shared variables hosted on a cRIO from the same cRIO?

0 Kudos
Message 4 of 14
(6,129 Views)

I've recently seen a similar issue where setting the cRIO to a static IP resolved everything.  Are you able to try this?  To my knowledge this has only happened on a single specifc network.  Can you tell me about what kind of router you're using?  I'm interested to know if perhaps there's some overlap between your issue and the one I'm working on.  

Regards,

Eric L.
Applications Engineering Specialist
National Instruments
0 Kudos
Message 5 of 14
(5,965 Views)

Eric_LV, thanks for taking the time to reach out. I am using a static IP for the cRIO. The router I'm using is a Netgear N600. To be clear as I said above, shared variable node access worked, but programmatic access did not. Do you have any pointers where I would look to try to troubleshoot this and allow me to use it in the future?

0 Kudos
Message 6 of 14
(5,939 Views)

Have you tried changing the shared variable path to be an IP address rather than a DNS/target name? I've had problems before with RT not being able to do DNS lookups.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 7 of 14
(5,933 Views)

Trying to use an absolute IP in the address for the variable or using localhost might get you different results.  Can you ping the cRIO using it's DNS name?  The network I'm working with has some irregularities in it's DNS server that we think may be related to this issue.  It would be interesting to see if you have similar issues with your DNS server.  We're also having the same situation where static variable nodes work and dynamic ones do not.  So it does look like we're seeing the same thing, or close to it.  

Regards,

Eric L.
Applications Engineering Specialist
National Instruments
0 Kudos
Message 8 of 14
(5,920 Views)

Eric: As far as I know, this is a problem with either:

- If using a static IP, you need to configure a DNS server IP

- I think that even then, sometimes LabVIEW RT just doesn't do DNS lookups properly (I've had the reverse lookup of the IP to String function timeout on myRIOs with a configured DNS server)


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 9 of 14
(5,916 Views)

Bumping this thread because I have exactly the same problem on LV2015 - cRIO 9035, as no solution were offered.

Anyone from NI could give an explanation as to what might be the problem?

 

Thank you for your help.

 

Edit: just a few more info about my program.

0) I use "localhost" in my url name.

1) if I run my main program as a vi, it works only if my subvi in charge of getting the SV Reference is in shared clone reentrant execution mode

2) if I built a rtexe, it doesnt work in any execution mode.

 

here is a screenshot of my subvi:
Ekran Alıntısı.PNG

0 Kudos
Message 10 of 14
(5,685 Views)