How do you synchroniz​e accesses to a LabVIEW Shared Variable?

I would like to create an ad-hoc weather station program (I'll explain more in a bit).  I am using LabVIEW 8.0 Full Edition, and I would like to share data over a network between stations with the LabVIEW Shared Variable.  Here's what I want to be able to do:
A node would start up, and begin publishing data to a network via a shared variable.
The shared variable is an array of clusters
The cluster information would hold things like:
Station Name
Station Location
Weather information cluster (temperature, rainfall, windspeed, wind direction, etc...)
Timestamp of last update
When a new node would like to enter, it would bind to the shared variable, grow the array, and add its information.
If a node's Station Name and Station Location is already in the shared variable, it would merely update the information in the cluster.
Viewing nodes could pop in, bind to the shared variable, and read/display the information at any time. 
I am trying to enumerate problems with this before implementing, and I have run into a stinker of a problem that I am not sure how to solve.  How do I synchronize accesses to the LabVIEW Shared Variable?  If I read the variable, modify it, and write it back, I will undoubtedly run into a race condition where 2 nodes attempt to update its data and I will lose the data written by the first node - Node A reads, Node A modifies, Node B reads, Node A writes, Node B Modifies, Node B Writes, and thus the modifications made by Node A are lost.  In my specific application losing some data isn't critical, but if not remedied this type of problem could cause massive amounts of data to be lost when there are numerous nodes, and that is definitely not acceptable. 
Does anyone have any recommendations on how to synchronize the read-modify-write operations on the data in the Shared Variable?
-Danny

Wendy,
I am afraid Semaphores are not network-shared objects (to my knowledge), they are system-level objects that use operating-system synchronization mechanisms.  If I were synchronizing on a single machine, a semaphore might be a valid mechanism; as an aside, most user-mode semaphores are designed to synchronize within a single process - to synchronize between processes you need to store the semaphore in the Kernel, and to synchronize over a network you would need a network node to handle serialization of requests.  My Shared Variable is published over a network, and to my knowledge there are no network-published synchronization mechanisms available - mostly because there is no way to currently perform an atomic test-and-set on the Shared Variable (am I correct?) and there isn't a mechanism for blocking access to a Shared Variable from another network device/machine (or is there?).  I've been looking for some way to implement an atomic test-and-set but I am running into a wall; I know that if I select the "single writer" attribute of the Shared Variable I can get LabVIEW to force a single writer allowing me to have an atomic "set", but I need more than that.
If only there was a network-shared Semaphore or some way to block other network accesses to the Shared Variable I would be in business - something like what I want doesn't exist, does it?
Thanks!
-Danny
Message Edited by texasdiaz on 02-23-2006 02:52 AM

Similar Messages

  • How do you disable remote access for mac routers

    how do you disable remote access for mac routers

    Hi, I'd never buy an Apple router again, but see if reverse thinking works here....
    https://discussions.apple.com/thread/3926392?tstart=0

  • HT202213 how do you remove a computer from the home sharing list

    How do you remove a computer from the home sharing list?

    See These Support Articles for Home Sharing
    Understanding
    http://support.apple.com/kb/HT3819
    How to
    http://support.apple.com/kb/HT2688
    Troubleshooting
    http://support.apple.com/kb/TS2972

  • Library content- I have several apple products... Music and pictures vary on all devices. How do you synchronize?

    Library content- I have several apple products... Music and pictures vary on all devices. How do I synchronize and retrieve older content.  Thanks

    Sync all devices to the same content in your iTunes library.
    Older content?  What kind?  I could type in 2 pages of how to get other things from place to place but won't unless you have more specific questions.

  • How do you get IBM Access Connections on T41 to remember channel of weak signal SSID?

    I have a T41 with Windows XP SP2. It uses IBM Access Connections to connect to wireless networks.
    How can I get IBM Access Connections to store the channel used by an SSID, so that it won't roam through all channels over and over looking for a better channel?

    i seem unable to setup the AE to do the same thing. i can stream audio to my hifi no problems - this is cool. i can set it up to create a wireless network and give it a different ssid and channel but it doesnt seem to want to choose the same ssid. i can manually change it to the same - is this what i should do?
    Yes you will manually need to enter the SSID.
    however when i do this the AE trys to act as DHCP and gives a 10.1 address to the laptop which is odd
    You also need to configure the AirPort Express (AX) to bridge (not share a single IP address).
    should i be using the join a wireless network option instead of the create a network? but isnt this for people who are extending their networks wirelessly?
    You should be using the "create a network" option.

  • HOW CAN YOU PROCESS AN AUDIO FILE IN LABVIEW?I NEED TO TIME-PITCH SCALE IT

    hello guys.
    can you insert an audio file into labview for further processing?i need to get an audio file (stored on my computer) and further process it for time-pitch scale.does anybody know how?any pointers will much be appreciated.
    regards
    alex

    hi there
    open the "Graphics & Sound" palette from the functions menu to use vis for reading/Writing wavefiles, search the examples shipped with LV for first steps. use the VIs in the "Analyze" functions palette to modify the data.
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"

  • How can I use an Access front end and Access button to control a LabView Shared variable boolean?

    My company has invested a lot of money on the office network to write many many access databases and front ends. I'm looking for a way to tie a button on an access front end to toggle a LabView boolean shared variable to notify me when they changed something on their side of the network. I'm not seeing anything that helps on a web or forum search. They don't like the idea of a separate labview control that they have to push a button on to let me know.
    Thanks
    Solved!
    Go to Solution.

    Hi Patrick,
    While this is not the intended purpose of Network-Published Shared Variables, you might be able to accomplish this by writing separate accessor VIs for reading from and writing to the variable, making sure to wire the inputs and outputs. Then, you could build a DLL, making sure that you include the accessor VIs as Exported VIs and include the DLL Library in the Always Included section of the DLL Build Specifications. During this process, you will define the function prototype, which will provide the function call, required parameters, and return values. Once the DLL is created, you can then call it and its functions from another programming language (C, C++, C#, VB, etc.). This may or may not work, but it is the only way that I can think of at this point. I have included some references that may help you in this process.
    Building a Shared Library in LabVIEW (White Paper)
    Calling LabVIEW VIs from Other Programming Languages (White Paper)
    Calling LabVIEW DLL From C# (Forum with Examples)
    I hope this helps.
    Regards,
    Mike Watts
    Product Marketing - Modular Instruments

  • How do you see TC in itunes as a shared device/ external hard drive?

    In order to pull movies and music off the TC and back onto the mac? Like a shared device? Just wiped out our macbook pro but backed up everything first on the tc, now it's frustrating because we are having trouble finding things that seem to be missing?? Sooooo confused!!!!!!!

    Redonkulous99 wrote:
    In order to pull movies and music off the TC and back onto the mac?
    Are the files you want to access stored on the Time Capsule as regular files or as part of a Time Machine backup?  If they are regular files, first mount the TC disk:
    1) Open a Finder window.  Look for the Time Capsule in the "sidebar".  If you don't see it, open the Finder's preferences, select the Sidebar panel, and check "Connected servers".
    2) Click on the Time Capsule in the sidebar.  You should see the Time Capsule's disk (named "Data" if you didn't change it).
    3) Double-click on the "Data" icon in the window.  Authenticate with the disk password you declared.
    The Time Capsule's disk should now be mounted and you should be able to use iTunes to access it.

  • How can I build an application that deploys my shared variable library?

    I have a VI that I want to build into an application and put on a non-development machine. I am using a shared variable which obviously is contained in a library. In the VI itself I can deploy the library by specifying a path. Is there a way to build the application so that the library is deployed automatically when the .exe launches? I want to get away from having the end user to have to know where the library is and set the path correctly.

    Hi Troy,
    Sorry, but I think I missundersood you.
    I think you have to deploy the library programmaticaly by using the Application Control functions (OpenAppRef, InvokeNode)
    I didn't test this but the following picture shows how to start:
    Kind Regards, Christian
    Message Edited by Christian_M on 01-05-2006 09:11 AM
    Message Edited by Christian_M on 01-05-2006 09:11 AM

  • Programati​c Access to network published shared variable - Knowlege Nugget

    Wanted to Share a coding problem I have just resolved:
    I have been trying to debug the code above.
    It worked for one device and not the other (Identical devices: DevA,DevB)
    It has been throwing an error, unable to access variable.
    I resolved the problem by changing by changing the timeout to something > zero
    Hope this helps future travellers
    This seems onlt yo be a problem during the first connection to the variable,
    Subsequent reads don't seem to need it.
    It is almost as though it needs time to troll through the project shared variable database to finde the reference the first time through.
    iTm - Senior Systems Engineer
    uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT

    Ben wrote:
    Since I don't use shared varibales I have to ask...
    Is there a timestamp returned that reveals the state of the variable?
    Ben
    The timestamp is only available on the reads.  It returns the timestamp of when the variable was written to.
    One more thing to watch out for (we recently got bit by this).  The NPSV is actually written to a buffer (8kB?).  The variable is published either when the buffer is filled or 10ms has passed.  There is a command to flush the buffer to avoid this 10ms delay.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How do you move an access app from one sharepoint subsite to another?

    Hi there!
    I have created an access app for my 'Account management' subsite. This database stores lots of important information, however I'd like to move this to a new subsite which I've created called 'Campaigns'. How do I do this? I literally want to take a copy
    of it with all it's contents and move it to a new subsite.
    Thanks!
    Sarah

    Hi Sarah,
    You can go with backup & Restore option.
    In Powershell:
    use this below commands,
    Backup-SPSite <site URL> -Path "Path Location" -Force
    <site URL> --> http://server_name/sites/Account management (which site you want to take backup)
    "Path Location" --> C:\Backup\site_name.bak(where you want to store the backup)
    Restore-SPSite <site URL> -Path "Path Location" -Force
    <site URL> --> http://server_name/sites/Campaigns (where you want to move the site)
    "Path Location" --> C:\Backup\site_name.bak (where you have the backup file)
    otherwise you can Go with remane the subsite.
    Vote me, if its helps you. Regards, Tamilarasi.

  • How do you set an access key of a button when the button's content is bound to a string?

    Hello,
    I want a button's context to be "_Edit" when it's in an edit mode and "_Add" when it's not. When I bind the button's content to a string, the access key would not work. So I used two separate buttons to do the work and that seems like
    the right way.
    Just out of curiosity, is there a way to bind the button's content to a string and still make the access key work?
    Thank you for the help.

    In general, if operations are quite different from each other like Add
    and Edit it's completely valid to use two different controls.
    Anyway, you can of course bind the content of a button to a string and add an underscore as a prefix in the setter of the property. That will change the access key according to the content string's first character.
    If altering the bound string is no option in your case you can also use a custom string converter.

  • How do you get to access Keynote documents?

    I have uploaded a Keynote document but can't access it on iCloud?  How is this done?  I have enabled iCloud on my iPad, Laptop -MacBook Pro, and on computer - but it doesn't work.  The Pages documents I uploaded at the same time can be downloaded.

    Only documents that have been opened on an iOS device can be downloaded from iCloud.com to a mac.

  • How can you give full access to your Apple ID and iTunes library to someone who moved in with you and have their own Apple ID?

    As the title says, we would like to use just one account in the future, or at least fully share both account so we can share our libraries. Thanks in advance!

    Hi Hansem1979,
    Here is an article describing 2 different methods to share your libraries and the differences beteween them:
    iTunes: How to share music and video
    http://support.apple.com/kb/ht2688
    Cheers!
    - Ari

  • HT1694 how do you synchronize hotmail across all apple devices

    We utilize an Imac, Mc Book Air and iphone and want to bring hotmail email accounts across devices into sync.. any wisdom would be appreciated

    It is not hard.  I can tell you for setting up Outlook 2011 (Outlook for Mac).  Go to accounts and add a new account. The first step is to type in your email.  DO NOT TYPE IN YOUR HOTMAIL OR OUTLOOK.COM EMAIL. Type in a dummy address like [email protected]  By doing this you will get the option to set up an IMAP account otherwise Outlook will force you to use POP which does not allow syncing across devices like IMAP. 
    Now enter the following under your settings:
    -Your real hotmail outlook.com email address
    -your hotmail or outlook.com password
    -for incoming server: imap-mail.outlook.com
    ---Incoming server port: 993 (you have to check the box "override default port" to change this
    ---Use SSL (make sure it is checked)
    -Outgoing server: smtp-mail.outlook.com
    --outgoing server port: 587
    --use SSL to connect (make sure it is checked)
    It is a similar process for setting up OS X Mail.  Use a dummy email to bypass the  automatic detection and then use the settings above.  I confirm IMAP works for hotmail in both Outlook 2011 and Mail v.7. 
    On the iPhone I think you can actually just select Hotmail as an email account type and it will configure it automatically. Something to do with Hotmail supporting active sync with IOS devices but not desktops.

Maybe you are looking for

  • How do I get company's central contacts to show in OWA?

    During summer 2013 we shifted from SBS 2008 (Exchange 2007 which worked great but just constantly bottle-necked) to Windows 2012 with Exchange 2013. The migration seemed have gone well but when users went to access the company's public folders, mainl

  • How do i read a text file and then display the content as a string

    I also would like to strip the string from a certain substring and convert the remaining string into an array of floating point numbers. I was thinking of using the read from spreadsheet vi but I'm not exactly sure if that is going to work. Any help

  • Illustrator CS3 crashes under Mac OS X 10.5.5

    Since some days I encountered crashes everytime I want to save or print a file. I didn't installed the last days any Plug In or program that could affect Illustrator. I tried to reset any preference file in any directory. - It didn't works. I tried t

  • How do I get the block duration for wave file playback?

    I'm using a LV example "Getting Started with sound and vibration express vi's (simulated).  When I play back the examples the audio does not match the graphing updates as the file is played. That is, the sound continues to play after the graphs have

  • Credit memo (Customers) deletion

    Hi One of the user created a credit memo for Customers and would like to delete the same as it is no longer required. Can any one suggest me whether we can delete the credit memo in PRD ? If yes, can you please expalin the process..! If no..! Is ther