Simple tcp messaging vs. shared variable

I am getting ready to deploy a project which will have one HMI and three sbRIOs on a closed local network with static IP addresses. Of course these devices will need to comminucate certain information to each other in order to advance the process each is responsible for. I have used shared variables back in LabVIEW 7.1 but not since. As I remember it was pretty straight forward and simple to implement. The data I will be sending will either be boolean or string. I was recently introducted to simple TCP messaging and was curious, based on experience, what will be the best option for reliable communication. i know this is potentially a vague question, but thanks anyway.
Doug Ferguson
www.southerndaqsolutions.com

Hi Doug,
Shared variables where introduced with LV8.0 so I don't think you used them with 7.1
If you need to pass big amounts of data and lots of different types I would suggest to use STM, which is btw very easy to implement and allready gives a good example on communicating between more cRIOs and a Host.
The advantage of Shared Variables is that they are very easy to implement, but for large data TCP/IP and so STM has a better performance.
Christian

Similar Messages

  • Using TCP or shared variable for data transfer

    I am trying to send a large amount of numbers from a real-time module to a host computer.  These numbers have been arranged into a large array, such as an array with 10s of thousands of points.  The time critical portion of getting the information has already been done, so the data transfer back to the host VI is not time critical.  I know I will need to break the large array down into smaller arrays and then reform the large array after all the information has been sent.  I know how to use both TCP and shared variables with FIFO.  What I am unsure of is which one is better to use for this application.  I do not know what the maximum size arrays I can send through either.
    Also, from what I have gathered from using LabView is that the sender has to be listening for a connection before the client opens a connection, or else it will throw an error.  When I tried breaking it down into 50 points, if i did not wait long enough in the host VI or if I did not put a long enough wait function in the RT loop, and error would throw, so it would take a long time to transfer the data when it worked properly.
    Any help or suggestions is appreciated, thanks.

    Regarding the array size question, there is no real limit (other then the amount of memory in your system) to the size of data that you can transfer in a single block using either TCP or the Shared Variable. In your case you can easily transfer an array with 10's of thousands of data points in a single write operation. Both TCP and the Shared Variable will automatically handle breaking up the data for the maximum packet size on Ethernet and then reconstitute the array on the receiving end. In LabVIEW you will simply get back the array as a whole without needing to worrying about how the data is broken into smaller packets on the Ethernet.
    I tested the attached example which transfers 400kB per block (50000 Doubles) without any problems. You do need to have the Server (in this case RT) running first before the client (Windows) can connect.
    Message Edited by Christian L on 02-09-2007 11:34 AM
    Christian Loew, CLA
    Principal Systems Engineer, National Instruments
    Please tip your answer providers with kudos.
    Any attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system,
    or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject
    to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense
    Attachments:
    TCP.JPG ‏44 KB

  • LABVIEW 2012 - shared variable error during programming of NI CRIO 9023 and TPC 2212

    HELLO,
    i am using CRIO 9023 with TPC 2212 and LV 2012. I want to develop a stand alone app which has a front panel on TPC. at first i am building a simple app with two controls variables, one is a sliding bar on TPC Vi and the other one is the while loop  variable "i" on CRIO VI. i used  shared variables.
    first i creat shared variable on CRIO side and access this on TPC Vi. I COMPILE both Vi,s and they are working fine. But when i created the slide bar control in TPC VI, compiled and deploy the TPC Vi, it get deployed in TPC. But when i  start compiling the CRIO VI an error mesage occured as follows;
    I have tried every option to best of my understanding like formating crio then installing all softwares including Network variable engine etc. i also go in properties of the executable file of TPC Vi and go in properties-shared variable- then check the "deploy variable in application" option . below is image displayed.
    I am in despirate need for solving this problem as i have to develop the final app for testing soon. can some one help me regrarding this.
    REGARDS

    I would not recommend using shared variable engine.  It is supposed to make things easier, but in fact, you will spend more time troubleshooting why it is not working than you will actually coding an alternative solution.
    Try the Simple TCP Messaging instead.
    http://zone.ni.com/devzone/cda/epd/p/id/2739
    Machine Vision, Robotics, Embedded Systems, Surveillance
    www.movimed.com - Custom Imaging Solutions

  • 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 Modbus TCP I/O Server with new DSC Shared Variables in LabVIEW 8.6

    Hello,
    I'm using LabVIEW 8.6 and want to communicate with a Beckhoff BK9000 Ethernet TCP/IP Bus Coupler via Modbus TCP. Instead of using the NI Modbus Library, I've tried the new LabVIEW 8.6 feature "DSC Shared Variables" as described at the bottom of this page: Latest NI LabVIEW DSC Module Features and Demos. Reading of analog input bus terminals works fine. However, I haven't figured out yet how to write on an anolog output bus terminal with these shared variables.
    It's about a 16 bit analog output and I need to write to the registers 0x1121 and 0x0801. It works with the NI Modbus Library (just using function code 6 and choosing the registers), but on the other hand I don't know which shared variables I have to choose for these registers. I've tried several data items (e.g. 400001 upwards as well as 402049 for 0x0801) but none of them worked. I would be glad for a short explanation - thanks in advance for your support!
    Regards
    utechle

    The Beckhoff documentation says, that holding registers start with 0x0800. I've checked this by using the NI Modbus Library. I used the "MB Ethernet Master Query.vi" togehter with the function code 6 for "Write Single Registers", changed the settings of the starting address to hexadecimal view and entered 801 (since it starts with a control byte in 0x0800 and the data out word follows in 0x0801). Furthermore, I had to address register 0x1121 in the same way for resetting the watchdog. As I've mentioned in my first post, this method works fine. However, I haven't found out yet which shared variables i have to use for accessing these registers.
    On the other hand, it's no problem to read data from analog input bus terminals using shared variables. They start with 0x0000 (status byte) and 0x0001 (data in word) and I can read data with the shared variable and data item 300001, respectively.
    Message Edited by utechle on 01-27-2009 11:12 PM

  • Distributed application: Networked Shared Variables, Named Services (Raw TCP/IP) or Other?

    Happy New Year NI forums! 
    I am working on a project involving mobile interacting robots. In the future it is likely the application's components may need to run on different PCs (Targets). Note: at this point in time all the components are seperate but all running on the localhost machine. Thinking towards the future I want to pick the 'best' architecture to allow all these components (VIs performing various functions) in multiple locations. For example, several VIs on the Robots, VIs on serveral PCs. 
    I am  currently aware of using Server/Client TCP/IP using named services. My mock up works well, but is it time efficient (my time coding) I wonder.. ?  
    Whereas I am aware of networked shared variables which handle connections and all the parsing for the underlying tcp/ip communication. But will this be difficult the manage? I am unsure if I can associate shared variables with a VI similar to named services. I suppose I could pro grammatically create the variable upon initialization of the server component - and the client could just search the list of avaiaible variables to connect too. Downside this would require DSC module. 
    As you can see, I am rather unsure. Any advice would be great!
    Kind Regards,
    James  
    Kind Regards
    James Hillman
    Applications Engineer 2008 to 2009 National Instruments UK & Ireland
    Loughborough University UK - 2006 to 2011
    Remember Kudos those who help!

    Hi Jason,
    Thanks for your reply. I hope your enjoying NI UK as much as I did.. fun times!
    I have seen the link you posted a few times before. But today, I took a better look at it.
    My issue is I need several multi-client severs, i.e. many servers which allow multiple clients to connect to them.
    Now the STM does have an example of this - STM mutli-client Example - Server.vi (used with the STM mutli-client.vi)
    However, when a make copies of these code (to have my second server) - it refuses to run. As in , it just stops itself.
    I DID change the port number, on the lister aspect of the server code. But I Am unsure what else I would need to change to get this setup to work?
    One thought I had was, the FIFOs all having the same name - this probably isn't a good idea between servers.
    Any suggestions would be grateful!
    *please could you provide me email support
    Kind Regards,
    James Hillman  
    Kind Regards
    James Hillman
    Applications Engineer 2008 to 2009 National Instruments UK & Ireland
    Loughborough University UK - 2006 to 2011
    Remember Kudos those who help!

  • Odd Shared Variable Dialog Box message

    I came across some odd behavior in the dialog box while I was created a new shared variable.
    As I was typing in the name, I kept see a warning pop up in the dialog.  It would come and go as typed.  I figured out that whenever I typed a space, and thus it was temporarily the last letter in the SV name, the warning popped up.  Type the next letter, the warning would go away.  You can see the space ending the name right before the cursor in the top picture, and the name ending with a normal character in the bottom picture.
    Now it is logical to me that ending a shared variable name with a space would be a bad practice, and should be warned against.  But the warning never actually states that you can't end with a space.  To be more precise, it says you can't have the slash code \s in the variable name.  Now I am not actually entering slash codes, but I am entering spaces.  And they seem to work just fine in the variable name, just not if it is the last character.
    It just seems to be a mismatch between what the warning says, and what you can and can't do.
    Can you have spaces in the SV name?  By my experience you can.
    Also, this in in LV 8.6 on an XP SP3 machine.
    Message Edited by Ravens Fan on 03-05-2009 05:02 PM
    Solved!
    Go to Solution.
    Attachments:
    SV Dialog.PNG ‏48 KB

    ColeTrain wrote:
    Ben, which VI did you use to create your bogus folder? Was this a specific DSC VI or just the generic Create Folder VI? 
    The CAR for that bug was "105656".
    The desription for that CAR was "Create DB while specifying path with space on end creates illegal Windows directory".
    It supposed to create then put then put hte data files in the specified folder. It does the create but has trouble putting the data in the folder.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Modbus Ethernet read and write to a Eurotherm 6180XIO Modbus server using LV8.2 shared variables

    I am having EXTREME difficulty trying to establish communications with a Modbus device using LV8.2 shared variables.  The device is a Eurotherm 6180XIO Datalogger configured as a Modbus master.  The PC and a cFP-1804 are slaves.  All IP addresses are set correctly.  This approach using shared variables would seem simple, but I can't find any examples or proper guidance on how to get it working.  I am trying to avoid having to mess around with TCP/IP, OPC, or any other old-fashioned method.
    I have read many threads on related topics but none directly apply to this situation.  I have created a library containing a Modbus I/O server and shared variables bound to read and write holding registers.  I have followed all recommended tips for creating such variables but I can neither read or write data.  All data types are U16 due to Modbus protocol limitations.  I have also applied the LV x10 factor in the most significant digit in the register offset (6 digits instead of 5).
    I have a cFP-1804 on the same network which reads into the datalogger OK.  The registers I use are 31000 (for CH0 on module 0, 31002 for CH1, etc) and the data can be read as FLOAT32.  I have updated the firmwate on the 1804 to the latest level.  I cannot even get shared variables to read SGL values.  Using registers 301001 for CH0 and 301002 for CH1 I can only read U16 values, and not a 2-word SGL.
    Third party Modbus simulation software is able to write to and read from registers very easily, but not LabVIEW.
    Some questions are:
    - do I use a Modbus master or slave as an I/O server in the library as a target for binding the shared variables?
    - is there some other wierd translation in register offsets between LabVIEW and traditional Modbus?
    - is this actually possible using shared variables or am I wasting my time?

    Sending the whole 60-character string using a string or array would be the most efficient.  I have tried both methods, and these only cause the datalogger to flag a message log but no text is displayed.
    For a string variable, I have used the following binding "My Computer\Modbus Test.lvlib\ModbusServer6180\442305", where ModbusServer6180 is a Modbus I/O server configured with the logger IP address, and 42304 is the register offset at the start of the text block in the logger.  I need to write to 30 consecutive registers starting with this one.  I am not using buffering and have not enabled single writer.
    Can anyone confirm whether this method should work in 8.2?
    Does the string need a special termination character?

  • Is it possible to generate a user event when shared variable value change on RT target?

    Hi,
        I wonder if it is possible to generate a user event when a network published shared variable value change?
        Thanks a lot!
        Regards,
        Tom

    Tom,
    I understand not wanting to waster resources on polling but I am not aware that LabVIEW can automatically generate an event on a SV change.
    Maybe a better solution...
    You could implement lower level TCP communication (i.e. have a look at STM - simple messaging protocol) for passing data betweeen RT and PC (instead of using a SV).  You could send a generic command (boolean trigger maybe?) from your RT system when the value of whatever it is the SV is storing has changed.  You can avoid polling on the non-RT system this way.
    Dan

  • Deploy Shared Variables

    I'm having an issue with using SVE. I'm using LV 8.6 (cannot upgrade to 2010 at this time, have to "make it work").
    I've used shared variables before with an HMI and PXI but my setup is different now:
    PXI (called my target) that "talks" to different controllers via Modbus TCP/IP. Separate PC to interface to the PXI to provide a user-interface (called my host).
    I've run across posts talking about calling the Deploy Library method in the top-level VI of the application. I want the PXI to deploy the shared variables since it will be running constantly and the PC is optional. Do I "manually" transfer the shared variable library, in this case called the NetworkVars, to the PXI so the PXI application can find it? The PXI will be running independently once the program is completely developed.
    I've used Labview a long time but have never had to do much with networking/sharing.
    Thanks for any help.
    Solved!
    Go to Solution.

    I still cannot figure this out, have read NUMEROUS white papers, help entries, etc. but I cannot get it to work properly.
    PXI system with analog I/O, TCP/IP connections to Watlow controllers. This is where I set up NI-PSP variables, autodeploy enabled, run as startup when I transfer the program to the PXI.
    Separate computer running an interface program to the PXI, the front panel controls and indicators are "bound" to the PSP variables.
    I download to the PXI, reboot it, start my PC program and there is no communication. The PSP LEDs on the bound items are all green but there is nothing going back and forth, UNLESS I run the PXI program on the other development computer.
    I know I'm missing something simple, just getting a little aggravated!  LabVIEW 8.6, no DSC module, just the RT module.

  • Target VI stops before being commanded using shared variable

    All,
    I decided to post this in general since it deals mostly with shared variables however I am working with a RT target so feel free to move it to another forum.
    I originally posted a problem I was having with the RT Module Getting Started example, regarding the 1950679023 error, and trouble shooting led me to create the simplest test project I could think of. (I know you all want a link to the VIs but my company does not allow me to access internet file sharing sites to upload data so bare with me.)
    NOTE: This is NOT an RT project. Just deployed on an RT target.
    In Project Explorer I have Host.vi under " My Computer " and Target.VI and 3 networked-published shared variables (call them A,B,C here for simplicity) with RT-FIFO checked, under my RT target.
    Host.vi is a single while loop with a 0.5sec time delay express VI. The loop contains (along w/ the time delay) 1 numeric control wired to SV A, 1 numeric indicator wired to SV B, and finally a Stop button wired to SV C plus the conditional term (stop if True). SV A is configured as write, SV B as read, and SV C as write.
    Target.vi is a single while loop with a 0.5sec time delay express VI. The loop contains (along w/ the time delay) a numeric add function wired to a constant double and SV A configured as read. Also, SV C is wired to the conditional term configured as read (stop if True). The VI adds the two numbers, one of which is controlled by the Host.vi using SV A, and sends the results to Host.vi using SV B until the Stop button is pressed on Host.vi and sent back to Target.vi using SV C.
    I successfully ran this project (which included my always present 1950679023 error). Then changing no code but merely redeploying/running it again right after or through out the course of many other project deployments I get incorrect data on Host.vi. Basically sometimes it would work, sometimes it wouldn't; having changed NO code. First discovery was that Target.vi would automatically stop after running ~ 1sec since deploying/running on the target and before I could disconnect and open/run Host.vi. I then deployed/ran Target.vi with a probe on the wire between SV C and the conditional term and highlight execution running. After an average of 3 runs through the loop the SV C would automatically send out a True signal even though I never open/run Host.vi. How can shared variable C, which is write controlled by Host.vi, automatically change it's state like that when I never even open/run Host.vi?
    Another interesting observation is, If I first open/run Host.vi and then deploy/run Target.vi, the program ALWAYS works. But those steps go against my limit understanding of running VIs with shared variables on a target, which I got from NI's RT Module Getting Started Guide? I am going to have a hard time developing anything useful with these shared variables if I can not get the LV RT Guide example and this simple VI working. Any help would be great.
    Thanks
    JD
    P.S. I've noticed this error message a few times during deploying/running either the Host.vi or Target.vi. The error is not consistent; sometimes I see sometimes I don;t.:
    error-2147220727 (Hex 0x80040309)
    The client process cannot communicate with the configuration server process. If this problem persists please note the steps you performed that led to this error and contact technical support.
    PXI-1045,PXI-8196 RT,PXI-4220 (slot 2),(2) PXI-6259 (slot 3 and 4),PXI-5152 (slot 5),PXI-2585 (slot 6),PXI-5404 (slot 7)
    LV 8.2.1, RT 8.2, DAQmx 8.5, MAX 4.2, VISA 4.1,
    Pharlap OS ver.12.0, PH_EXEC ver. 8.2

    Thanks for the responses, (sorry this is going to be long)
    - First question is how do you initialize a shared variable (SV)? I don't have the DSC module, which I know has an initial value parameter. The SV is configured as a read and doesn't have any inputs, so am I missing something on the way to initialize it? I know the boolean defaults to False, which is good for my application. Also, right clicking on the SV doesn't bring up any obvious solution? Help if I am lost. Also, all my code is inside the loop (both the RT.vi and Host.vi), nothing is outside the loop.
    - I think I learned something through some trial and error. I made this test VI project even simpler by just having an incremental counter using shift registers inside the RT.vi while loop. The results of that counter are sent out, by way of a network-published SV, to the Host.vi. This network-published SV is located under the target within the Project Explorer. I temporarily got rid of the boolean SV, which was used to stop both the RT.vi and Host.vi. It was that boolean SV that gave me all the problems.
    This new test VI works consistently (also as a stand alone application, which was a first for me). My thoughts are that the issues had something to do with not "completely" removing all previous run instances of the VI and associated SVs/library from the RTs memory. I think I was getting old buffer data or SV corruption when, on my first test VI, would re-run the RT.vi and have the boolean SV inexplicitly switch states from False to True, even though the write controlled instance on Host.vi wasn't even running. I now undeploy everything (and check the Variable Manager) to make sure I have a clean sheet when re-running the VI. Now that brings up a question, is undeploying the only, or proper, way to clear the RT's memory?
    Anywho, I reintroduced the boolean SV into this new edition of the test project (read instance on RT.vi and write instance on Host.vi, while "hosted?" under the target in the Project Explorer) and everything works (although I still get that 1950679023 error once in a while when running for the first time). Meaning, I deploy the RT.vi then disconnect, then run the Host.vi and get valid data, then I press stop and both VI's stop. I then clear out the RT memory (I think all of it?) using undeploy and then repeat. Doing this I get consistent, valid results. If this seems like a learning experience for me please let me know, I don't want something to "work" just by accident. 
    - To answer the second reply: 1) all the SVs where created under the target in the Project Explorer. Also, I have not unchecked auto-deploy or tried deploying manually, but will give it a try. That brings up a great point, most of NI's data on SVs is "technical specification" like and not very in depth for something so complex. I have not been able to find any "tips/tricks" or "best practices", like trying to deploy manually. Is it because SVs are still new?? Also, a frustrating thing is that NI's step by step tutorials treat SVs like they are simple and fool proof, but following their instructions to the T I get errors. They leave out all the little nuances of correctly working with SVs and so it creates a steeper learning curve.  Enough of my rant.
    Thanks again for the responses and any more help to come.
    JD
    PXI-1045,PXI-8196 RT,PXI-4220 (slot 2),(2) PXI-6259 (slot 3 and 4),PXI-5152 (slot 5),PXI-2585 (slot 6),PXI-5404 (slot 7)
    LV 8.2.1, RT 8.2, DAQmx 8.5, MAX 4.2, VISA 4.1,
    Pharlap OS ver.12.0, PH_EXEC ver. 8.2

  • The shared variable does not exist????

    This seems really strange!!
    I already use several shared variables within my whole project without any problem. At this point, I created a new one (a boolean network published) and everything seemed just fine (no errors were detected in my VI and it runs normally). However, when the VI on my host computer tries to use the shared variable, it generates an error message saying "LabVIEW:  (Hex 0x8BBB0005) The shared variable does not exist." (see attached screenshot).
    What is going on? I can't find any help online about that... Can anybody help me with this please?
    Thanks!

    Hello,
    This error can occur if you have an incorrect Path specified under your Bind to Source section for the shared variable - this could be as simple as a typographical error in the defined path.  Double-check that portion of your shared variable definition, and hopefully it'll be as simple as finding a typo in your path.  You should be able to browse for your variable/path by clicking Browse and then selecting Network Items if your shared variable is on the network.  Can you find it by browsing?
    I hope this helps!
    Best Regards,
    JLS
    Message Edited by JLS on 10-05-2006 03:54 PM
    Best,
    JLS
    Sixclear

  • Shared Variable communication (network publiched )

    Hi all ,
    The whole day I have been banging my head with Shared variable communication between RT Host and host computer :
    I essentially attempted to pass an array from the RT host to the Host computer .For this purpose I used a Network published shared variable of type Array U64 . I utilized this link to help me understand usign shared variable communication 
    http://www.ni.com/white-paper/4679/en .. 
    I also enabled RT FIFO .Now in the mentioned link this the information given about using single element FIFO or Multi element FIFO
    '' By enabling the real-time FIFO, you can select between two slightly different types of FIFO-enabled variables: the single-element and the multielement buffer. One distinction between these two types of buffers is that the single-element FIFO does not report warnings on overflow or underflow conditions. A second distinction is the value that LabVIEW returns when multiple readers read an empty buffer. Multiple readers of the single-element FIFO receive the same value, and the single-element FIFO returns the same value until a writer writes to that variable again. Multiple readers of an empty multielement FIFO each get the last value that they read from the buffer or the default value for the data type of the variable if they have not read from the variable before.'' 
    I had read the above content a 100 times but still I am not able to get a clear picture of the difference and when to use which option .So I decided to throw away the text and attempted to try somethign out for myself .
    I had a loop in the RT host that writes different 3 element arrays into the ''network published shared variable '' . Now when I use the multi element option with '' number of arrays as - 2 '' I am able to read the arrays seperates one by one in the host computer ( as we can read a general queue).
    Now when I used the single element option for the RT FIFO with un editable 1 array option ,only the last written array into the ''network published shared variable '' gets read in the host computer .
    This sounds absolutely silly as if this is the case then what is the purpose of setting the ''buffer''.For testing purposes I had set the buffer as 5 arrays .
    In fact I have only one writer ( writing in loop in the RT Host ) and one reader ( again reading in loop in the Host computer ).So I am not even sure if I require The RT FIFO option for the network published shared variable .
    I apologise for the long message but I have reached the limits of running in circles waiting to bang somewhere
    I know I am doing a silly mistake somewher or I am probably missing a simple obvious trick but dont know what it is ..
    I request for some clarity .. In fact I had posted a little while earlier today as well .... link - http://forums.ni.com/t5/LabVIEW/RT-Host-to-Host-computer-communication/td-p/2348130 )
    any help would be appreciated
    Cheers
    me  
    Solved!
    Go to Solution.

    Hi,
    I think the difference between both types is clearer in the LabVIEW help :
    Enabling the Real-Time FIFO
    You can enable the real-time FIFO of a shared variable from the Real-Time FIFO page of the Shared Variable Properties dialog box. Place a checkmark in the Enable Real-Time FIFO checkbox to deterministically share data using single element or multi-element FIFOs.
    Single Element FIFO
    A single-element FIFO shares the most recent data value. The shared variable overwrites the data value when it receives a new data value. Use this option when you need only the most recent value. Configure the size of the array elements or the size of the waveform for the FIFO buffer if you select an array or waveform data type.
    Multi-Element FIFO
    A multi-element FIFO buffers the values shared by the shared variable. You can configure the size and the elements of the FIFO buffer to match the settings from the Use Buffering section of the Variable page, or you can configure a custom size for the FIFO and the FIFO elements.
    Note  For both single-element and multi-element FIFOs, if the variable contains array or waveform data, you must configure the size of the FIFO elements equal to the size of the data you want to share. If both the network buffer and the RT FIFO are enabled, the network buffer must be at least as large as one FIFO element. Sharing data smaller or larger than the length you specify causes a memory allocation that affects determinism.
    Note  Waveforms contain variable-size variant elements that are not compatible with the Real-Time FIFO. Therefore, if you enable the Real-Time FIFO on a shared variable that contains waveform data, the variant element of the waveform data does not transfer.
    http://zone.ni.com/reference/en-XX/help/370622K-01/lvrtconcepts/rt_projectvariable/#Single_Element_F...
    'Hope it helps
    Aurelie

  • Problems with builded app and shared variables

    I got connection error message (Invalid server: cannot connect to server) when selecting a shared variable using dashboard. The app is running on a Win7 PC.
    I have no problem connecting the PC's IP at my dashboard indicator, even, I can select the shared vars library of my app.
    I opened the ports on Windows and Router TCP: 2343, 59000-60000 UDP: 2343, 6000-6010, and created new inbound rules for the kads.exe, lktsrv.exe and tagsrv.exe programs and installed the Run-Time 2013 engine on that PC. By the way, the application also has HTML files created with the web publishing tools that is working OK.
    When I test the application on my develop PC (with LabVIEW 2013) everything works fine.
    Did I miss something?

    Hello jesushidalgo,
    Make sure that there is not a personal firewall enabled on either computer that could be blocking the NI-PSP packets.
    Acess http://digital.ni.com/public.nsf/allkb/6E37AC5435E44F9F862570D2005FEF25?OpenDocument and see the solution.
    Acess: http://www.ni.com/white-paper/12402/en/  to see how configure software and hardware Firewalls to support National Instruments Products.
    Tell me if worked, ok?
    Best Regards
    Rita Souza
    Engenharia de Aplicações
    National Instruments Brazil

  • STM vs shared variable

    From what I have seen on the forum so far, it seems to me that compared to shared variable, STM is better with different data type and bigger data size. The only thing that makes shared variable slightly better than STM is being a bit more simple.  If that's the case, why use shared variable at all?  Are there aplication where shared variable is a lot better than STM?  
    Kudos and Accepted as Solution are welcome!
    Solved!
    Go to Solution.

    soupy wrote:
    Yup, you can set up multiple connections with STM, but it does not come with the stock examples. You'll have to do quite a bit of development to make it happen. This is the implementation i plan to go with, and the work involved is what is preventing me from going this direction.
    Getting off-topic a bit from the original question here, but I wrote a server in LabVIEW that used the TCP primitives and handled multiple connections.  The same approach should work for the STM, using STM connection info clusters in place of connection references.  In case it's of use to you, here's what I did (unfortunately I no longer have access to that code, it was several jobs ago):
    - have one loop dedicated to listening for new connections.  When one arrives, put it in a queue and go back to listening.
    - in another loop, maintain an array of connection ids.  For each connection ID, also store a timestamp.  When a new connection arrives, dequeue it, bundle it with the current time, and add it to the connection ID array.
    - inside the same loop, add another loop to iterate through each connection, checking for data.  If there's data, do whatever you need to with it (usually enqueue it for some other loop to handle), and update the timestamp associated with that connection ID.  Ignore error 56 (timeout) since any connection that doesn't have data will report this error.  For any error that indicates the connection is closed or no longer available, remove that connection from the array.  If the difference between the timestamp for a connection and the current time is greater than some amount, close the connection and remove it from the array (this is optional, but prevents you from leaving connections open that haven't been cleanly closed).
    If you're using a command-response scheme, and you pass the data off to another loop to handle, you'll need to track the connection with which it is associated so that the response can be sent to the right place.  I was using "Variant to Flattened String" and "Flattened String to Variant" for data passing over TCP, so I just tacked on the connection information as a variant attribute, but there are many other ways to handle this.

Maybe you are looking for

  • Process purchase orders

    Hi all, our's is extended classic scenario,  one user is trying the open the PO through process purchase orders option, he entered the po number and then clicked on find. He is getting the message " no documents avail for search criteria". Here the P

  • Maximum firewire drive size for OS9?

    What is the largest firewire drive I can fully use? Can I mount a larger drive, but only use part of it? Thanks!

  • Loading, playing in "sync" multiple videos with OSMF

    Hi All, I've just started to use OSMF in a Flex project. I was wondering if it was possible to manage loading 2 videos with OSMF, start playing both videos when they're both downloaded (or when there's enough data downloaded to play them both) Both v

  • JMS Standalone Application

    I am Developing JMS Standalone Application And Using Sun App Server 8.1 The Following I Have Created 1. META-INF/application-client.xml 2. source/jms/SimpleQueueSender.java 3.source/jms/SimpleQueueReceiver.java The Following Is The Code In applicatio

  • PSC 2410 photosmart borderless printing off center

    Hello, My 8.5 X 11 borderless printing has an 1/8" border on two sides of the page when printing from one computer while the same file printed from a different computer has a 1/4" border on the same two sides. I have tried a mulitude of setting chang