09-30-2009 06:53 AM
Hi,
I use LV DSC RT 8.2.1
I have a Vacuum System That includes signals from - Pumps failure, Valves status, Vacuum gauge, start Pump ...
Each signal is read by a FieldPoint.
All the relevant FieldPoint Channels are read by the Server (a computer in the Ethernet Network) and published to the network in the form of Shared Variables.
I have a client VI that is reading the Shared Variables published by the Server using Front Panel Binding.
Problem :
Some of the Bindings are in the mode 'Write &Read' and that causes some initialization problems.
For example - Valve #1 is Open, and then a User start running the Client VI, (the Valve #1 Status mode is 'Write & Read")
if in the VI the status of Valve #1 is closed (before running it) then the Valve status is changing to Closed.
I want the Client VI to first read the Physical status of the instrument and then to change the Value if the User changes it.
But that's seems to be a problem when using Front Panel Binding... (is it?)
I know I can Deploy a lvlib in the Client Side and Item Bind to the Shared Variables or Use DataSocket.
(Is DataSocket is a Reliable method when connecting to Shared Variables? What are the disadvantages when using DataSocket?)
What is recommended by those of you that are experienced or by NI ?
Sincerely Yours,
Amitai Abramson.
09-30-2009 07:31 AM
You Know What....
I want to expand my question. (I still need an answer for the last ones above...)
My Problem is choosing the most appropriate method (for me) to connect as a client to SV in another computer (the Server).
I know of 2 ways :
1. Front Panel Binding. (Right Click a Control >> Properties >> Data Binding ...)
2. DataSocket. (Opening and then Read or Write using the DataSocket Palette)
I am using LabVIEW DSC RT 8.2.1 so I can't use the Item Binding Method when connecting to another computer in the Ethernet Network (Dragging the Shared Variable Node into the Block Diagram) since I don't have the option to change it to Target Relative or Absolute.
So if I want to read the Shared Variable using Item Binding I build another lvlib in the Client Side and bind the Shared Variables in the Client Side to the ones on the Server, and then I can drag the Shared Variable to the Block Diagram.
I don't like to do it, because I don't like to duplicate Shared Variable at each Client.
I want to know all the ways that I can connect to Shared Variables,
and I want to know the advantages and disadvantages.
I hope there are people here that can help me to understand it further,
I have read 'Using The Shared Variables....' but some of the features there are 8.5 and I have 8.2.1.
I know one disadvantage (it can become an advantage sometime to the Network Traffic) when using Front Panel Binding - It is the fact that the connection to the Shared Variable Engine is becoming a part of the Front Panel Thread.
I don't know if there are any other advantages or disadvantages when using one of the methods.
Sincerely Yours,
Amitai Abramson.
10-01-2009
06:04 PM
- last edited on
04-28-2025
01:29 PM
by
Content Cleaner
Amitai Abramson,
Hello and thanks for using the NI Forums.
I'm glad that you've read the Using the LabVIEW Shared Variable Tutorial on our website. Check out these other resources:
The issue that you are seeing by having "Write & Read" bound items on both the server and client side is essentially a race condition, you don't know which one is being read/written at what time. To resolve this issue I would take a look at some of the document below.
You mentioned not wanting to have two sets of shared variables (one on each side), but this is a great method to resovle this issue, that, or you can develope some sort of hand shaking to prevent these race conditions.
I would suggest that in the future when using these forums you try to ask only one question per thread and make it more concise. It's hard to tackle multiple questions and such broad questions as "I want to know all the ways that I can connect to Shared Variables, and I want to know the advantages and disadvantages." I suggest this because we want you to get your questions answered and more concise questions will result in quicker and better answers.