High priority code

Hi,
 I am writing a code in LabView-10, where there is a camera involved. I need it to go to a particular temperature before I should close it. If my program works fine, I have a part at the end of the code that does this job.
My problem is, if the program crashes for some reason (for parts that does not involve camera), or even if someone hit the stop execution button, the program stops abruptly and that part of the code is not being executed. 
Is there a way to make something like a "High Priority" part of a code, that will always be executed no matter how the program stops.
Or any other idea that can solve this problem.
Thanks.

You need to actually code in proper error handling as well as handle how the application exits. If the code is crashing it is a sign of bugs in the code and the code should be robust enough to detact and handle errors. Without seeing your code it is impossible to give you any advice on how to improve it but from your description you basically have buggy code. You need to fix the bugs.
As for catching exit events you should detect them explicitly. NEVER allow the user to use the abort button to stop your program. It is an imediate abort and doesn't allow you to clean up. Its the equilivant of stopping your car by rnning into a wall. It will stop the car but it certainly isn't advised. You should use an explicit stop/exit button on your front panel. You can use the event structure to detect that the user has signaled a stop and then perform your normal cleanup. The event structure can also detect when the user stops the code using the X (Windows close) and again perform the necessary cleanup.
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

Similar Messages

  • Is it possible in IOS to have two static routes for the same subnet, one a higher priority and "failover" between the 2?

    Hi All
    Is it possible in IOS to have for a particular subnet:
    a) Two static routes?
    b) Make one static route a higher priority than the other?
    c) If one static router "goes down", failover to the lower priority static route?
    We have a l2tp/vpdn connection to a supplier which can be accessed via two vlans/routes. I would like to make one route the preferred one but the "route" to failover if the preferred route goes down.
    Again, many thanks in advance for all responses!
    Thanks
    John

    Hi John,
    Hope the below explaination will help you...
    R1(config)# ip route 0.0.0.0 0.0.0.0 2.2.2.2
    R1(config)# ip route 0.0.0.0 0.0.0.0 3.3.3.3 10
    If you notice the Administrative Distance for the secondary route pointing to ISP2 is increased to 10 so that it becomes the backup link.
    The above configuration with just two floating static routes partially accomplishes our requirement as it will work only in the scenario where the routers interfaces connected to the WAN link are in up/down or down/down status. But in a lot of situations we see that even though the links remain up but we are not able to reach the gateway, this usually happens when the issue is at the ISP side.
    In such scenarios, IP SLAs becomes an engineer's best friend. With around six additional IOS commands we can have a more reliable automatic failover environment.
    Using IP SLA the Cisco IOS gets the ability to use Internet Control Message Protocol (ICMP) pings to identify when a WAN link goes down at the remote end and hence allows the initiation of a backup connection from an alternative port. The Reliable Static Routing Backup using Object Tracking feature can ensure reliable backup in the case of several catastrophic events, such as Internet circuit failure or peer device failure.
    IP SLA is configured to ping a target, such as a publicly routable IP address or a target inside the corporate network or your next-hop IP on the ISP's router. The pings are routed from the primary interface only. Following a sample configuration of IP SLA to generate icmp ping targeted at the ISP1s next-hop IP.
    R1(config)# ip sla 1
    R1(config)# icmp-echo 2.2.2.2 source-interface FastEthernet0/0
    R1(config)# timeout 1000
    R1(config)# threshold 2
    R1(config)# frequency 3
    R1(config)# ip sla schedule 1 life forever start-time now
    The above configuration defines and starts an IP SLA probe.
    The ICMP Echo probe sends an ICMP Echo packet to next-hop IP 2.2.2.2 every 3 seconds, as defined by the “frequency” parameter.
    Timeout sets the amount of time (in milliseconds) for which the Cisco IOS IP SLAs operation waits for a response from its request packet.
    Threshold sets the rising threshold that generates a reaction event and stores history information for the Cisco IOS IP SLAs operation.
    After defining the IP SLA operation our next step is to define an object that tracks the SLA probe. This can be accomplished by using the IOS Track Object as shown below:
    R1(config)# track 1 ip sla 1 reachability
    The above command will track the state of the IP SLA operation. If there are no ping responses from the next-hop IP the track will go down and it will come up when the ip sla operation starts receiving ping response.
    To verify the track status use the use the “show track” command as shown below:
    R1# show track
    Track 1
    IP SLA 1 reachability
    Reachability is Down
    1 change, last change 00:03:19
    Latest operation return code: Unknown
    The above output shows that the track status is down. Every IP SLAs operation maintains an operation return-code value. This return code is interpreted by the tracking process. The return code may return OK, OverThreshold, and several other return codes.
    Different operations may have different return-code values, so only values common to all operation types are used. The below table shows the track states as per the IP SLA return code.
    Tracking
    Return Code
    Track State
    Reachability
    OK or over threshold
    (all other return codes)
    Up
    Down
    The Last step in the IP SLA Reliable Static Route configuration is to add the “track” statement to the default routes pointing to the ISP routers as shown below:
    R1(config)# ip route 0.0.0.0 0.0.0.0 2.2.2.2 track 1
    R1(config)# ip route 0.0.0.0 0.0.0.0 3.3.3.3 10
    The track number keyword and argument combination specifies that the static route will be installed only if the state of the configured track object is up. Hence if the track status is down the secondary route will be used to forward all the traffic.
    Please rate the helpfull posts.
    Regards,
    Naidu.

  • How RequestDespatcher.include() method gets higher priority  ?

    Hi,
    I have three jsp pages named as A.jsp ,B.jsp and C.jsp respectively. In A.jsp , i include B.jsp using include directive and i include C.jsp using RequestDispatcher.include().
    But in output of A.jsp , The output of C.jsp comes as first and then output of B.jsp comes as second , eventhough i included B.jsp before C.jsp.
    I don't know why RequestDispatcher.include() gets higher priority than include directive of JSP.
    Just clear me.
    thanks in advance,
    nvseenu

    It has to do with when each cache is flushed.
    Each of these JSP pages will build up its output text into a buffer. When that buffer is full, or you flush it manually, the text gets written to the underlying output stream.
    The jsp:include uses the same buffer as its parent page. The output writer of the current page gets passed to it so that it can just append to the end.
    When you short-circuit things by using the RequestDispatcher manually, you only pass along the request/response. The page invoked then obtains the output stream, and wraps its own buffer around it.
    When a page is complete, it flushes its buffer to the output stream.
    So the order is:
    Page B completes and flushes its buffer. That result gets sent to A's buffer.
    Page C completes and flushes its buffer. That result gets sent straight to the underlying response output stream.
    Then page A finishes, flushes its buffer. All of its buffer (including what it got from B) now gets written to the outputstream.
    Solutions:
    You can manually flush the writer before you invoke the RequestDispatcher: ie out.flush(). If you try to forward/redirect after this though, it will raise an error.
    If you really want to get complicated, create a ResponseWrapper, and when you invoke the RequestDispatcher, pass it a response object with an outputstream/writer that gets added to the current buffer (ie what it does with a jsp:include)
    Or you can just use jsp:include.
    here is some code to play with.
    Try changing the flush attribute on the jsp:include to "true" and see what happens.
    Uncomment the out.flush() command to get it to print in the "correct" order.
    // includeOrder.jsp
    <html>
    <body>
    Ok, this is the main page of this little test.
    At this point we are going to <jsp:include> the second page:<br>
    <jsp:include page="includeOrder2.jsp" flush="false"/>
    <hr>
    And now we use requestDispatcher.include() to include the third page<br>
    <%-- out.flush();  --%>
    <% request.getRequestDispatcher("includeOrder3.jsp").include(request, response); %>
    <hr>
    And now we are done.
    </body>
    </html>
    // includeOrder2.jsp
    Here we are on page 2!
    // includeOrder3.jsp
    Beware of page 3!Cheers,
    evnafets

  • Create at runtime a job to run at the central instance with high priority

    Hi All
    Using the function modules  (  job_open, job_submit and job_close )  or ( job_open, submit via job  jobname number jobcount, job_close) I need that this job runs in the central instance and with high priority.
    I would like to know how to  inform  it using the statements above?  How to pass the parameters to make the job run in the central instance with high priority?
    I would appreciate any help.
    Thanks in advance.
    João Gaia

    Hi
    I hadn't realized about the parameter TARGETSERVER of  the function module JOBCLOSE. I am going to make some tests.
    thanks in advance

  • Why is time-critical thread not interrupting sleepless high priority thread?

    Hello,
    I have two threads running in the same execution system on a real-time PXI platform. The time-critical thread sleeps using "AI Single Scan.VI", and acquires my data at a rate of 8000 Hz.
    I have a slower high priority process that calls a DLL function to calculate some filter coefficients. This function call takes longer than 1/8000 s to complete, and runs in a loop, executing as often as it can (with new data from FIFOs).
    I expected the time-critical thread to interrupt the the high priority thread without problem.
    I am finding that unless I insert a LabVIEW delay (for example a wait for x ms VI) in the loop, the real-time system stops responding. With a small delay (ie 1 ms), t
    he acquisition completes, and a FIFO shuts down the loop of the slow process.
    Why do I need a labVIEW delay in the high-priority loop, when the DLL function call itself is quite slow? Even without a DLL call, I would expect the time-critical VI to interrupt, finish its data acquisition, and shut-down the high-priority thread using its FIFO.
    Any suggestions?
    Thanks in advance,
    Frenk

    Here are a couple things to try/check:
    1) Check the call library node in your high priority VI. If it's orange (runs in UI thread), your high priority VI is actually switching to the UI thread every time your dll runs. That alone is not a problem. But if your TC VI tries to update any control terminals, the TC thread will switch over to the UI thread to access UI resources, possibly while the dll within your high priority VI has a lock on those resources. Why does the dll have a lock on UI resources? Because it was running in the UI thread and got interrupted by the TC thread before it finished doing its business. Not likely, but possible.
    2) There's another possible reason you're seeing this behavior. If the TC VI and the high VI call a mutual subVI, the subVI will be elevated to ALWAYS run in the highest priority thread irrespective of the actual caller (in your case, it's the the TC thread). Even when the *high priority VI* calls the mutual subVI, that subVI runs in the time-critical thread, which means there's a thread switch from high to TC, then back to high after the subVI finishes. And because high and TC VIs are in the same exec system, that mutual subVI will always run in the 1 and only TC thread alotted to that exec system.
    So, while your TC VI is running, you're in the TC thread. While, your high VI is running, you're in a high non-TC thread, and when your high VI calls the mutual subVI, you're again in the TC thread until the subVI finishes.
    So how could this arrangement cause your TC VI to become starved by the high VI? If your TC VI wakes up while the high VI is in the middle of running the mutual subVI, the TC thread responsible for running the TC VI is actually busy (in the middle of running the subVI in your high VI!!!), so the TC thread cannot run your TC VI until it finishes running that mutual subVI.
    The fix: make your TC VI run in a different exec system. It will be given its own TC thread that no one else can mess with. When TC VI wakes up, it's guaranteed a TC thread.
    I think there's a good reason behind why a mutual subVI ALWAYs runs at the highest priority of all its callers, irrespective of the actual caller's priority...but I can't think of the reason at the moment.

  • EIM Auto pushback - requeue at higher priority?

    Hello,
    In our EIM 4.3.2(8) implementation (ICM Enterprise integrated queues and agents), all new and incomplete activites auto-pushback to queue after 8 hours (overnight generally). The problem with this is, they're getting pushed to the back of the queue. I'd like to have all auto-pushback emails queue at a higher priority so that during days of high email volume, we don't get stragglers that keep getting pushed to the end of the queue while newer emails get handled.
    I saw this:
    http://docwiki.cisco.com/wiki/Transferred_Emails_Get_Sent_To_End_of_Queue
    and thought maybe I could pull some Activity related column through to ICM to act on to change the priority... Not sure what I should use though. I considered looking at the "WHEN_CREATED" field and upping the priority in ICM if that's more than a day ago, but I wonder if there is a simpler way to do this.
    Any help you can provide would be greatly appreciated.

    New tasks are sent from EIM to ICM in order queue priority, activity priority and oldest - in that order. While sending new task there is no differentiation between new email first time in queue Vs email which is auto pushed back to queue, if queue and activity priority are same then oldest activity criteria will be honored.
    There is no other way in default EIM product to push auto pushed back emails ahead of others.

  • Listing Items based on criteria e.g. High Priority Items First.

    Hi,
    One of our customers have a need to List High Priority Items first on the WebTools site.
    Let's take two ItemCodes for example: Printer001, and, Monitor001.
    >> If these two items are included in the same category then Monitor001 will appear before Printer001 as WebTools sorts in alphabetic ascending order;
    >> But, our customer wants Printer001 to appear before Monitor001 as it is an Item higher in priority that Printer001.
    I can think of two possible solutions:
    1/2) Prefix Items with a number or letter to have it appear first in the WebTools default sort order. E.g. Rename "Monitor001" as "AMonitor001". This will not be possible for existing Items in SAP, so it doen't solve the issue,
    Or,
    2/2) Customize the Default WebTools Item List block to sort Items based on a User Define field called "pririty". Which might require a lot of effort.
    Please advise if anyone else has solved similar issue and how.
    Thanks very much for your replies in advance.

    Hey Kafil ... I think you may be stuck modifying the parts list page or creating something from scratch. I'm not aware of an easy way to do this out of the box.

  • High priority bug to be solved very  urgent

    Hello Experts,
    I need your help and plz close this topic once its solved.
    Here is the problem:
    There is  report called "Material Group".When its is displayed for  material gorup say "GB06010000" is displayed as part of report data wheras the source system (oracle ) does not have this item any more in the catalog. This indicated that data is not refreshed for quite a long time.
    This report is connected to the third party application (oracle db) not EBP system(r/3). Time to time there has been deletion  or addition  catalog items and in all as of today there are 815 items, whereas BIW report displays 4204 items. How can i refresh this data to display 815 items.
    how to solve this issue any ideas or suggestion????
    the reports is on ODS level.
    I hope  all of u take this problem as urs and try to give me solution as earliest possible.
    <b>this is high priority issue from client side</b>.
    thanks in advance . Surely il assign the points.
    email id: [email protected]
    Urs,
    Raki.

    Hey Lilly,
    Yep  i have deleted the contents of ODS sucessfully and i have reloaded it sucesfully but from biw side there is no problem as i feel.
    So i requested my onsite people to look in to the oracle db table how many records are available.Later then we will make take some decision .
    So still the problem isnot solved il be updating this in another couple of days.So i request u to take care this issue and now i have assigned u points also.
    Thanks for ur info.
    Possible give me ur personal mail id so that i can direclty drop to ur mail.
    Urs,
    Raki

  • Updating offercode(priority code) in campaign element

    Hello,
    My requirement is to create Campagins and Campaign Elements from flat file through BAPIS.
    I have used BAPI  MKT_ELEMENT_CREATE to create that.
    But in the attributes(IM_ATTRIBUTES) we dont  have the offercode or the priority code field to  be updated to campaign element.
    Can anyone please suggest how to update the offercode to campaign element.......
    Thanks
    kranthi

    We can add fields , Hide fields add onther Tab by using SPRO configuration.
    CRM - Marketing - Marketing Planner and Campaign Management - Additional Fields and Business Add-Ins (BAdIs) for Marketing -Define Additional Fields: Set Types
    the fields are in a new separate tab will be added into a addition tab.
    Regards,
    Siva

  • Can I make "High Priority" default - or is there a script?

    Hi,
    When sending an email, is there a way to choose to mark the message as "High Priority" without having to go up the the "Message" menu to do so? If there isn't a keyboard shortcut, is there a script out there anywhere that can do that?
    Patrick

    not important to me any more

  • The technical name of 5GHz has high priority in dual band AP

    Hi,
    As I know, when open dual radio on some Cisco's AP, and configure one dual wireless client associate with the AP, the AP will use 5GHz for wireless client to associate first.
    Does somebody know this technical or function name?
    I'm looking for the AP which has this kind of function.
    Thanks.
    Walter

    Hi Eric Moyers,
    Thanks for your reply.
    Sorry about describe not clearly.
    For example:
    1. Enable 2.4G and 5G on an AP, and configure both SSID on these 2 band with the same SSID "ciscosb" and security "WPA2-AES".
    2. Configure a dual band wireless card to associate with an SSID "ciscosb". (specify the SSID in the profile)
    3. AP will be associated via 5G band. 
    So 5G can has high priority to be used. Is this new design? or base on chip?
    I have used WAP561 to perform the steps, but WAP561 was associated via 5G or 2.4G randomly.

  • TO priority fields to high priority for  special kind of materials.

    Hi,
    Can we automatically set the TO priority fields to high priority for Can we automatically set the TO priority fields to high priority for special kind of materials?
    thanks
    Raj Kiran

    Hi Prashant,
    Is there any way the TO priority can be set to high priority before at the time of TO creation. Becuase the operator has to go through each TO to see if it is a special material which need special attention.
    Can we automate this process a little bit by assigning a high priority to TO(automatically) for these kind of materials or is there any other alternative possible through "Special movement indicators"?

  • Workflow: Setting the high priority flag

    Hi,
    Does any one know how to set the priority for the email notification?
    (Eg: In microsoft outlook red exclamatory mark for high priority)
    I tried the option priority in notification and message but its not giving the desired output(i.e Flag).

    I know you can set the priority on the task.
    If you click on the User step and go under Routes and Priority, you can change the priority and you will see a different icon in Workspace.
    I'm not sure this will change the priority on the email though.
    Jasmin

  • Query:Pop up on login for incomplete high priority tasks in sap inbox

    Hi All,
    I am having requirement to display pop up for incomplete high priority in sap inbox on loging in sap.
    I wil be thankful if you can guide to fulfill this requirement.
    Thanks.

    Hi,
    To get the High priority work items you can use the table SWWWIHEAD.
    using this table you can get the Priority, Status, and agent of the work item. Using this you can build the logic to
    display the pop up with this details.
    Thanks,
    Viji.

  • High Priority Items Inventory Alert

    Hello All --
    Thoughts on this...
    I would like a report that indicates when we are either low or out of stock of inventory.  However, I don't want a general report that just tells us when ALL inventory is low or is out of stock.
    Rather, we would like the report to update us only when certain high priority products are low or out of stock. 
    What's the best way to go about doing this?
    Thanks!
    Mike

    Hi Gordon --
    In answer to your question, the query shows the following:
    Style #...Color...Total Qty...L Size Qty..L Size %
    This is very close to what we are looking for.  The gap is that it only shows the data for a single size -- Large.  It sounds like we would have to run separate Queries for each of the other sizes. 
    Ideally, the Query would indicate whenever 1 or more of the sizes fall below the minimum %  (or qty) set. Initially, I envisioned it looking something like this:
    Style #...Color...Total Qty...S Size Qty...S Size %...M Size Qty...M Size %..., etc. for rest of sizes.
    However, this may not be the best format and a lot of data to look through.  You suggested an alternative which I am certainly open to...just not sure what you mean by it. 
    The ultimate goal is to have a report that will help us identify when inventory falls below a critical level (either by % or amt -- % would be more accurate as sizes are not purchased equally) ) for high priority products. 
    Bishal -- thanks for the suggestion.  Have not set up the alert function - thought a query would better achieve what we are looking for as it is all combined in a single report.
    Gordon - can you send example of Query you are suggesting?
    Thanks!
    Mike

Maybe you are looking for

  • Can anyone make my program short? tnx

    i'm new in java programming and have limited knowledge in OOP.. please help me make my code short please please... tnx guys... i want to split my program in 2 or more files/classes.. and can you help me with my looping .. thank you so much... my prog

  • Apple TV video cuts out after an hour

    I have been having a problem where my screen goes black after an hour, but I can still hear the sound. I switched the "Sleep After" to never, but each time I watch for an hour, the screen still goes black. It doesn't matter if I'm watching Netflix or

  • Audio lags in iOS

    Hi, I've been making an animation with click-triggered sounds (to get around autoplay), but once I view it in iOS, the audio lags by a couple of seconds. It seems to be loading, because when I click it a second time, the audio is timed fine. But I ha

  • Live trace, gradients and compounding paths

    I have a complex shape, and I want to have a copy behind of it that is filled.. the shape itself is a combination of stokes and fills, so a straight-out fill doesn't look good at all.. I can get it all colored the same way using live paint groups to

  • IPhoto to wireless storage to iPhone?

    Hello all, I'm looking for a way to transfer photos from my iPhoto library to my iPhone individually as needed. Ideally, I would like to upload a bunch of my iPhoto images to a wireless storage space and then access that storage on my phone and downl