Enter and exit a case structure

I'm currently building a control.  I have a condition for three booleans to become true to enter a case structure as true.  One of the conditions is a temporary increase in temperature. I want to stay in the case structure after the temperature becomes false but both of the other booleans stay true. Is there a way to do this or should I be using some other technique?
Thanks,
Colt

I think this guy is running into the same misconception I and many of my classmates ran into about LabVIEW back in the day.  When your code enters the True Case, it will complete the True Case and immediately exit the True Case to complete whatever other tasks that may be outside of the Case Structure (assuming it didn't already do them). Then, the while loop (you must have a while loop) will move on to the next iteration, meaning it will do it all over again.
Now, if you know already know and understand how code works in general (about iterations) then do forgive me.  I've edited a lot of student code and have seen this very mistake.  A misunderstanding of the fact that code reiterates and will do it all over again if not told to do something else.  Typically the mistake is made with Event Structures.  I know it doesn't make much sense to not understand that...but trust me, it makes sense to those who don't understand.  ha

Similar Messages

  • Profiler API - Locks, Threading.Monitor.Enter and Exit

    I'm using the Profiler API in a project in order to track the locks made using Monitor.Enter, Monitor.Exit, and the lock keyword. I planned to do this by outputting using a pipe, the events from the FunctionEnter3WithInfo and FunctionLeave3WithInfo callbacks.
    These callbacks are called when methods are entered and exited, and appear to be functioning fine regarding their implementation - they generate a large output of methods that had been entered and left, but I'm not receiving callbacks for the following:
    ENTER: Monitor.Exit
    LEAVE: Monitor.Enter and Monitor.Exit
    Oddly enough, I do get receive a callback for entering Monitor.Enter. Other than these problematic methods, I appear to be getting calls from the Profiler API for everything else. 
    Is there a known issue regarding these methods not being reported by the API? 
    Alternatively, if there's a better way of achieving my goal than the way I'm doing it, feel free to point me in the right direction :)
    Thanks,
    Olu

    Thanks for the reply Brian,
    I don't get a JITInlining callback for Monitor.Exit (however I do for some Monitor.Enter calls). For FunctionTailcall3WithInfo, I also don't get a callback for Monitor.Exit (but I do for some Monitor.Enter calls).
    I'm not getting anything from ExceptionUnwindFunctionEnter, though when manually tested by throwing an exception within a try-catch, I get a callback.
    If it helps, I have the following flags set for events:
    COR_PRF_MONITOR_ALL
    COR_PRF_ENABLE_FUNCTION_ARGS
    COR_PRF_ENABLE_FUNCTION_RETVAL
    COR_PRF_ENABLE_FRAME_INFO
    Additionally, I've tried the following flags to see if it resolves the issue:
    COR_PRF_DISABLE_INLINING
    COR_PRF_DISABLE_OPTIMIZATIONS
    Edit 1: Using COR_PRF_DISABLE_OPTIMIZATIONS now means I get a callback to FunctionLeave3WithInfo when Monitor.Enter leaves, however there is still no sign of Monitor.Exit
    Edit 2: As a test, in the small application that I'm profiling, I've wrapped the Monitor.Exit and Monitor.Enter method calls in another class, so I can call them as so:
    CCMonitor.Enter(obj) and CCMonitor.Exit(obj).
    The profiler reports both the enter and leave of these functions correctly.
    Thanks,
    Olu

  • How do I delay 1 of many outputs exiting a case structure?

    I have a system here which is sort of a finite state machine, using digital I/O, I am monitoring a series of digital inputs which in turn form a binary number which is the input to a case structure. Depending on the binary string (number) that is read by the case structure, a particular series of boolean constants (T or F) exit through the case structure which are then used as my digital outputs (in my case they are controlling a series of relays). Basically, I have a condition where I would like one of the relays to be time delayed when switching in one direction, but not in the other. The problem is that when I do delay this bit, it also delays all of the bits coming from the case structure.
    i.e. all the relays are delayed. How can I delay just one of them?

    Well, I can't think of a really easy way. You could generate a delayed pulse on a counter output, instead of using a digital line. Otherwise you will need to keep track of the delay time in your loop somehow. The timing is only going to be as accurate (deterministic) as your loop rate, and will be operating system dependant. You may have some jitter. Attached is an example of a software delayed boolean indicator. Download both VIs.
    -Jim
    Attachments:
    delayed_relay.vi ‏30 KB
    boolean_trigger.vi ‏14 KB

  • Using addEventListener for Enter and Exit frame

    hi , sometimes i want to set some function in specific frame in start and exit this frame
    for example i have Flv player in frame 20 , i have background sound ( mp3 player ) so i want when swf goes to this frame my sound goes Off and when Exit from it and go to another frames the sound played again ...
    i put these script in frame 20 :
    addEventListener(Event.ENTER_FRAME,enterfunc);
    function enterfunc(e:Event):void {
        trace("I started");
    addEventListener(Event.EXIT_FRAME,exitfunc);
    function exitfunc(e:Event):void {
        trace("will Exit");
    but after test movie i see I started and will Exit runs Repeatly without stoping !!
    Notice : first i put my sndChannel = soundClip.play; and sndChannel = soundClip.stop;  but my music runs over and over and finally my system Hanged and need to Restart so i use trace to see
    so whats a problem ?  thanks for spending time and help me

    kglad wrote:
    // in frame 1:
    function f():void{
    trace("function f is executing when the playhead is in frame:", this.currentFrame);
    // in frame 2:
    f();
    This works well For Excute Function on entering Frame Once !! thanks ...
    but Only 1 More Question :
    as You told me in your No.2 Replay :
    I try to add some movieclip with instance name Or FLv playback with instance name and then Try to use this codes :
    mymc.addEventListener(Event.ADDED_TO_STAGE, addedF);
    function addedF(e:Event):void{
    trace("I Start");
    mymc.addEventListener(Event.REMOVED_FROM_STAGE, removedF);
    function removedF(e:Event):void{
    trace("I exit");
    why The removedF function Works well and the addedF function not work ?!?   in fact nothing Happend on Enter This Frame but on exit i see my I exit Trace !!

  • Loading a video/image on entering and exiting a marker

    Hi,
    i am doing a project with Adobe director. I was wondering if
    there is any piece of code I can use if I want to run a flash file,
    for example, when I go to a marker. So that I run a flash flash
    before the marker loads and similarly run another flash file when I
    click on some other marker and exit that specific marker.
    I want to run the flash file before the contents of the
    marker is displayed and similarly for exiting????
    ASAP....thanks in advance

    For the start of the new section, you could put the Flash
    sprite at the marker,
    have it play and then, when it finishes, move to another
    frame and show the new
    content. If the Flash sprite is integral to the content, then
    just have it play
    at the frame where the marker is located.
    When you want to leave a particular area, have the
    navigation button store the
    new marker's name in a variable and then play the closing
    Flash sprite. When
    the Flash finishes have it tell the play head to move to the
    marker that is
    stored in the variable.

  • Can Video widgets start and stop when entering and exiting the browser viewport?

    I like to use multiple autoplaying/looping video clips on a single page but I need to figure out how to make the videos start only when they enter the viewport on a browser and stop after they exit the viewport. Does anyone know a way to do this?

    I do not know if this can have an affect on it but the videos are being downloaded through multiple computers to a private server and being accessed through the mac. Please let me know what you think.

  • My iPhone is constantly entering and exiting the load-up screen

    Hello Apple Support, I'm having troubles with my iPhone 4s ( possible firmware damage ).
    Prior to the current problem I had a flat battery.
    I went back home to charge my phone which was stuck on the charger for the rough 4 hour minimum quota. After that the phone forced itself into recovery mode ( which seems apparently to have happened to many individuals prior to my error ).
    So I've connected it to iTunes and followed through the manual recovery troubleshoot ( as shown by this link https://discussions.apple.com/message/24076492#24076492 ), and it was apparently error 9.
    After solving error 9, my phone showed up with error 11 which according to my provided source ( http://theiphonewiki.com/wiki/ITunes_Errors ) says that there is possible firmware damage.
    After various attempts to revive my phone ( which I've now been doing for the past 2 hours ), my phone forced itself out of recovery mode, only this time...
    The load-up screen seems to be corrupted.
    Instead of the initial load-up screen > recovery mode screen ( connect to itunes picture with cable ), it now goes as the
    load-up screen ( 3 seconds ) > forced hard reset > back to load-up screen ( 3 seconds ) > forced hard reset again > rinse & repeat.
    I am now stuck because it seems possibly the firmware after my various attempts to save it ended up killing it... ( kinda like a cardiac surgeon gone nuts ).
    If possible I would like urgent help, thank you very much Apple.
    Possible req. info
    iPhone 4s Model A1387 8GB
    iOs before error : not sure but it should be well past iOS 7.0.2
    hardware condition : perfect condition ( no scratches / dents ), screen protectors both front and back.
    spare memory : 2.1GB
    time of purchase : Mid-January 2014 ( purchased off an optus [AU telecom company] dealer along with a plan )
    note : I am not a technology specialist ( should be the complete opposite actually ), just a simple highschooler who requires this for work and training related issues
    Thank You for your time.

    Update to whoever reads this.
    The back and forth load-up failure only occurs when I am connected to the computer.
    The phone enters the initial start up that every receives (The greetings along with language select and area), but unfortunately it tells me to connect to itunes which.... ends up with the initial problem we started with.
    I've managed to force my phone back into recovery mode with the demand for itunes whilst connected to the computer.
    I've tried to restore the phone through itunes but a problem occurs.
    Problem : once the extracting of software is complete, my phone resets itself which automatically disconnects itself from the phone causing the process to be restarted over and over again. I cannot get past the software extraction step because of this problem with the phone automatically resetting itself to cancel out this extraction.

  • When user enters and exits one movieclip, button changes color

    Hello,
    I currently have a slideshow-style navigation site.  There are five buttons on the bottom and when the user clicks each button, it triggers a nested movieclip to play.  I would like the button to be highlighted when the corresponding movieclip is playing, but when they click another button and another movieclip plays, I want the button to go back to its original color.
    The problem is that the movieclips that are playing are nested two levels down and the buttons have to be on the main timeline.  I think I might need an event listener to see if a certain nested movieclip is playing, to know to change the button color.  It seems to easy but I can't figure it out, thanks for any help!

    Hi again!  Sorry, I keep changing my mind on whether I've figured this out or not.  Now I need the buttons to become disabled when they are highlighted and active.  I tried putting a:  btns[i].enabled = false;  in the else part of the for-else statement and it didn't work.  Where would I put that kind of code?  Thanks!
    stop();
    //attach sounds
    Sound1 = new Sound();
    Sound1.attachSound("Sound1");
    Sound2 = new Sound();
    Sound2.attachSound("Sound2");
    Sound3 = new Sound();
    Sound3.attachSound("Sound3");
    //buttons
    //nav buttons
    b1.onRelease = function() {
        gotoAndStop(1);
        stopAllSounds()
        activeBtn(b1);
    b2.onRelease = function() {
        gotoAndStop(2);
        stopAllSounds();
        activeBtn(b2);
    b3.onRelease = function() {
        gotoAndStop(3);
        stopAllSounds();
        activeBtn(b3);
    //array for highlighted button state
    var btns:Array = [b1, b2, b3];
    function activeBtn(mc:MovieClip):Void{
       for(var i:Number=0; i<btns.length; i++){
          if(btns[i]!=mc){
             btns[i].gotoAndStop("inactive");
          }else{
             btns[i].gotoAndStop("active");

  • Iphone 6 on iOS 8 is freezing and lagging occasionally esp when entering and exiting the Facebook app?

    Am I the only one experience this?
    Also the spotlight search results sometimes don't return any web results.
    Wifi is extremely slow, forcing me to use my mobile data at home.
    Random reboots
    Most recently, my phone was accessing apps and clicking on things without my permission. I was had it on the passenger seat in the car and looked over and it was doing it's own thing?
    Touchscreen becomes unresponsive occasionally.

    Adding to the list of features not working(I don't know how or if I can edit my original post):
    - Apple Pay
    - Voice to Text (Dictation)
    I was trying to use Gmail on Wi-Fi, but kept getting an offline error until I switched to LTE. This could be a Gmail glitch so I am not going to consider it as a Wi-Fi problem until I'm certain since Gmail worked fine on Wi-Fi during all this in the past.
    So far, I have tried to restore my device from a backup and reset my network settings but neither have fixed the problems listed.
    I have also opted to send Diagnostic & Usage data to Apple in hopes this bug will be fixed in a later update.
    I also remembered when I first had to instal iOS 8.3. My Wi-Fi and LTE were not connecting to Apple to verify the software install, so I used a family member's (using the same phone carrier and plan as me) iPhone 6 Plus's hotspot  to connect to their LTE to download iOS 8.3 in attempts to fix this.

  • Cluster value lost when leaving case structure

    Hello all,
    I am having an issue with a particular VI I am working on. (FYI this is in Labview 8.0)
    The VI is set up to run a current source, voltmeter, and thermometer and then record and graph data in various ways that are selectable by the user.
    Everything seems to be working fine except one particular graphing method. When I try to graph Current vs. Voltage, the current value is gettiing lost. Within a case structure the current and voltage are combined into a cluster and then exit the case structre to be later appended to a cluster array.
    However, the value of the cluster is being lost when the graph is set for Current vs. Voltage. Any other method and it is working properly.
    I can't seem to figure out why this is happening as it does not make much sense that the other methods of graphing work but this one doesn't when it is coded the exact same other than having different variables.
    I have attached the VI with added indicators showing that the cluster value is being lost once it exits the case structure. Any help would be much appreciated.
    Thank you very much and I apologize for my extremely messy VI.
    - Nathan Cernetic
    Solved!
    Go to Solution.
    Attachments:
    IV-RT.vi ‏185 KB

    You really need to boil this down to something we can run and reproduce the issue.
    Have you tried to break a few relevant connections and rewire? Maybe something is corrupt.
    Beside being a mess, your VI has quite a few glaring mistakes.
    Let's have a look at the structures in the upper right:
    90% of the code is the same in all three case structures, so all that needs to be inside the case structure is the small part where you built the 2D array. Everything else belongs outside the case.
    The sequence structure has no useful function.
    Why do you need to reverse the array with each iteration of the small FOR loop? Once before the loop would be enough. Right?
    Why do you use built array inside the small FOR loop, but don't autoindex at the loop boundary? All you ever get is an array with exactly one element, no matter how much the loop runs. Seems useless! (see below image for an alternative).
    You would not even need to reverse if you would use "built array" instead of "insert into array at position 0" in the central part.
    Others: You constantly hammer all your property nodes. The only need to be called when things change. Again, you have way too many instances. For example in the case structure where you are having problems, the same property nodes exist in all cases. A single instance of the property node belong outside the case and only the string constants inside each case. Whenever code is the same in all cases of a case structure, that code belongs outside!
    Message Edited by altenbach on 06-19-2009 03:39 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    RubeLoopII.png ‏10 KB

  • Ipod nano resets when I click on music, and exit podcasts.

    As the subject say's, on my 4GB black, ipod nano when I click on the music tab it resets, bringing up the apple logo and goes back to the main menu. Same thing happens when I exit the podcasts menu, I can listen to a podcast but when I exit podcasts and go back to the main menu it resets bringing up the apple logo again and going back to the main menu. I can do every thing else view Photos go into the Extras tab, Settings and even Shuffle Songs which play fine. I can enter and exit these with no problems. When I plug it in to my computer it's fine even in itunes it's fine I can play anything and do anything. I did a restore of the software already and it fixed nothing, I’m all out of ideas.
    Please help thanks.
    CoH
    4GB ipod nano Windows XP

    I think I figured it out. Podcasts are the culprit, if you set up you your iPod nano to automatically update podcasts and it downloads them on to the iPod, it causes an error in the iPods software, causing it to restart when you click on music or leave the podcast menus. So I changed the settings to manually update podcasts. Putting my podcasts manually onto the iPod, they show up in the Podcasts playlist under my iPod nano menu (which shows automatically) in iTunes. This is when the error starts, when I undock my iPod nano and go to music sure-enough it restarts, I plugged it back into my computer and deleted the podcasts, undocked it and it was working fine. I converted the podcasts to AAC and then put them on the iPod. They did not show in the Podcasts playlist, they just show as normal songs, and when I undock it it works fine. Now I know that they don’t have to go into that playlist and that I can create my own smart-playlist. But it should not do something like this. I’ll make a new thread about this problem.
    Thank you all for the help.
    CoH

  • In the attached VI I dont understand why data from the inner case structures are not being transmitted to the array.

    In the attached VI I don't understand why data from the inner case structures are not being transmitted to the array.
    Thank you.
    Solved!
    Go to Solution.
    Attachments:
    TEMP.vi ‏25 KB

    It took me some time to figure what you are trying to do but I think I have it now.
    The SR is still required.
    What is happening is your "Bundle By Name" is replacing all of the fields of the cluster, not just the value coming out of the case structure. So to maintain the cluster stuff you do in earlier iterations you can either...
    1) Put the "Index array, Bundle by name, and Replace array" inside the case structure and ONLY bundle the value you are setting in that iteration. (as you will see Tim post shortly)
    OR
    2) Move the Index array before the Case, unbundle all of the fields and feed teh case structure and run them across the case so that ALL of your output tunnels come from the coresponding input tunnel EXCEPT for the filed you are trying to set.
    Ben
    Message Edited by Ben on 05-05-2010 01:31 PM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How do I get a case structure's panel?

    I am trying to place a boolean indicator within a case structure via LabVIEW scripting and am not having any luck.
    I started with the following source code, which creates and populates a case structure from an array:
    https://decibel.ni.com/content/docs/DOC-22703
    So my code, rather than put an enum inside each case, creates some compound arithmetic and a mask for each case.  This is all working fine.  I now want to place boolean indicators on the front panel that correspond to each case, and this is where my problem is.  I can create the indicators, but when I look at the block diagram view, all of the indicators are located outside of the case structure, rather than the indicators being inside of each respective case.
    I think the reason is that a boolean indicator is created by passing a reference to the front panel.  But the problem with this is that the VI panel reference does not indicate that the boolean should be placed inside the case structure, just on the panel, so when you view in block diagram mode, it's just thrown the indicators all outside the case structure and wired them up via tunnels.  I am getting the panel reference by accessing the OwningVI field of my CaseSel object.  I feel like there must be some field I should be able to access that indicates to put the block-diagram boolean inside of the respective case structure, but I can't find it.
    I've attached a file with 3 pics in it.  One shows a pic of the code I'm using to create the indicators.  One shows the type of output I'm looking for.  One shows the type of output I'm getting.
    Solved!
    Go to Solution.
    Attachments:
    lv_case_struct.jpg ‏221 KB

    Before you connect the wire to the terminal, call the Move method on the indicator's terminal and use one of the case structure's Diagrams[] as the owner. This will move the terminal into the structure.
    Try to take over the world!

  • Event structure vs case structure?

    I am developing an application that is fairly user input based... lots of boolean control buttons to do different things.
    In the past, I have avoided "value change" event structures, and instead went with a while loop, stacked sequence, and series of case structures. After having done it, I decided this was a terrible idea. This time, I intend to build an array from the booleans, convert it to a number, and feed it in to a single case structure. This will give me the option to add cases for different combinations of the booleans being pressed.
    I guess the question is: What is the best method for doing something like this?  Does one have advantages over the other?
    Edit: I wasn't that clear.  I would like a comparison between the "value change" event structure method, and just feeding everything in to an array -> case structure.  I also am worried that with the bool array -> case structure that I will run in to problems where I end up with too many control variables, and the value of the resulting number gets ugly very quickly. The application has several buttons... next, last, save, load, several different configure setup buttons etc.
    Thanks!
    Solved!
    Go to Solution.

    Aalenox wrote:
    I am developing an application that is fairly user input based... lots of boolean control buttons to do different things.
    In the past, I have avoided "value change" event structures, and instead went with a while loop, stacked sequence, and series of case structures. After having done it, I decided this was a terrible idea. This time, I intend to build an array from the booleans, convert it to a number, and feed it in to a single case structure. This will give me the option to add cases for different combinations of the booleans being pressed.
    I guess the question is: What is the best method for doing something like this?  Does one have advantages over the other?
    Edit: I wasn't that clear.  I would like a comparison between the "value change" event structure method, and just feeding everything in to an array -> case structure.  I also am worried that with the bool array -> case structure that I will run in to problems where I end up with too many control variables, and the value of the resulting number gets ugly very quickly. The application has several buttons... next, last, save, load, several different configure setup buttons etc.
    Thanks!
    Event structure. Among other things, it will allow your loop to "sleep." then wake up when an event happens. With a case structure it's going to be constantly polling. Event structure is pretty much always the right way to go in newer versions of LabVIEW that have it available. I assure you, your first solution was aboslutely wrong and you noticed that, your second is better and was common the way before event structures existed, now that event structures exist, you should go with those.
    CLA, LabVIEW Versions 2010-2013

  • How to implement Case Structure for multiple inputs to Pic Ring?

    So I have a reasonably simple program which I am almost completeed with. Basically the data of an array is read and then is indexed and a new array is created from the indexed data. And then I use Match Pattern to see if elements in the new array match certain words. And if they do then a number value is allocated to a Pic Ring at the end. And depending on the final number value the Pic Ring changes from one pic to another.
    However, I have the problem that I will be using multiple Match Pattern functions to compare elements in the final array, but I can't attach multiple Match Patterns and their subsequent logic statements to a single Pic Ring, only one. I've been trying to work this out by implementing a Case Structure or Event Structure. But the Event Structure isn't working and with the Case Structure, it is very messy with multiple True/False Case Structures inside of each other. Anyway, hopefully this all makes some sense. I'm attaching the VI program to this post. Thanks.
    Attachments:
    ArrayTest2.vi ‏495 KB
    ArrayTest2.vi ‏495 KB

    Obviously, you can only display one picture.  So then the question becomes which picture to show.  Therefore, you will have to create some sort of preference of one pattern over another.
    I would use a FOR loop so that you can loop through your available patters and their possible results.  Use the Conditional Terminal on the FOR loop so that you can stop the loop on the first match.  Then you just wire up the selected value for the ring outside of the loop.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

Maybe you are looking for

  • Re: IMPORTANT - How to install Windows 2000 on a Satellite L300-16M (PSLB0E) ?

    Hello, I'm an independent developper and absolutely need to install several operating systems on my *Satellite L300-16M (PSLB0E)* : it's very important for me because I've to check working of piece of software under every environment for real (not us

  • Displaying files from a local filesystem not in Webserver Root

    I have been attempting to display a file from a local filesystem with no luck. Is there any way, with something like UTL_FILE, to read in a file (A pre-generated report from Funnel Web) and display it through a custom portlet? I have created a provid

  • Text missing from user notification email

    I set up a form and embedded it on our web site. For every completed form I received an email containing all the text submitted. The users also received a notification email, but some of the text was missing from the responses. It appears that only t

  • Copy the media from your iPod to reconstitute the library on your computer.

    trying to copy the media from your iPod to reconstitute the library on your computer. I stored all songs on ipod...updated my OS. I completely wiped out the old microsoft windows and installed windows XP. (I know, bout time.) Besides that I have read

  • ITunes album artwork still ain't working

    I still haven't found anyone with a solution After I import an album, I right click on the album for GET INFO and then assign cover art: But iTunes is not accepting my selection. Sometimes it works - sometimes it doesn't. See the screenshot below, so