LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Network Shared Variable with Event Based ? PC to cRIO

Solved!
Go to solution

Hi,

 

I'm having a trouble to create an event based network shared variable in cRIO platform. I tried to use DSC Data logging and Supervisory but failed in cRIO. 

 

Anyone here have suggestion for me to do so?

User will have to click a start button from PC -> Network Shared Variable -> cRIO waiting event based and execute instead of poling and detect data change( my data is in cluster of array Start and array stop).

 

Thank you

0 Kudos
Message 1 of 6
(3,326 Views)

I assume you're following this guide: https://forums.ni.com/t5/Example-Programs/Creating-a-Value-Change-Event-for-Shared-Variables/ta-p/35...

 

Before branching out to the cRIO, can you get it to work on just your PC?

0 Kudos
Message 2 of 6
(3,280 Views)
Solution
Accepted by topic author fendywoo

As the one who defended Global Variables at NI Week 2016, I will state that Network Published Shared Variables are evil.  They are slow and I have found them unreliable.

 

I suggest just using Network Streams or TCP (I prefer using the STM library) to send updates to the cRIO and back.  It will be more responsive, secure, and reliable.  You will want to have a loop on the cRIO and PC that just maintain the connection and listen for data to come back.  Any data received can be sent to any other loop via Queues, Notifiers, User Events, etc.


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 3 of 6
(3,269 Views)

Many years ago I found a Network Queue class on the web. I believe it was posted on Lava. Over the years I have made some tweaks to it and we have been using it without any issues for years. One of the things I added was to disable the Nagle algorithm so that code is included as well. I place both of these in the user.lib folder. Each gets its own folder there. 



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Download All
Message 4 of 6
(3,256 Views)

Hi,

 

In PC platform, yes I able to do it.But not in cRIO platform. 

0 Kudos
Message 5 of 6
(3,252 Views)

Thank you!!!

Before this, my pattern of programming would be any of settings or user events will use Network shared variable, any data streaming (IMPORTANT data) will go under network stream. 

Now, I get it and thanks to you, I just have to create a network bridge (Network Stream) between PC and cRIO. and awaiting event from PC. 

0 Kudos
Message 6 of 6
(3,249 Views)