Occurrence refnum - access from a different vi.

Hi,
Labview help enticingly has this to say about Occurrence refnums:
"Occurrence Refnum—Used with the Occurrence functions. Use this type of refnum when you generate an occurrence in one VI but want to set or wait for the occurrence in another VI."
This is exactly what I want to do. I can create an occurrence refnum in vi #1 but I just cannot see how to 'get at' the refnum in vi #2 without using something like a global variable to pass it.
The vi's are all dynamically loaded so (unless I'm missing something else as well, very likely!) it is not possible to wire the occurrence or references.
I'm a 'C' programmer just starting out with Labview so please don't assume I know *anything* for sure.

Ben wrote:
Yes!
And to extend the idea I have used AE's to share data not only between threads and between exe's, but also between machines across a network by exposting the AE and invoking the AE using VI Server call by reference in which case the call is mad on one PC and the inputs passed to the AE are transported across the network to the target where those inputs are used to call the AE on the target. The results of the AE method are then retuned to the VI server layer which in turn passes it back to the calling VI as if the AE was just a normal sub-VI.
The Un-initialized SR appears to be implmented as a "static local" (forgive my C jargon since it is very rusty) where the data space for the SR is not recreated on each cll but persist fromcall to call.
Ok, I've read a lot more now and I see that the USR technique seems to be officially sanctioned by NI. I was worried this might be exploiting undocumented behaviour which could change between compiler revisions. "Static local" is fine by me!
The real power of the AE comes into play when you promote it from what is often called a FGV (Functional Global Variable that functions like a global having a write and a read) to an AE by encapsulating the operations that act on a data structure (in the SRs) and returns the results to the same SR thereby preventing the possibility of a Race Condition. Race Conditions are part of any multithreding environement and since LV is by default multithreaded, we can't willy-nilly go off and ignore race Conditions.
It boils down to the same effect as wrapping every bit of code that accesses the data in some form of lock, whether that be a mutex, semaphore or whatever, but the encapsulation of the functionality with the data is quite elegant. I wasn't planning to ignore race conditions.
In the case you outlined above you were using controls and indicators to share data and planned to use Semaphores to protect them. In theory that could work if you only used property nodes to read and right the objects. Using a local variable of the control would present an potential Race Conditions becuase of the way locals are implemented (Search for more on that topic) since they have a "special back door" that uses a buffer to apply the update without getting the UI thread involved.
I have tended to do all reads and writes using property nodes because it isn't possible to wire data into a control. Plus, I read all sorts of warnings about local variables being inefficient and consuming lots of storage space. I didn't see any warnings about property nodes causing a performance hit in the help pages - in fact, I got the impression that the 'value(signal) property' would force the control to update but the 'value' property would not. Having re-read that section I now see that it is referring to the generation of UI events rather than updating the control. The two things just merged in my mind. I also see that Google has *lots* of info on the property node/UI thread switch problem.
I found a lot of material explaining the traditional multi-thread interleaved read-modify-write problem - I assume this is the cause of the race conditions you're referring to? 
And regarding the UI thread...
If you did implement your scheme using property node >>> value you would be forcing all of your data acces to operate in the UI thread (which is single threaded) incurring the over-head of thread swapping added to dealing with the bottle-neck of doing most of your work in a single thread. Running that code on an eight core machine would swamp one of the cores and leeve the other seven to twiddle their thumbs.
Yeah, that's bad news. Do you know whether the UI's of all top level windows in one .exe run in the same thread?
"No Sir, Don't like it." (Mr Horse from Ren and Stimpy ?)
Stepping back and doing the big picture thing for you...
LV is often looked at as just another programming langauage. This is true on the surface but "the devil is in the details." (Ross Perot). Since LV uses a data flow paradigm, development in LabVIEW is well served by ading an additional phase to the traditional design work which is very similar to the "Data normalization" applied to data bases ("The key the key and nothing but the key so help me Codd."). Altough I have no formal training in that area I am married to a DB-Guru so I have an informal awareness of the ideas.
I thought Labview was supposed to be 'programming made easy for electronic engineers'. It's funny, really, because I've only been timkering with it for a few weeks and I'm already up to my neck in multithreaded programming issues while just trying to put together a fairly trivial program with a few windows and a bit of data. I'm quite enjoying it, but I hadn't expected to be so concerned with what's going on under the hood quite so early. NI should do a course entitled "Advanced Labview for Complete Beginners".
the Dta analyisis work amounts to looking at the data structures I plan to use in an application and doing sanity checks and drawing up data paths to help me streamline my designs.
Some of the things I look at BEFORE CODING are;
1) Are the values I am grouping together used together? If not I seperate them.
2) What type of operations are perfomed on the data? The processing steps may benefit by me structuring the data as an array of clusters rather a flat cluster etc.
3) How big is the data set? Large data sets get special attention because they can sneak up and bite you. Benchmarking may be involved in this step so I know about perfomance issue ahead of time.
4) How busy is the data path? Busy data paths (DAQ to logging in high speed apps) is of particular concern. I have had to implement duplicate DAQ systems to provide a second data path for information coming from a RT machine or used SCRAMnet to provide the perfomance I need.
5) What all needs to touch the data? This combined wiht the above help to suggest where I am going to put the data. Do I put it in an AE so it can be shared and mashed from multiple locations, Do I put it in a queue to get the raw dat there fast...
I can probably go on a bit more but my point is it is only after the data anaylsis phase that I have a good idea what types of mechiansms will be used for each data structure.
That's all good advice and makes a lot of sense.
Still trying to help,
And I very much appreciate it!
Ben 

Similar Messages

  • I would like to know how to get refunded when my iTunes account was accessed from an unusual device.

    I received a receipt for a purchase I did not make in the store. It's for a single $1.29 ringtone. The same day I received an email saying my account had been accessed from a different device than was usual. I followed the directions and change my password but I want to know if my account will be credited back the $1.39 for the ringtone I did not purchase.

    Contact iTunes Customer Service
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • APEX Application accessing data from two different databases

    Hi All,
    Currently as we all know that APEX Application resides in database and is connected to the schema of that database.
    I want APEX Application to be running and accessing data from two different databases. Elaborating my question,
    Currently, my APEX Production Application is connected with XXXX Schema of DB1 Database(Where APEX Resides). Now I want to add some pages into this APEX Application for REPORT Purpose, But I want to connect this REPORT APEX Pages to get data from Different Schema YYYY for Database DB2.
    Is it possible to configure this scenario?
    The reason for doing this is to avoid the REPORT related (adhoc queries) resource utilization effect on Production DB1 Database.
    Thanks
    Nil

    1. If you do the joining of two or more tables in DB1 then all data is pulled over to DB1 and then the join is executed: so more data over the databaselink and more work for DB1. Better keep the joining stuff where the data resides and just pull exactly that data over that you need.
    2. Don't know about your different block sizes. Seems a nice question for one of the other forums (DBA or SQL).
    3. I mean create synonyms on DB1 for reports VIEWS in DB2.
    Hope all is clear!

  • We have created shared folder on multiple client machine in domain environment on different 2 OS like-XP,Vista, etc. from some day's When we facing problem when we are access from host name that shared folder is accessible but same time same computer when

    Hello All,
    we have created shared folder on multiple client machine in domain environment on different 2 OS like-XP,Vista, etc.
    from some day's When we facing problem when we are access from host name that shared folder is accessible but same time same computer when we are trying to access the share folder with IP it asking for credentials i have type again and again
    correct credential but unable to access that. If i re-share the folder then we are access it but when we are restarted the system then same problem is occurring.
    I have checked IP,DNS,Gateway and more each & everything is well.
    Pls suggest us.
    Pankaj Kumar

    Hi,
    According to your description, my understanding is that the same shared folder can be accessed by name, but can’t be accessed be IP address and asks for credentials.
    Please try to enable the option below on the device which has shared folder:
    Besides, check the Advanced Shring settings of shared folder and confrim that if there is any limitation settings.
    Best Regards,
    Eve Wang
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • How do I access and use my Itunes library from a different/new computer?

    How do I access and use my Itunes library from a different/new computer?  My computer is no longer working, so I need to be able to access my library from my wife's computer.

    Your library will only be where you put it.  Copy everything from your backup copy of your old computer to the new one.
    You can redownload some itunes purchases in some countries:
    Download past purchases - Apple Support

  • Access a component in an mxml file from a different mxml file

    Hi,
    I want to access a component in an mxml file 1 such as this one  <mx:Image id="img" width="101" height="200" source="{product.image}"/> using the
    id
    from the actionscript function from a different mxml file 2
    public function init():void
           HERE.addEventListener( MouseEvent.MOUSE_DOWN, beginDrag );    
    so i can make it dragable, Please help me  in this if u can urgently!!!!

    okay,
    I have the image component in ProductCatalogThumbnail.mxml, which has an id of "img"
    so, i created a public variable in the file and a public function that returns the value of the object.
    public var imagecopy:Object;
            [Bindable]
             public function imagecopyfunction():Object{
             imagecopy  = img;
             return imagecopy;
    now, I want to access this image in the mxml file ProductList.mxml in a function
      public function init():void
          ProductCatalogThumbnail.imagecopy.addEventListener( MouseEvent.MOUSE_DOWN, beginDrag );
         // accepting a drag/drop operation...
           this.area.addEventListener( DragEvent.DRAG_ENTER, acceptDrop );
           // handling the drop...
          //this.area.addEventListener( DragEvent.DRAG_DROP, handleDrop );
    I tried to use the variable, and then i tried to use the function:
    I got this error when I tried the variable : 1119: Access of possibly undefined property imagecopy through a reference with static type Class.
    ProductCatalogThumbnail.imagecopy.addEventListener( MouseEvent.MOUSE_DOWN, beginDrag );
    and this error when i tried the function:  1061: Call to a possibly undefined method imagecopyfunction through a reference with static type Class.
    ProductCatalogThumbnail.imagecopyfunction().addEventListener( MouseEvent.MOUSE_DOWN, beginDrag );
    i made sure i imported ProductCatalogThumbnail file in the beginning of my application.
    I am not sure what went wrong.

  • Unable to access web setup from 4 different Win7 machines with IE9 / FireFox

    I Hope someone can help, I suspect this may have something to do with a recent update to Windows or IE since this worked at least a couple of months ago.
    I'm unable to access the  web setup screen from 4 different windows machines running IE 9 or Firefox (various combinations of wireless, wired, etc.). When I get to the certificate error and hit the "yes, i understand, continue", it comes back with a 'can't be reached' page and looking into the details says the 'connection was dropped'.  However If I connect from a MacBook / safari, I'm able to reach the page fine (and admin the router).
    Summary:
    Using a wrt610n
    I am connected to the router, the ip address hasn't changed, the password hasn't changed
    I can use the router & connect to the internet
    I have the router set to require HTTPS, but switching it to allow HTTP doesn't help.
    Both Wired & Wireless Win 7 / IE9 machines can't connect.
    Tried setting the router ip address to 'trusted' zone in IE
    Tried setting the router ip address to the 'compatibility' mode in IE
    Tried using latest version of Firefox with the same results.
    Thanks in Advance!
    Stephen

    Before I suggest you any troubleshooting steps, I would like to ask few question. Like did you try opening the “https://192.168.1.1” in Internet Explorer 8. If not, then try to open the Router Management page in the same manner in Internet Explorer 8 and check whether it opens or not. As it should show up.

  • Accessing "globals" from 2 different executables

    For an application we need to access the same set of "globals" from 2 different executables.
    How can this be done?

    hi
    can't be done (as far as i know). each executable has its own data space, so no memory or vis are shared between two executables (well, otherwise the behaviour of an app could change when other apps are opened). to share data between two apps i suggest to use dstp, tcp, udp or just a simple ini-file.
    or: build a single application. the top level vi of the app calls both top level vis of your apps dynamically. then they use the same dataspace.
    best regards
    chris
    Best regards
    chris
    CL(A)Dly bending G-Force with LabVIEW
    famous last words: "oh my god, it is full of stars!"

  • Accessing cDAQ-modules from 2 different computers ??

    I am maybe asking a hopeless stupid question here, but working from the thesis that there is no such thing, here goes;
    If I have a NI cDAQ-9188XT with a NI-9401 DIO module, where I use 4 lines for digital output and 4 lines for digital input,
    is it possible in any was to access these 8 lines from 2 different computers more or less simultaneously ?

    Yes, but not directly.
    Set up one computer to directly talk to the cDAQ.  From that computer, either update deployed shared variables for other PCs to read or setup a network with another form of communication such as network streams or TCP/IP.  The first method doesn't require the second computer but is lossy (it won't check to see if other applications read the updated variable).

  • Can you access your iPhoto on your MAC from a different device?

    My Mac, which is my housing source for all photos from the past 7 years. Is there any way to access my iPhoto and it's contents from a different device WITHOUT using iCloud? I have iCloud, but I don't believe that I ever connected it with my MAC.

    Where is your laptop?  You might be able if you have file sharing setup and remote access enabled on it.  However the laptop whould have to be setup to allow you access remotely.  You can learn more about that by asking in the forum for the system that is running on the laptop.
    OT

  • Accessing an object from a different server

    Hi,
    I am making a program that will access an object from a different server.
    I have a program that when I run calls a jsp page running on Server A which in turn should request an object A from Server B.
    I am relatively new to Java and jsp. What would my best course of action be.
    Thanks in advance,
    Brian

    Or RMI?OK, sounds good, I will look up some RMi on the site.
    Thanks, will prob have more questions for you later.

  • Javamail - How do you access mail from a different Google domain

    I'm trying to accessing mail from a different Google Domain (custom google apps domain i.e. email(at)labs.com
    Currently the application is accessing the mail from Gmail and sending it to same mail id
    Does anyone know how to change this?

    I don't actually know, but I would guess that either there's a mail server running at imap.labs.com,
    or else you just login to imap.gmail.com using your labs.com email address.

  • So I had a mac with an account on it, I no longer have that laptop. Can I access my library from a different computer? If so, how?

    So I had a mac with an account on it, I no longer have that laptop. Can I access my library from a different computer? If so, how?

    No

  • Accessing a document from a different system

    Hi,
    I need to get (display) an attachement stored in EBP from a different R/3 system (in transaction display purchase requisition).
    Could somebody point me to right direction ?
    Thank you for your feedback.
    Marian

    Marian,
    Which version of EBP and R/3 are you using? You can look for an RFC and use it for accessing the document and displaying in R/3
    In my project we had a requirement that the attachments have to be displayed in R/3 purchase orders and we solved it by storing the attachments in document management system in our back end R/3 system and then adding some screen enahncements in PO userexits wherein we accessed the DMS and displayed the attachments.
    But if I remember correctly this required some core modification on the EBP side.
    Regards,
    Vani

  • HT1203 How can I access my itunes account from a different computer as I need to cancel a subscription and I am on holiday at the moment

    Hello
    I need to access my itunes account from a different computer as I need to cancel a subscription and I am on holiday at the moment.
    Am I already now logged in to Apple ??
    Thanks

    If the Computor you are on has iTunes library go to tunes as if u were going to buy a song or film and you can log into your account. At the bottom of the iTunes home page you should see the user that is logged on usually a email address. Click on it to log them out and enter your own apple I'd and password. You can then update whatever you want and log back out after

Maybe you are looking for

  • How do I Hide the text printed from a standard Text Element in SAP Script?

    Hi, I have created one SAP Script which gets printed from IW33 using a standard print program. In config the standrad SAP script is replaced by the zsap script. Since the Zscript is printed from a Standard print program, I had to keep all the text el

  • Linked Ole Object with MS Word has bad resloution / invalid fonts

    Post Author: Winfried Boennhoff CA Forum: .NET Environment: .Net 2003 Viewer with external .rpt created by CR XI As result I get a bad resolution of the word document and the original fonts are not supported, I tried all common fonts. The font used b

  • Having trouble importing .PDF file into Adobe Digital Editions

    I tried to import .pdf file into Adobe digital Editions. I received an error message that the version of Adobe Digital Editions does not support password protected files. The file is not password protected. I can open it easily with Adobe acrobat rea

  • Error in File

    Hi everyone, The following code create an execution time error and I can not find the solution for this. If you help me, I will be happy. import java.io.*; class Files {      // properties      static int first = 0;      // constructor      public Fi

  • HOORAY!!  Apple finally fixed QT!!

    Just downloaded and installed the latest software update for QuickTime and it fixed the previous update issues. The problem was that the video would stall a few seconds into a movie but the audio would continue on. So if you had this same problem due