Datasocket read stop but shared variable can update

Hello ,
I program with datasocket open/read, sometimes the read stops and after some time,maybe 10s, it go on reading, I compare this with shared variable (DSC) and found
the shared variable can update ,I don't know what happen to my program.
( the reason I'd like to use datasocket is that I need to change the ULR dynamically , I have many OPC tags to read ( 100 PLCs time 80 tags per PLC )  )
thanks for your help!  
Solved!
Go to Solution.
Attachments:
shared variable VS datasocket.jpg ‏23 KB
shared variable VS datasocket.vi ‏17 KB

Hi~
The read function waits for items to be updated, and 10ms is the default time for this waiting. Setting wait for updated value to false will probably solve this issue.
PS: URLs of variables could be changed programmatically, see this document if you like.
Good day

Similar Messages

  • Datasocket Server vs. Shared Variables

    Does anyone have any thoughts on what is better - Datasocket Server vs. Shared variables?  I have a table on my application that has text indicating application status, information, warning and debug messages and would like to view it remotley over a network.  The old way was to use the datasocket server and bind it to the other control.  Is the new shared variable engine more efficient?  These machines are at different sites.
    John

    Hi John,
    It definitely seems as if you want to gauge user experience on this issue, but since you've had no response I'll chime in and give the "National Instruments view" on the DataSocket/Shared Variable debate.
    Shared Variables were created to expand the functionality of DataSocket and simplify the programming style required to pass information between networked computers. We have extensive literature on this topic and the most pertinent is linked here.
    I hope some users will post to this forum to give you a less formed response than you get from me, but I am more than willing to answer more specifically if you have any more questions regarding this issue.
    | Michael K | Project Manager | LabVIEW R&D | National Instruments |

  • Shared variables not updating in exe

    Hi,
    I've created a project with 2 vi's, they share data via Networked Shared Variables, one vi writes while the other reads.
    The data is passed between the 2 vi's whilst running in the Labview 2009 SP1 development environment, but when I create an exe, the screen values in the reader vi do not update at all.
    In the build specification I've tried both including the vi's which reference the shared variables and the
    option to list the shared variable libaries for deployment at run time, as methods to overcome the problem.
    Please, any clues why the exe should fail to allow shared variables to pass data ?
     thanks,
    Gary. 

    Hey Gary,
    I've just created a project to replicate the issue you are having and indeed when I built the application, the Shared Variables were no longer working. This is because I hadn't deployed the Shared Variables in code; which I think may be the problem that you're having at the moment. When create a Network Published Shared Variable library in LabVIEW, it auto-deploys itself for the development environment; but this is definitely not the case for when you build an executable. Instead, you must deploy the library yourself in code.
    In the attached zip folder, please follow the following instructions and hopefully you'll be able to fix your VI:
    Unzip the folder and extract the files.
    Open up the project.
    Look at the project layout. Notice the SharedVariableLibrary.lvlib and inspect the Shared_Double variable.
    Look at how the Reader.vi and the Writer.vi interact with the variable.
    Go into the Main.vi. See that I make an Open Application Reference VI and Invoke Node to manually deploy the library in code. You'll have to change the path to this library to match the directory structure of your own computer, so just make sure it navigates to the library in the extracted folder.
    Check out the Build Specifications. I've done nothing here except ensure I only include the Main VI. Finally build the VI and run the executable. 
    You should see that this will give you a working Shared Variable setup. The Machine Name input for the Open Application Reference is blank because you only want to communicate with the localhost i.e. Your computer. Therefore by explicitly deploying all libraries you require, your VIs should be able to communicate effectively.
    Does this solve your problem?
    Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)
    Attachments:
    GlobalVariableProject Folder LabVIEW 9_0SP1.zip ‏26 KB

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

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

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

  • Problems reading from bound shared variable

    I have a shared variable that is bound to another shared variable.  When I go to read it's value in a VI by wiring the variable to the "value" property of a digital numeric object it displays zero.  When i look at the two shared variable in the variable manager they show the correct values.  Does anyone have a clue what's going on?

    Welcome to the forums!
    Let's narrow down the possibilities here.  Try wiring the shared
    variable directly to a front panel indicator rather than using a
    property node.  Second, the shared variable object includes an
    error out terminal - this is where the variable engine can report any
    errors in obtaining a value from the bound item.  Wire the error
    out to an error handler VI and re-run - you may find that the Shared
    Variable Engine is reporting an error, which would be most helpful in
    determining the problem. 
    If you could let me know the results of the above suggestions, I'll be glad to help further!
    Cheers,
    Matt Pollock
    National Instruments

  • Problema di polimorfismo con Read/Write delle Shared variable

    Salve,
    Cercando di modificare l'esempio di progetto "Shared Variable Client/Server" in un progetto dove sono i diversi client a mandare dati al Server ( ovvero l'esatto contrario di quello che fa )
    mi sono inbattuto nel problema illustrato nelle due figure che seguono.
    Ovvero, sostituendo "Writable PSP Variable" ad "Readable" nella scheda "Connect"(FIGURA 1) mi da un errore nella scheda "Read/Write" (FIGURA 2), ovviamente anche qui ho sostituito a "Read Variable" un "Write Variable".
    Mentre utilizzando il Data Socket funziona, ma non mi sono chiari i vantaggi e gli svantaggi nell'utilizzare quest'approccio.
    Qual'è la strada migliore tra Shared Variable e Data Socket per creare un sistema Client/Server così costituito, ovvero con un cospicuo numero di client da servire ( destinato a crescere  )che mandano simultaneamente un discreto quantitativo di dati ( circa quelli di una seriale a 115200bps ) ad un server
    FIGURA 1 
    IMMAGINE 2

    Translation 
    Hi,
    Trying
    to modify the sample project "Shared Variable Client / Server" in a
    project where different clients to send data to the server (ie the
    exact opposite of what it does)
    I untapped in the problem illustrated in the two figures that follow.
    That
    is, replacing "Writable PSP Variable" to "readable" in "Connect"
    (Figure 1) gives me an error in "Read / Write" (FIGURE 2), and of
    course here I replaced "Read Variable" a "Write Variable.
    While using the Data Socket works, but I have clear advantages and disadvantages of using this approach.
    What
    is the best route between Shared Variable and Data Socket to create a
    client / server system so constituted, or with a large number of
    customers to serve (to grow) that simultaneously sends a fair amount of
    data (approximately those of a serial to 115200bps) to a server
    The images points to a gmail location. It is not properly attached.

  • Labview is reading zero from shared variable

    Hello everyone 
    -I have a problem in labview shared variable cause it reads only zero value for all inputs and outputs and timers in S-1200 ...etc
    but in NI OPC server using quick client it reads the correct value but when adding them in labview project they are not reading the correct value and only retruing zero
    any suggestions 
    Thanks

    Hi,
    I recently finished the commisioning of the system I started to work upon. Hence the delay to come back to this thread.
    During the commissioning of the system, I was concentrating on finalizing the system functionality and was using only the PC#1. Now when all the system functions were finalized, we duplicated the changes to PC#2 and started the operation.
    What we observed when the PC#2 was started, was that if we were to open the same HMI page as in PC#1, the operation of the HMI was very sluggish. When we selected a different page for both PC#1 and PC#2, the HMI operation was good,  all operations seemed to happen in real time!!
    To give a background of the HMI, we have a subpanel to which the desired HMI page/screen is loaded. This loads a VI related to the HMI page.
    Here, I am guessing that when I load the same page in both the PCs, the read/write operations to the shared variable(it is the same in both PC, and is deployed in a library on the cRIO) are some how hindered due both PCs trying to access the same network resource from different locations.
    Is this guess correct? Any work arounds or solutions? Do I need to post any more information?
    Thanks in advance,
    Regards

  • My project writes accelerome​ter data to usb drive but shared variables do not communicat​e with modbus

    Hi there,
    I have got a program that reads input from 3 off 9234 modules on a cRIO, the idea of the program is to read this data and save it in a bin file to a connected usb hard drive, the program also uses shared variables to connect the max signals from the 9234 then send thm to a modbus slave, my problem is that althought I am now getting the correct data on the usb drive I am not getting anything down the modbus link, I attach the program for you to see, all the shared variables are on the rt low speed loop, any help would be most grateful.
    Many thanks
    Jason 
    Solved!
    Go to Solution.
    Attachments:
    logger 2plusmodbus2.zip ‏679 KB

    Hi Jasonh,
    Thanks for posting your code! Due to the lack of comments on the code, would it be possible to direct me to where it sends the code to the modbus slave please?
    This tutorial on How to turn a RT Target into a Modbus Slave using IO Servers may also be of some help.
    Kind regards,
    Tori
    Student

  • FIngerprint reader stopped working after windows automatic updates

    Hi,
    I recently purchased an Envy j109tx laptop.
    From day one the finger print scanner was not working. 
    After updating hp simplepass it started to work.
    Again today I installed some windows update. After that it stopped working.
    The light in the fingerprint reader is not turning on.
    Is there a fix for this?
    Someone please help me.
    Thanks in advance.

    @naga5speed ,
    Hello and thank you for posting on the HP support forums.  First thing did you do the windows update due to your system having some issue?
    If not then do a system restore back before the update.
    It is probably some microsoft update that is conflicting with the driver.
    It is good to keep your system up to date.  But it is better to make sure before you run an update that you take a look as to why you are updating.
    Do I need to fix an issue?
    If i do not do the update will something stop working?
    Using Microsoft System Restore (Windows 8)
    If this fails to work then you may have to back up your data and run a system recovery.  The reason for this is what ever update you ran has made changes to system files or the registry that a restore will not fix.
    Performing an HP system recovery (Windows 8)
    Here is another link you may find useful.
    Fix Microsoft Windows Update Issues
    Please let me know how things go.
    Thank you again for posting and have a great day.
    Please click the "Thumbs Up" on the bottom right of this post to say thank you if you appreciate the support I provide!
    Also be sure to mark my post as “Accept as Solution" if you feel my post solved your issue, it will help others who face the same challenge find the same solution.
    D5GR
    I work on behalf of HP

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

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

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

  • How fast can shared variable update?

    Hi,
         According to online documents shared variable engine update at 10ms or forced by flushing command. But  I tested the following two program and can not get the shared variable updated:
          Thanks fo rhelp!
          Tom
    Attachments:
    test_program1.png ‏20 KB
    test_program2.png ‏20 KB

    Hi,
         I don' use NSV to transfer large amount of data between RT and host. The actual application is as follows:
          I also would like to test how fast the NSV update rate and how the flush vi works. I test two programs and did not match the number in the documents.
        Tom

  • Slow performanc​e to read/write shared variables programati​cally

    We are using datasocket read and write functions to read and write shared variables programatically (in the same machine) but we only achieve a performance of aprox. 200 reads/writes per second. We are using Labview 8.6 with DSC.
    Is possible to get better results? That performance is normal?
    Any help would be appreciated. Thank you in advance.

    Hi MMCDAT,
    I think this value can
    be normal as you can see in this link:
    http://zone.ni.com/devzone/cda/tut/p/id/5037
    As you can see, the
    limit for datasocket depends on your Ethernet limitations, even if you as using
    it just in one PC:
    http://digital.ni.com/public.nsf/websearch/6AC9E65​734E53F9A8625672400637ECC?OpenDocument
    You can improve the
    performance changing the update mode or Vis configurations:
    http://digital.ni.com/public.nsf/allkb/F8F7DE98856​B50588625672400648045?OpenDocument
    http://digital.ni.com/public.nsf/allkb/2D9C6D73A16​0537986256B290076456E?OpenDocument

  • 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

  • Read LabVIEW shared variables ( network variables?) with VB6

    Hi, i need to read some LabVIEW shared variables (network variables?) using a VB6 program.
    Is it possible?
    I think that yes, using Measurement Studio for VB6 but I don't know how and I haven't found information in the  Measurement Studio for VB6 help file
    Could some one send me a program example or explain me how it is possible to read LabVIEW shared variables fromVB6?

    Hello quintella,
    To be able to interface with LabVIEW
    Shared Variables with Visual Basic 6 you will need to use NI Measurement
    Studio, which ships with examples on how to use VB6 with DataSocketing. Apart
    from Data Sockets, if you are using Measurement Studio 8.1 or higer, with the
    Network Variable Library introducted in NI Measurement Studio 8.1, you can read
    and write to shared variables in ANSI C, Visual Basic .NET or Visual C#. (http://zone.ni.com/devzone/cda/tut/p/id/4679)
    Here you have two links where you can
    find more information about how to use the datasocket option. In addition, there
    are several examples included in Measurement Studio with Network Variables and
    Datasocket.
    http://forums.ni.com/ni/board/message?board.id=230&message.id=2945&requireLogin=False
    http://forums.ni.com/ni/board/message?board.id=230&message.id=3324&requireLogin=False
    Regards,

  • Slow update of shared variables on RT (cRIO) after building exe

    Hi,
    I've been struggling with this for the past few days.  I am having a problem with slow updating of shared variables on my RT project....but only after building the application into exe's.
    The application consists of an RT target (cRIO 9073) sampling inputs at a rate of 1sec.  I have a host PC running the front panel that updates with the new acquired values from the cRIO.  These values are communicated via shared variables.
    Once the cRIO samples the inputs, it writes the values to the shared variables, and then flags the data as 'ready to be read' using a boolean shared variable flag.  The hostPC polls this boolean shared variable and updates the indicators on the front panel accordingly.  
    Now, this worked fine during development, but as soon as I built the RT exe and host exe's, it stopped working properly and the shared variables ended up being updated very slowly, roughly 2-3sec update time.
    To give you some more background:
    I am running the Labview 2010 v10.0.
    I am deploying the shared variable library on the RT device (as the system must work even without the hostPC).  I have checked that its deploying using Distributed System Manager, as well as deploying it into the support directory on the cRIO and not the exe itself. 
    I have also disabled all firewalls and my antivirus, plus made sure that the IP's and subnets are correct and its DNS Server address is set to 0.0.0.0.
    There are 25 shared variables all in all, but over half of those are config values only used once or twice at startup.  Some are arrays, plus I dont have any buffering and none of them are configured as RT FIFO's either.
    The available memory on the cRIO is about 15MB minimum.
    What strikes me is that it works fine before building exe's and its not like the cRIO code is processor intensive, its idleing 95% of the time.

    Thats exactly what I'm saying, it takes 2-3seconds to update the values.
    I have tried taking out the polling on the PC side, and registered an event on the changing of that shared variable and that doesn't do anything to change the slow update time.  Even if I stop the PC, and just monitor the shared variables in DSM it updates slowly.
    I also tried utilising the "flush shared variables" vi to try to force the update....that does nothing.
    I wire all the error nodes religously. Still no luck.
    Its very strange, I'm not too sure whats happening here.  These things should be able to update in 10ms. 

Maybe you are looking for

  • Possibly graphic problem with air mid 2013

    Hi I bought in Miami the latest air,  I5, with 128gb and 4 gb of ram. one week ago i go a problem that id doesnt look good at all. everytime the screen is off and turns on the first image that i see for a second is the typicall image of the graphic c

  • 1080p pour export quality for 25p material from Canon HF100 PAL

    Hi I have now tested iMovie 11 with a Canon HF100 PAL version. Shooting in progressive. The AIC import has good quality. New 1080p export gives same pour quality as before when using QuickTime 7 for h.264 export. AIC export provides good quality. So

  • ON BUTTON.....

    Hi, my MacBook, it's "ON" button it isnot doing anything at all at all, can you please if you can help me with perhaps solutions, I thank you much Beijos, Isabella

  • Why does my white macbook keep on producing new cracks?

    I have had my white macbook for just over a year now, I have never once dropped it. When I take it to school I put it in a sleeve thing. I'm really careful but I have been noticing that cracks are appearing. There is one at the top right where a litt

  • I need to remove dupilcate songs from itunes

    i have a lot of dupilcate songs in my itunes library how can i mass delete them