Network Datastreams and FIFO Shared Variables

Does someone know why one would use a Network Datastream as opposed to a network published shared variable with FIFO enabled? Seems like they would be identical except that the Shared variable could potentially have multiple listeners.
Thanks,
Craig

Hey Craige
You are correct that a major difference between Network Steams and Network Published Shared Variables with RT FIFO enabled is that the Shared Variable can publish to many computers at once.  There are a few other differences that are outlined in the comparison table in this article  
http://zone.ni.com/reference/en-XX/help/370622J-01/lvrtbestpractices/rt_gui_bp/
There's another good comparison with some more information in the last paragraph of this article. 
http://zone.ni.com/reference/en-XX/help/371361H-01/lvconcepts/networkstreams/ 
Regards,
Eric L.
Applications Engineer
National Instruments

Similar Messages

  • Why should you explicitly open and close shared variable connections?

    I'm looking into switching over from the old Datasocket API to the new Shared Variable API for programmatic access to shared variables, and I noticed that LV doesn't seem to have any problems executing Shared Variable Reads & Writes without first opening the connection explicitly. That is, I can just drop in a shared varaible Read VI, wire a constant to the refnum input, and it will work. I'm wondering, then, what benefits are offered by explicitly opening the conenction ahead of time...?
    I guess I could see some cases where you want to open all necessary connections in an initialization state of a top-level state machine, particularly if you want to use the "Open & Verify Connection"---so you could jump straight to an error case if any connections fail. But other than that, why else might one want to explicitly open the connections.
    And, along those lines, are there any problems with implicitly opening the connections? One reason why I am hesitant to open them explicitly is because for one of our applications, we need to be able to dynamically switch from one variable to another at runtime. It would be nice to just switch the variable refnum (wired to the input of the Read function), without having to manually close out the old connection and open a new one. A quick prototype of this seems to work. But am I shooting myself in the foot by doing so?
    Thanks in advance.

    I'd expect there's a very small number of people at NI that would know the answer to the detail you're asking for.  But, let's try to extrapolate from this rather old post to see if we can understand what they're forming their impression on.
    The shared variable has to have some sort of reference going on in the background.  It looks like they're calling this a connection.  It's how LabVIEW knows where to find this variable on the network.  We can also see this reference certainly exists if we're opening/closing the reference in the explicit method.  You see the connection as just a string referencing the variable by URL.  This "reference" has to be stored somewhere.  No matter how we're looking at this, we're aware there's a reference of some sort stored. 
    Now, we'd want to look at what would cause this reference to go away.  If you open/close explicitly, it's easy to see it goes away at the close.  If it's implicit, when would it make sense to close it out?  The VI can't be expected to guess where it's done being referenced and close it out.  This puts us into a situation where the soonest it could close is when the VI ends.  From my experience, references tend to be wiped when you close out LabVIEW.  It's this kind of idea that makes the FGV possible.  I wouldn't be surprised by Morgan's claim here.
    If we look at scalability, you're talking about two different topics.  You're talking about adding an extra open, close, read, etc rather than just a few wires.  That certainly would look a mess.  In terms of the dynamic swap that was being discussed, we wouldn't be adding all of those.  The concern would be if enough connections were opened it'd start to behave similar to a memory leak.  This could be something that works with a smaller number of variables.  If you continue to scale, it becomes problematic.  This is why they suggest it's not scalable. 
    To your questions:
    Does LV allocate some kind of session in memory using that string as a lookup?
    It would HAVE to allocate some memory to hold that string.  Otherwise, it'd be pointless to even have the reference. 
    Does it reuse that session if other parts of the application reference the same variable, or does it create a unique session for each referencing call to "Read Variable.vi"?
    I would expect this to be "it depends."  With the implicit method, I would expect it to open a new reference in each point it isn't wired.  This is similar to int x,y = 5;  x and y share the same value but are their own unique memory location.  If you wire the reference to the other points, it should use the same reference.  This would make more sense to me than the program seeking out any other potential usage of the variable in the application to see if there's already a reference open.  I could be wrong, though.
    And what resources does this "connection" actually represent?
    At best, this is just the string.  At worst, it's the string and the TCP socket.  I'd lean towards the first.  Opening and closing sockets should be relatively easy in most applications.  But, it also wouldn't surprise me if it holds the socket.
    I'm sure others have a better understanding than I do.  But, that's what I'd expect for anything you've asked.

  • Diferencia entre RT FIFO shared variable Single element y Multi-element.

    Si en las propiedades de una Shared  Variable, elijo el tipo de dato como Booleano y activo RT-FIFO, Cuál es el tamaño del buffer en la opción Single element? Si elijo Multi-elemet, entiendo que el tamaño lo determino en "Number of Booleans".
    Gracias

    Hola Ainhoa!
    Estuve leyendo un poco respecto a la diferencia entre ambas opciones. Realmente no pude encontrar el tamaño del buffer, por lo que pude entender la diferencia principal es el acceso de más de un lector o escritor a la variable.
    En el caso del single element, solo un elemento permanece en el buffer por lo que si tienes dos lectores, ambos obtendran el mismo valor. Así mismo el tipo single-element FIFO no reporta alertas cuando existe un underflow u overflow en el buffer. En el caso del multi-element, por cada lector o escritor que accese la variable se creará un nuevo buffer independiente y los valores que lean serán así mismo independientes. Finalmente, en LV 8.6 tu puedes definir el tamaño del buffer, dentro de la categoría Networking. Te dejo una liga a un poco más de información que espero te sea de utilidad:
    http://zone.ni.com/devzone/cda/tut/p/id/4679
    Que tengas un excelente día!
    Oswald Branford

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

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

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

  • Network profile and Internet sharing

    Hi,
    In the network System preference applet there is the possibility to create network profiles for different environement, ex: Home, work, etc.
    In sharing preferences includes the Internet sharing as well.
    Is it possible to attach a Network profile to an Internet sharing configuration?
    What I'm trying to do is to have an Internet sharing profile when I want to share my Airport card in ad-hoc mode (to share with my Newton), but when I'm finished, I do want to switch back to the normal Airport operation so I can use my PB in wireless mode.
    So, I need a way to bind the 2 together without having to reconfigure all my network preferences all the time.
    Thanks

    Hi,
    What you suggested, is exactly what I've been trying and is not working.
    I think your mistaken:
    Location are great to create new network profiles, true. You can't access them from the Airport menu, but from the Apple menu in the submenu location.
    The problem is that this does not include the Internet sharing preferences, located into the Sharing preferences pane. So, switching location does not switch Internet sharing preferences. You have to disable and enable them each time.
    So, that's not the solution I'm searching for, unless you know some way to bind the 2 seting into a location.
    Thanks

  • Desperately need help with a networked printer and SMB sharing for windows

    Complete xServ newbie here. I'm a windows/novell admin, with limited experience in Unix and Linux.
    Against my advice, a client of mine that owns a small office of 20 people bought an XServG5 to act as a server for 20 mixed Windows PCs. File sharing services are working fine. I've created the users, set up groups and rights - that's all good.
    I cannot get an SMB shared printer to work from the windows machines. They run through the network printer install just fine, it shows up online, etc. However, when print jobs are submitted they DO show up in the printer queue on the server, sit there for a while, and then get moved to the completed box.
    They never print. There's not any indication that the job is even submitted to the printer. I can print to the printer just fine from the server itself, but the windows clients don't work, but they don't return an error message.
    Print services are running on the server, I've configured the printer name to be less than 12 characters for the share, and indeed it does pop right up during the "add network printer" routine.
    Ideas? I'm not even sure what questions I'm supposed to be asking, such is my ignorance of the OS. I do know that I followed the documentation to a T, and according to Apple this should work.
    Thanks in advance for the help. I'm extremely frustrated.

    We have the same problem. Our printer worked for about 2 years but failed similar to yours after a system update.
    Can you go into the Windows service, Logs, Printer Service. Copy and paste the log here. What I am looking for is a line like lpr: CANNOTCONNECTCLIENT or something similar to this.
    What I expect is that you have a problem where the cups defined printer is not usable. We can't get our problem fixed either - but am just curious if you have the same thing. We reloaded our server, applied all of the update and still cannot get it to work.
    Again, I think it stems from the update.

  • TS2972 My computer is on and has network connection and home sharing is switched on in itunes but my apple tv just says turn on home sharing! Its driving me up the wall I have used it many times before but just today cant get it to work! I have tried turn

    Please help! I use my apple tv only to view photos on my tv from my macbook pro every few months - it has always been slightly unreliable and usually takes some fiddling to get working but today nothing is working!! The message on the tv screen from apple tv is that I need to turn on home sharing on my computer but it IS ON!! I have tried turning it off and on again, I have tried turning everything off and restarting but nothing is working today :-( and I have friends coming round for a slideshow in half an hour :-(

    Amber22P wrote:
    So, my ipad suddenly frozed. Its stuck ...
    Perform a Reset...
    Reset  ( No Data will be Lost )
    Press and Hold the Sleep/Wake Button and the Home Button at the Same Time...
    Wait for the Apple logo to Appear...
    Usually takes about 15 - 20 Seconds... ( But can take Longer...)
    Release the Buttons...

  • Serializin​g read/write operations of network-pu​blished shared variables

    Hi all,
    I'm developing a distributed application (PC + CompactRIO), and using shared variables (SVs) for inter-device communication. Here's my journey so far:
    Intended procedure
    PC parses file
    PC writes processed file data (custom cluster, large) into the 1st SV 
    PC writes a "grab data" signal/command (enum) into the 2nd SV
    cRIO polls the 2nd SV
    cRIO sees the command, then reacts by reading the 1st SV
    Steps #2 and #3 were sequenced, using error wires.
    Unexpected results
    Even after the command is transmitted and the cRIO sees it, the cRIO could not read the data (which I wrote BEFORE the command) -- LabVIEW reported that the buffer was empty.
    The operation succeeded when I placed a wait (5 seconds) between steps #2 and #3.
    Questions
    What am I doing wrong, and how do I achieve my desired outcome?
    Is SV I/O asynchronous by design?
    Is it possible to use event-driven programming to handle SV access? (i.e. does LabVIEW signal when the new SV value has propagated across the network?)

    BillMe wrote:
    Why do you have to "notify" the other end that data is available? The subscriber can simply sit in a loop doing a timed read just as if using a queue or notifier IPC. If it doesn't time out, you got new data. If it does time out, do some other processing if needed and then loop back for another timed read.
    My sytem architecture is command-driven -- the cRIO listens for instructions from the PC interface (sent as an enum via one SV), and performs tasks (motor control) in response. One of the commands (the one described in this thread) happens to be "download a new motion profile from the PC, by reading the other SV". Given that the cRIO is already polling the command channel, I felt that there's no need to also poll the data channel (especially since the "download" command is issued very infrequenty). Plus, I thought that polling two channels would increase the chances of race conditions or illegal state transitions, particularly if the app is developed over a long term.
    I am also new to LabVIEW, so my current programming style will heavily reflect my C++/Qt background while I get a feel for LabVIEW's strengths and weaknesses -- Qt is a heavily event-driven framework (even for networking!), where polling often means you're doing something wrong.
    Still, thank you for pointing out that I can use timeouts to determine if new data has arrived -- my subscriber current writes a null command back into the SV when it has consumed the command, but you showed me that I don't have to.

  • Shared variable engine network published source issue

    Hello,
    I am attempting to use the shared variable engine to share some simple stings over a network between a Windows 7 computer and a Windows XP computer. 
    I got through the shared variable example just fine and can share variables between VIs on a single computer. When I open the shared variable engine, it shows the client and server variables that are shared on the local computer. I then create a new process, and attempt to define a new variable, and the Shared Variable Property screen comes up. I attempt to "Bind to Source" and click browse, and see the computer name I am attempting to connect to. However, when I click it, it stalls and I cannot expand the computer to find the variable I am trying to bind to. What am I missing?
    Thanks, Arron

    Arron,
    This document may be useful in helping to setup your network shared variables. Take a look at this and see if you have followed all the outlined steps in setting up a network shared variable.
    http://zone.ni.com/devzone/cda/tut/p/id/4679
    Let me know how this works for you.
    -Nick-
    Nick C | Staff LabVIEW Platform Product Support Engineer | National Instruments

  • Shared variable RT FIFO (multi element) - Read all at once

    Hi all!
    I'm trying to collect data from analog inputs on my cRIO with a 1 sec time step. For that purpose I use a Timed loop and a shared variable with RT FIFO enabled (multiple array of doubles). Parallel to the timed loop, I also use a while loop that is significantly slower (lets say 10 sec period) that should read all arrays stored in FIFO and write them down in a .txt file (everything is executed locally on RT target). Is there a way to empty the RT FIFO shared variable at once, and if no how can I get a number of arrays that are currently stored in a shared variable?
    What is the difference between RT FIFO created by a shared variable and the one created using Real-Time/RT FIFO palette? I prefer using shared variable instead of Real-Time/RT FIFO since it also allows timestamping.
    Best regards,
    Marko.
    Solved!
    Go to Solution.

    Marko,
    We recommend that the non-deterministic loop run faster than your deterministic loop and pull off samples when they become available. If you don't want to do this, you can simply put your RT FIFO read in a For Loop set to execute 10 iterations and then place that in your while loop. For more information on the differences between the RT FIFO and Shared Variables with RT FIFO enabled, please see pages 32-35 of the CompactRIO Developers Guide linked below.
    http://www.ni.com/pdf/products/us/fullcriodevguide​.pdf
    Hope this helps!
    Rob B
    FlexRIO Product Manager

  • Datasocket and Shared Variables

    I am curious if there is any advantage to using Datasocket to read/write shared variables (as opposed to a direct read/write).  I'm specifically talking networked shared variables here.
    Is there any speed advantage to accessing shared variables thru the Datasocket functions?  Since both a direct read/write and a Datasocket PSP read/write talk to the same variable engine I assume they are equally efficient but I'm looking for confirmation here.  I've seen benchmarks for shared variable performance but none of them use DS/PSP to access the variables.
    Normally I would not even think of using Datasocket to access shared var's but where I currently work we have a large app that does this and it works great.  I suspect that this functionality only exists in LV8.x for backward compatibility and non-Windows OS compatibility and is not really meant to be used for new, Windows-based apps?   Am I off base on this?
    I am working in LV 8.5, BTW.....

    Hello Jared,
    Thank you for the reply with clarification. 
    Based on your comment, I changed the buffer parameters and also tried the programs with two different data types, previously StringArray and now String.
    In the attached LV8.6 project, you have all the programs, and shared variable library to review my tests. 
    There are two sets of two files - each set has a Write Shared Variable and Read Shared Variable file. One set is for StringArray type Shared Variable (named StrArr in the library), and the other set is for String type Shared Variable (named Str in the library).
    String Array example:
    MultipleDS-Write-SharedV-StrArr.vi / MultipleDS-Read-SharedV-StrArr.vi
    In my String Array shared variable, I use only 4 element array, each having 4 character strings - meaning 16 bytes per String Array data. I have two loops in the write file, writing to the same variable, an array of 4 strings, each loop continues until the loop index is >0. This means, sometimes, depending on the processor speed, the variable will be written 3 times or 4 times (the variable could have a new value before the loop condition is checked).
    So this means, if I have buffer of 100 bytes (16*4=64<100), it's enough for 4 such arrays (of 4 elements, each element with 4 characters) could be buffered to have sufficient time at the client (Read) program to read them. 
    I am putting 2048 bytes in buffer, which is much more than sufficient in my case. 
    The writer loops run with 200 ms to wait for each iteration. The reader loop runs with 100 ms in DS timeout and 100 ms in wait timer. This gives results without any loss. However, if I run the reader loop with 1000 ms to wait for each iteration, the data is lost. The buffer is not maintained for 2048 bytes.
    In the read program, just to make sure if all data is read or not, I am showing data in two different string indicators, showing data of each loop.
    String example:
    MultipleDS-Write-SharedV-Str.vi / MultipleDS-Read-SharedV-Str.vi 
    The String Array shared variable didn't show values in the Distributed System Manager. Hence, I created another simple variable with String datatype.
    The writer program writes strings of 4 characters, one-by-one, in two loops. Meaning, total 8 strings of 4 characters each are written in the "Str" Shared variable. 
    The reader program, however, doesn't always display all the 8 strings. Although the wait timer is not high (slow) it still misses some data usually. Data is overwritten even before the buffer is filled (in buffer, I have defined 50 strings with 4 elements in each).
    In both of the Read programs, I read using datasocket. I think thought datasocket has more ability to buffer. Earlier I had "BufferedRead" in DataSocket, which I have changed to just Read, because BufferedRead didn't give any special buffer advantage in the Shared Variable reading.
    ---- This is an update on the issue. 
    Ok, just while typing the last paragraph above, regarding datasocket, something clicked in my mind, and I changed the DataSocket functions to simple Shared variables (completely eliminating datasocket functions) in the read programs as well. And bingo, the buffer works as expected, even if I have reading loops very very slow, there is no data loss in any of the program sets. 
    The two changed Read programs are also included in the attached project - MultipleSV-Read-SharedV-Str.vi and MultipleSV-Read-SharedV-StrArr.vi
    So this means, I can completely eliminate DataSockets (not even using PSP URLs in DataSocket Open/Read functions) from my programs. 
    One question here, what will be an advantage of this (or any side effects that I should be keeping in mind)?
    Vaibhav
    Attachments:
    DataSocket.zip ‏71 KB

  • Multiple versions of Shared Variables on same network

    I have 2 seperate reactors working on the same network each deploying ~50 shared variables (different names on each process) communicating with LV 8.5RT running on FP hardware.  One of the reactors is requested for new features and to be upgraded.  Is it possible to heve 2 different shared variable engines (8.5 and 2010) and versions on the same network and client computer, or am I asking for trouble.
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA
    Solved!
    Go to Solution.

    I believe we address this here: http://forums.ni.com/t5/LabVIEW/multiple-versions-of-Shared-Variables-on-same-network/m-p/1487366#M5...  
    Sam S
    Applications Engineer
    National Instruments

  • Network-Shared Variable - read string with CVI

    I need to read an NSV string with CVI.  I have been digging into accessing and writing NSV with CVI, but they are all scalar value.  What should I do with strings, clusters and arrays?

    'm an employee at National Instruments and I wanted to make sure you didn't miss the Network Variable API that is provided with LabWindows/CVI, the National Instruments C development environment. The the Network Variable API will allow you to easily communicate with the LabVIEW program over Shared Variables (http://zone.ni.com/devzone/cda/tut/p/id/4679). While reading these links, note that a Network Variable and a Shared Variable are the same thing - the different names are unfortunate...
    The nice thing about the Network Variable API is that it allows easy interoperability with LabVIEW, it provides a strongly typed communication mechanism, and it provides a callback model for notification when the Network/Shared variable's properties (such as value) change.
    You can obtain this API by installing LabWindows/CVI, but it is not necessary to use the LabWindows/CVI environment. The header file is available at C:\Program Files\National Instruments\CVI2010\include\cvinetv.h, and the .lib file located at C:\Program Files\National Instruments\CVI2010\extlib\msvc\cvinetv.lib can be linked in with whatever C development tools you are using.
    Thomas N.
    Applications Engineer
    National Instruments

  • Shared Variables using Two Computers and Crossover Cable

    I'm just trying to put together a simple bench test tying two computers together by a crossover cable.  They ping correctly to each other.  I used the LabVIEW examples for TCP connections and they talk correctly that way too.  I try to build and deploy shared variables on one computer, but the other computer will not identify the SV's on the first computer and vice versa. 
    Can someone give me some details on how to build, deploy, and effectively use SV's?  I've read all the NI documentation, but I'm not getting the step-by-step approach very well.
    Thanks.
    Nathan - Certified LabVIEW Developer
    Solved!
    Go to Solution.

    Are you making them network published shared variables and binding them to each other? This doc gives a pretty good step by step:
    http://digital.ni.com/public.nsf/allkb/7815BCE435DCC432862575DA006FEBF8
    --Ryan

  • Strange behaviour with Vision 8.2 and Shared Variable 1D Image Array

    I've just upgraded to LabVIEW 8.2 and Vision 8.2.  When loading a particular VI, it is searching numerous times for ...\LabVIEW 8.2\resource\objmgr\IMAQ Image.ctl - which of course doesn't exist.  As best as I can track it down, this seems to be cause by a Shared Variable I have in the project which is a custom control of a 1D array of Image. 
    So I've created a new project from scratch to illustrate (attached).  The VI runs OK, but any editing means that this non-existant control is searched for again.  Of interest is also that there is a coercion dot where the Image is used, but the data type on the wire seems OK.  Creating a control (rather than a Shared Variable) works fine.
    Anyone know what's going on here?
    Message Edited by GregS on 02-26-2007 03:43 PM
    Attachments:
    1DImage.png ‏4 KB
    1DImageShared.zip ‏15 KB

    Hello Greg,
    I downloaded your project and opened it up on my
    system.  I received the same results as you
    did – I tried to open the project it searched for \LabVIEW 8.2\resource\objmgr\IMAQ Image.ctl.  I also used the 1d Image.ctl file as a constant on my block diagram and it did not
    show the coercion dot as you mentioned.
    There does seem to be some strange behavior going on here
    with the coercion dot and the shared variable. 
    I will have to look further into it and report this to R&D. 
    But for now, we need to address your application.  What is the goal of your application?  How does using a shared variable with IMAQ
    Images help you get there?  You may be
    aware of this already, but when an Image wire is passed around LabVIEW, it is
    not actually passing a copy of the data in a dataflow manner.  The large size of IMAQ Images necessitates
    that LabVIEW pass around a pointer to the IMAQ Image.  Therefore, when an array of Image controls is
    made and used as a shared variable, the controls do not contain the actual
    image data.  Instead, they contain
    pointers to the IMAQ Images.  When they
    are passed into a shared variable, unexpected results may occur.  If the shared variable is network published,
    for example, another computer on the network would receive a pointer to an
    image that it would not be able to find or access.
    There may be a much better way than shared variables to
    achieve the same functionality you are currently looking for.  If you do in fact require shared variables,
    you could use IMAQ ImageToArray.vi
    to create an array that can be used in the shared variable like any other data
    type, and then use IMAQ ArrayToImage.vi
    on the other end to be able to view the array as an image.
    Please post back with more information about your
    application and we should be able to find the best solution for you.
    Regards,
    Luke H

Maybe you are looking for