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 Variable

Hi! I’m creating a program in Labview with a MyRIO-1900 in the RT VI. Now I am trying to communicate with other MyRIOs through shared variables. The connection is meant to be in real time but it takes almost 30seconds to send and receive the information, I’m wondering if you have some tips so that the connection takes less time and is more effective. Thanks!

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

Don't use Shared Variables.  I have had nothing but issues with them.  Create dedicated TCP/IP connections or use UDP to send out your data.  If you are trying to broadcast your data to many myRIOs, UDP is probably the way to do.


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 2 of 6
(2,529 Views)

Thanks for the tips! The problem is that this is an university work and they say I must use shared variables... 

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

Without seeing your code, without knowing anything about the network connection, and without knowing how you are setting up the Shared Variables (for example, what Target is hosting the Shared Variable Engine).

 

How are you communicating with your myRIO?  Are you using TCP/IP?  Is it working?  Are you using USB?

 

If this is a Homework question, talk to your Instructor and get some clarification.

 

Bob Schor

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

I am using the MyRIOs IP adress and it works but it takes like 30s to receive the information from the other myrio. Everything is through Wi-Fi.

0 Kudos
Message 5 of 6
(2,487 Views)

Shared variables usually have buffers on by default (50 elements, server and client side).  I suspect that either the read/write rates are such that it appears that the data is delayed (read rate is too slow compared to write rate) or there is some connectivity issue interfering with the read portion of the application, slowing it down.

 

Can you monitor your variables using Distributed System Manager (should be included in your LabVIEW install)?  Take a look at that and see if your variables are updating close to real time.  You may first need to go to "Actions >> Register Computer..." for your targets to show up there.

 

The only other thing I can think of is that 30 seconds sounds like a default timeout for something.  May want to take a look at other functions in your read/write loops to see if they are interfering with the intended loop timing.

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