Event applied to control references

Hello!
I built a VI that can run on its own or controlled by a superordinated VI. If there are valid references comming into the subordinated Vi these are used exclusivly, otherwise references to the controls of the superordinated VI are used.
So inside my program I exclusivly use references and property nodes to access or change data.
My first question is if you think that is a bad solution concerning the performance of the VI and if you have any improvements?
The next problem is that my VI is quit slow now (there is a while loop checking all the time if there are changes made to the controls (via their references) and acquiring data (using RS232) and updating controls. Thereby I use a 20 frames long sequence inside the loop.
Is that the reason for slow performence?
To speed things up I considered to us an event structure instead of the sequence to check the changes and only to do the acquisition every cycle.
But I don't see a possibility to use the event structure to check events on value changes of controls via their references.
Any idea?
Thank you,
Alexandra

> But I don't see a possibility to use the event structure to check
> events on value changes of controls via their references.
>
With LV7, it is possible to use an event structure on control references
to another panel. As for whether this is the reason for performance
problems, that is hard to say without seeing your application.
First suggestion is to use the profiler. Tools>Advancec>Profile VIs.
It should help you start looking in the right place and run informed
experiments.
Another way of doing this is to send it to [email protected] and let me use it
as part of the VI critique going on at NIWeek. We will keep the names
anonymous and find the best technique we can for the problem you are
trying to solve. This offer goes for anyone with a VI t
hat they'd like
to see NI try to improve upon.
Greg McKaskle

Similar Messages

  • Creating a dynamic event from a control reference

    Does anyone have an example of creating a dynamically driven  event from a control reference?

    Hi 4BoysDad,
    There is a good example that can achieve what you're looking for in the example finder.  It is called "Dynamically Register For Events.vi".  It will be under
    <labview>\examples\general\dynamicevents.llb\Dynamically Register for Events.vi
    Regards,
    Che T.
    Applications Engineer
    National Instruments

  • Accesing controls (references) from several VI's

    Ok I have this small problem:
    I have a large program
    and have put serveral "advanced settings" in a different VI.
    Result
    is that the values entered here need to be passed to controls in
    different other VI's
    The way I use this now is using 1 element
    queues to pass the control
    value. 
    For one VI I can create control
    references, call a sub vi and put here the control that can manipulate
    the value.
    How do I achieve this for multiple VI's? Is
    there a way to make control values from ANY running VI available? Maybe
    using xcontrols? I have no idea how to achieve this though.
    thanks!

    Ben wrote:
    I will typically use a GUI controller in my apps to accomplish that type of thing.
    GUI Controller
    I develop an Action Engine  that will cache a cluster of control references when an Init method is invoked. This put all references in a SR that can be accessed from any place the Ae is used.
    I add methods to the AE to take care of screen settings associated with changes of state ("Set Visability Edit Mode", "Set Visablilty Login", etc).
    I also add a method to return the cluster of refs so I can use them to set-up dynamic event registration in sub-VI etc.
    A side benfit of using a GUI Controller is that you have a single point where you can add a "stack" of screen views so functions like "Back" and "Forward" can be added easily. 
    So...
    trying using a GUI Controller.
    Ben
    This an excellent method for achieving what you want. A variation of it would be to use LVOOP instead of the AE. The two approachs are essentially the same but with some thought on the definition of the classes I imagine you can create a general purpose base class to handle most of the common aspects. Customizations can be achieved using derived classes.
    Further adding to Jeff's comments about the up front hit in the schedule. When done right you will see the benefits of shorter schedules for future projects. The first time is the hardest sell to management. However once you get a couple of successes under your belt future requests will be much easier since you now have a track record of benefits achieved by using reusable code libraries.
    Message Edited by Mark Yedinak on 03-30-2010 08:55 AM
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Pass control references to subVI using Invoke Method

    Hi guys,
    Can I use <Control Value Set invoke method> to pass some control references to a sub VI, then use the <Run VI invoke method> to run the sub VI with the previously passed data?  The control refnums are for some frontpanel controls in the Main VI.
    I was able to pass other data but the refnum didn’t work.
    Thanks

    Hi there, There are a couple examples that use the same method. Check them here:
    - Set Control Values and Trigger UI Events in Another VI        
    - Set Values and Properties of Controls in a SubVI
    - Save and retrieve front panel control values
    Alejandro | Academic Program Engineer | National Instruments

  • Advanced ?? Control Reference Update - Too slow.

    I have a main VI which controls a bunch of SubVIs. Each of these subVIs
    get data from the DAq and generate the plots and intensity graphs. I
    use a control reference to display these plots and graphs on my main
    VI. This is really slow. When I compare the speed at which the main VI
    is updated and the subVI is updated, there is a significant difference.
    Is this usually the case or am i missing something ?
    Thx
    Kudos always welcome for helpful posts

    I agree with tst, your PP VI runs at unlimited speed for no good reason. You should pace it with a small delay so it will release the control to other processes after each iteration.
    Also your DAQ part seems inefficient. Why do you configure the DAQ task from scratch, acquire, and close at every iteration? This is way too much work. You should flatten this out to the PP vi. Configure outside the loop on the left and close outside the loop on the right. Place only the ACQ part inside the loop.
    Also, place the real terminal of the graph inside the loop and clear it once at the beginning using a local variable. A local variable is always more expensive and less efficient.
    I don't understand why you need a timeout event in the main VI, it does not do anything except spin the loop, right? Just delete the timeout event.
    LabVIEW Champion . Do more with less code and in less time .

  • Get All Controls References

    Hi all
    If somebody know how can i get all controls references of VI (including controls that founds in Tabs and Clusters). I need generic method, because i haven't information about VI (reference to VI i get only at run-time).
    Thanks, Nadav

    To include the controls on Tabs, pass the array from my previous answer into a for loop, use auto-indexing. Place a Class Specifier Constant in the loop, right click on it and set it's type to a Tab Control. Place a "To More Specific Class" function below the constant, and wire the constant into the top.
    If the control from the array that you pass in is a Tab Control, "To More Specific Class" will NOT return an error. Use a case statement and use the No Error case to expose the Tab Control properties. Return the "Pages" property (an array) and pass this into a for loop. Connect a property node to the indexed pages, then select Controls On Page to return an array of controls ON EACH PAGE. You need to set up a shift register and use build array to return all of the controls from all of the pages. Make sure you close the Page Reference.  You can concatenate the array of Tab Control Page items with your original FP Controls.
    Now is the right time to use %^<%Y-%m-%dT%H:%M:%S%3uZ>T
    If you don't hate time zones, you're not a real programmer.
    "You are what you don't automate"
    Inplaceness is synonymous with insidiousness

  • Data acquisition with control references

    I'm a new LabView user and I would like to acquire data in a subVI and display that data in the main VI. I think that I need to use control references and refnums, but I just haven't been able to figure it out. I would GREATLY appreciate any help I could get.
    Thank you!

    From your description I would guess that the "subVI" has a loop in it that repeatedly reads the FP hardware, and the indicator is inside the loop. Right?
    The thing to do is move a lot of the logic in the subVI up to the Main VI--or add the Main's added logic to the subVI, whichever is easier. In the first case, the subVI would go away, in the second, the subVI would become the Main VI.
    If you're confused, post your code in V6.0 format and I'll show you what I mean.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Handling events of ActiveX controls in TestStand!rol

    Hi,
    I want to use the Microsoft WINSOCK control with existing ActiveX Automation Adapter of TestStand. These control generates an event in case of incomming data.
    Question:
    Is there any way to treat the events of such controls in TestStand (same problem with MSCOMM control) or can this only be realized by polling the size of incomming buffer?
    In case of answer two, i would be interested in any realized example.
    Regards,
    Sunny

    Hi Sunny,
    Currently, you cannot call ActiveX controls using the ActiveX Automation Adapter in TestStand. To do this, you would need to call a code module that was set to display/utilize the control, and retrieve all of the events generated by the control. TestStand can only currently call ActiveX servers (either DLL or EXE) that support the IDispatch interface. Hope this answers your question.
    Regards,
    Bob

  • Cluster of control references: want to access the control value

    I want to be able to save and set control values that are saved (XML). I have my controls on about 5 sub vi's. So I thought it'd be a good idea
    to put all the control references in a cluster from the several sub vi's and save and read from one point.
    I can get the cluster values (i.e. the references to the controls), but how to proceed from here? If somebody has a better idea it is very welcome.
    I have also read Ben's nugget here, but it deals with references to controls in a cluster, not references to a reference of a control in a cluster

    Thank you for reading that Nugget!
    I use a GUI Controller in many apps so I can grab refs in sub-VI's.
    Here are some screen shots of them in use.
    The first "GUI Cnt" is a wrapper around the AE and invokes the action "Set Analysis mode" then another call let me get a cluster of the refs so I can choose based on the name.
    This image shows what that action does.
    THis is what happens when going into collection mode.
    That is a small set of what you will find in my image gallery Feel free to browse (yes I know there is a lot of Olivia in there ) and ask if anything catches your interest.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Help!: Control reference seamingly "lost" in run-time execution mode

    Hi!
    The Facts:
    LabView 6.1 PC under NT.
    I've been using "Vi loader" technique since a few month s to distribute a LabView application on severals PCs without having to re-compile it each time. My application uses more than 500 VIs so I can't build it directly. The directories/Vis of the application are simply copied on the target PC and run through the Vi loader technique instead of using the development environnement.
    The problem:
    Since the last release of the my application, differences between the application running in development mode or run-time mode have appeared:
    One VI reading a .ini file does not act the same way if runned in the developpment environnment or
    runned in the run-time environnment. This VI uses control-references from its front-panel and passes them to sub vis. In run-time execution those references seems to be perverted: the sub-vis get them but can't access their properties like Label Name, Values,...
    All works perfectly fine if the VI is runned in the environnment developpment.
    Moreover the same sub-vis called with other control references in other VIs work fine.
    Question:
    Has anyone seen any behavioral difference between run-time execution and development environnement execution?
    Are there any differences in the linkage process between those 2 execution ways?
    Is there any labview Feature that would automaticaly "de-allocate" references at run time and would do so "too early"?
    Is there any know problem with poly-morphique VIS in run-time execution mode.
    That's all, any idea, lead, wellcome!

    Hi Andrew!
    I've allready had a look at the "Problem with VI Loader technique". It only deals with top vis not working (ie broken) when called from loader in Run-Time mode because of ill declared vi.lib path.
    It's "unfortunately" not my problem: My VI is not broken, it's kind'a working, but not as it does in development environment execution mode.
    If NI people are reading this, I would like to send them the VI and it sub-VIs to understand if something has been perverted .
    The problem is seen on all three target PCs.
    Moreover, a new one has appeared: in run-time mode, the standard "file dialog" vi called to prompt the user for a file with a given extension pattern sends back the file name with the extension "double dotted" (exemple: anything..data
    instead of anything.data).
    About the first problem, does any know why a Ctrl Refnum would loose its parent information (name, value...) in run-time execution mode?
    Bye!

  • Performance issues using control references in Analog control loop?

    My main vi of a tensile tester control application calls a number of sub-vi's, including a analog control loop which controls the test. The control loop must update some boolean and digital indicators and respond to user input on the front panel of the main vi during a test.
    To simplify my main vi, I moved the control loop code into a sub-vi, and used control references to access the controls and indicators on the front panel. However, this has dramatically affected my loop performance, and the loop can no longer keep up with the acquisition speed.
    Do control references always cause such a slowdown? Is there anything that I can do besides moving the code back into the main vi?
    Thank You,
    David Creech

    I have had the same problem. I have discovered other funny things about references also; some kind of memory management (or mismamagement?) is taking place behind the scenes.
    Regardless, you can often do away with the references by passing the initial state of a control or indicator into the subvi, changing it inside, and passing the altered state back to the caller. Once back in the caller you update the front panel control or indicator by using a local variable.
    One thing to watch out for if using this scenario is the dreaded race condition; this can be avoided using a state machine. Check out
    http://www.advmeas.com/goodies/statemachine.html
    for a good example. It is a shame that references behave in this way; it limits thier usefulness.
    Perhaps someo
    ne else will point out a way to utilize them more sucessfully?

  • Difference control refnum and control reference

    Hi guys.
    I am new on labview reference, can you explain difference between control refnum and control reference. 
    Gary Wang

    Are you sure you don't mean "refnum control"? That is a front panel control that can be selected as a reference to any one of several data types such as application, VI (including strictly typed), control or indicator. Whereas the "control reference" is a block diagram object that points to a specific control on your front panel (it can also be "linked" to other objects so it is similar to a "refnum control" in that respect).
    “A child of five could understand this. Send someone to fetch a child of five.”
    ― Groucho Marx

  • Non Tempo-event found in sync reference

    Hello everyone. I ran into a problem yesterday. I was working on a project and out of nowhere (I don't remember anything I was doing out of the ordinary) the tempo changed to 5bpm. I changed it back and kept working and when I was done I saved a new instance of the project which I normally do after substantial editing, but when I try to open the new file I get this error "Minor correction of project data has taken place. (1)" . After pressing Ok I get "Warning! Project may be damaged". Then Garageband freezes and I have to relaunch. The original file (the one I was working on when the tempo changed) gives me the error "Non Tempo-event found in sync reference", but proceeds to enter the project fine. The only problem is the tempo is still set to 5bmp and any changes made to this project appear to save fine, but when I try to open them I get the double error that I explained.
    I've tried copying the contents of ProjectData to another blank file and tried renaming and saving in different locations but nothing worked.
    My concerns are that I still want to do work on this project and be able to save it. At this point all I'd be able to do is work on it and finalize with a mixed down audio file. The other concern I have is that I don't want this to happen again to another song.
    Anyone encounter this problem? Can't find information anywhere.
    Thanks in advance.
    Tony

    TJraije wrote:
    I still want to do work on this project and be able to save it.
    you may be able to rescue most of the data:
    http://www.bulletsandbones.com/GB/Tutorials.html#allaboutrescuingfiles
    Anyone encounter this problem?
    in 6+ years i have never seen, nor heard of anyone seeing this error which could suggest a random/non-recurring bit of data corruption

  • How to generate event on other control within one event

    Hello
    I am using event structure.
    When program is inside the event case of one control, I want to trigger the �mouse down� event on another control at that time (without operating that another control),
    so that next time, another control�s event is called.
    I have many controls and hence thrir event cases , after which I want to trigger a specific event case corresponding to a button control.
    (I wish to keep the contents of button2 case inside the event only)
    In attached example:
    When user clicks �button 1� or �button 3�, event must be generated so that contents of �button 2� event are executed when program comes there next time
    Thanks
    Attachments:
    Trigger_Other_Event.vi ‏35 KB

    Sorry, I just noticed that you only use LabVIEW 6.1 where signaling properties are missing.
    Here is a simple solution for LabVIEW 6.1:
    - set all buttons to latch.
    - set all button events to "value changed"
    - merge the timeout event with event 2
    In event cases 1 and 3 set timeout to zero, in all other cases to -1 (no timeout).
    See attached example. I placed a 500ms wait.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    Trigger_Other_EventMOD.vi ‏31 KB

  • Main VI stops when using control references.

    Hi, This is my first question on this forum. I've created an engine simulation VI which uses control references. The main VI has a data acquistion loop and control references. The control references link to another VI that runs an equation loop which continuously calculates engine speed base on data collected in the main VI. The control references work but the main VI data is collected and updated only once when the main VI starts. If I remove the control references from the main VI the daq loop runs fine. Thanks in advance for your help.
    Mike

    Joe,
    Thanks for the response. I do not load the subvi dynamically. I have attached a similar vi to show what I'm trying to accomplish. The DAQ vi reads the input and calculates the power. The power is sent to the "engine momentum sub" vi where the speed, as a function of time, is generated and sent back to the DAQ vi. I created the sub vi to clean up and isolate the DAQ vi from the subvi. I wanted the sub vi to run at a certain speed (by adjusting the wait time)and not affect the DAQ vi. If you input a value of 10 into the DAQ vi and then start it you will see the speed ramp up to 100. While the DAQ vi is running, I need to be able to change the input which would cause the power to change and in turn change the speed. I thought the control r
    eferences were the way to go. In my real DAQ vi, I have many more inputs, all which do not update after the first reading. I considered putting the DAQ functions in another subvi and reading the outputs through control references but that seemed too cumbersome.
    Thanks again,
    Mike
    Attachments:
    DAQ.vi ‏27 KB
    Engine_Momentum_Sub.vi ‏33 KB

Maybe you are looking for

  • Report fonts mapping and PDF output problem(Easten European languages)

    Hi experts, I have such a problem. If i run oracle reports(10g) via reports builder all layouts looks fine. When i run them in PDF format via application server - report text and numbers strech out off frames, also textfields and text itself becomes

  • Field selection PT0 not not defined

    Hi All    I am creating purchase order i will checking the following error  coming      "    Field selection PT0 not not defined" Thanks and regards Deepa

  • Mapping from smallint to boolean

    How should I map -1 to boolean? 0 ==> false 1==> true -1 ==> ? Thanks, Alex

  • Overview of Oracle Grid Control components

    Hello, We want to look at Oracle Grid Control feature. Can anyone make clear to us what components need to be installed where and how do the components communicate with eachother. I am talking about Enterprise Manager, agents, databases etc. Preferab

  • RuntimeException while calling DriverManager.getConnection()

    While trying to open my H2 database recently, I've run into an exception that hasn't been happening in the past. The only thing I can think of that has changed is that I moved the database from a networked PC to my development PC, but I know that the