How can I reduce the number of event cases in the main VI?

I would like to reduce the number of event case of the event structure in my main VI. E.g. I would like to have pop up window with a table when the user double click a table row. Nothing more simple than this: add a case to the event structure trigger by double clicking the table, read the table row ... But in my main VI I would have lots of them and the event structure gets crowded with minor tasks. One solution is using XControls. But is there any other recomended way to handle selected events separatly from the event structure in the main VI?
to clarify: I don't want to distribute the whole event structure. (In this case the code would not be maintainable) But I would like to handle certain context specific events in a differnt place. If I have them all in the main VI the drop down list of the events in the event structure exceeds the windows size and the program becomes difficult to maintain because one looses the overview.

"Strictly forbidden" is not true. But highly not recommended. The reason is simple:
1. Code can react unpredictable. Dennis already stated some things about that in your linked thread. 
2. Code is not readable and therefore not maintainable. Each event source should have only one event structure for its events. Since the UI is a single source, events from there should be captured in a single event structure. It is recommended to use this event structure as producer in a producer/consumer design pattern in order not to block the events.
3. You will most propably need timeouts in your event structure which completly negates the advantage of event driven programming. Either use event driven programming or stay at polling. Do not mix (most of all because of maintenance).
Regarding your "advantages" you listed:
- Clustering  reduces readability in therefore should never be done. Additionally, it requires timeout cases in most places which is not recommended.
- If you have such many events and interactions in your "sequence", it is a clear indication that you chose the wrong architecture for your application.
Please see attached example. Since i am not used to program with more than one event structure (except if i have different dedicated event sources), the example is "constructed" and therefore may lack of "realism". Nevertheless, it shows some issues which might occur:
- Blocking calls within the events lead to the fact that the UI is not responsive for the event time (FuncA). Nevertheless, interaction is still enqueued and if the blocking call is over, all those interaction are executed. In the example, please press FuncA and then press FuncC immediatly. You will see that nothing happens and after the 5s blocking call, the FuncC dialog appears. You also can switch tabs, but the visual display will update only after the 5s blocking call.
- In order to keep the UI responsive, FuncB is configured not to block the UI. But this is no solution: Press FuncB (on page 2) and the change to page 1 and press FuncA. Additionally, press FuncC. What happens? Just to mess things up, press Stop as well......do this combination several times. It is possible that only the lower loop is finished and the VI is still running even if Stop has been pressed.
Please note everyone that the attached example shoudl strictly be seen as "NEVER DO IT LIKE THIS". This is a negative example and shows the approach which is not recommended by any means!
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Attachments:
Never EVER86.vi ‏10 KB

Similar Messages

  • How can i read every"number" value and not only the 1st?

    in the vi only the first "number" value(from the data acquisition)is read in the small loop.how can i make every value to be read?every value must be compared with the "numeric" constant,and,if greater the led must turn on.afterwards,when a value which is less than the "numeric" is found the led must turn off.please answer or send mail to [email protected]
    Attachments:
    oximet5.vi ‏152 KB

    The more I look at your program, the less I understand it.
    Why are you setting number = number in a case if SO2 = ""? number always equals number.
    In your sequence frames 1 and 4, you have no control over which write (date or time) happens first. Just placing one function to the left of another doesn't make it happen first if your wiring doesn't create data dependency. Review the section on Data Dependency in chapter 5 of the LabView User's Manual.
    It looks you're writing to and reading from the same file using Write File and Read Lines from File.vi. Why read back data you just wrote? You have the data on your diagram. If you want to convert it from string to numeric, use a Sring/Number Conversion function from the String palette.
    On Read Lines from File.vi (which I'm not sure you even need), you should use a shift register for the start of read offset rather than a local variable for mark after read (chars.). With a shift register, you can initialize it to 0 when the VI starts. Using a local, if you restart the VI, it will try to startup from where you left off the last time, but you just opened the file for create or replace.
    In your sequence frames 2 and 3, why do you wait for the number to be less than the numeric before writing a carriage return to the file? Also, LabView has a End of Line constant which adapts to the expected value for the operating system. That's generally more flexible than a Carriage Return.
    It looks to me like you're overusing control refnums. You don't need to use a control refnum and a property node to set or read a control's value if you can wire directly to the control's terminal.
    I really don't understand what you're doing with pause and variants. I may be missing the point, but it looks like you made this much more complicated than it needs to be. Why not keep it a boolean?
    For your pause-path, you open the file but never close it. You can lose data that way. You also open it using open function 3, create new file. You'll get an error if the file already exists.
    On a general note, your diagram would be easier to read if you were more selective in how you routed your wires: you have wires on top of wires, wires running under sub-VIs, wires running in the frame of a while loop, wires running under labels.
    I think there's a temptation to overuse sequences. I don't think you need one here. As I mentioned in my earlier message, case structures and shift registers will be more useful to you.

  • TS1702 how can I remove large number of photos on my iPhone 4s from iTunes using a PC - Lenovo Think Pad - so that I can reduce the space used on the phone by 50%?

    how can I remove large number of photos on my iPhone 4s from iTunes using a PC - Lenovo Think Pad - so that I can reduce the space used on the phone by 50%?

    You don't need iTunes for that. Simply connect the iPhone to the PC where it will be recognized as a camera. You can then select the photos you wish to transfer, transfer them, and delete them.

  • How can i reduce the number of calls archived in recents

    How can i reduce the number of calls archived in recents

    You can't change that.  It's a function of the OS and cannot be altered.

  • How can I insert a number of photos in a numbers doc without the file becoming too large?

    How can I insert a number of photos into a numbers doc without the file becoming too large?

    Use smaller photos.
    Seriously, reduce the file size of the photos in Preview, PhotoShop, iPhoto or other application before inserting tehem into the Numbers document.
    Regards,
    Barry

  • How can I reduce the size of stardard css and js of BSP?

    Hi all,
    I have problem with the js and css standard of sap.
    When I enter the first each in the portal, this css are loaded (after cache):
         - sapUrMapi_ie6.js with 333331 bytes
         - ur_ie6.css with 174256 bytes
         - popup_ie6.js with 22690 bytes
         - events.js 22886 bytes
    Total: more of less 1MB of datas.
    How can I reduce the size of these files?
    Can i not use this files and see the tabscripts or others object htmlb?
    thanks

    Hi Benito,
    these files contain all "stuff" that the BSP Extensions need to work. If you decide to code your own HTML content you don't need them.
    The other thing to consider is that these files should really be cached b your browser so this overhead only happens once.
    Cheers
    Graham

  • How can I reduce number of rows in Planning webform in Smartview?

    Hi,
    I downloaded a Planning webform into Smartview. I want to reduce the 1000 rows down to 20 for a particular user as he does not submit data for the other 980 rows. How can I reduce number of rows in Planning webform in Smartview?
    Someone said that I can insert vlookup code into Smartiveiw pointing to a new worksheet that has only 20 rows. I could not test it as our Planning 9.3.1 has a bug that would not take sub variables from Smartview.
    Thanks.

    Hi,
    My first reaction is why do you have a form with a 1000 rows, surely this is a design issue and doesn't benefit anybody when entering data, anyway why not have security on the dimensions then users will only see what they have access to when they retrieve the form in smart view or through the planning web front end.
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How can I reduce the brightness of my screen?

    I installed WIndows 7 on my MAC and after installing the boot camp drivers, the screen went really bright.
    I reduced the brightness to the lowest setting on my keyboard, but it is still bright.
    The problem is not so much on the graphics, its more on the brightness of the white background & black text.
    How can I reduce the brightness?

    ang188 wrote:
    I reduced the brightness to the lowest setting on my keyboard, but it is still bright.
    The problem is not so much on the graphics, its more on the brightness of the white background & black text.
    How can I reduce the brightness?
    Start menu > control panel > appearance & personalization > display > calibrate color
    I would adjust the keyboard setting back to midway before calibrating, this way you have some flexibility to use that again.

  • I have a large number of photos imported into iPhoto with the dates wrong.  How can I adjust multiple photos (with varying dates) to the same, correct, date?

    I have a large number of photos imported into iPhoto with the dates wrong.  How can I adjust multiple photos (with varying dates) to the same, correct, date?

    If I understand you correctly, when you enter a date in the Adjust Date and Time window, the picture does not update with the date you enter.  If that is the case then something is wrong with iPhoto or your perhaps your library.
    How large a date change are you putting in?  iPhoto currently has an issue with date changes beyond about 60 years at a time.  If the difference between the current date on the image and the date you are entering is beyond that range that may explain why this is not working.
    If that is not the case:
    Remove the following to the trash and restart the computer and try again:
    Home > Library > Caches > com.apple.iphoto
    Home > Library > Preferences > com.apple.iPhoto (There may be more than one. Remove them all.)
    ---NOTE: to get to the "home > library" hold down option on the keyboard and click on "Go" > "Library" while in the Finder.
    Let me know the results.

  • How can someone put their number under someone else's name in an iphone without touching the phone

    Ok, so last week on saturday my wife called and asked me why I facetimed her.  Well I never facetimed her and didn't have an accidental call to her at all.  I didn't think anything of it.  Well later that day she called me again very upset saying there someone facetiming me from your number and it was someone elses picture on the other end.  So we called sprint and they reser our  network setting and said call apple support.  Called apple support they said change all passwords and sign up for that duel security option.  Well no one asked us to have her look in her phone and see if there's another number in her phone under my contact info.  So I asked her to look and what do you know there's another number under my contact in my wife's phone.  Now theres no way she accidentally added in a number to my contact.   We know the face and name of the Asian Indian man who called us because sprint told us his name and we've seen his face because he facetimed and my wife saw his face.  We don't known him at all.  The weird part is that the number hes calling from is the same area code that we live in.  So that makes it extra creepy.  We figured he hacked in some how and was sitting somewhere in Asia....  I hope this all makes some since to someone who can tell us how my wife's iPhone 5s contact list was changed by a man who is phone stalking her???

    It can't be tracked by serial number, if can only potentially be tracked via Find My iPad - if that has been disabled, as you say in your post, then you won't be able to try and locate it.
    You've reported it to the police ? If your iTunes account info has been changed then you should contact Support in your country so that you can try and get it back : Apple ID: Contacting Apple for help with Apple ID account security
    You should also change your email account passwords, and any passwords that you'd stored on websites/emails/notes etc.

  • How can I reduce the file size when PDF Optimizer does not do much?

    I have a PDF form that exists of 48 pages. 44 pages are forms / have form fields, the other 4 are just informative. Each form-page has approx. 80 fields (checkboxes, text fields).
    When I started setting up the PDF form the file size was 12 MB and I had placed fields on 21 pages. Then with 34 pages the file size was 19 MB. And with 40 pages it was 35 MB big! Finally with 44 pages the file size is 34 MB.
    So I searched with Google and found some tips. Using the "PDF Optimizer" option inside Acrobat for example. So I did, and the file was reduced only with 3 MB... 31 MB was the file. Also used the option "Save as.... Optimized".... no difference. I also found a suggestion about removing embedded fonts. Using the "Audit Space Usage" option I noticed the fonts taking many MegaBytes:
    * Content Streams: 5.287.000     15,09 %
    * Fonts:                24.556.810     70,08 %  !!
    * Acrobat forms:      3.349.164    12,05 %
    In the older PDF version (I saved and kept this one too) with just 21 pages with form-fields, the  "Audit Space Usage" shows:
    * Content Streams: 5.292.000     40,14 %
    * Fonts:                 1.290.224     9,79 %
    * Acrobat forms:      1.588.758    12,05 %
    So I could save many many MegaBytes by -UnEmbedding- fonts. But if I do this (unembed ALL fonts), the file size stays almost the same!?!?!? Why? What can I do to reduce the file size? I would like it to be 8 MB if possible (32 MB -  24 MB = 8 MB)?
    Thank you for your help!

    If you have authored the form, reduce the number of different fonts for the content and form fields.
    Any font used in a form field will cause that font to be embedded into the PDF.
    If you are going to Optimize the PDF be very careful with forms. Optimization does a lot of removal of items and rearranging of items which can really mess up forms.

  • How do I reduce the number of audio channels in the source or export settings?

    I'. trying to export my finished edit through the "movie" setting but keep getting the message that the number of audio channels to create in the exported file must be equal to, or less than the number of channels in the source. Reduce the number of audio channels in the source. Reduce the number of audio channels in the export settings. I am at a loss as to what this means and how I proceed with it prior to putting it to DVD. Please advise.
    JWooley

    What is your source, sequence settings and export setting. Which version of PP?
    Prefebly a screendump of the export settings box.
    (e.g. trying to export a mono track to 5.1)

  • I have an imac 27 inch O SX 10.6.8. using iphoto 11 Version 9.1.5. I have scanned some photos at very high resolution with each photo being about 45MB. They're saved to desktop. How can I reduce the size of the scanned photo's they are crashing iphoto

    I have an imac 27 inch O SX 10.6.8. using iphoto 11 Version 9.1.5. I have scanned some photos at very high resolution with each photo being about 45MB. They're saved to desktop. How can I reduce the size of the scanned photo's they are crashing iphoto.

    What format are they? Tiif? Jpeg? You can compress them with a lot of apps - including Preivew and just about any graphics editor out there. I'm not sure that 45mb would crash iPhoto thogh, are yo sure that's the cause? I know that some folks have mentioned pixel dimensions causing issues, as can color profiles.
    Regards
    TD

  • Why is my word and pdf files so large? How can I reduce the size?

    My document contains mostly photos from a database via a path to the actual jpeg photos on disk.
    There are 39 jpeg photos + a small amount of text with each photo.
    The 39 jpeg photos on the disk add up to be 5.79 mb.
    If I export the crystal reports document as [Microsoft Word (97-2003) Non Editable] the, the file size is 36.8 mb.
    If I export the same data as a [Microsoft Word (97-2003) Editable] the file size is only 3.1 mb.
    That is a difference of 33.7 mb! Why?
    Also, when I export the same data to a PDF file it is much larger than I think it should be; 12.7 mb.
    Why is my word and PDF files so large?
    How can I reduce the size of the word and PDF files? (without reducing the photo quality).
    Are there any tools to post process the Word or PDF files to reduce the file size?

    You can't, extra size is to hold the details

  • How can I copy a number of like fields and paste to reduce form creation time?

    How can I copy a number of like fields and paste to reduce form creation time?

    Creating Form Fields by Ted Padova

Maybe you are looking for

  • Creating a Template DW CS3

    I have created my first template in dreaweaver (CS3).  The editable region works except for one small problem... I cannot change the style.  It will not allow changing any content from H2 tag & Style 2.  My original template for this editable region

  • GUI Problem in Screen Painter

    Hi All, we are using SAP logon 640. In screen painter we are not getting GUI. we are getting the screen in Alphanumeric mode, But not in Graphical mode. How to resolve this problem. Thanks in Advance. Regards, chandra. Message was edited by: K Chandr

  • Help please itunes update error

    now when i try to install on my iphone the latest iphone software i get an error (9) what i have to do ?

  • No option to scan 35mm rolls with 10.10.2 and a HPScanjet g4050

    before the necessary use of Image Capture to get access to my scanner options, i used the "original" HP software without problems, The scanner performed all the necessary work in a sequence, working in "backstage"  while other tasks were made. After

  • I got a wrong tracefile path

    Hi, In initPostgreSQL.ora file,I set ODBCINI=/etc/odbc.ini. In odbc.ini file,I set the tracefile path on /tmp/odbc.log. When I got some error in sqlplus,I will got some log in the trace file. but it always wrote log on /tmp/sql.log. I don't have set