Reusing code within the same VI (when a sub-VI won't do)

My last question here got awarded a kudos point "for being a great question", which is pretty embarrassing, because at my present skill level it's hard to envisage the time when I'll ever be anything other than a "taker" from this forum !  So here goes with a "dumb" question to try to put the record straight.
My front panel has 17 groups of one button + three numeric indicators, that's quite a lot of front panel items and 8 of the groups have an enum indicator as well.  All of these items are also contolled by property nodes for visibility and/or "disabled".
My program gathers all the data for these items into a Functional Global Variable array, and at end of the main loop it refreshes the properties and the values of all of these front panel items.  It could look unruly, but because of the similarity between the 17 groups the refresh of the front panel items all happens within a neat FOR loop (albeit with a 17-way CASE structure inside it) so at least these controls aren't sprawled out all over my block diagram.
The only problem I have is that my program takes quite a few seconds to initialise and get the loop running, during which period the front panel shows garbage (well, maybe not garbage, maybe data related to the last time the program ran, which may have been a different context, so much better if not visible).
But if I also ran the same "front panel refresh code" right after initialising (wiping) the data in my Functional Global, the result would be that all of these controls would be invisible or disabled, which is a much better place to start from.
But do I have to put a completely separate copy of the loop onto my block diagram to get this effect ?
Making a sub-VI is out of the question, because it's this VI's front panel I am working on.
The word that describes (to me) what I want to do is "subroutine", but in LabVIEW "subroutine" seems to have a very specific meaning, a "stripped for speed" VI that won't touch any front panel anyway.
Is this just a problem of my mindset ?  It's true that in my life by far the most code I wrote was assembler for 8-bit embedded micros, those applications were always strapped for memory.  At this stage of my career the balance won't be tipped however much high-level code I write (yes, I'm a dinosaur).  So I tend to fret about how big my compiled code will be.  Should I just put another copy of the loop (actually it's only the 76 "visible" property nodes I need) onto my block diagram and stop worrying about it ?
Solved!
Go to Solution.

A number of comments.
1) The title of Dinosaur is still up fro grabs with many of us in the running ( I as well used to play the game of "ICan write that charceter in X lines...")
2) When you are doing a lot with the GUI, "Defer FP Updates (its a property of the FP to shut down screen updates, serach for that) may spped things up.
3) I use a GUI controller very often in my apps. I posted about it here.
4) If you chase down my tags I have a collection related to GUI performance.
I'd put the code in a VI called from my GUI controler (that called your FG to get the info).
Regarding memory
When we used to depend on someone with a crochete hook and beads to make our memory, it was justified. Today, memory is cheap and using to save yourself time is just fine. When you worry about memory is when you find the code does not fit into 2 G anymore.
Ben
Ben Rayner
I am currently active on.. MainStream Preppers
Rayner's Ridge is under construction

Similar Messages

  • Having problem buying online.need your help since it's my first time here.apple is asking for my billing address but when i enter my address here in qatar,it's saying i should enter a valid zip code within the u.s.does it mean i can't buy online

    having problem buying online.need your help since it's my first time here.apple is asking for my billing address but when i enter my address here in qatar,it's saying i should enter a valid zip code within the u.s.does it mean i can't buy online even if it wil be shipped within u.s. only?

    To buy in for delivery in Qatar, you should be starting from the Apple Qatar site:
    http://www.apple.com/qa/
    Do you have an Apple-ID? if you do, then you should not have to enter your Address again, and may be able to sidestep the US Zip Code issue.

  • When using Adobe Photoshop CS5, print settings default within the same session.

    Windows 7 Pro 64 bit.  As mentioned after adjusting some settings and printing, the settings reset the next time we go to print the same file within the same session. (never closing the file)

    Hi Chris,
    I will definitely give that a try. I had a tech set up my computer after i purchased it less than a week ago but it is a possibility that he missed it. I will try and run an update this weekend and see if that increases the speed when OpenGL is enabled. I will get back to you on the issue in the next few days.
    Thanks for your insight and helpful suggestion.
    Much appreciated.
    -Darren

  • TS1589 my airport stopped working when i changed its location within the same network (wired)

    Please help....I replaced my airport express with an apple tv and moved the airport to a different location within the same wired network and the light continues to flash amber. I know the ethernet connection is good and I have tried restarting the modem/router/airport with no change in status and when I look in the airport utility software, it reports that it cant see it. When I move back to its original location, the light goes green.  What happened and how can i correct this issue? Thanks very much for any assistance.

    the weird thing is that all Ive done is move its pysical location....my house has ethernet ports in every room all running through a common upstream router which in turn is connected to a dsl modem. At this point Ive hard reset the AX back to factory settings....now the AX utility sees the AX but shows me that it has a total of 3 problems. 1) Internet connection...2) no DNS servers...3) default settings. When I highlight "default settings" the info reads "this AX base station has default settings. You should configure it to connect to the internet, secure the wireless network, and provide a password. I assume that if I correct this, the other 2 troubles should take care of themselves.  At the bottom of the page there are buttons that say...help, revert, update and a drop down menu that says default settings, recovered settings, create profile, edit profiles. not sure where to go from here. thaks for taking the time to help me.

  • How to make use of adjacent data elements within the same buffer

    Hi,
             Does anyone know how to make use of adjacent data elements within the same buffer? To make my question clearly, I would like to give you an example. In my application, I set "sample to read" as 10 which means at each loop 10 data samples will be taken into a buffer. Now, what I would like to do is to do some calculations on adjacent data samples in same buffer. I tried to use "shift register" for this, but it seemed to me that it only can deal with the calculation between data from adjacent loops. In other words, it skips 9 data elements and take the 10th one for the calculation.
             Here I also attach my VI showing what I did.
        Thank you very much in advance,
                            Suksun
    Attachments:
    wheel_encoder_1.vi ‏98 KB

    Hi Suksun,
          I hope you'll forgive me for distilling your code - mainly to understand it better.  I tried to duplicate your logic exactly - which required reversing the "derivatives"-array before concatination with the current samples array.  As in your code, the last velocity is being paired with the first position.  If first velocity is really supposed to be paired with first position, just remove the "Reverse 1D Array" node.
    cheers
    Message Edited by Dynamik on 01-07-2006 03:17 AM
    Message Edited by Dynamik on 01-07-2006 03:19 AM
    When they give imbeciles handicap-parking, I won't have so far to walk!
    Attachments:
    encoder2.GIF ‏14 KB
    encoder2.vi ‏102 KB

  • SO idoc from PO idoc within the same client

    Hello SAP Gurus,
    We need help with the following .
    The requirement is we need to create the Sales order from Purchase order using idocs within the same client .
    We created the partner profile of the customer and the vendor .
    Customer ---maintained an inbound parameters with message type ORDERS and process code ORDE
    Vendor -
    maintained outbound parameters with message type ORDERS and idoc type ORDERS05 and process code ME10 .
    Now when we create the PO and check the status in WE02 we get the error status 56 , EDI: Partner profile inbound not available.
    What could be the posible cause of the error .
    Anybody with some suggestions and solutions .
    Thanks
    Honey

    Hi ,
    You should maintain in the inbound parameters  and out bound parameters also
    out bound parametrs
    message typ[e---ORDERS
    receiver port----
    basic type -
    ORDERS05
    tick on transfer idoc immediately
    Inbound parameters
    message type ---ORDERS
    process code --ORDE
    if you have any further clarifications let me know
    Regards
    Damu

  • Using || and && within the same Powerpivot Calculate syntax

    hi. i'm trying to isolate two groups of users. the 1st is a group who has suffered one of 3 "negative" experiences, without regarding whether or not they also had "positive" ones - i.e., they are the users from the entire population,
    who encountered one of 3 negative statuses in their user lifetimes. 
    the 2nd is based on this group, but users who have ONLY encountered these bad experiences, and never any good experience. for some reason, when i use && to "trim down" the positive statuses from the user group, i end up with the same size
    groups, i.e. the following two codes yield the same powerpivot measure result: 
    =CALCULATE(DISTINCTCOUNT(CDRs[USERID]), 
    CDRs[disposition] = "negative exp 1" || 
    CDRs[disposition] = "negative exp 2"|| 
    CDRs[disposition] = "negative exp 3")
    =CALCULATE(DISTINCTCOUNT(CDRs[USERID]), 
    CDRs[disposition] = "negative exp 1" || 
    CDRs[disposition] = "negative exp 2"|| 
    CDRs[disposition] = "negative exp 3"&&
    CDRs[disposition] <> "positive exp 1"&&
    CDRs[disposition] <> "positive exp 2"&&
    CDRs[disposition] <> "positive exp 3")
    i would love some help on this...
    thx!

    Hi Guy,
    A first stab could be...
    Users with Negative Feedback Only:=
    CALCULATE(
    DISTINCTCOUNT(CDRs[USERID]),
    CDRs[disposition] = "negative exp 1"
    || CDRs[disposition] = "negative exp 2"
    || CDRs[disposition] = "negative exp 3",
    FILTER(
    VALUES(CDRs[USERID]),
    CALCULATE(
    COUNTROWS(VALUES(CDRs[USERID])),
    CDRs[disposition] = "positive exp 1"
    || CDRs[disposition] = "positive exp 2"
    || CDRs[disposition] = "positive exp 3"
    ) = 0
    This solution can almost definitely be re-written more optimally to avoid using a FILTER but should do what you're asking. Let me know if it works as expected and performs acceptably over your data set. The FILTER and inner CALCULATE are just filtering
    out users that have at least one row with positive feedback. I've assumed that this is for a Calculated Field and the syntax is for defining one within the Calculation Area beneath the table in the Power Pivot window.
    Regards,
    Michael Amadi
    Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to vote it as helpful :)
    Website: http://www.nimblelearn.com
    Blog: http://www.nimblelearn.com/blog
    Twitter: @nimblelearn

  • Illegal cross join within the same dimension

    Hi,
    When certain fields are selected within the presentation table an "illegal cross join" error is returned by the BI Server. However if a FACT is added from one of the other presentation tables the "illegal cross join" error goes away. we need to query without fact column.
    We are getting following error
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 14065] Illegal cross join within the same dimension caused by incorrect subject area setup: [ CALL_CENTER.COUNSELOR_MANAGER T782130] with [ CALL_CENTER.COUNSELOR_HR T781594 On CALL_CENTER.COUNSELOR_HR.MASTER_STAFF_COUNSELOR_ID = CALL_CENTER.MASTER_STAFF_COUNSELOR.MASTER_STAFF_COUNSELOR_ID, CALL_CENTER.MASTER_STAFF_COUNSELOR T781739] (HY000)
    Can anybody help me solving this issue.
    Thanks,
    KS.

    Please give us an example of what you need.
    OBIEE perform a query in the dimension or through the fact table.
    You can't join two dimensions in the repository without going through a fact table.
    If you need to query without fact column, it's because you have design two dimensions where
    normally you can do one.
    You have then two solutions :
    * change the design of your logical model to make only one dimension.
    * use the OBIEE logical SQL in answer.
    http://gerardnico.com/wiki/dat/obiee/bi_server/design/obiee_logical_sql
    Success
    Nico

  • How can I open the WD iView within the same pop-up window?

    I have created a Web Dynpro(for ABAP) iView direct link that a hyperlink action.
    (From different Web page)
    And I used window.open(appointment to target) of javascript for opening only one window.
    However When I click the link it opens in a new window every time.
    (Also iview of different type is same)
    How can I open the WD iView within the same pop-up window?
    Could anybody help me by giving suggestion and codding?
    Regards
    Jin

    Hi JinKyu,
    Have you tried <b>window.location()</b> in place of window.open() something like
    <b>window.location = 'URL'</b>
    Rgds,
    Vivek

  • Simple button action that goes to a page within the same doc

    I can't figure this out. I have a button I want to use that takes a person back to the first, or second page of the same doc. It's a catalog section with a table of contents. I need to make links for the pdf that takes people to certain pages within the same document.
    In the Buttons panel, I see how to make the button, but when I assign an action, the only choice that makes sense is "Go To Destination", but I don't get or see any way to choose "page 2" of the document, or another selection method.
    I did this before a few years ago on hundreds of pages, and when I open those old documents up to copy/paste the same buttons, they don't even appear to have actions on them anymore, as if it never happened.
    So, what's the secret? Certainly there's a way to link to another page in the same ID file, no?

    Finally figured it out. I do NOT use the button panel at all. No buttons needed. Just select the grouped object that I want for my button, and hit the "add hyperlink" button in the Hyperlink panel. Then choose "Page" from the menu that opens up and be on my way. What was throwing me for a bad loop, was that I had copied and pasted the button graphic form another document. Well, since the link made previously was broken now, I had the red flag in the Hyperlinks panel...and thus, the "new hyperlink" button was greyed out, sending me in circles. The minute I deleted the old hyperlink it carried over from the old document, the new hyperlink button worked again and all was well.
    Thanks.

  • Can iTunes purchases be loaded to multiple iPods within the same household

    Is it legal to download purchased music from iTunes Music Store to more than one iPod within the same household?
    I understand the implications with teenagers sharing music in this manner; however, it seems crazy that I need purchase duplicate music to download to both mine and my wife's iPod.
    I tested this with a few of the songs I purchased over the weekend and the iTunes software will allow the files to be imported into iTunes but not the iPod. It gives a message that states my wife's iPod is not autorized to download these files.
    Please advise if it is legal to do this and if so how I can go about importing purchased files to my wife's iPod?

    It says the files are not authorized for use on that her iPod. I made the purchases from my work laptop and updated my iPod from iTunes on my computer.
    I added original CD tracts to the iTunes software on my work laptop and copied these and my purchased files to a second version of iTunes that is running on my home computer that my wife uses to manage her iPod.
    I imported the folders to her computer by going to "File" and "Add Folder to Library". It brought the purchased files in to her library and auto-created a folder that it identified as imported Limeware files for the folders of the CD files.
    When I updated her ipod it loaded all the files except for the 6 purchased files that I had brought in. That is when I got the message saying that her iPod was not authorized to receive the 6 purchased files.
    In addition to not being able to load my purchased files to my wife's iPod, I am afraid that I will be charged for the imported CD files that iTunes automatically and erroneously identified as "Limeware" files.
    Any advice? Thanks for the feedback and taking the time.

  • HT1420 I purchased new computers twice within the same year because they old were damaged in a storm.  However, I can't deauthorize/reauthorize the new computers.  How do I deal with this situation.

    I purchased new computers twice within the same year because they were damaged in a storm.  However, I can't deauthorize/reauthorize the new computers because it has been less than a year.  How do I deal with this situation?

    BrianBlaze wrote:
    I have 3 Computers at home, I am studying computer sciences and am constantly rerformatting my computers, installing windows and linux over and over again.... EVERYTIME I reformat I have to authorize the same computer and so it takes up one of my 5 authorized computers... Anyways after deauthorizing all my computers in september I was not aware I couldn't do it for another year (why does APPLE assume these stupid tactics prevent piracy). Anywysw I need to reach apple and have them make it so I can do it again. I had a similar problem with Playstation and when I called them they fixed it for me... even windows (which you can only have one serial per computer) made it easy because all I had to do was call them and they fixed it for me. Now I need APPLE to do the same and this is the only place I could see to actually say what is going on... I can't believe I have to do this with my iPhone... I wanted an mp3 player and a phone together and if I can't put new songs until September 20, 2012 I am going to freak out!
    HELP!
    Brian
    Try this link: http://www.howtogeek.com/howto/23974/beginner-deauthorize-all-computers-associat ed-with-your-itunes-account/

  • How to merge pages within the same document?

    Can I merge pages within the same pdf document? I have two large maps, an east and west, can I put the two pages together to make one map?

    How different are the layouts?
    You can vary the left and right pages:
    +Inspector > Layout > Section > Configuration > Left and right pages are different+
    But the position of the headers, footers and margins will be the same.
    You could make different designs and capture those but each would have to be its own section. This sort of thing works better in Layout mode, where every page is a different section, but you won't get automatic text flow nor TOC, footnotes etc.
    Pages rapidly gets very clumsy when you try to do detail layout to this extent.
    Peter

  • How can I start a new paragraph within the same table cell?

    In Numbers, when adding text within a table frame, how can I start a new line within the same frame (rather than advancing to the next cell)?  I'd like to enter a mini-list of several items of various lengths of data.

    While Wayne's answer solves your problem, another possibility is to uncheck the box at the bottom of the Table inspector for "Return key moves to next cell." If that is unchecked, the return key types a paragraph return within the cell (the same as Option Return with the box checked).
    With that box unchecked, Shift Return types a soft return (new line without a paragraph break).

  • Monitoring servers in SCOM 2012 via different locals within the same management group

    Hi,
    I have 2 management servers in a same management group. The 1st one is having English (US) locale while other is installed on Swedish locale. Both are accessed by different users having same admin rights.
    Once a USER 1 try to register a server through authoring tab from 1st management server(installed on English locale), a profile/group wrt the server registered is created successfully but the USER on 2nd management server (installed on Swedish locale) can
    not see the same in Authoring tab. He can view it in Monitoring tab as as well as Administration tab.
    The Vice versa is also true.
    Does any one have idea that is it SCOM 2012's expected behaviour wrt 2 2 different users on 2 different locales within a same management group ?
    Thanks in advance.

    Hi,
    I am a little confused, what do you mean by "register a server through authoring tab"?
    Do you mean that when you discover a server on 1st MS with discovery wizard then you cannot see it on 2nd MS(and the vice versa)?
    As far as I know, all those information should be stored in the operation database which is shared to both MSs within the same management group.
    We may use SQL query to find the discovered server on the operation database. Please also check operation manager event logs to get more information to troubleshoot this issue.
    Regards,
    Yan Li
    Regards, Yan Li

Maybe you are looking for

  • Officejet Pro 8600 not able to be set as default printer

    I've just installed the Officejet Pro 8600 on my wireless network.  It was added correctly using WPS andindicated no problems found on the wireless network test results that the printer did. All items were listed as 'PASS'. It is showing up in the de

  • I am unable to install iTunes due to Windows Installer error message on Vista

    I needed to update my iTunes since I purchased the iPad2.  My Windows Vista machine will not allow me to update the program due to a "Windows Installer" error message.  I first attempted to update, then I uninstalled and am unable to reinstall the so

  • T42p vista fn + f3 and fn + f4 functions (turn off screen and sleep) not working correctly

    Hi -- I recently installed windows vista on my T42p.  It works fine except that the fn+f3 and fn+f4 functions do not work as expected.  Before installing the hotkeys driver, the fn+f4 function worked correctly while f3 did not (going to sleep worked,

  • 0fiar_o03 to 0fiar_c03 very very slow

    Hi guys, 3 months ago i initialized the 0fiar_c03 infocube the whole processs took 5 hours for 2.051.350 records.... 1 hour in load from r/3 and 4 hours from 0fiar_o03 to 0fiar_c03... but now due a cancelled job in r/3 it took 4 hours from r/3 and 22

  • User exit for pricing in Sales Order

    Hi Gurus, I have a requirement while changing Sales Order and an Inquiry.Below is the requirement. I have a custom filed at the Sales Order Item level as VBAP-XXXXX. When the user changes this value to a value (say abc) then the NET value in the Cond