08-22-2006 10:58 AM
"If you are using a network-published Shared Variable node that is configured to read data, you must run each Shared Variable node before the node subscribes and starts receiving buffered values. If a buffer for a network-published shared variable overflows, the data is lost, and LabVIEW does not return an error."What is meant by "run each Shared Variable"?
Anyone know of a way to "clear out or empty" old, buffered values stores in a Shared Variable?
Thank you in advance.
- Con
08-23-2006 03:00 PM
08-28-2006 09:37 AM
I guess there are a few of ways to look at this...
1) The answer to my questions are so obvious to others that they must think I am trying to be funny just to ask? (I am sincere)
2) No one else knows?
3) No one else cares?
08-28-2006 10:08 AM
08-28-2006 10:24 AM
@otoro wrote:
My interpretation on "you need to run each variable node" is to deploy the library that contained the variables before running the VI.
I do not know how to reset the buffer, but i am curious on why you want to reset the buffer ? I think if you undeploy the variable that would clear out the buffer
Thank you for your post.
As far as needing to deploy the variable to wherever is hosting the variable, I understand that. However, it seems as if they (NI) could have easily used those words rather than saying "run each variable node". So I am just looking for clarification from them.
Here's a reason for wanting to clear out that buffer: I have a RT application ("RT-app") that populates a Buffered Shared Variable hosted on some other computer. I have a second application ("2nd-app") that reads that Buffered Shared Variable while running. When I run "2nd-app" the first data read it gets is the last value still in the Buffered Shared Variable (which is actually data from a previous RT-app run). So I want to be able to clear out the Shared Variable at start up to get rid of any previous data still in it.
Any ideas?
As far as deploying/undeploying shared variables: Is this to be done only during development or can one deploy/undeploy shared variables programmatically during code execution?
Thanks again!
08-28-2006 10:44 AM
08-28-2006
10:52 AM
- last edited on
01-14-2025
03:36 PM
by
Content Cleaner
I just found some info on deploying/undeploying libraries:
Application Control | Library.Deploy Library Method
Shared Variables and Stand-Alone Applications or Shared Libraries
If you plan to distribute a stand-alone application that uses shared variables, do not include the .lvlib file in an LLB or in the executable. Use the Source Files Setting page of the Application Properties dialog box to change the Destination of the .lvlib file to a destination outside the executable or LLB. You can deploy the shared variables in two ways:
- Write the application so that it programmatically deploys shared variables at start time. Call the Deploy Library Method in the top-level VI of the application. In the Library Path input of the method, use the relative path to the .lvlib file that contains the shared variable.
- Manually deploy the shared variables to the computer or target Shared Variable Engine before running the built application.
If you plan to distribute a shared library (DLL) that uses shared variables, do not include the .lvlib file in the DLL. Use the Source Files Setting page of the Shared Library Properties dialog box to change the Destination of the .lvlib file to a destination outside the DLL.
Here's a link where the above was copied from:
http://zone.ni.com/reference/en-XX/help/371361A-01/lvconcepts/project_variables/
I'm still wondering if deploying/undeplying the library is the best way to go. Or is
On a side note: I'm still debating whether or not to use datasocket with a "psp://..." URL to publish and subscribe to the variables. When I use the Shared Variables my applications seem to "get choppy" when the application first starts running.
08-28-2006 11:56 AM
08-28-2006 12:59 PM
Hi There,
You can programmatically deploy shared variables without the DSC module. This can be done by utilizing the Deploy Library method of the Invoke Node. To find the Deploy Library method:
You can also programmatically deploy shared variables on the shared variable engine on a RT target, but you would have to deploy it from the host vi running on a windows machine. To accomplish this all you have to do is give the IP address of the RT controller where you want to deploy it to in the Invoke Node. Hope this helps!
Regards,
Prashanth V
Applications Engineer
National Instruments
08-28-2006 02:04 PM
Thanks everyone for your assistance and information.
- Con