Re: shared variable: create programmatically then read/write

I programatically create and destroy Shared Variables using these subVIs (see enclose llb file for Add Variable Connection.vi and Delete Variable Connection.vi).  But it seems to take a long time to run each subVI.  This might be tolerable for a single Shared Variable, but it gets rather lengthy if several need to be created or destroyed.  The user specifies how many depending on how they are using the application.  Is there a more efficient way of doing this?
Also, after a Share Variable is "created," it can take a while before it is usable for reading and writing in another part of the application.  Is there a way to determine a Share Variable is ready prior to using Search Variable Container and Open Variable Connection functions to find and use it?

Ummm, nothing attached. Also mention, when you do post, what version so that people won't waste time downloading when they don't have the appropriate version installed.
Putnam
Certified LabVIEW Developer
Senior Test Engineer
Currently using LV 6.1-LabVIEW 2012, RT8.5
LabVIEW Champion

Similar Messages

  • How to create files with read/write privileges for everyone?

    I have two iMacs 7,1 (one with Snow Leopard and the other with Mountain Lion) in a local area wireless network.
    I have shared the "documents" folder in the Snow Leopard iMac in order to have files available to the other iMac. The folder has read/write privileges for everyone.
    When I create a new file in the shared "Documents" folder (for example a new Open office document, or a Keynote presentation) this file is by default "read/write" for the Administrator but only "read" for all the other users, so when I try to open it from the other iMac, I am informed that the file is "read only".
    I can obviously change the privileges of the file in the information window, but I have to do on a file per file basis and this takes too long.
    Is it possible to change settings in order to create files which are always "read/write" for everyone?
    And, secondly, since I have several existing files whose privileges I should manually change one by one, is it possible to make global changes of their privileges?
    Thanks in advance
    Best regards

    couple of different changes - 1st, if you want to share folders, doing your whole documents folder is not the best way.  Since both your computers can handle AidDrop, that's what I would recommend - http://osxdaily.com/2011/11/14/how-to-use-airdrop-in-mac-os-x/ - as it create an instant Ad-Hoc network between the two computers and then let's it done. 
    A second possibility that may not be what you're looking for, is to use google drive or some similay cloud sharing app to sync the documents back and forth.  both of these solutions will transfer the files well, but the airdrop may be simplest

  • Why shared variable generates events when I write constant value?

    Hello all,
    I'm using LV 8.5 with DSC packet.
    I modified "DSC Events Demo".vi and made a test. I noticed that only variable which work okay is double typed. Why this code generate events all the time when I write constant values to shared variables? Double is okay, but string and boolean types not work okay. Is there any other people how have noticed same symption?
    Attachments:
    modified_dsc_event_demo1.zip ‏391 KB

    You may get an initial event on startup which is normal.  Also make sure that you have not enabled timestamp change events.

  • Lion server file sharing issue with windows API read/write ini file (GetPrivateProfileString)

    Hello,
    I try to config lion server as file server for a windows application we use at work. All other computers are windows 7 or XP, lion server is the only mac. I choose lion server because it's size, quality and personal love of apple products.
    10.7.2 lion server's samba file sharing works almost perfectly with all my windows machines, I can copy, delete, modify any text files or office files without any issue, but the most important windows application for my business doesn't work with samba file sharing. After some digging, I found it is because windows program can't read or write INI file stored on lion share. Windows API GetPrivateProfileString always returns empty if the INI file is store on lion share.
    You can download a small application for read/write windows INI file from codeproject.com to test this problem:
    http://www.codeproject.com/KB/files/ini.aspx
    I can open/edit the in file using any text editor without any problem. The only problem is with those windows APIs. ACL is turned on for my lion share and assigned "delete" rights to samba users.
    I install samba3 on the same server; it works perfectly with windows API. My windows program also works. Looks like there is something wrong with lion server's sambax.
    I'd prefer to use built-in samba even I have samba3 working. Built-in samba is very immature right now, but considered how young it is, I will give apple some time to make it mature.
    Does anyone have same issue or knows how to fix it?
    Thanks,
    Michael.

    All the memory is fine. The server rarely if ever goes down when there are only around 10-12 users connected. When there are 20+ users connected and working heavily it goes down often. When I say working heavily, I mean they are transferring huge files to the SAN (100GB+), sometimes 5 at a time per user, and there are a bunch of others who are reading large video files at a minimum of 220MB/sec from the SAN.
    Though this worked on Snow Leopard without any issues, Lion just doesn't seem to be able to handle it. The odd thing is, on Snow Leopard there was only a single 1GB ethernet connection to a NAS system, whereas with Lion we have a much more powerful machine with a 6-port 10GB ethernet card and a 4 lane 8GB fiber card to a true SAN. You would think that the newer scenario with Lion would handle far more users with ease.
    So far, very disappointing with regards to Lion's file serving performance.

  • Why do Single-Process shared variables create a single variable VI in my dir.

    I'm creating an application VI following the example which is created by starting a two loop Real-Time project which creates a Single-Process shared variable and a Network-Published shared variable for each variable that needs to be sent to a non-Realtime host VI. Each of the Single-Process variables shows up as a VI file with the following format: <variable library>_<variable name>.vi. The VI has one control which is the shared variable. I have a large number of variables and this creates a lot of clutter in the directory. I expected them to be rolled up into the library file. Is this expected behavior? I'm attaching a screen shot to show the behavior.
    Attachments:
    Shared Variables in Directory.JPG ‏383 KB

    Hi davidreed10,
    This is a known issue with single process variables that are saved in a
    project that has the .lvproj and .lvlib files initially saved in different
    locations, as is the case with Real-Time projects. This has been
    previously reported to our R&D department with the ID #56580, and
    is being worked on for a fix in a future release of LabVIEW.
    This should be only a problem for Single-Process variables, and not
    Network-Published variables, so if you want to keep your folder from
    getting cluttered up, changing the variable types to Network-Published
    should get you around the problem for now.
    Regards,
    Stephen S.
    National Instruments
    Applications Engineering

  • Variable created and then appears on other InfoObjects as well

    Hi,
    I created a variable for InfoObject 0CALDAY, and for some reason the variable also appears from other date InfoObjects. Are there some settings that I would have to make in order to avoid this problem. Shouldn't it only be craeted and seen from 0CALDAY InfoObject? I am working on BI 7.0.
    Thanks,
    RT

    Hi RT,
    Yes, it happens. Its not specific to BI 7.0, it happens  in 3.X as well.
    I don't think there is any setting to avoid this as system automatically take 0DATE as reference characteristic whenever you define any characteristic as DATS.
    Hope it helps.
    Thx,
    Soumya

  • Shared Variable connectivity in LabVIEW Mobile

    Hello,
    I'm developping an application for a portable device running Pocket PC 2003 O/S.
    I'm trying to figure out whether shared variable connectivity VIs (Open, Read, Write, etc..) are supported in LabVIEW Mobile 2010 module or not?
    Is dragging shared variables from the "My Computer" target directly under "Pocket PC 2003 Device" target the only way to use shared variables in LabVIEW Mobile?
    Thanks.

    Is NI planning to implement progamatically connecting/reading/writing/closing of SV's functionality using the PDA/LabVIEW Mobile module ?.
    In my company we have started to include a cFP 2220 + various I/O modules with one of our products - might I say thats not easy when the Siemens guys can sell their PLC's at a fraction of the NI cost- but please do read on...
    As a user-interface an 8" touch panel is used. One of the problems is that I have to "hardcode" the IP address of the SV's used on the touch panel to connect to specific variables on the cFP 2220 var. engine. This gives the tedious work of recompiling the touch panel code over and over again for specific customers needing specific IP addresses for their cFP controllers. And if the customer uses MAX to change the IP address of the cFP, then his GUI stops working.
    Initiallly I had this problem with the cFP 2120 controller, and thought that my problems would be solved when the cFP2220 came out, since it has two network cards. One card could then be used for "local" communication with the touch panel/GUI and the other for the company network of our customer. Needless to say I was sad to find out that the var. engine can only run on one of the cards - not both.
    The only other solution I see it to implement a homemade protocol via TCP/IP, but this is a lot of work and not really the intention of the Shared Variable.
    Any suggestions to a soltion of the above problem would be greatly apriciated.
    /søren jensen

  • Polling variables using Modbus IP and labview 8.2.0 shared variables

    I'm using shared variable in order to read/write register on a Watlow PM controller over Modbus IP standard. Once I make a change to FP control, the shared variable polling starts and I no longer get update of any controls or indicators on the FP.
    Just wondering if this is an LV 8.2.0 issue and if any of this is addressed in LV 8.5?
    Thx ahead of time
    richjoh

    Hi richjoh,
    If I understand correctly, there are two issues to address: the status of the UpdateNow shared variable and the fact that your controls and indicators are not updating. 
    When you right-click on UpdateNow in your project and select Properties, what is the data type listed there?  Is it bound to one of the other shared variables that has a value in Variable Manager?
    After changing a control on the front panel, do you continue to see the values changing in Variable Manager even though the controls and indicators do not update on the front panel?  Do you see the same behavior regardless of which control you change? 
    Thanks for the additional information. 
    Jennifer R.
    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

  • Reading shared variables

    hi ,
    im having problems reading a shared variable value from a vi ,
    i created a project library , periodic i/o server deployed it. created the shared variables i needed . bound them , created my new vi  draged the shared variable i wanted to read , just a time value , set it to a indicator , then ran the two vi s the triangle has apeared on both the main vi and the hmi vi ,and is green , no conflicts arose , but the hmi vi isnt displaying the data ,
    both vi s are on the same computer , have i missed somthing ,?

    Hi Vadajooz,
    Good Morning and I hope your well today.
    I was wondering how you got on with your application and if you still require support?
    If so, I would be interested to know what version of LabVIEW you are using?
    I would make two simple VIs, one to write to the variable and one to read from the variable. 
    1. Create the bound variable.
    2. Deploy the library,  make sure it appears in the Distributed System Manager (DSM - LabVIEW 8.6+) or Variable Manager (LabVIEW 8.5 - ).
    3. Run the writer VI, for example, just have a switch (true/false) and when you change the switch state does the status update in the DSM or Variable Manager?
    4. If so, then run the reader VI, is the status matching the writer and there DSM/Variable Manager. 
    *DSM/Variable Manager can be found by going to tools>>... in the VI toolbar. 
    If you are still having problems,
    A. There is a known issue with bound variables in LabVIEW 8.6 - so I can inform you on this if you are using it.
    B. I would confirm that the variable is deployed - to do this right-click the library and select Deploy All. 
    C. Make sure you write to the variable before reading from it.
    D. Add error cluster indicators and note any errors you see.
    E. Please attach your simple (test) project - so we can confirm its correct. 
    I hope this helps, 
    Kind Regards
    James Hillman
    Applications Engineer 2008 to 2009 National Instruments UK & Ireland
    Loughborough University UK - 2006 to 2011
    Remember Kudos those who help!

  • Can not read shared variable on cRIO, error -1950678968 nitaglv

    Hardware setup:
    Laptop
    Laptop connected via USB to a frammer garber. 
    Laptop IP: 192.168.0.2
    NI vision calculating a diameter and setting a network varaible
    cRIO
    cRIO connected to the laptop
    cRIO IP: 192.168.0.1
    Project has the shared variable in the cRIO library
    NI vision writes to the variable on the cRIO.  I can see the variable properly updating in system manager on the cRIO.  I can also run a VI in my computer that shows the variable properly updating.  But......   When I read the variable with a VI running on the cRIO, I get the folowing error and the variable never updates:
    Error -1950678968 occurred at Shared Variable in Main.vi
    Possible reason(s):
    LabVIEW:  Failed to load nitaglv, which is required for Network-Published Shared Variables.
    This error or warning occurred while reading the following Shared Variable:
    \\NI-cRIO-OASIS\cRIOVariableLib\BubbleDiameterFromVision
    \\192.168.0.1\cRIOVariableLib\BubbleDiameterFromVision
    (I do not get any errors at deloyment)
    So everything (NI Vision, a VI deployed on the laptop, NI Distributed System Manager) can see the variable on the cRIO being updated by the NI Vision.... Except for a VI running on the cRIO.
    I have verified that I have Network Variable Engine and Variable Client Support for RT installed on the cRIO.  I have tried reinstalling all s/w on the cRIO.  Tried rebooting all. And talked in a nice, positive, reassuring voice to the chassis.

    Hi!
    I just had the same issue with my cRIO 9073 using NI RIO 3.6.0.
    The problem is not caused by a corrupted project, but the improper installation of the OS on the target. There is nothing you can do using the SW installation wizard in MAX, as it does not matter if you intall a full RIO SW, minimal or custom.
    You have to install the full install or a custom one with Shared Variable support. Then you have to FTP to the cRIO, and manually edit the "ni-rt.ini" file located in the root of the controller.
    Make sure you have a line in the "[MODULE VERSIONS]" section which shows the version of the nitaglv.out file. (The problem is caused because this dll is not loaded when you try to access a SV) Mine looks like nitaglv.out=6.3
    Then you have to insert "nitaglv.out;" without quotes to the [LVRT] section's StartupDLLs key's value. I did it after the taggerrt.out name. So my key entry now looks like this:
    [LVRT]
    StartupDLLs=nisysapirpc.out;NiViSrvr.out;NiRioRpc.out;taggerrt.out;nitaglv.out;sysstatepublisher.out;
    memoryChecking=False
    LABVIEWRTDir=/c/ni-rt/system
    PATH=/c/ni-rt/system/;/c/ni-rt/;
    CDIntervalTicks=55
    WebServer.Enabled=FALSE
    RTTarget.VIPath=/c/ni-rt/startup
    RTTarget.IPAccess=+*
    RTEnetRcvMode=2
    RTCPULoadMonitoringEnabled=True
    RTTarget.ApplicationPath=/c/ni-rt/startup/startup.rtexe
    server.tcp.access="+*"
    RTTarget.LaunchAppAtBoot=True
    RTTarget.EnableFileSharing=True
    server.tcp.serviceName="Main Application Instance/VI Server"
     After you are done with the editing, you have to save the file, and overwrite the original one. You have to reboot the controller for the modification to take effect.
    After this you will be able to host your variables on the cRIO and also read/write them from the application running on that same target.
    I hope this will help for you too.
    Regards,
    Peter

  • Peculiar behavior of Shared Variable RT FIFO

    I'm trying to "leverage" the enhanced TCP/IP and Shared Variable properties of LabView 8.5.  My application involves (among other things) doing continuous sampling (16 channels, 1KHz/channel) using 6-year-old PXIs (Pentium III) and streaming data to the host.  I developed a small test routine that was more than capable of handling this data rate, even when I had the host put a 20msec wait between attending to the PXI (to simulate other processing on the host).  To do this, I enabled the "RT FIFO" property of the Shared Variable (which was an array of 16 I16 integers) and specified a buffer size of 50 (that's 50 arrays).  Key to making this work was figuring out the "error codes" associated with the SV RT FIFO, particularly the one that says the FIFO is empty (so don't save the "non-data" that is present).
    Flush with success, I started developing a more realistic routine that involves rather more traffic between Host and Remote, including the passing back and forth of "event" data.  These include, among other things, "state variables" to enable both host and remote to run state machines that stay "in sync"; in addition, the PXI also acquires digital data (button pushes, etc.) which are other "events" to be sent to the Host and streamed to disk.  I developed the dual state-machine model without including the "analog data" machine, just to get the design of the Host/Remote system down and deal with exchanging digital data through other Shared Variables.  Along the way, I decided to make these also use an RT FIFO, as I didn't want to "miss" any data.  One problem I had noticed when using Shared Variables is the difficulty of telling "is this new?", i.e. is the variable present one that has been already read (and processed) or something that needs processing.  I ended up adopting something of a kludge for the events by including an incrementing "event ID" that could be tested to see if it was "new".
    Today, I put the two routines together by adding the "generate 16-channels of integer data at 1 KHz and send it to the Host via the Shared Variable" code to my existing Host/Remote state machine.  I used exactly the same logic I'd previously employed to monitor the RT FIFO associated with this Shared Variable (basically, the Host reads the SV, then looks at the error code -- a value of -2220 means "Shared Variable FIFO Read Buffer Empty", so the value you just read is an "old" value, so throw it away).  Very sad -- my code threw EVERYTHING away!  No matter how slowly the Host ran, the indicator always said that the Shared Variable FIFO Read Buffer was empty!  This wasn't true -- if I ignored the flag, and saved anyway, I saw reasonable-looking data (I was generating a sinusoid, and I saw numbers going up and down).  The trouble was that I read many more points than were actually generated, since I read the same values multiple times!
    Looking at the code, the error line coming into the Shared Variable (before it was read) was -2220, and it remained so after it was read.  How could this be?  One possibility is that my other Shared Variables were mucking up the error line, but I would have thought that the SV Engine handling reading my "analog data" SV would have set the error line appropriately for my variable.  On a hunch, I turned of the RT FIFO on the two Event shared variables, and wouldn't you know, this more-or-less fixed it!
    But why?  What is the point of having a shared variable "attached" to an error line and having it return "Shared Variable FIFO Read Buffer Empty" if it doesn't apply to its own Read Buffer?  This seems to me to be a very serious bug that renders this extremely useful feature almost worthless (certainly mega-frustrating).  The beauty of the new Shared Variable structure and the new code in Version 8.5 is that it does seem to allow better and faster communication in real-time using TCP/IP, so we can devote the PXI to "real-time" chores (data acquisition, perhaps stimulus generation) and let the PC handle data streaming, displays, controls, etc.
    Has anyone been successful in developing a data-streaming application using shared variables between a PXI and and PC, particularly one with multiple real-time streams (such as mine, where I have an analog stream from the PXI at 16 * 1KHz, a digital stream from the PXI at irregular intervalus, but possibly up to 300 Hz, and "control" information going between PC and PXI to keep them in step)?  Note that I'm attempting to "modernize" some Version 7 code that (in the absence of a good communication mechanism) is something of a nightmare, with data being kept in PXI memory, written on occasion to the PXI hard drive (!), and then eventually being written up to the PC; in addition, because the data "stayed" on the PXI, we split the signal and ran a second A/D board in the PC just so we could "see" the signal and create a display.  How much better to get the PXI to send the data to the PC, which can sock it away and take samples from the data stream to display as they fly by on their way to the hard drive!
    But I need to get Shared Variables (or something similar) working more "understandably" first ...
    Bob Schor

    Bob,
    The error lines passed into and out of functions are just just clusters with a status boolean, an error code, and an error string, and are not "attached" to a particular function as you describe in your post.  Most functions have an error in input and an error out output, and most functions will simply do nothing except pass through the error cluster if the error in status is True (to verify this for yourself, double click on a function such as a DAQmx Read or Write and look at the block diagram.  If there is an error passed in, no read/write occurs).  This helps prevent unwanted code from  executing when an error does arise in your program.  By wiring the error cluster from your other shared variables to your analog data variable, you're essentially telling LabVIEW that these functions are related and that your analog data variable depends requires that the other shared variables are functioning properly.  The error wire is a great way to enforce the flow of your program, but you must always consider how it will affect other functions if an error does arise.
    Anyways, it's great that you have things more or less working at the moment.  Keep us all updated!

  • 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

  • Custom data type causing trouble in deploying shared variable to RT target

    I seem to be having some difficulty in using a network published shared variable created from a custom data type when deployed as an executable on an RT cRIO target.  I'll start by describing why I believe this is where the problem lies.  I created my RT VI in the LabVIEW development environment (LV 2012) and everything works fine.  This VI is pretty simple because it rapidly devolved in to a debug exercise.  The RT VI starts by simply blinking the User LED a couple of times and then starts a simple acquisition loop to read a few values off the hardware using the scan engine (while still blinking the User LED).  After reading the hardware, the values are bundled in to a cluster and written to a network-published shared variable defined by a type def custom control.  The custom control contains five dbl precision floats.  If it matters, the cRIO RT system hosts the shared variable in this case.
    So, I deploy this under the development environment and everything works fine.  The LED blinks merrily along, telling me that the program is running properly.  Running a host VI that reads the network-published shared variable yields the desired result.  All is good.
    Now I want the cRIO system to run this simple program autonomously at startup.  I build it, set it as the startup VI, deploy it and then restart the cRIO target.  The LED never starts blinking... the VI does not seem to run.  I will spare you most of the debugging work and jump to the end.  I basically "Diagram Disabled" various sections of code until the VI started running correctly as an executable.  I kept reducing the size of the disabled code until only one thing was disabled:  the write to the custom data type shared variable.
    So, I guess my question is this:  Are custom data types defined by type def'd custom controls allowed in executable RT programs?  I've read through the cRIO Developers Guide, my NI Real Time Development course book and the Using Shared Variables white paper and I didn't see anything that forbade it.  I know that there are some things not allowed in executables that are allowed in the development environment (front panel property nodes, dialog VIs, OS-specific calls, etc), but no mention of custom data type shared variables.  Any ideas as to why my VI runs in the development environment but fails when compiled unless I remove the write to the network published shared variable?
    Thanks in advance for your help!!
    Solved!
    Go to Solution.

    Paolo,
    So I thought that you meant to disconnect them in the build specification.  Under the Additional Exclusions in the build specification, there is a check box for Disconnect Type Defs.  I checked that box, recompiled, redeployed and it did not work.  At this point I had to give and move forward, so I was going to convert the data typed from a cluster to an array.  When I went in to change the data type in the shared variable pop-up from the project explorer, there was a big button under the variable definition that "Disconnect from Type Def".  Clicked that button, recompiled, redeployed, restarted and everything worked great.  Thank You!!
    I suspect that I'll have to be careful if I change the definition of that data type (add an element, etc) since it is no longer connected to the data type.  We'll cross that bridge when we need to.
    Thanks again

  • Modbus I/O Server Shared Variable Not Updating Immediately After Flush

    Hi everyone,
    Weird issue here... If I create a Modbus I/O server in a LabVIEW project, bind a shared variable to a holding register, write to the shared variable, flush, and read back, the value returned in an immediate readback is NOT the value I previously wrote. I've attached an example snippet.
    In this example, PLC Command Complete is TRUE coming in. I write a FALSE to it. I flush the shared variable buffer. I read back PLC Command Complete. When I do this, PLC Command Complete will return TRUE (???), and after 100ms or so, return FALSE. How is this possible??
    Some notes:
    The shared variable is NOT network buffered.
    The slave is NOT altering the value of this variable; only this snippet of code is.
    Altering the refresh rate of the Modbus server does not affect the outcome.
    If anyone has any idea as to what's going on, I would greatly appreciate it!

    Couple of points.
    First, your screenshot shows network shared variables, not single process!
    Next, network shared variables take time to update (much longer than NI tell you!) If you knock up a little timing noddy to set a variable and then loop reading that variable until the transition comes through you get results like this (runnng from the programming environment, I've not tried with a compiled exe):
    Network shared variable, no flush - approx 20ms (NI say is should be 10)
    Network shared variable, flush buffer - very fast (faster than the ms clock resolution) but still took between 14 and 20 iterations of my loop before the change percolated through (certainly not what you would expect)
    Single Process variable - instant (even without the flush)
    This has caused me so many problems in the past (my own race conditions are bad enough without NI throwing in extra ones with this unexpected behaviour) that I try to avoid network shared variables now.
    Change yours to single process and you should be fine (or do they need to be NS?)

Maybe you are looking for