I using an event structure for an input box and also for hardware input

Hi there!
I have many input boxes and display boxes on my user interface and i have a case for it in the event structure. If the user changes the values of the input boxes, the particular event case writes this new value to the hardware. However, in the timeout section of the event structure, we read the inputs from the hardware and we set the value for its related display object.  Within the timeout section i set the value for the related user interface display component, by making use of the property node value.
Furthermore, for most of the display components, i have a event case for a value change associated with it. In that event case, i check for range errors and so forth.
My assumption was that when i read the value in from the hardware and set the property node value, the user interface component's value will change and it would then trigger the event of the value changed for that component. 
My assumption worked to the point of updating the component's value, however, it did not trigger the event  for the value changed for this component.
Please advise me on how to achieve what i wish to.
Thanks.
Regards,

Local variables are actually much more efficient than property nodes as far as execution speed goes. Take that same VI and delete the property node and instead write to a local variable inside the loop. You'll see the speed nearly identical to writing directly to the indicator. But note that variables also cause a copy of the data to be created. So if you're just using the "Value" property, you're much better off using a local variable. But don't use both at the same time. If you are reading/writing other properties when you update/read the value, you might as well use the value property.
Sometimes you can't get around using either variables or property nodes. Initializing controls to saved values from an ini file is one example. But in this case, they are only written to once as the application starts so the performance hit is negligible.
One thing you can do is store values in a shift register as they are read and pass this through your application so the last value read can be accessed from anywhere. You can even create a cluster that runs through the shift register to hold several values in a single register. This can be expanded a bit farther to create what's called a Functional Global. This basically a subVI with a While loop that only runs once on each call. It has a shift register to store data and a Case structure to Read or Write data into the register. There's a pretty good example that ships with LabVIEW showing how these work. Open the Example finder and search for "Functional Global Communication". This example shows how to use them to pass data between two independent loops, but they work just as well in a single loop application.
One of the big advantages of these Functional Globals over the standard LabVIEW Globals and local variables is that you can add cases to manipulate the data in addition to just storing it. Also, since it's a subVI, access to the data is protected to one caller at a time whereas variables can have multiple reads and/or writes at the same time. This can cause race conditions.
Hope that helps a bit.
Ed
Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

Similar Messages

  • Can i use time capsule for external h drive and also for time machine?

    Can i use time capsule for external h drive and also for time machine?

    Hello, vascocaco.
    If I understand correctly, you're wondering if you can use your Time Capsule's internal hard disk both for Time Machine backups and as an ordinary drive. Is this your question?
    You can, but Time Machine backups may take longer.
    To do it, you should partition your Time Capsule's hard disk to create one volume for the backups and one for other files.

  • What are the main uses for a Macbook Pro, and also for a Macbook Air?

    I'm curious of whether I should buy a Macbook Pro, or Macbook Air. Before I make my decision I would like to know what are the main purpaces for each Macbook.

    Here's an article that compares the two.
    http://news.cnet.com/8301-13579_3-57458148-37/13-inch-macbook-air-vs-13-inch-mac book-pro-which-should-you-buy/?tag=postrtcol;posts

  • Which Event Classes i should use for finding good indexs and statistics for queries in SP.

    Dear all,
    I am trying to use pro filer to create a trace,so that it can be used as workload in
    "Database Engine Tuning Advisor" for optimization of one stored procedure.
    Please tel me about the Event classes which i  should use in trace.
    The stored proc contains three insert queries which insert data into a table variable,
    Finally a select query is used on same table variable with one union of the same table variable, to generate a sequence for records based on certain condition of few columns.
    There are three cases where i am using the above structure of the SP, so there are three SPS out of three , i will chose one based on their performance.
    1) There is only one table with three inserts which gets  into a table variable with a final sequence creation block.
    2) There are 15 tables with 45 inserts , which gets into a tabel variable with a final
    sequence creation block.
    3)
    There are 3 tables with 9 inserts , which gets into a table variable with a final
    sequence creation block.
    In all the above case number of record will be around 5 lacks.
    Purpose is optimization of queries in SP
    like which Event Classes i should use for finding good indexs and statistics for queries in SP.
    yours sincerely

    "Database Engine Tuning Advisor" for optimization of one stored procedure.
    Please tel me about the Event classes which i  should use in trace.
    You can use the "Tuning" template to capture the workload to a trace file that can be used by the DETA.  See
    http://technet.microsoft.com/en-us/library/ms190957(v=sql.105).aspx
    If you are capturing the workload of a production server, I suggest you not do that directly from Profiler as that can impact server performance.  Instead, start/stop the Profiler Tuning template against a test server and then script the trace
    definition (File-->Export-->Script Trace Definition).  You can then customize the script (e.g. file name) and run the script against the prod server to capture the workload to the specified file.  Stop and remove the trace after the workload
    is captured with sp_trace_setstatus:
    DECLARE @TraceID int = <trace id returned by the trace create script>
    EXEC sp_trace_setstatus @TraceID, 0; --stop trace
    EXEC sp_trace_setstatus @TraceID, 2; --remove trace definition
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • Can I use an event structure within another event structure

    Hi
    Can use an event structure within another event structure?
    Thanks
    Yasamin
    Solved!
    Go to Solution.

    I attached my Vi from my old project (MY OLD VI). It is worked correctly.
    But I decided that use event structure instead of case structure.
    I attached my new VI as a picture and as a LabVIEW VI too (network_analyzer_8510_920527 Frequency Sweep.vi )
    My graphs show by pressing "case 5: button (Bottom of page right hand).
    Then I want to show each of graph in a large window( in a new VI) by clicking a key (for example "show 1").
    Thanks
    Yasamin
    Attachments:
    my VI.JPG ‏256 KB
    network_analyzer_8510_920527 Frequency Sweep.vi ‏72 KB
    MY OLD VI.vi ‏69 KB

  • How to use a event structure in a subVI

    I am trying to use an event structure inside a subVI.  The subVI has an array builder that builds arrays, and the event structure is used so that when the program is running, it allows you to change the elements of the array.  It works, but when I implement it inside a subVI, it does not work properly.  This is going into a subVI, because it will be a part of a much larger progrram, so it needs to be modular.

    If you're using an event structure, it's not a subVI.  if you're worried about modularity, you shouldn't be using the event structure.
    You seem to have a fundamental misunderstanding of modularity.  An event structure should be placed within a while loop.  If you have a while loop within a subVI, you've handed over control of your program to the subVI.  You're not modular at this point.  Your top level GUI has no control.  You'd have to create some asinine system of variables to pass data down to that loop to stop the loop and return to your main VI.  That's not a good design decision.
    Instead of looking for a way to do something broken, you should spend effort trying to understand what you actually want to accomplish.  You should also spend some time learning how event structures work.
    This application is small right now and it's already on the path to unreadable.  That's a terrible thing to do to yourself.  Break these habits now.  se variables only when absolutely necessary.  Use subVIs to accomplish individual tasks, not run the entire application.  With event structures, use a stop button value change event to not be held hostage by the timeout.  If your variable has "2" in it, you're doing something wrong.  There has to be something different between the setpoints, put that in the name.  If you want to make subVIs, create an icon.
    But first and foremost, invest time in understanding dataflow

  • Using multiple events structure inside state machine to control the Tab

    Hi y'all,
    Anne here.I have a Tab indicator in my front panel and I want to be able to control the flow of my program based on what controls I clicked inside the tab. I am using a state machine architecture and inside every state, I use an event structure to check for user interaction  to determine the next state and what tab page is going to be displayed next. This means that I am actually using multiple event structures in my application and I use them in just one while loop, but just that they are not running in parallel since I am only using "one event structure per state" which means that only one event structure is running at one time. My questions is, programming technique wise, am I doing it correctly? So far, I am not facing any problem (I am still in the early stage of the project) but I want to check with you all first on your opinion regarding this architecture. Will there be any issue on using multiple event structures in a vi? Since I will be using a tab, and the controls available in the tab will be the controls that will control my event structure for that state, by right, there should be no issue. Am I correct to assume this? Is there any limit on the use of event structures? I have attached here a simple sample of the architecture that I am talking about for your reference. I have attached a 2010 version and a 8.6 version. Let me know what you think or any opinions that you may have.
    Hoping to hear from you soon! Thanks so much in advance!
    Cheers!
    Anne
    Attachments:
    State Machine-Event Structure Sample_2010.vi ‏19 KB
    State Machine-Event Structure Sample_8.5.vi ‏25 KB

    Hi jak888,
    I decided to use tabs cause I don't want to have subvi pop ups every time i need to perform the process in the state and show an update in the front panel. This is actually going to be more of an ATE where you will have to choose first whether the one using is the operator or the engineer. If the operator is logged in, she will proceed to choose what test to run (this state will have its own event structure). This part, I don't want a pop up, so what happens is that from Login page, if the user logs in as operator, the tab will automatically switch to the Test Selection page. After selecting the test, it will proceed to Start Test state and the tab will show the Result Summary page. If the user logs in as engineer, then a totally different tab will be automatically shown next and so on. By doing this, I will be able to show an update on the front panel objects without having the subvis pop up. I will also just need to use the call reference functions to call my subvis, making my Main VI more generic. The tab Page header will be hidden so the operator will actually not see that there is a tab and that there are a lot of controls and indicators cause they are hidden in the tabs and that page will only be shown based on what they selected from the main tab. 
    I appreciate your thoughts! thanks so much!

  • Boolean switch until released using an event structure

    I am using a boolean control with the mechanical action set to switch until released, I want the button to go back to the original state.
    I am using it in an event structure set to trigger on a value change. The action of pushing the button is generating two events, one of the on state and one for when it returns to the off state.
    How do I control this so that only one event is triggered and the second event that is queued up is ignored, I would like the button to go back to the original state and not execute code twice.
    Thanks
    Jim
    Solved!
    Go to Solution.

    You can use the value from OldVal or NewVal in the event case and a conditional structure to mask it off.  Do you really need switch until released functionality?  That's intended to give you two events, as the click and release are different actions.  Switch when released might be a better fit for you if you only want one event.
    --Using LV8.2, 8.6, 2009, 2012--

  • Acquiring continuous data using an event structure

    I am new to labview, having recently taken the Core I and II courses.
    I am programming a test rig to acquire the linear position of a hydraulic cylinder and plot it over time.  In programming this code, I elected to use an event structure so that when a front panel button is pressed, a certain part of the test is run. 
    In one particular part of the test, called the Snub Test, I need to measure the position of the cylinder over time and plot it to a graph.  The data acquisition needs to be continuous, however the event structure only allows the loop to run once. 
    I have attached a portion of my code for reference.
    Can someone please advise how I can get this data acquisition to run continuously until the user (or a reference trigger) stops the test?
    Thanks
    Attachments:
    Front Panel.vi ‏115 KB

    A few comments to your VI in general:
    You changed the stop button to "switch until released", most likely because you fabricated a race condition and did this as a quick fix. The reason is (1) your placement of the stop terminal outside the event structure and (2) the use of a local variable wired to the stop condition. The button terminal of a latch action boolean belong inside it's associated event case! This way it gets read (and reset to false) when the event occurs. In your case, the local variable and the button get read before the event occurs and the loop needs to spin once more at the event that occurs when you release it (true->false). At this point, the local is still true from the earlier event and the loop stops. Correct would be: latch action, stop terminal inside stop case and wired to the stop condition from inside the event. Other cases use the default output (false) and don't stop the loop.
    Your "equal false" code fragment is just an invert, right? So why complicate things?
    Why do you need a wait if there is an event structure?
    LabVIEW Champion . Do more with less code and in less time .

  • Using an event structure to reset a boolean control with ring menu value change

    I am trying to get two boolean buttons to reset when the value of a ring menu changes.  For this I am using an event structure set to execute with a ring value change.  However I have other code that needs to be executing while the event structure waits for the value change.  I place my event structure inside the while loop the buttons reset as expected but my other code does not run (except at the moment of value change). If I place it outside the loop the rest of the code functions as expected but the buttons do not reset.  Any help you can offer is much appreciated.
    Solved!
    Go to Solution.
    Attachments:
    event structure reset.vi ‏11 KB

    try this
    Attachments:
    event structure reset_edit.vi ‏14 KB

  • Using nested Event Structures

    Hi ,
    I wanna clarify whether using nested event structures in a vi is good Labview programming ?
    I have a vi which has two event structures nested,assuming it has two buttons GO1 and GO2.
    The outer event structure handles event triggered by GO1 and inner event structure handles Go2.
    The outer structure does fine by handling the button click on GO1,the problem is inability of inner
    event structure to handle click on GO2 button.
    I'm also attaching a sample.vi for reference.It would be great if you could help me
    solve this issue.Thanks in advance.
    Regards,
    Nalin
    Attachments:
    sample.vi ‏30 KB

    You can actually make this work, but like the others, I don't recommend it.
    To make your VI work. Right click on the "GO1" structure and select "Edit Events.....". At the bottom of the dialog, there is a checkbox that reads "Lock Front Panel until the event case for this event completes". With this checked, all front panel objects are locked until the GO1 event completes. This is what is causing the GO2 button not to work. Uncheck this and your application will work as you want it to.
    If your intent is to have GO2 disabled until you click GO1, try the attached VI. It uses property nodes to disable the GO2 button until you click the GO1.
    Another thing that you have setup that doesn't look necessary is the Timeout event, especially set to 1ms. The basic idea of the Event Structure is to not have to constantly poll for front panel events. If you just deleted the timeout event cases and removed the 1ms constant, your application would just well, but would just sit and wait for you to click a button.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
    Attachments:
    sample.vi ‏27 KB

  • Pop-up input box add in for Oracle E-Businesss suite form

    I would like to create a Pop-up input box add in for Oracle E-Businesss suite form that will take in a barcode value and write it to a database table. I want to make a form/routine that can be used by any existing form in the E-businees suite that I want.
    Any idea how to get started with this. I am a .NET developer, not an oracle foms developer. Any help is appreciated.

    There are very strict restrictions on what you can do with E-business forms. I'd think you'd be better off asking this question in the E-biz forum

  • Use external drive for both Time Machine and storage for Back to My Mac

    Hi all,
    I have been "a Mac" now for over a year and just keep finding cool new things that make me happy I switched. The latest thing is Back to My Mac offered with my Mobile Me account. With a rather convoluted mix of PC/Mac/iOS devices to manage - best $99 I ever spent btw...
    I also have a 1TB Time Capsule that I have been using with Time Machine to back up all four of my Mac computers at home. Needless to say, the 1TB is really struggling to handle the amount of data being backed up and certainly leaves no room for anything else.
    What I wanted to do was to attach a larger external hard drive via a powered hub to the USB port on the Time Capsule and use it for Time Machine backups while using the internal 1TB drive with Back to My Mac so that I can have remote access to all my data from anywhere without having to leave my computer running at home all the time in order for my laptop to "see" it when I'm away. And, yes, the amount of that data far exceeds what any level of Mobile Me subscription can offer! I should also mention that the hard drive is the only USB device connected through the hub to the Time Capsule at the moment. There are no other devices that might be "getting in the way".
    I'm thinking maybe all this is asking too much without the addition of a dedicated file server (Mac Mini, perhaps - not a purchase my budget wants to make).
    I understand that the Time Capsule doesn't support partitions, so I bought a Western Digital 2TB Elements drive, connected it to my Macbook Pro and used Disk Utility to reformat the drive from the incompatible NTFS it shipped in to a single, Mac OS Extended (Journaled) partition. I then made two folders on the drive, one for Time Machine backups and one for Back to My Mac remote storage/access. Great.
    However, when I connected the 2TB drive to my Time Capsule I could not see it at all. Time Capsule was reporting problems in the way of a disk error. From within my Airport Utility, I could see the trouble was the external drive. The utility suggested connecting the drive to a Mac and using it's Disk Utility to troubleshoot.
    I followed through, checking the disk, etc. and ended up reformatted the drive on my Macbook Pro yet again with the same specifications as before but without the folders and reconnected it to the Time Capsule. Same deal. But now, I can't even remotely connect to the Time Capsule at all. I can see the Time Capsule in the shared area of my Macbook's Finder but can not connect. The connection tries and fails even before it gets to asking me for username and password credentials.
    Long story short, first of all, I suppose I would like to know if I'm asking for the impossible?
    Second, if what I want to do *is* possible, what steps do I need to take to make it so?
    Thanks in advance for any advice or suggestions you might have.

    Well, I have now reformatted/partitioned my poor WD Elements 2TB drive about a dozen times as well as restarted my 1TB Time Capsule so many times it's no wonder it's as confused as I am! <G>
    Last night, at your suggestion, William, and in respect for your continued support, I tried creating two 1TB Mac OS Extended (Journaled) partitions on the WD external USB drive, both with GUID partition tables. Both volumes mounted to my laptop's desktop flawlessly and without issue.
    Once the external drive was connected to the Time Capsule, however, it was a crap shoot as to whether or not the drive was recognized at all, reporting a problem with the disk, or, even at one point, mounting one of the two volumes but not both. <sigh>
    I read somewhere on the Internet that you need to restart the Time Capsule for volumes on an external USB drive to be recognized.
    So I tried that. I connected the freshly partitioned/formatted disk to the Time Capsule and restarted it. This succeed in removing the issue of reporting a nameless drive with a capacity of 0MB. It then reported the drive with its correct name but would not recognize whatever volumes in whatever partitions that particular crack at it contained with the exception of the once, as I mentioned above, when only one of two volumes mounted correctly and was listed with the right name and capacity on the Time Capusule's Setup's Disk tab.
    At this point I have given up on my goal to use the external drive with Time Machine to back up my Macs or to hope I will ever be able to see its contents remotely via Back to My Mac. All I would like to do now is simply find a reason why I can't get it successfully connected and playing nice with my Time Capsule in the first place!
    Any further suggestions or advice as to what steps I might take next would be greatly appreciated.
    Thank you all.

  • Is it possible to use an external hard drive for time machine backup and also as a regular hard drive?

    Is it possible to use an external hard drive for time machine backup and also as a regular hard drive?

    I am using an external drive in the exact way that you described. You just keep it plugged in to the computer when you want to access the movies and files. In order to put files on it, just go to finder open up the drive under devices and drag and drop files onto the drive. It is just like using a usb drive with a terabyte of space.

  • I don't know what to order. I want PS for photo editing and some composting. I don't do any website work or sharing yet. I have been using elements for a few years and also have Lightroom 5 on my desktop. I don't want to spend $1000s for a bunch of stuff

    I don't know what to order. I want PS for photo editing and some composting. I don't do any website work or sharing yet. I have been using elements for a few years and also have Lightroom 5 on my desktop. I don't want to spend $1000s for a bunch of stuff I don't use. Any advice on what to buy?

    Well, there is a whole world of free or affordable software out there like GIMP, PDPaint and similar. Otherwise if you want to stick with Adobe stuff signing up for the CC photography program would be the most cost-efficient way...
    Mylenium

Maybe you are looking for

  • Could not be moved to the mailbox (null) alert - anyone know how to fix this?

    Greetings When I archive mails in one of my mail accounts, about 50% of the time, I'll get an alert that says - "The message XYZ could not be moved to the mailbox (null) - The destination mailbox does not exist." Anyone know how to fix this? Thanks,

  • Can't open 'Downloads' folder. Finder crash.

    Can't open my 'Downloads' folder. Every attempt to open it crashes Finder and restores a new finder window. However I have no problems with other folders. I appreciate any input or suggestions. Using a Late 2009 White Unibody Macbook with OS X Lion 1

  • How do I get my movies to play while loading like the QT  trailers do?

    I have tried several different things in iMovie and iWeb, and I can not find anything on it. When I put a movie on my site, the viewer sees a Q for Quicktime, until the movie is fully loaded. How can I make it so it plays while loading, the way the Q

  • Export from FCE is different then the timeline

    hi there, when I try to export from FCE the output file is different from the video in my timeline. It concerns a screengrab recorded with QT10. That QT file is converted to a Apple intermediate codec - as I normally do with QT files. I edit it & the

  • Full screen safari ability to bring apps into safari screen?

    im new to apple OS and the fact that i run safari on fullscreen mode and then when  want to say tab to limechat and it slide safari out of the picture. i want to be able to keep safari and stack whatever else i want to over top of it without going to