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!

Similar Messages

  • Network shared variables lose binding

    Hello,
    I am developing an application in LabVIEW that uses network shared variables to transmit data between two PC's on the same subnet. The shared variables work fine when running the VI's in development mode, however, when i build the vi's into an executable I find that they no longer work. Here is what I have found so far:
    I deploy the shared variable library on the publisher machine (also happens to be the development machine) through an invoke node in the executable. NI distributed system manager confirms that this does deploy and indeed updates as it should.
    For the executable on the subscriber PC I created a second shared variable library (same project) with the same shared variables and bound them to the respective shared variables from the first library by selecting enable aliasing, then bind to PSP URL and browsing to the shared variable I wish to bind it to (e.g. \\hallnet-ellm2\shared variable library\serial Number). The machines listed under browse were listed by name so when I tried this initially and it did not work I manually changed the name of my machine in the URL box to the IP address of the publisher hoping that would fix it in case the subscriber could not resolve the publishers machine alias. So now my bind URL read \\192.168.0.1\shared variable library\serial Number.
    As part of the executable on the subscriber I deploy this second shared variable library. NI distributed system manager confirms that this deploys but under quality for an individual variable it has a list of issues (see attached) and the bound variable is not updating. At this point the publisher shared variables are still functioning fine. By clicking on 'edit variable' I can see that the variable on the subscriber is still bound but the PSP URL is now \\localhost\shared variable library\serial number. Changing the PSP URL on the subscriber to \\192.168.0.1\shared variable library\serial number enables the variable to update as expected.However by this time my executable has already picked up the error and does not function.
    I think that the issue lies with the bind URL used on the subscriber as for some reason it does not keep the binding configured in the project and instead changes to 'localhost'. Why is this? Should it not stay bound to the address specified in the project?
    I have tried changing the IP addresses in the aliases file so that
    [My Computer]
    My Computer=localhost 
    becomes
    [My Computer]
    My Computer=ip of local machine
    This did not help.
    The shared variable libraries are included in the build spec to go into the support files directory and they are successfully deployed from there on both publisher and subscriber.
    I am using LabVIEW 8.6 on Windows XP
    Thanks for any help you may be able to offer,
    Lee
    Attachments:
    distributed system manager.JPG ‏74 KB

    Hi Lee,
    I hope you are well.  Thank you for your post.  Your application sounds very interesting.
    Looking at your issue I was wondering, have you tried lowering your firewalls, as this may be causing the problem.
    Also, another option would be to setup a private network.  Do you have access to any routers that you could use to link the two machines independent of your IT's infrastructure?
    The other thing to try is two other computers entirely.  Again, it would be ideal to take them off the network you are on, but it's something to try if my prior suggestion doesn't work.  It should work on the original two machines though, and it's likely that different computers won't solve your problems because I suspect the network.
    Remember that the client variables must know the location of the variables on the server, so you can't move the server exe around without changing this value.
    Make sure to set the network location in the "Bind to Source" option for the client variables.
    It is also possible to write a separate piece of code to install on every machine that is responsible for deploying the library and by doing so eliminate the need for programmatically deploying the variables in the original application.  However, this won't really help you, because the variables you use in the application have to be the same as the ones deployed in the library, so if you change the library, they'll no longer be linked and they won't receive data.  You'd have to create a separate exe for every binding source you wanted to link to, and then have a second, known library for the sake of communication locally on the computer between the ‘deployer’ and the actual application.  The main application could then be assigned the responsibility of launching the correct ‘deployer’' if it sees it needs to switch to a different variable binding source.  This method is not the most streamlined or effective, but it might work.
    Just to let you know, you will need to use the DSC toolkit.
    Please find below some knowledge base links that I think you will find helpful in your application.
    Using Shared Variables in Executables
    How do I Programmatically Change the Data Binding Source for Shared Variables?
    I hope this information helps and if you can give these suggestions a go and let me know how you get on, that would be great.
    Kind regards,
    Prashant M
    Applications Engineer
    NI UK & Ireland

  • Not able to access Network Shared Variable when deployed in PC

    Initially, when we deploy a Network Published Shared Variable in PC and try to access the same (Read/Write) from RT, we get an error/warning "-1950679023". But when we access the same variable from the PC, it works fine. In the distributed system manager, we can see the variable getting deployed. Also the value changes in Distributed System Manager if we write a value from PC. The attached image "Shared variable Issue.png" will give more understanding of this issue. 
    The other way round it works fine i.e deploying in RT side and accessing from both RT and PC is working fine. 
    We also see that the network adapter settings is not loading properly in MAX, if at all we install any software in RT. With no software installed, it loads properly. 
    The following were the steps that we tried to solve the issue. 
    1.Flushing the entire NI software and Re- installing again 
    2.Formatting the RT(PXI). 
    3.Removing the EtherCAT Card and testing. 
    4.Checked the network properties of the RT network. 
    5.Checked the IP/Subnet/Gateway settings. 
    6.Checked Firewall Settings, If Shared Variable Engine is accessible.
    Attachments:
    Shared variable Issue.png ‏491 KB

    First Root cause needs to be identified before any actions.
    I would suggest first check if you can access the shared variable hosted in PC from RT using other ways like using SVE API (Logos and PS protocols, Datasocket etc..)
    Check if antivirus or firewall is playing...
    Check the same experiment with some other PC if you can.
    You can also try creating another Shared Variable in RT and binding the same to the PC and try to access it...
    Since you have did all the reinstallations already
    Best Regards,
    Vijay.

  • RT Network Shared Variable and Visa Serial Instr class

    Hi,
    I'm using Labview 2009 SP1 with the RT module. I've had no problems creating a RT Target application and a Host PC application which are interconnected using Network Shared Variables, until I came to the COM ports fitted to the RT Target (PXI Embedded Controller and 2 x 4 port COM cards).
    I can configure and use the COM ports in the RT Target application providing I use constants to define which COM port to use, i.e. VISA OPEN function accepts hardcoded "COM2" , (VISA Serial Instr class).
    But I want to pass the COM Port resource name from my host application. 
    Is there a suitable Network Shared Variable I can create ? or how do I change the string value (COM Port name) of the VISA Serial Instr class variable in the RT Target application ?
    thanks,
    Gary.

    Hi there Gary,
    Thanks fot the post. I think I have found something that may be if use to yourself.
    http://labviewwiki.org/Functional_global_variable
    This is the functional global variable.
    Take a look at it and let me know what you think!
    Many thanks,
    Liam A.
    National Instruments
    Applications Engineer

  • Network Shared Variable: Aliasing not working

    Hello!
    I am running a cRIO 9075, which is publishing network shared variables.
    I can see and modify them within Distributed System Manager.
    Unfortunately I am not able to read/write the variables through labview.
    What I have done so far:
    Tools -> Shared Variable -> Register Computer, using the IP of the cRIO
    Adding a Variable to the project. Type = Network-Published, Enable Aliasing, choosing "Browse" to select the variable (all published variables from cRIO are shown there), Access Type = read/write. The PSP-URL is: \\192.168.10.70\WaveformManager\Op
    Trying to read the variable results code -1950679034 and the result is always the default value for that data type.
    BUT this works: using the VIs Data Communication / Shared Variable / Read/Write Variable  and typing in the same URL the Distributed System Manager is showing is showing (in my case: \\192.168.10.70\WaveformManager\Op)
    So, what am I doing wrong? Did I forget something or misunderstand how "Aliasing" works?
    Thanks!

    hi,
    in which way to you read your shared variable? If you read it before you write  a value "into" the variable it may couse this waring.
    Have you tried this?
    http://digital.ni.com/public.nsf/allkb/7DBC2C3E95AFD85C86257442005CF74C?OpenDocument

  • Network shared variables reconnecting network dropout

    I've got a cRIO unit communicating with a Laptop using Network Shared Variables, with one of them being a 21 index array that is buffered.
    The system connects and communicates fine, but occassionally the wireless card in the laptop is losing the signal from the WAP attached to the cRIO.
    When this happens the Network Shared Variables never "reconnect" and start receiving values again once the Wireless link is restored.  Is this an expected behavior?
    When I tried using another industrial WAP instead of the laptop wireless card I do not get the drop-outs.
    Ryan Vallieu
    Automation System Architect
    Solved!
    Go to Solution.

    Hello Ryan,
    Thank you for contacting National
    Instruments!  I have looked into the issue you are experiencing and
    wanted to ask you a few more questions.  First of all, do you have a
    time frame in which you allow for the reconnect?  I believe that the
    Shared Variables should regain connection after a short period but it
    will not necessarily be a very quick process.  It may take a few
    minutes for the Shared Variables to reconnect.
    The other
    thing that may be happening is if you have error wires being passed
    through the Shared Variables, it is possible that the error is not
    being cleared and so it will always see the error and therefore never
    reconnect.  In this case you will have to filter this error out and
    then clear the error in order to utilize the shared variables again.
     If
    you have any more specific information about your program that may help
    us determine the reason for this behavior.  Also a screenshot of your
    code would also be helpful.  Please let me know if you have any further
    questions and I will be happy to assist you.  I hope this helps!
    Thanks!
    Bob H
    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

  • Error during launching executable with network shared variables

    Hi,
    I am launching an executable which deploys network shared variables before running the application, I am getting the follow error. can someone tell me whats going on.
    thanks,
    Attachments:
    Untitled.png ‏28 KB

    Mudda, 
    Is LabVIEW 2010 installed on the PXI chassis or was this program developed on a different computer?
    If LabVIEW 2010 was installed on a different computer you may need the 2010 runtime engine on the controller. If the development environment is installed on the PXI controller then you should be fine. 
    How are you connecting to the PXI chassis is it on the network or do you have it directly connected to your development computer?
    If you look at this forum the same error occured when another device on the network was sharing the same IP address. 
    http://forums.ni.com/t5/Real-Time-Measurement-and/Deployment-Completed-With-Errors-Network-Shared-Va...
    Could you try plugging the PXI chassis in directly and see if that resolves the issue or changing the IP address?
    Kyle Hartley
    RIO Product Support Engineer
    National Instruments

  • Inconsiste​nt Network Shared Variables

    I will eventually be implementing a controls program on a machine using cfp. Before the cfp gets here, I am getting practice in network shared variables by trying to pass shared variables between two VIs on my computer. I have attached the two VIs and a screen shot of my project. I run a queued state machine and after the initialization routine is done, I run the control portion of the program. The control program is titled 'The4Mprocedure2.vi' and the QSM is titled '4M_QueueDrivenStateMachine'. In the initialization routine of the QSM, 'FALSE' is written to the boolean network shared variable, 'Run_4M_Procedure'. After the initialization routine is done, and a set of certain parameters are met, the QSM writes the value 'TRUE' to 'Run_4M_Procedure'. Ideally, The4Mprocedure2.vi would read the shared variable, and when the value is 'TRUE' The4Mprocedure2.vi would run. The4Mprocedure2.vi has a case statement that causes to run the program when 'Run_4M_Procedure' = TRUE. The4Mprocedure2.vi does not run when the variable is FALSE.
    The problem that I am having is that The4Mprocedure2.vi does not always recognize that the value of my shared variable has changed. When the QSM passes the value of 'TRUE' to the controls program, The4Mprocedure2.vi will sometimes still read the network shared variable as FALSE. Sometimes, I have to restart the controls program several times while the QSM is running to ensure that 'TRUE' is passed to the controls portion. Why does my controls program not recognize when the network shared variable changes values?
    Message Edited by tquintana55 on 07-14-2008 11:04 AM
    Attachments:
    The4MProcedure21.vi ‏87 KB
    ProjectScreenShot1.JPG ‏68 KB
    4M_QueueDrivenStateMachine1.vi ‏131 KB

    Hi tquintana55,
    I believe your Issue is related to the methods that LabVIEW subscribes to the shared variables. Here is a link to a related article:
    How to Avoid the "0" Value at First Read of a Shared Variable in LabVIEW 8.5.x?
    To resolve this you can move your Run_4M_Procedure inside the while loop.
    Sappster

  • Network Shared Variable Description

    Hi,
    I've created alot of Network Shared Variables through Project Explorer...and i have also added a description for each one in the shared variable properties screen
    Could someone please tell me how i can get access to the description through LabVIEW?
    Many thanks
    Mike

    Hi attached is a sample of code in which i am viewing a value and also its description.
    Ideally id just like to have the channel name once and the description and value be taken off that, rather than if i ever change it , then have to change the input to the description and also the variable displaying the value. Hope that makes sense
    Regards
    Mike
    Attachments:
    opctest3Kep for forum.vi ‏19 KB

  • Need help getting networked shared variables on compact fieldpoint to work

    I'm still a newbie and am trying to get Networked Shared Variables to pass from a VI running on a PC to a VI running on a Compact Fieldpoint. I created a VI that sends a message via a Networked Shared Variable and a VI that receives it. I have them both in the same project. If I run them both on the PC, it works, I can send a message string from the first VI to the Networked Shared Variable and read it in the second VI. I have the second VI turn the LED "A" on and the LED "B" off if I send the string "a", and turn the LED "B" on and the LED "A" off if I send the string "b", and turn them both off if I send anything else. It works as expected if both the VIs are running on the PC. The second VI also continuously blinks the LED "C" so I can verify that it's running.
    I "deployed" the second VI to the Compact Fieldpoint as follows:
    In Project I dragged the VI from My Computer (under Project: name.lvproj) down and put it under the Compact Fieldpoint name.
    I right clicked on Compact Fieldpoint name and verified it was set to "Connect".
    I right clicked on the second VI and selected "Deploy".
    I started both VIs with the "Run" arrow. At this point I know second VI is running since the LED "C" keeps blinking. But, when I try to send an "a" or "b" nothing happens, so the VI on the Compact Fieldpoint must not be receiving the messages in the Networked Shared Variable.
    I also right clicked on Compact Fieldpoint name and selected
    "Disconnect". The second VI continued to run since the LED "C" keeps
    blinking, but I still can't get messages to pass.
    Any help will be greatly appreciated.

    I got this to work. I moved the library (.lvlib) containing the Networked Shared Variable to down under the Compact Fieldpoint name. Now it works.

  • Using network shared variables in two computers connected via a network switch

    let me start by saying im a rookie to the programming environment but i have used Labview a couple of times to understand the basics,  i have a computer and a laptop (both using vista), both of them with Labview Full development System (Student ed. with Mathscript) installed, so what im tryin to do is to use the built in microphone located in the laptop to aquire sound and then use a Shared Variable to transfere the sound signal from the laptop to the computer, the laptop and the computer are connected to a network via a network switch and ethernet cables,  so far i nothing worked, i can manage to create the shared variable in the laptop and use it there but it doesnt appear in the computer, im not sure whats the problem i have even disabled firewalls in both systems, help from anyone wil be appreciated.....

    Hi Lukie,
    This KB should be of some assistance to you.
    Trouble shooting network published shared variables
    Also the following link gives some instructions on the use of shared variables.
    http://zone.ni.com/reference/en-XX/help/371361B-01/lvhowto/bind_to_source/
    I hope this is of some assistance, let me know if you have any more problems.
    All the best,
    Message Edited by mickeyw on 08-05-2008 12:29 PM
    Mike W
    Applications Engineer
    National Instruments UK&Ireland

  • Picture Network Shared Variable

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

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

  • Network-Shared Variable - 1 subscriber / variable?

    I have been reading into the NSV Subscriber example that comes with CVI.  My question is: does each variable require 1 subscriber, or can 1 subcriber be used to read multiple NSV?  Better yet, can anyone explain to me how NSV read and write can be done?

    Hi hn_sofec,
    Each network variable requires its own subscriber, reader, or writer. The CNVCreate... functions accept a reference to the network variable in the form of the networkVariablePathName parameter. Please refer to the CVI Function help for these functions to find further information and links to examples.
    Kristen

  • Problems writing to network published shared variable hosted on rt (set as modbus slave for crio)

    Hello Ni Forums
    This is my first post on this forum and I have been using labview for about 8 months now
    I have a problem regarding writing data to modbus registers through an i/o server set as a modbus slave for my 9074 hardware.After I have completed building project and deploying the variables and following instructions from here , it yields no result but a line zeros. I have the Ni DSM open and modbus master setup to see whether the data is actually being read/written from the respective sides which both yield the same line of zeros as well.  What I am actually trying to write to is an array of single precision floating data. The registers are structured from ranges F40000-F46534 for 10 elements or have them for range AF40001L1-AF46534L1 of item AF40001L10 where it is an array of length 10. (Referenced ranges here)
    I know 1 thing for sure, the modbus connection works and is ready for data requests, I tested this through NI DSM and manually set data for and my master received them . 
    System and Project specifications
    Windows 7 OS
    Labview Full Development System 2011
    No Labview DSC module but I am using the real time module as referenced by one of the documents
    This project is a real time application with fpga mode (not scan interface mode)
    The master and slave are the same subnet and network
    Modbus Connection Type: TCP
    9074 compact rio 8 slots
    9234 module x3 
    9221 module x1
    9472 module x1
    Shared Variable Engine service running on windows os and rtos system 
    Used this  guide to learn about the modbus protocol as I searched all over the internet to learn about modbus 
    I already having Modbus IO Server software installed on the crio through ni max version 1.8 for NI RIO 4.0
    attached file(s)
    Image of Crio software specifications
    Image of the Data being written into variable in rt block diagram
    Short Version of the problem: Why is the io variable not being written into with properly converted data?

    The data can have zeros but not all of them will be zeros and I have another program (on local computer for database storage)that is recieving the same data through TCP and they are not zeros. 
    If a machine is running and is active then the data that will be collected should not be zero , it should infact  be some analog value > 0.
    I will look into the function you described
    How do you view the errors in the IO server subfolders ?
    Is it the modbus register called error status that returns an error code if so that value is currently 0 
    Regards mzamstl
     

Maybe you are looking for

  • Report server 6i and Report services 10g

    what is the extra features in Report Services 10g which are not available in Report server 6i. why would we use AS report services 10g rather then report server 6i,and our only requirment is to run oracle report on web which can fulfill with the help

  • Contacts and Calendar Generating Error Logs

    Although my contacts and calendar sync perfectly with my Gmail account, I get error messages in the Console when using my early 08 MacBook Pro but not on my mid 2011 Mac Mini. I have two way verfification enabled with my Google accounts. Below are th

  • DVDs fail to play on PC

    I know variations of this question have come up before on this forum but looking at the suggestions offered they don't help. My short (12 min) film was exported out of FCP using compressor. Then the standard res PAL files used in DSP to make a disc i

  • How to use external libraries in EP

    Hi! I am with dificulties in utilizing an external ".jar" file in a Portal application (JSPDynPage). The ".jar" file is the JSTL 1.0 version. It compiles and is exported correctly (SNDS to Portal), but give me an error at runtime (NullPointerExceptio

  • Invalid Template id:minimal/ error

    Customer Team Members are receiving an 'invalid template id:minimal/ error when attempting to provide information in My Profile Create User. Customer is unable to 'enter' their email and password to get a profile/account assigned so that they are abl