12-26-2017 05:26 PM
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
Solved! Go to Solution.
12-27-2017 07:21 AM
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?
12-28-2017 07:15 AM
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.
12-28-2017 02:30 PM
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.
12-28-2017 06:54 PM
Hi,
In PC platform, yes I able to do it.But not in cRIO platform.
12-28-2017 06:58 PM
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.