Dynamic shared variable node

Hello, i'd like something like a Shared Variable Node, but with ability to choose at runtime which variable to read/write, for example passing a variable name. Is it possible?
I have the DSC module and it supports "Shared Variable Costant", which can be passed to a Property Node and allows to dinamically access a SV's properties, but apparently not its value and error status.
I tried to retrieve the DataSocketURL property and pass it to "Datasocket Read"; it kinda works, but i'm not sure if it's equivalent to a SV Node... it's slower and error status is not easily detected. May it be the right way?

Greetings and Merry Christmas,
I guess I’m a little confused about your application. An idea for choosing a variable to read/write from your front panel would be with a state diagram. This could be placed in a stacked sequence to occur first. Is that what you are trying to accomplish? Would you please elaborate on your application as well as what you mean about “choosing a variable”
For the Shared Variable Constant, I’m not sure why you would want to pass the value or error status when you could just deploy the shared variable?
Let me know of any head way and good luck!
Jordan Randall
National Instruments Italy

Similar Messages

  • Use buffering and psp with datasocket-VIs and without any binding and shared variable node

    Hello,
    I'm using LV 8.5.
    I'm trying to develop a multiplatform (windows and mac os x) and multi-computer application. II want to get executables running on each device, communicating through the network. Communication process includes datas (such as images) and events messages (something like "Hello, I got an error" or "youyou, my work is done" or "I'm hereeeee!!!!...."). I do need a communication without any loss of data.
    I worked a lot and wanted to test a psp-based design, without any binding nor shared variable node (mac os...) using data socket VIs and SVE buffering.
    I managed to :
    - deploy shared variable library dynamically (even in an executable)
    - communicate between two PCs with datasocket VIs
    However, I never managed to enjoy buffering (even locally with one VI doing the deployment and writing datas and another one for reading).
    I worked hard (dynamic buffering setting, dynamic buffering watching like in  http://zone.ni.com/reference/en-XX/help/371361D-01/lvconcepts/buffering_data/ and in the example "DS send image" and "DS receive image" in the labview examples, trying to use "?sync=true" in the URL, etc...) but no way to get things work.
    I attached a jpeg of an example of receiver and sender. I use wait commands in both receiver and sender to test buffering
    Receiver do receive datas (the last written) but buffering doesn't work.
    Did somebody did that before ? (better than me...)
    Thanks
    Bo
    Attachments:
    Sender.JPG ‏87 KB
    Receiver.JPG ‏96 KB

    Hello,
    Indeed my problem has been solved. My error : in the While loop of the receiver VI, I always reactualize the PacketsMaxBuffer and OctetsMawBuffer parameters, what resets the buffer and make it appears ineffective.
    I now set  the PacketsMaxBuffer and OctetsMawBuffer values only once at the begining of the VI and the psp buffering works perfectly.
    Sorry for the desagreement...
    Bo

  • Bug: Built Real-Time app won't run if it accesses a typedef'ed shared variable node

    Hello,
    I finished developing a Real-Time program that uses typedef'ed (clusters and enums) networked shared variables (SVs). It works fine when I run the program in Development mode. However, when I built and deployed it as a start-up app, it refuses to start. The VI monitor in the Distributed System Manager says that the VIs that use those SV nodes (and the top-level VI that references them) have "Bad" status, and the rest are "Idle".
    To get my built program to run, I had to disconnect all the variables from the typedefs. Deleting the SV nodes made the program run too, but that's not an option.
    Has anyone else encountered this?
    Platform: LabVIEW 2012 (32-bit), NI cRIO-9076

    Yes. See the following thread.
    Paolo
    LV 7.0, 7.1, 8.0.1, 2011

  • 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.

  • Weird delay reading shared variables

    Hello,
    I'm working on a project were I'm monitoring some prodution lines. I'm using DSC module's OPC server to connect to PLCs on the production line and I've created bound variables on my labview project of the PLC's tags.
    On my project I have one main VI were I show information about the production lines and were I can access several subVIs were I show other information about those lines. Then I have a VI that is running in background were I'm reading about 50 shared variables from the PLC and where I'm registering some data in a MySQL database, datalogging data on the Citadel database and registering alarms.
    The problem I'm having is that on the VI that runs in background I noticed a delay reading the variables that are reading containers weights from the production line. It seems that all the other shared variables don't suffer any delay, only the weight variables start having some delay when the values are increasing. It also seems like that, when I'm only running that VI alone, without running the main VI, there isn't any kind of delay. I'm reading the shared variables as shared variable nodes.
    Can anybody help me understand what's happening and how can I fix this delay? The VI that runs in background is time critical and a weird delay like that messes up my data.
    Solved!
    Go to Solution.

    Hi Mateus23,
    The shared variable has various buffering capabilites, including integration with the Real-Time FIFO feature in LabVIEW Real-Time.
    I guess that the buffering settings are causing the unexpected behavior.
    Check these resources:
    Buffered Network-Published Shared Variables (whitepaper)
    Shared Variables Properties Dialog
       - Network Page
       - Real-Time FIFO Page
    ~~

  • -1950679023 Shared Variable Engine and the NI 9148

    I'm running an RT application on a cRIO-9074 that calls I/O from a connected cRIO expansion chassis (NI 9148). At some point some digital input variables throw he following error
    -1950679023, The connection to the server was disconnected.
    What's strange is that its only some of the inputs that have this problems. Other variables on the same module work just fine. What's going on here and how can I get my system to recover from this error once throw?
    I'm running RT 2011.0.1  and Network Variable Engine 1.8.1
    Craig

    Hi Craig,
    Do you see these same problems if you place the two offending modules in the 9074's chassis instead of an expansion chassis? If you do make this switch do you then see errors on other modules?
    Have you tried programmatically reading the variables instead of using shared variable nodes? You can find an example of this if you're not familiar with it here, https://decibel.ni.com/content/docs/DOC-12548. 
    When you see these errors does your application stop running, or do you just see the errors being carried through the variables as it continues to run? Also, just to double check, you're seeing these errors intermittently not every time you run correct? Also is there anything noticeable happening when this error occurs other than the error itself?
    Finally, could you post a little bit of your code, or some screenshots of where you're accessing these variables and how often you're doing so? 
    Thanks,
    Miles G.
    National Instruments
    Applications Engineer

  • How to create an array containing shared variable values

    Hi
    I am trying to programmatically create an array containing shared variable values and their names.  I can get the variable names by supplying the process name to the get shared variable list function.  How do I then read the value of all the shared variable items returned?
    I have used a data socket open to open a connection to all variables when my program starts.  I then use datasocket read on the opened connections to write to an array.  This works fine until I try to write to one of the variables using a shared variable node.  The variables writes can take from 4secs to 2 mins.  When I remove the shared variable node again all is fine.  Also when I stop using the data sockets, all is fine.
    Is there a conflict between shared variable nodes and data socket writes to the shared variables?
    Can anyone help?  I cannot easily post example code because I am reading the variables from a Wago PFC (PLC) using OPC.

    Hi
    Sorry I forgot to mention the LabVIEW version, its 8.20.  I have tried saving the shared variable node as a sub VI and it makes no difference.
    Attached is a stripped down version of the software.  You will not be able to connect to the IO server because it requires some Wago hardware and software.  You may spot something I have done wrong with the I/O servers, variables or sub VI's.
    The main program that runs is called 'HMI Engine' in the 'Framework' folder.  There may be some other things in the project that aren't used in this example.  I have removed all but the variable connection part of the code.
    I hope someone can help!?
    Thanks
    Mark.
    Attachments:
    HMI Test.zip ‏144 KB

  • Using a 2-D array Single Process Shared Variable w/ RT FIFO for comm between a Deterministic and non-deterministic loop on an RT Target

    Our problem is that we currently use a 2D array to store CAN data on a Real-time Target. The array is 20 elements of 3 byte elements as so:
                    0              1              2
    0              [byte]   [byte]   [byte]
    19           [byte]   [byte]   [byte]
    These values are passed between a Deterministic Timed (DT) loop where they are set and a Non-Deterministic Timed (NDT) loop where they are read and passed into a Network Published Shared Variable (NPSV) for communication across the network to a Host PC. I have insrted an image for illustration, pardon the size.
    Currently to pass the data between the DT and NDT loop we are using a Global Variable (GV). To improve the system we have attempted to replace these GVs with Single Process Shared Variables (SPSV) with an RT FIFO enabled.
    To create the shared variable I simply right clicked the GV of interest and selected create Shared Variable Node form the drop downs. At this point LabVIEW presented me with a 2D NPSV within a new Library hosted on the RT Target. I then selected this new NPSV from the Project, changed it to a SPSV, and enabled a single element FIFO. This variable was initialized with a default value for the size described above and then used in our code for the DT to NDT communication, and conversion to a corresponding NPSV for sending to the Host.
    When I went to run the code I noticed that the variable was in fact 2D, however its size was only 2 elements of three bytes each, in other words only two of the row indices were populated and the other appeared as uninitialized. in addition, this data had no resemblance to the set initilazation value. This was also how the variable was presented on the host side of the network after tranfer into a NPSV.
    The peculiar part is that If I change this SPSV to a NPSV and then try to change it back, I receive an error saying the type is not supported for SPSV with an RT FIFO enabled. I have to disable the FIFO (which defeats the entire purpose) in order to successfully compile! I am unclear as to what is the bug in this case. Should I not be allowed to create the original 2D SPSV with a single element RT FIFO enabled without receiving an error? Or if this is okay how do I fix the problems associated with the variable after being allowed to create it?
    I have found the following discussion in which a user states “The only limitations for custom controls is the ability to use it with RT FIFO enabled on a network-published shared variable”. Is this also true for SPSV? I have not found any documentation explicitely stating this for SPSV, though it is stated for the NPSVs.

    Martin,
    RT FIFOs don't support Multi-Dimensional Arrays, which would corroborate the issues you're seeing.  You can break up the 2D array into 1D arrays by reshaping the array, then you'll be able to use the RT FIFO enabled variable, just set the array size to the total number of elements (20*3 = 60).
    You can also pass the 2D array via pre-allocated queue, or using a Functional Global.  We have a reference example for a circular buffer using Functional Globals here.

  • What is the blue thing in shared variable?

    I'm going thorough a code which has huge set of shared variables and in some nodes I find a blue colored mark/thing just bottom left to the globe as shown below.  What does this indicates?
    Thanks,
    Ajay
    Solved!
    Go to Solution.

    I found the answers from my team member.  The blue mark actually indicates a dot and a slash ".\" which means Target Relative Shared Variable.  If the Shared Variable is Absolute, then this indication will not be shown.  To know more about the difference between Absolute and Target-Relative shared variable, check it out here.  A Shared variable node can be swtiched between Absolute and Relative using
    Context menu (right click the node)->Reference mode.
    Thanks,
    Ajay.

  • Picture Network Shared Variable

    Hi Everyone, 
    I am having a lot of trouble to use the network published shared variable with a picture.
    I always receive the message Unable to locate the shared variable in the SVE, 
    What is supposed to go into the chain \\<machine-name\<process>\<variable> for process name?
    How should I configure it?
    Thanks, 
    Best Regards,

    Hi nick, 
    Thanks for your answer and for your help,
    No I cannot see the variable in the distributed system manager, 
    Nor my VI works with a Shared variable node, see attached screenshots.
    Although I found a more complex but functionning solution transmitting over TCP, I would still be interested to find out why it does not work with shared variables.
    Thanks, 
    Best Regards,
    Attachments:
    Captura.PNG ‏29 KB
    SharedVariableNode.PNG ‏36 KB

  • Empty Shared Variables & Data Binding not working in dynamically called VI

    Hi,
    I have just upgraded a system from LabVIEW 2011 to 2012 DS2.  I have a real-time PXI system running several shared variables, hosted on the PXI.
    After what appeared to be a succesful upgrade I have a couple of odd issues. 
    1.  The PXI writes test data into a network shared variable, based on a typedef of an array of custom clusters.  The variable is disconnected from the typedef, as RT does not function with shared variables linked to typedefs.  It seems that writing a seingle entry to the array is fine, but writing multiple entries causes the variable to appear empty. 
    I still need to debug this a little more, as while I was station to do so this other issue popped up.
    2.  I have some controls on the Host app with data binding to shared variables.  The host app uses three VIs dynamically called into the wrapper VI.  One of these called VIs is not able to connect to its variable when inserted in to the wrapper, but it can if run independently.  The other two have no such trouble.  Where I see a problem, the indication LED is grey and the mouse-over text reads "no status".  What does this mean?
    Any clues?
    Thanks,
    Ian

    I have changed the Invoke Node to a Run Asynchronous node, and this seems to have fixed the data binding issue. 
    The other issue may be related to a bug fixed in 2012 SP1:
    368648 Network Stream operations return Error 42 when data type contains nested clusters of typedefs
    I am now getting error 42 when reading a particular network shared variable.  This variable contains the results of measurements, in a data type which contains an array of nested clusters of typedefs.  When there is a single entry in the array I can read the variable fine, but when there is more than one entry in the array it does not read and I get error 42.
    I have downloaded 2012 SP1, and will see if this helps. 
    Ian

  • Changing shared variable reference modes for all nodes in applicatio​n. Shortcut?

    I have a large application which makes extensive use of both network-published and single-process shared variables.  I want to change the reference mode of every such node in the application from absolute to target-relative.  Is there any way to do this without having to open every subVI in the application and use the right-click menu on every node?
    Sean

    I don't know of any shortcut, but if you want to change the reference node of everything in the application you could probably script it.  I was thinking something similar to what I have below where you traverse the BD of a specific VI for all SharedVariableNodes and change the relative mode to Target Relative.
    Depending on how your project is organized you can add some additional functionality before the open VI reference to go through and open the reference of every VI in your project.
    Matt J
    Professional Googler and Kudo Addict
    National Instruments

  • Programmatically deploying WSN node shared variables

    I'm working on a WSN network composed by one WSN9791 gateway, eight WSN3202 programmable remote nodes and one PC with LabView.2013. The nodes are programmed to get some voltage readings and store them in shared variables. My main application is running on a PC, it basically reads the global variables values and performs other processing.
    Before running the main application I give the command "Deploy All" by right-clicking on the gateway name. I can do the same by right-clicking on each node and selecting "Deploy".
    Some weeks ago, due to a thunderstorm, the power to the entire system was lost and, after automatic restart, my application was no longer able to contact the shared variables and I had to manually repeat the "Deploy" sequence.
    My question is: "is there any way to programmatically deploy/undeploy shared variables"?
    Note that in my application I access the nodes shared variables by opening a connection to the variable and then reading its value (see attachment 1) instead of using explicit connections to variables (see attachment 2).

    Hi,
    this is done on your block diagram using an Invoke Node. Go to your functions palette on your block diagram and go to Programming>>Application>>Invoke Node. Then left-click the Method of the Invoke Node and go to Library and select the desired command. It is important to note that you cannot deploy single variables at a time, you can only deploy variable libraries at a time. 
    I also think that the following article will help you understand better the process of using shared variables in LabVIEW. I referenced it while I was researching your questions. 
    Using the LabVIEW Shared Variable: http://www.ni.com/white-paper/4679/en

  • Dynamically enabling/disabling opc-binding to shared variables?

    Hi.
    I've got some shared variables binded to my OPC server, but sometimes some variables need to "ignore" the OPC updates and and be simulated, and in some cases, all of the variables.
    So, I've got an application to dynamically change the shared variables properties: Network.UseBinding and Network.URL to "connect to" or "disconnect from" the OPC server, but is there a way to "unbind" the whole library from the OPC quickly and restore it back when need it?
    I tried creating and deleting the IO server programatically but the variables go "bad"...
    Is this is a good practice or should I change the method?

    Hi Keptat, you can bind them directly to the OPC sever but you need to add
    psp: at the begining.
    For example 
       psp:\\localhost\IOServer\ModbusSlave1.000001
       psp:\\aebenjamin\IOServer\OPC1.Channel_0_User_Defined.Ramp.
       psp:\\ host \ library\IOservername.register
     An easy way to find the complete address y bind a Variable with psp
    binding to the OPC server and you will get the path.
    In the example code it gets the psp address from a Library, but won't get
    you the directions of the registers inside the IOserver, so you need this list
    manually.
    Another option is create 2 libraries one with the variables binded to the IO
    Server and the other binded to the simulated info, in this case you just have
    to point to the library, and get the address of all variables.
     Also you have to make sure the OPC server is deploy and you can see it
    in the Distributed System Manager
    Best Regards
    Benjamin C
    Senior Systems Engineer // CLA // CLED // CTD

  • Binding Shared Variable to Source

    Dear all,
    I'm currently working on a project that requires the use of shared variables. The shared variables will be network published and programmatically created using properties nodes. However I encounter one error and one problem in the process of doing so.
    1) I programmatically bind the shared variable directly to the fieldpoint channel (data item) by writing the URL \\10.0.0.1\FP\1AIO\00 when i create the shared variable. The shared variable can be created successfully but when i deploy it, it generates an error which seems to tell me "it is out of range". Can anyone help me to rectify this problem?
    2) The 2nd question will be, as my fieldpoint is connected to a DHCP server. At the start when i create the shared variable programmatically, i could bind the shared variable directly to the data item by writing the URL to its property. However, during the process of deployment, the dynamic IP address assigned to my fieldpoint may change . How can I ensure that the shared variable continue to bind to the right fieldpoint channels respectively? even though the IP address changes?
    - Or is there any method that I could view all the network data items in a table? a list? or an array? so that I can link them to the URL.
    I tried using the data socket URL.vi, I can only select the data item one by one.. this will be tedious for 100 or 200 I/O points..
    Will greatly appreciate for any advice and help. Thanks in advance.

    Try this.
    Give your fieldpoint controller a computer name through MAX.  Then instead of referencing it by 10.0.0.1 in the URL's of the shared variables reference it by computer name.  So  \\MyFPmachine\FP\1AIO\00 instead of  \\10.0.0.1\FP\1AIO\00.
    Dynamic IP's can definitely cause headaches, and it would be best to use static IP's if possible, but doing this method should help.  It seemed to work for me.  I found when you browse for the channel in LV, it wants to give it the IP address by default, but it was possible to edit the string and paste in the computer name.
    Message Edited by Ravens Fan on 01-10-2007 11:01 AM

Maybe you are looking for

  • Billing due list

    HI, I created a sales transaction in CRM and replicated to ERP. After posting goods issue in ERP, I can see the status become 'for billing' in CRM. But nothing can be found in maintain billing due list ( tcode  /BEA/CRMB01). Billing relevance of item

  • Replacing pages in accessible PDF's

    Hi - Brand new to this forum.  Hoping someone can help... I have an existing tagged, tested and accessible PDF - needed content update, so did that in Word, created a new tagged, tested and accessible PDF, and used Replace pages to insert the new pag

  • Message mapping tab works fine ,runtime exception

    Hi , Need some advice... I get a runtime messge mapping error ( system error) failing the substring logic although when i download the same payload and run in test tab it works fine. Has anyone encountered similar issue ? Thank you.

  • Score system in vendor evaluation

    Hi, Please explain how scoring system works in vendor evaluation for criteria Delivery and sub criterias on time delivery and qty reliability. Thanks in advance! Regards, Jana

  • Language translation of Condition text

    Hi Friends, I am working on an Implementation Project & would need your inputs on the following requirement: Condition Texts are maintained in ECC at a Condition Record level. This is maintained in English and would be uploaded using a BDC / LSMW pro