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?)

Similar Messages

  • Modbus I/O server & Shared Variable Engine

    小弟做專題用到Labview,想請教一個問題,目前是用labview對智慧電表讀取資料
    主要用modbus I/O server(TCP/IP模式)和shared variable engine
    但是網路上大多數資料是教學如何建立I/O server和設定shared variable
    小弟想知道背後理論是什麼?
    例如:labview如何對modbus TCP/IP的封包進行處理,並取出所要資料。
    謝謝各位指教

    建議使用 google
    關鍵字 = labview shared variable concept

  • 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

  • I/o server shared variable not working in deployment system ( error no-1950679034 (0x8BBB0006) (Warning))

    Hello ,
             am using shared variable from opc client in labview when am run a exe file at development system its working fine but when am running it in deployment system its not working am using same configuration file in opc server at development and deployment system error -1950679034 (0x8BBB0006) (Warning)

    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.

  • 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. 

  • 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

  • Can not update apps after IOS8 update on iPhone 4s

    Can not update apps after IOS8 update on iPhone 4s
    I can no longer update apps on my iPhone 4s after the IOS 8 update. The IOS 8 update took a very long time to complete, maybe 12 hours, and afterwards, it worked but updating packages were very slow. Package updates have since been problematic and about 4 days ago, it stopped being able to update any packages. I click on them to update and they never make any progress. I have 2.8 Gbytes free and I keep deleting more and more packages, pictures, etc. It seems like, from the amount of stuff that I have deleted, I should have more than 2.8 Gbytes free.
    Is anyone else having this kind of problem?

    16GB iPhone4: Go to Settings, scroll down to iTunes & App Stores and touch. At the top of the next page it shows: Apple ID. Touch this. Select Sign Out. Your Apple ID will go away. Re-enter Apple ID and password. Try App Store again.
       Other solutions were to go to Settings:General:Date&Time and turn off auto-update, then change date to next year. This didn't work for me, nor a lot of other users on the forums. It took reading a lot of threads to find the log-out, log-in solution. Even on the official Apple Website all I saw was: Make sure your connection is working, battery is charged, desktop is plugged in when you try to sync. OK I exaggerate, but with all the users posting this problem, you'd think they'd post their solutions when they work with a Tech Help call.

  • Time not updating immediately

    I've noticed that the time is not updating immediately or accurately when I turn on my phone. It started about a week ago. When the screen first comes up, it will show something like 4:57, then quickly changed to 5:33, however, the correct time will be 5:43. It continues to keep time, but can take 10-15 minutes to finally sync to the correct time. Very annoying. Has anyone else had this problem or know of a solution?
    Additional info: Just had original iPhone replaced at Apple Store with another original. Software is 2.0.2

    still experiencing the problem with the delayed or out of sync time and also having the issues of not receiving phone calls, text messages, and voice mail messages at the time of call or when the phone is on. time is usually 12 - 27 minutes slow, i've actually clicked the top button and the time showed 1:27PM and noticed I missed the call at the same time. essentially, i am not receiving my phone calls (i literally answer about 1 out of every 9 calls). the genius bar is no help, giving me the good ol suggestion of "replacing" my phone for a mere "$199" when they really should be saying, get a new phone. if you have the same problem with the 2G iPhone, I implore you to add your story about your problem to the thread.
    Thanks,
    VJ.

  • On my MacBook with Lion Safari does start, does not react immediately after trying to open it. Installing a new Safari does not help. Removing parts of Safari in the Library did not help. Where can I find and remove all components (LastSession ...)?

    How can I reset Safari with all components? On my MacBook with Lion, Safari does not start, does not react immediately after trying to open it. Installing a new Safari does not help. Removing parts of Safari in the Library does not help. Where can I find and remove all components as LastSession and TopSites?

    The only way to reinstall Safari on a Mac running v10.7 Lion is to restore OS X using OS X Recovery
    Instead of restoring OS X in order to reinstall Safari, try troubleshooting extensions.
    From the Safari menu bar click Safari > Preferences then select the Extensions tab. Turn that OFF, quit and relaunch Safari to test.
    If that helped, turn one extension on then quit and relaunch Safari to test until you find the incompatible extension then click uninstall.
    If it's not an extensions issue, try troubleshooting third party plug-ins.
    Back to Safari > Preferences. This time select the Security tab. Deselect:  Allow plug-ins. Quit and relaunch Safari to test.
    If that made a difference, instructions for troubleshooting plugins here.
    If it's not an extension or plug-in issue, delete the cache.
    Open a Finder window. From the Finder menu bar click Go > Go to Folder
    Type or copy paste the following
    ~/Library/Caches/com.apple.Safari/Cache.db
    Click Go then move the Cache.db file to the Trash.
    Quit and relaunch Safari to test.

  • Shared variables not working on PC

    Can anyone tell from the attached screen shot, why my one shared variable is not working with the labview application I'm running on my PC. I set the variable to 48 (I thought), and yet in the NI Distributed System Manager the value doesn't changed. 
    Solved!
    Go to Solution.
    Attachments:
    shared_var_not_working.JPG ‏255 KB

    Its not likely to be a deadband problem if you haven't touched the settings. I would check it out just in case though. In the project window, right click on the shared variable>>properties and select Update Deadband. See attached image. If it's not this, I shall have to think some more about what else could cause this.
    As for ensuring it works when setting it from DSM...from your screenshot you appear to have a VI that writes to the SV. Change the code ore create a new VI so that it reads the SV and then double check that if you change the value in DSM, the VI also reads back the updated value. It may be that the number changes in DSM but does not update the SV in the VI - this would indicate a problem with the shared variable engine or the deployed variable library...Reboot PC and retry... if the problem persists let me know or attach the SV library!
    Regards,
    Dave
    Senior Software Engineer
    www.Adansor.com
    Attachments:
    SV_deadband.PNG ‏8 KB

  • Variables not updating in Snippets

    Hi there.  I'm currently still on RoboHELP 8 and about to upgrade but I've found this issue is still a problem when I've upgrading my project to a trial version of RoboHELP 9 (with the critical update applied).  It's on my local drive - no networks involved.
    I've got a large project (around 2364 topics) and I use variables and snippets a lot in the project.  The developers have had a total redesign of the software interface and I updated a couple of the variables to guage how much work it will take to totally update the help.  In normal topics there doesn't appear to be a problem - but when a variable is in a snippet, the values aren't updating in the view (as per the above image).
    If you preview the topic, the variables update but each time you open the topic, it's reverted to displaying the wrong values.
    The compile uses the correct value so it's only a visual thing.
    The problem is that every time you open one of these topics, it looks wrong and you have to check the snippet to make sure it's been updated.  I'm very concerned that I will get complacent thinking that what's displaying on the screen is a visual firfie and actually overlook a variable that I haven't updated.
    Has anyone else experienced this problem?  Any comments would be greatly appreciated.
    We will be updating very soon and at least I can turn the snippets into html in each of the topics to fix the display issue but that would be defeating the purpose of having snippets.

    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

  • Variables not updated after repository merge

    Hello,
    I am using OBIEE 11.1.1.7 and i am having issue with RPD patch merge.
    I have updated the value in the Variable and created a patch out of it.
    when i am trying to merge or apply this patch other RPD , it is not updating the value in the variables.
    can you please help me with this.
    Thanks.

    Anybody on this?
    Why do the labels of Project Variables not change in Weblogic Enterprise Server 10GR3 although they change in BPM Studio?
    I also tried deleting these project variables from the Engine Tables --> PPROCINSTANCE and PPROCINSTEVENT
    Restarted Weblogic
    Restarted the Engine
    Restarted the workspace
    Redeployed a fresh BPM project.
    But nothing changed?

  • Problem with Bind Variable not updatable.

    Hi all,
    I'm using Jdev 11.1.2.3.0. In my VO, I created a Bind Variable and set it NOT UPDATABLE. Then I created a View Criteria with some other Bind Variables.
    I use this View Criteria in a search page, but at runtime I see also an inpunt text for the variable that is set NOT UPDATABLE and I can change its value.
    Of course if I try to change the value and I do the search, I get an error.
    This is the VO source:
    <Variable
    Name="UlssVar"
    Kind="where"
    Type="java.lang.String"
    IsUpdateable="false">
    <TransientExpression><![CDATA[adf.context.current.sessionScope.get('ulss')]]></TransientExpression>
    </Variable>
    Is it a ADF bug?
    Thank in advance.

    Hi,
    try selecting the bind variable and open the Property Inspector, under UI Hints, set the "Display Hint" to hide. This should hide it (No bug for this reason)
    Frank

  • Global variable not updating in main vi

    Hello Friends,
    I had already prepared a vi with global variables assigned in it previously... now I have updated 4 more global variables to this vi... The output at the read jet data sub vi is updating whereas the force and the rpm values are not updating in this main vi.... I call this as main vi because I just see the final output here, all in one front panel...
    If i click on run once, I get 1 value and in order to get another value i should stop and run again.
    Could you please suggest me how can I get it updated continuously?

    LabVIEW will execute whichever one who wants to first.
    You can use error wires to force an order of execution.
    I would recommend looking at the online LabVIEW tutorials
    LabVIEW Introduction Course - Three Hours
    LabVIEW Introduction Course - Six Hours

  • Using shared variable not in the project.

    hi all
    I have a project with the 2 RT targets and the development PC which were i currently deploy all my shared variables, But I need to finally deploy these shared variable in a different stand alone windows based machine. To do this I created separate application which does nothing but deploys the shared variables in this PC. but when i tried to bind to this variables (frount panel binding) from my RT targets it woudnt work, the led does not glow, it is always transperent. but when I tried to connect to these variables from my development PC it works fine. I double checked the firewall problem, that is not the case here. Can anyone tell me what am i doing wrong?
    Thanx
    Arun

    Hi Prashanth
    Thanks for the reply. I did realize that the front panle connection would not be supported in RT, now i have the shared variables on my RT machine which has te source as the windows machine. If the windows machine is my development machine the shared variables connect fine, but if its a different PC the shared variables connect for few seconds and with the error info "shared variable value 0" then the connection gets disconnected.
    Also i read a note in the shared variables help, it said to subscribe and publish on a network shared variable all the shared variable which connects to this variable should be active. does this mean that if there are 2 RT targets that subscribe data and one of them is not switched on the shared variable does not work.?
    Thanks again for your support.
    Regards
    Arun

Maybe you are looking for