Using Shared Variables and Initialize Front Panel Binding (to PSP)

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.

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:
Network Variable Technical Overview
Troubleshooting Network-Published Shared Variables
Why Do I See Unexpected Value Change Events for Shared Variables Using LabVIEW DSC?
All You Need to Know About Shared Variables
Creating a Value Change Event for Shared Variables
Alternative Method for Using Shared Variables Between Systems in LabVIEW 8.x
What Is The Difference Between Using Shared Variables And DataSocket VIs To Access OPC Tags?
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 documents below.
Using a Local, Global, or Shared Variable in Parallel Loops Can Cause Race Conditions
Using Local and Global Variables Carefully
Tutorial: Local Variable, Global Variable, and Race Conditions
Locking a Shared Resource or Variable in LabVIEW Using Semaphores
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. 
Message Edited by Ben S on 10-01-2009 06:05 PM
Ben Sisney
FlexRIO V&V Engineer
National Instruments

Similar Messages

  • Using a Meter control in LV Touch Panel, and using shared variables that are custom controls.

    I Just started using LV touch Panel module with an NI TPC-2106.
    I have two differenct problems:
    1) I was planning on using the "Meter" control quite a bit. I can set up the meter exactly how I like on the host PC, but on the touch Panel computer it seems to ignore my adjustments, mainly the start and end of the scale - i.e. I would like control to run from 0 to 360 with 0 straight up, using the entire circle. However, on the Touch panel computer it always puts 0 at about 7 o'clock and 360 at about 5 o'clock. I have also tried adding markers to no avail.
    2) I am communicating with a compact fieldpoint controller. I can creat a shared variable that is a simple double with no problems. However, I have some shared variables that use a custom control for the variable type - bascially a cluster with a couble doubles, a time stamp, and an enumeration. It lets me drag the shared variable into my diagram, but it seems to ignore it when I run it.

    Ipshita_C,
    - I am using LV 8.6.1f1and LV Touch Panel 8.6.1.
    - I have attached a simplified VI that shows how I want to use the meter. Notice that the placement of the endpoitns does not work correctly on the touch panel, and that it ignores the arbitrary markers that I placed.
    - I also have included an XY graph control that displays on the TPC with margins around the graph area that I removed from the graph control.
    - For the shared variable, it appears to be an issue related to the touch panel, not fieldpoint. I found another thread in this forum that mentioned that clusters containing Enumerations do not work in shared variables on the touch panel. I changed the enumeration to an integer and it now works fine.
    In general, there seem to be a disappointing number of limitations in the touch panel implementation. My biggest concern is that I have not found any documentation from NI that lists these limitations. I seem to have to try things out and see what works and what does not work. Can you point me to a comprehensive list of touch panel modules limitations?
    Attachments:
    test 2.vi ‏10 KB

  • I want to publish my data using datasocket connection on the net and I want to use Front panel binding. Can I?

    I want to publish my data on the net.
    I want to use front panel binding and I do not want
    to write the code. Can I do that. What should I modify
    in my datasocket server manager. The other question is, When I open my VI, I want to open automatically my DataSocket Server. My english is bad. When I open the LabView I also want to open my DataSocket server. How can I do this?

    To use datasockets to publish data to be accessed via the web, see the following document.
    http://digital.ni.com/public.nsf/websearch/F58A6C2DAAADECB68625672400636145?OpenDocument
    This document explains how you can create an interactive Web page with which users can view data from a remote acquisition application without the common problems of a client-server application. You use the Measurement Studio DataSocket control and Microsoft Visual Basic to create a software component that you can insert in a Web page. You then use that Web page to read, write, or share data with other applications across the Internet.
    If you want to publish data but do not want to write any code, you should consider the web publishing tool available in Labview 6.1. This tool allows
    you to create a webpage to be published from the the LabVIEW webserver on your machine. See the following link for more information on ways to easily publish to the web from LabVIEW.
    http://zone.ni.com/devzone/conceptd.nsf/webmain/E4E311FA046EE24586256B1F0074F39D?opendocument
    As for starting the datasocket server when you run your VI, you can use the 'System Exec' VI to run the application. The exe to start the server is located in the following directory:
    C:\Program Files\National Instruments\DataSocket\cwdss.exe
    I hope this is helpful.

  • Problem with dsc shared shared variables and error 1950679023

    I'm having trouble using shared variables on my laptop PC (with Windows XP) using Labview 8.2 and DSC.   I've set up a simple project with one VI and one shared variable library.  In the VI, I have  a while loop that writes a number from a front panel control to the shared variable.  Another loop running in parallel reads the shared variable and displays to an indicator on the front panel.   The VI resides on my PC (no remote targets). This program executes just fine on my desk top PC; however I get the following error codes out of the shared variable nodes when I run the project and VI on my laptop for the write and read, respectively: ni_tagger_lv_Write 180121604 ni_tagger_lv_Read -1950679023 I've tried to manually deploy the shared variable library without success. The NI knowledge base  and other entries on this forum suggested that the Windows firewall should be disabled for a quick fix, however, the firewall was already disabled on my lap top. I didn't see any entries regarding the 180121604 error code.
    Any suggestions would be appreciated.

    The problem has mysteriously gone away.  For about the 10th time, I manually deployed the share variable library, and it started to work properly.

  • Question about shared variables and report generator

    I have a project with about 200-250 shared variables and at every 12 hours i want to make a report containing information about some boolean and double front panel variables linked to the shared variables... Now, i've tried with both the "Write Trace to SpreadSheet File" function from DSC->History and with different functions from NI Report Generation Toolkit. My problem is this: i would like to get my xls file to contain just the timestamps when my shared variable changed value. As it is, the number of rows in the file depends, obviously, on the sampling interval given as input. As an example, in 12 hours, my shared variable would change value maybe 5-6 times. Thus i would like my xls file to contain just 5-6 rows with those 5-6 changes. If i set the sampling interval to say, a matter of seconds, that would mean too much unneeded information in my xls file. Instead, if i set it to let's say 15 minutes, i would probably lose the moment the shared variable changed value. Is there a way for me to achieve my desired functionality with functions from DSC or Report Generation Toolkit? Thanks in advance, Sabin 

    Hi Mike and thanks for the reply. Actually, my first idea was exactly this: in an event case structure, whenever my variable changed value, i would retain the relevant data in an array and then at the 12 hour period write all of it in a report. However, my boss deeemed it memory unefficient and compelled me to use only one function. Thus my predicament... If you have more advice on this new info, i would be grateful... Cheers, sabin

  • About the performance of using shared variables

    Hi
     My system has almost 200 I/O points,I want to the host communicates with PLC using OPC(I had create a OPC I/O Server).
    If I use shared variables bind to OPC data items, there must be almost 200 shared variables.
    And my puzzle is that what's the performance of using these shared variables,will they eat up memory and processor?
    Another question is that if an shared variable will be time-lapse(i.e.,if an OPC data item value change feedback to  program block with 0 delay or not),if so ,then how many millseconds it will delaies? 

    here is a paper about the performance of shared variables.
    Steve Bird
    Culverson Software - Elegant software that is a pleasure to use.
    Culverson.com
    Blog for (mostly LabVIEW) programmers: Tips And Tricks

  • Coercion problem when using Shared Variable

    I have a curious coercion problem when using Shared Variables.  I want to share the state of a State Machine, which is an enum saved as a control (typedef) called TYPE State (see attached).  I create a shared variable called State and define it as a Custom Control, using the just-mentioned typedef.  So far, so good.  I've attached three simple VIs -- the first one, Init State, simply wires a constant to the input of the Shared Variable to initialize it -- the wired constant is, of course, defined by the typedef.  However, the Get State and Set State, meant to wire an indicator (for reading the state) or control (for setting it), develop coercion dots when wired into the Shared Variable.  Why?  How do I get rid of the dot?  [I suppose I could abandon my typedef and custom control, but the beauty of typedefs and custom controls is that it "enforces" rules, lets you use enums for clarity, keeps the code "honest", etc. -- I'd hate to give that up just to get rid of a dot!].
    On a related note, the code seems to work.  This is much too simplistic to do anything, but if you open Set State and Get State, set the state to anything, run it (it immediately stops, of course), then run Get State, you'll see the chosen state appear in the indicator.  So it does appear to work.  The "error" (coercion dot) may, I suppose, be a "bug" in Labview because it can't figure out the mapping of the (very simple!) Custom Control, but if so, I hope it gets fixed quickly!
    Bob Schor
    Attachments:
    Coercion Problem1.zip ‏38 KB

    Hello Bob,
    I am also seeing this behavior, I will escalate this question to our LabVIEW developers and post again here no later than next Tuesday, November 27th as National Instruments will be closed for the remainder of this week.
    If this issue does turn into a product suggestion, I would suspect the workaround would to live with the coersion dot for the time being.
    Enjoy the holiday
    Regards,
    Erik J.
    Applications Engineer
    National Instruments

  • Using shared variables in a rt target

    Hi all,
    I wrote a diesel engine ECU in LV 7.1 FPGA and ran it for the past year, using TCP VI's to communicate between the Host and cRIO-9004.
    Next, I translated it to LV 8.0 (with some difficulty recompiling the FPGA) and it worked fine up to that point.
    Next step was to use the much-touted shared variables to eliminate all the TCP overhead.  I defined 2 shared variables as big clusters with lots of controls and data passing back and forth.  This worked fine while running under the source code.  However, once I compiled the Host and cRIO code (ECUHost.exe and C:\NI-RT\startup\startup.rtexe), the sharing stopped.
    I tried defining and binding the variables under My Computer and also tried under the cRIO target, with no success.  I was able to get source code to talk to compiled code (I forget which one was which), but not when both were compiled.
    Thanks for any suggestions,
    McSynth

    That is quite strange. Here is some information regarding shared variables and building stand alone applications that may or may not help:
    Using Shared Variables in Stand-Alone Applications or Shared Libraries
    If you plan to distribute a stand-alone application or shared library (DLL) that uses shared variables, do not include the .lvlib file in an LLB, the executable, or the DLL. Use the Source Files Setting page of the Application Properties dialog box or 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 executable, LLB, or DLL.
    Best Regards,
    Jaideep

  • Use shared variables with FPGA device on Host PC

    Hi all I am having a frustrating problem. I am trying to use shared
    variables linked to a cRIO 9012. The shared variables were created and
    then written to in a RT vi. is there any way I can assign locations to
    these not within a RT vi. I altimately need to run the Host vi on a
    TPC-2512 touch panel computer and I can't run a RT application on that. I
    just need the variables to update without the RT vi running and I can't
    figure out how to do that, if its even possible. Here is what I have so
    far. Thank you in advance for your help.
    Attachments:
    PumpMonitoringDevice.zip ‏2083 KB

    Adam:
    You may be able to use arrays to speed up your program, but bear in mind that the TPC is pretty much guaranteed to be slower than your computer (as it's likely to have lower system specs).
    You'll want to use the array manipulation functions to combine and retrieve your data (most useful will likely be "Build Array" and "Index Array," see context/LabVIEW help for more details). Once you have the data in an array, you can likely pass it through a shared variable configured for an array datatype.
    I'm not sure if/how much of a speed boost it will give you, but I think it's definitely worth trying. If you're not sure about the speed, try simply cutting your variable count in half and see what kind of speed increase you get with the same amount of code but fewer variable values being transmitted through your network connection.
    Good luck!
    Caleb Harris
    National Instruments | Mechanical Engineer | http://www.ni.com/support

  • How to use shared variables to measure analog input

    Dear All,
    I am using Real time remote system. I am using PXI-6259 card, PXI-8184RT controller and PXI-1031 Chassis.
    I want to use shared variable to measure and analog Input(voltage) from
    an analog input Channel.  I tried  attaching it  with the physical
    channel using the bind to source option but it idoes not seem to work,
    can any one give me any suggestions?
    Screen shot  of this is available.
    I tried using the Acq and graph example and deployed it to the RT but
    the Sine wave I input in the measurement channel  becomes highly
    distorted when I see it in the host.vi, there is also a Screen shot of
    this also. Is there any other option.
    What am I doing wrong? all suggestion are highly welcome.
    Thank you.
    Sincerely,
    Munir Afzal Bhatti.
    Attachments:
    SV2.jpg ‏2305 KB
    SV3.jpg ‏2305 KB

    You will have to give us the whole picture. What is your client computer; a PAC, desktop etc? What are you running on the client computer; a VI or an executable? Where are you going to deploy your library? On the host machine or the client machine?
    If I assume that you are running a VI on the client machine and are depolying the library on the host, all you have to do is to create another shared variable and bind it to the variable on the host machine. You can do this by checking the Bind to Source option when creating the variable and browsing to the network item in options. Be sure to have the library deployed on the host side before you attempt to do this otherwise you won't be able to find the variable.
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

  • How to use shared variables?

    Hello..
            Can anybody please guide me in using shared variables... I'm learning LabVIEW 8.5.... But did not understand how to use shared variables... I tried to read web pages regarding shared variables but got confused.... So anyone can please help me...?
             Thanks for any help from you...

    You will have to give us the whole picture. What is your client computer; a PAC, desktop etc? What are you running on the client computer; a VI or an executable? Where are you going to deploy your library? On the host machine or the client machine?
    If I assume that you are running a VI on the client machine and are depolying the library on the host, all you have to do is to create another shared variable and bind it to the variable on the host machine. You can do this by checking the Bind to Source option when creating the variable and browsing to the network item in options. Be sure to have the library deployed on the host side before you attempt to do this otherwise you won't be able to find the variable.
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

  • Configurin​g Database for logging to citadel Database using shared variable engine

    Hello All,
    I have two systems with me here, one with LabVIEW 8.5 and one with LabVIEW 8.6, I'm using Shared Variables in my code and I am Logging to citadel Database. In a PC with LabVIEW 8.5, I am able to Log Data to citadel Database, but with the same code I am not able to Log Data from the PC with LabVIEW 8.6. Both the PC's have Database Installed and the connection with the Database Exists when I test connection with database through control panel. I would Like to know any configurations (in LabVIEW or in code or in Database or in PC) that have to be done for Logging to Database because the PC with LabVIEW 8.6 was added recently and the code was upgraded to 8.6.

    It was due to a dll in LabVIEW, a dll named nitaglv.dll
    Now I have a issue with Data Logging from the EXE, once the shared variables are deployed programatically from the EXE the Data Logging stops, 
    can I get any input on this issue..???

  • How to use shared variables to address multiple Watlow controller​s on the same COM port

    Hello,
    I am trying to use LabVIEW 2010 to control 4 Watlow temperature controllers on one COM port. 3 are Model 96 and 1 is an EZ zone controller. Each controller has a unique modbus address, and I am trying to read from and write to individual registers (such as closed loop setpoint) using shared variables. I am getting return data when reading (although the data appears to be invalid), but am unable to change the value in the register by writing. How can I be sure that the Modbus server is sending commands to the correct controller?
    Chuck
    Solved!
    Go to Solution.

    Peter,
    Thanks for the reply. I have actually solved that problem. I realized that the Modbus server address has to be the same as the controller's Modbus address.
    I have, however, run into another problem. Perhaps you could help me with that. I have a system with 4 Watlow controllers, 3 are series 96 controllers, one is PID only and 2 are ramping. The 4th controller is an EZ zone. I am using RS485 for communications and the controllers are all wired in parallel for communications and power.
    I have set up 2 Modbus servers for 2 of the controllers.
    This is the first I have ever worked with Modbus based communications. I have successfully programmed using the Modbus read/write VIs, and am wanting to move to shared variables. My questions right now revolve around addressing, Modbus I/O servers and COM ports. Specifically, at this point, I know the addresses need to match up between the server and the slave device (Watlow controller in my case), how many servers can I create and use on one COM port? If the number is limited, is there a way I can specify an address that I want the server to talk to? Will the broadcast mode work to request data values from the controllers?
    I'd appreciate any information you can help me with, or if you could point me to some sort of concise 'How-To' for Modbus communication.
    Thanks.
    Chuck

  • How to use shared variables with native c programs

    Hello
    What is the way to use shared variables with native c programs?
    I have a c/c++ program that uses the NIDAQmx C-API to perform measurements. Now I want to communicate to a LabVIEW program via shared variables.
    Is there a C-API for shared variables as there is for the NIDAQmx functionality? Where can I find further documentation? The document "Using the LabVIEW Shared Variable" mentions that one "can read and write to shared variables in ANSI C", but there are no hints about how and where to look.
    Thanks in Advance

    Hi user42,
    with CVI 8.0, you cannot create or configure shared variables. However, you can read or write to an already configured LabVIEW 8.x shared variable from CVI using the DataSocket API.
    In order to do this you need to have and DataSocket 4.3 or higher installed.
    Here's a forum post about using the DataSocket functions a LabVIEW Shared Variables:
    http://forums.ni.com/ni/board/message?board.id=180&message.id=24569&requireLogin=False
    With CVI 8.1 and Measurement Studio 8.1 it's possible to use Shared Variables via the Network Varaiable Library (check out the end of the "Network-Published Shared Variable" section within the "Using the LabVIEW Shared Variable" documentation and the following link).
    Datasocket with LabWindows/CVI and LabVIEW Real-Time:
    http://digital.ni.com/public.nsf/allkb/CC4343488413A2F586256E6200099638?OpenDocument
    Daniel
    NIG

  • Can we use shared variable in main report's crosstab

    Post Author: sangi
    CA Forum: General
    Hi,
    I have a main report with subreport (in Group footer), crosstab (in Group header).
    For cross tab calculation, I need a value from subreport to be passed to main report's crosstab.
    I could pass the value using shared variable.. but since the crosstab is in group header , I am not able to get the values .. .it is all 0....
    Please help me

    Post Author: wapper
    CA Forum: General
    To my best knowledge, what you ask for is impossible. The subreport in group footer is going to be evaluated during the last pass, so you are too late to get values into the group header. I could suggest creating a copy of your subreport and placing it (possibly hidden) into the group header just to get the values you need... But this would be the last measure if you really can't do anything else to achieve same goal. Wapper

Maybe you are looking for

  • Cannot uninstal FF and cannot access FF

    OS Windows 7 (64 bit)s Cannot access Firefox 31 via desktop (FF icon has a locked padlock) or via Control Panel......etc All I get is a small window stating "Cannot load XPCOM". Cannot uninstall FF....even using '\helper.exe' Urgent help please.

  • BPC75NW: DM Package runs for parent level node

    Hi, I have build a DM package which has a variable input on ENTITY dimension. Now while I had built and unit tested on <ALL> ENTITY members, it took only base member values from the variable input. But when I test this again after sometime, the ENTIT

  • BDC (Background processing in call transaction )

    Frnds how to go for background processing in " call transaction method" We know that " NO display" mode is there but any other method is there in real time. > in session method while data is getting uploaded suddenly server stops then how to upload t

  • Registering IDM to SLD and Solution Manager

    Hi Everyone, Is there any way to register IDM to SLD/Solution Manager? Right now, I am having it as a Portal Component only for the UI, with a standalone server for the IDM Dispatcher. Any idea, Appreciated Manuel

  • Using LabView version 6.1, Best way to capture data every 5 milliseconds

    Best way to capture data every 5 ms (milli-seconds) in the .vi diagram when using "Time between Points, and Small Loop Delay tools"