Execute default case unless user presses one of several event buttons, in which case execute a different case only once.

Hello everyone,
I am communicating with a serial device using the VISA functions. My VISA commands are inside a loop, and per loop itteration I am sending a default command and receiving a message back from my device. However, I would like to incoroporate two non-default cases, which are to be initiated by buttons on the front pannel. When pressed, a corresponding command should be sent to the serial device only once, and then I'd like to go back to the default case. The message coming back fromt the device should be a string, common to all cases - I don't want a separate string per case. How can this be done efficiently?
I tried to do a three-case case structure, but I haven't figured out how to use boolean switch buttons for more than two cases (I prefer buttons to a drop-down menu selection). I also tried an event structure (which I have no experience using), but these remain idle, and I can't figure out how to make a default case run actively.
Thank you in advance for your help.
Solved!
Go to Solution.

An event structure has a time out event which you could wire a value to.  The default value (nothing wired to it) is -1 which means never timeout.  You can put in a 0 which means zero timeout, execute the timeout case immediately if some other event hasn't already been queued.  Or put in any value meaning milliseconds.  Wait that many milliseconds and execute the timeout case if another event hasn't happened in the mean time.
Do combine multiple boolean buttons, build them into an array.  Then search 1-D array for the first true.  A -1 means none are true, a number from 0 to n-1 means that particular element of the array is true.  So you just feed the value to the case structure.  (-1,default   0    1     2    ...)

Similar Messages

  • How can I still be able to execute some codes after user press Ctr-C

    When user press Ctr-C to exit my program, I want to do something before the program terminated, how can I do that?
    Thanks for help.

    BOOL CtrlHandler(DWORD fdwCtrlType)
    switch (fdwCtrlType)
    // Handle the CTRL+C signal.
    case CTRL_C_EVENT:
    Beep(1000, 1000);
    return TRUE;
    default:
    return FALSE;
    * Class: alexiworld_yahoo_com_CtrlCHanler
    * Method: init
    * Signature: (V)V
    JNIEXPORT void JNICALL Java_alexiworld_yahoo_com_CtrlCHanler_init
    (JNIEnv *env, jobject this)
         SetConsoleCtrlHandler((PHANDLER_ROUTINE) CtrlHandler, TRUE);
    }

  • With newest ios 7 version, can no longer change "just this one" recurring calendar event, like if a monthly meeting time changes, but only this month. How to fix?

    With newest IOS7, installed this morning, can no longer change just one time, a recurring event-like a monthly meeting.  It used to ask if i want to change for this event only, or for all the events.  How else can you change the time "just this once" and leave the other times alone?

    no-turns out the only problem is taking the event from an "all day" event that repeats, to one with a time, if time is only for the one event this year.  Do all repeating events either need to be for the entire day, or for a time-but cannot change an all day event, to one with a time only for this event.
    I have the "all day" for the annual event so I don't forget to take care of this, but this year I want to give it a time so it is more prominant on the calendar.  Only wanted it at a specific time this year, and want it to stay "all day event" in the future. 
    I think the only way to fix is to make a new event just this year and give it a time, then keep the recurring event as as "all day".
    Not a big deal-thought it was a bigger problem than it turns out to be.

  • Everytime I try to pay with my cc on paypal, I enter all of my infor and after I press the "review and confirm" button the same page reopens but has erased only my cc #, exp date and security cvv number. What could be wrong?

    b.stats.paypal.com : server does not support RFC 5746, see CVE-2009-3555
    This appears on my error page everytime I try to use my credit card through paypal. I enter all of my info (billing, etc..) and after hitting the "review and confirm" button the same page reappears and has erased my cc number and leaving my name and billing info. What can I do to finish my transaction?

    The message about CVE-2009-3555 is meant for webmasters to make them aware that they need to fix their servers.<br />
    Firefox 3.6 versions can detect such a misconfiguration and displays a warning in the "Tools > Error Console".<br />
    * http://wiki.mozilla.org/Security:Renegotiation
    You may have a problem with the PayPal cookies.
    * "Remove the Cookies" from sites causing problems: Tools > Options > Privacy > Cookies: "Show Cookies"
    See also:
    * http://kb.mozillazine.org/Cookies#Removing_cookies
    * [[Cookies]]
    * [[Enabling and disabling cookies]]

  • Giving Access for an User On One Schema.

    Hi all,
    I want to give read,write and execute access for an user in one schema and only read access to another two users.
    How can I give..Please suggest.

    Hi,
    Well in that case you may have to give the select privilege to a particular user for all tables.
    Or
    You may like to create two roles, and give select privilege to a particular role for all tables. And give write i.e. insert/update privilege to the other role. Then assign this role to the user whom you like to give the access.
    Regards
    Anurag Tibrewal.

  • When I am on a call and I come to hang up, the phone which when to my ear has a black screen, starts to light up then blacks out intermittently and in the brief moments it is lit up, the hang up button doesn't work unless I press home or lock buttons firs

    When I am on a call and I come to hang up, the phone which when to my ear has a black screen, starts to light up so I can see and click the hang up button, but it then blacks out intermittently and in the brief moments it is lit up, the hang up button doesn't work unless I press the home or lock buttons first

    Wow- thanks Jim! I removed the case and voila... it worked. Knock on wood that you solved my problem with such an incredibly simple solution. I'll find out where this proximity sensor is and make sure my case does not interfere with it.
    Thanks so much.
    Annick

  • Execute SSIS Package from JOB which contains Execute Process Task calling a .bat file

    Hi All,
    I have a EXCEL Macro needs to be called from SSIS. We could not use Script task because of some internal reason.
    So we have taken an approach to call a .BAT file using Execute Process Task. This .BAT file will call a .VBS file which will execute the EXCEL Macro.
    The SSIS Package is running good if I execute the package from BIDS.
    But the real problem is with the scheduling this SSIS Package using SQL JOB.
    If i execute this SSIS package from SQL Server Job, its executing the whole package successfully except the Execute Process Task.
    So the overall issue is SQL Server Job is not executing properly if I call any .BAT file from the SSIS Package.
    Please give me suggestion to get rid of the issue. Thanks in advance.

    Hi Sai.N,
    If you run the SQL Server Agent job manually from SSMS, does the package execute properly? If the package executes properly when you run the job manually, the issue should occur due to permission issue. In this case, I suggest that you create a SQL Server
    Agent proxy based on the current Windows account which you use to log onto the operating system, and run the job under the proxy account.
    If it is not the issue, please enable logging in the package as Visakh mentioned and post the warning/error message for further analysis.
    Regards,
    Mike Yin
    TechNet Community Support

  • Plz send simple bdc  code with flat file which is executable

    plz send a simple code for upload bdc with flat file which is executable.

    plz send a simple code for upload bdc with flat file which is executable.

  • How to create an default profile for every user on one machine? Deployment of configurations?

    On firefox 3.5.X i can copy an configured profile from an user-folder to the programm folder of firefox. \mozilla firefox\defaults\profiles.
    After an new user log in to the machine the default profile will get the actual profile of the new user. With all bookmarks, configurations and so on.
    But this doesn't work with the firefox 3.6.10? What changed? What will be the way i can get an default configuration for every user on one machine? I want to deploy the firefox with an default configuration in our enterprise? Why does the behaviour change?
    What to do?
    Thanks...

    No - there are no missing data, because nothing will be copied. The profile - folder does not work.
    There are the standard first start behavior.
    There might be another trick? Hint? Todo?
    Thanks.

  • How to terminate remaining Actions in a script sequence if the user presses "Cancel" during SaveAs

    Hello,
    I'm using the following script to email a completed form to a pre-programmed email address and would like a way to cancel remaning in-line scripts if the user cancels teh first Step.
    Basically, after completing the form I cereated, the user would click the submit button and a series of actions will take place:
    1. Execute a menu item: SaveAs giving the user a chance to Save the current state of the form.
    [Here is where I need a Arcobat script that terminates all remaning actions if the user cancels the SaveAs action]
    2. Once the form has been saved (and not canceled), the next action involves prepping and generating an email to send the form using the user's default email client:
    var e = this.getField("ccAdd");  //There is a field on the form that enables the user to enter a CC: address, if applicable
    var cCCAddr = e.value;
       var cSubLine = "Subject goes Here"; //preformatted subject
       var cBody = "File attached." // preformatted Body text
       // Build the e-mail URL
       var cEmailURL = "mailto:[email protected]?cc=" + cCCAddr
                     + "&subject=" + cSubLine
                     + "&body=" + cBody;
    //Before sending, set ALL form fields to "readonly"
    for (var i = 0; i < this.numFields; i++) {
        var fname = this.getNthFieldName(i);
        var f = this.getField(fname);
            f.readonly = true;
    // hide submit display button, so that it doesn’t show on “readonly” version
    var h = getField("Button1");
    h.display = display.hidden;
    //Generate the outgoing email using the user’s default email client. Send attachment as a PDF
       this.submitForm({cURL: cEmailURL, cSubmitAs:"PDF", cCharSet:"utf-8"});
    3. Once the form has been emailed, another SaveAs menu item fires, thereby, allowing the user to save the "readonly" version.  So now, he has a clean "open version"  that he saved before Step #2, and a "readonly" version after step #2.
    The only thing that's causing an issue now is if the user presses Cancel after the Step #1  (where he/she is asked to save the form), the remaining scripts in-line continue to fire, alougth the "Cancel" button was pressed. 
    SO, I need a script that terminates all remaining scripts (i.e. end process) if the user hits cancels during Step #1, thereby preventing step 2 from starting.
    Any ideas? Thanks in advance.
    S

    ok, i've had a play with it . . . and come up with two options, one that breaks attempts to break any code being run if the cancel button is hit.  either way, they need to be added into a document level javascript, and applies the required action to your submit button (trust me, this becomes a lot easier than applying script to buttons directly!)
    i just wrote functions that chain, so the first function calls the second, and the second calls the third.  seemed easier than trying to nest them.  i know the finaliseForm function simply calls the first in the chain, but that's just a matter of personal preference, i prefer to define functions with logical names.  also, that way, you can test each function individually, or all together, and write more code to the finaliseForm function if you need to.
    not sure if you're using acrobat 9 or X, but the document level javascript is in two different places.  in 9 it's under advanced - document processing - document javascripts.  just give it a name, add it, remove any lines in the window that appear and paste in this code.
    so here's the one that continues the script, with prompts, even when the no button is hit. let me know how you go!
    function saveasEditable() {
        //prompt the user to continue save as
        var saveasPrompt = app.alert({
                    cMsg : "Do you want to save an editable version of this file before emailing?",
                    cTitle : "Save As Editable Form",
                    nIcon : 2,
                    nType : 2
        //where 4 is yes and 3 is no
        if (saveasPrompt == 4) {
            app.execMenuItem("SaveAs");
            emailForm();
        } else {
            emailForm();
    function emailForm() {
        //and invoke a second alert to prompt emailing the form
        var emailPrompt = app.alert({
                    cMsg : "Do you wish to email the form now?",
                    cTitle : "Submit form via email",
                    nIcon : 2,
                    nType : 2
        if (emailPrompt == 4) {
            var e = this.getField("ccAdd"); //There is a field on the form that enables the user to enter a CC: address, if applicable
            var cCCAddr = e.value;
            var cSubLine = "Subject goes Here"; //preformatted subject
            var cBody = "File attached."// preformatted Body text
                // Build the e-mail URL
                var cEmailURL = "mailto:[email protected]?cc=" + cCCAddr
                 + "&subject=" + cSubLine
                 + "&body=" + cBody;
            //Before sending, set ALL form fields to "readonly"
            for (var i = 0; i < this.numFields; i++) {
                var fname = this.getNthFieldName(i);
                var f = this.getField(fname);
                f.readonly = true;
            // hide submit display button, so that it doesn’t show on “readonly” version
            var h = this.getField("Button1");
            h.display = display.hidden;
            //Generate the outgoing email using the user’s default email client. Send attachment as a PDF
            this.submitForm({
                    cURL : cEmailURL,
                    cSubmitAs : "PDF",
                    cCharSet : "utf-8"
            saveasReadonly();
        } else {
    function saveasReadonly() {
        //and invoke a third alert to prompt save of the read only form
        var readonlyPrompt = app.alert({
                    cMsg : "Do you wish to also save a read-only copy of this file?",
                    cTitle : "Save As Read-only Copy?",
                    nIcon : 2,
                    nType : 2
        if (readonlyPrompt == 4) {
            app.execMenuItem("SaveAs");
        } else {}
    function finaliseForm() {        saveasEditable();
    //assign all of this to the submit button from the doc level
    this.getField("Button1").setAction("MouseDown", "finaliseForm();");

  • How to enable detail view interactive report as default for public user?

    Hello all,
    I'm currently developing a search results page.
    I'm trying to do a nice view instead of a default table like view from the interactive reports. So in this case i enabled the detail view so i could make fancy designs.
    all worked well and looked neat but however when i pass value from my search page using IR_ROWFILTER and clear the results page using page_no,RIR, it brings me to the interactive reports result page with the default table like view.
    i have to press the detail view to get it. i tried saving it as default but it wont work. this issue is for public user.
    if i make the page requires authentication, and save the detail view as default i would not have any problem. i could search and it will straightly bring to the detail view of the search page.
    of course the other reason i found is because im using the IR_ROWFILTER and clearing page using page_no,RIR..without it,it works well but i need it coz im doing a a search result. i need to send search text from another page and put it in the filter in the search page. i would need to use RIR to clear it for searching again.
    is this a limitation for public user? it doesnt happened for authenticated user though..
    how can i make this view as default for public user?

    T101_cyberdyne wrote:
    how can i make this view as default for public user?
    Flip the report into Detail view on page load using an Page Load dynamic action with the following Execute JavaScript Code true action:
    gReport.data.view('DETAIL');
    I'm trying to do a nice view instead of a default table like view from the interactive reports. So in this case i enabled the detail view so i could make fancy designs.
    Do you really need this to be an IR? Other than the detail layout, do you require any of the interactive features? If not, try using a standard report with a custom report template.

  • Multiple users sharing one itunes library

    i have multiple users on my mac, but i'd like us all to be able to access the same itunes library. when i go to itunes prefs on one of the other users accounts and redirect their music library to my folder, it says it is doing it, but itunes still goes to their own music folder instead of mine. i can share my library with the sharing pref, but while they can now listen to my music, they still can't use it in imovie. is there any easy way around this problem??
    thanks for your help.

    I wrote a simple shell script that executes each time a user logs in (well, actually, each time I log in, coz' it's not really applicable to other users). It syncs my work and home addressbooks and iCal calendars to one another.
    I named it "sync". Then I read somewhere that if you wanted to make it double-clickable (to launch it from the Finder), I appended a ".command" filename extension (so it's now named "sync.command"). I also did a chmod 755 to that file so that it had execute privileges. Depending on whether you give each user their own copy of this thing, or keep a single copy in, say, the /Users/Shared directory, you may have to play around with chmod. Whatever, just so long as the user that has just logged in has execute permissions to the file, and to the entire path to the file, you should be good.
    Then, in SysPrefs > Accounts > Login Items, I added that "sync.command" file to the list. So, really the only difference is I'm not wrapping mine inside an Automator script like you are.
    I had tried adding it to ~/Library/LaunchAgents and make a launchd plist for it, that would kick it off at login. But I didn't get that to work. Don't know why. But just adding the double-clickable executable unix script to the Login Items list did the trick. Whether the plist has to hang out there with it, I don't know. I still have it there, though, in case I ever get motivated to figure out what's wrong with my launchd plist file. So, if just adding it to the Login Items list doesn't do it for you, you could try making a (functional?) launchd plist for it and plopping them both in ~/Library/LaunchAgents, too. That's how I am now, and, like I said, it launches at user login as that user's process (not as a root process like the above referenced article said how login hooks worked -- although, you may want it to run as root since you want this to work with multiple users...in which case, you might want to listen to Cole and not me...).

  • How do i output multiple arrays from a case structure to create one larger array

    I currently have a vi that has one hardware input that i needed to take a measurement then be moved and take a similar measurement at a different point.  To accomplish this i used a while loop inside a case structure.  The while loop takes the measurement  and finds the numbers i need while the case structure is changed per the new measurement location.  I want to take the data points i have created in each case and output them into a single table.  I assumed to do this the best way would be to get the data from each case into its own built array and build a larger array but I cant get the information out of the case structure so that it all inputs at different places.
    thanks for your help
    Attachments:
    Array.vi ‏30 KB

    Hi Ross,
    attached you will find a solution for your table building problem.
    I would suggest thinking about program design - having the same case content in several cases doesn't make sense. I also would not want my user to press several stop buttons depending on choosen measurement...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    Array.vi ‏45 KB

  • How to retain the work item in inbox of user if user press the icon cancel?

    HI,
    we  are using a text editor in approval section of workflow where the user needs to enter the reason for apporval or rejection.
    the requirement is how to retain the work item in inbox of user if user press the icon cancel? there are two icons in editor,one is ok(tick marg) and cancel(cross mark).
    so when user dont enter any text in the editor and press on cancel icon,then approval/rejection should not authorize and work item will remain in the user's inbox .unless and untill he enters the text.
    i have tried   LEAVE TO TRANSACTION 'SBWP'.leave program etc but nothing is working.
    please guide me.
    thanks
    prsahu

    Hi,
    Go with Sangvir Singh suggestion.
    It also looks neater from a Business Process Modeling perspective. You continue the process flow only when a change has occurred.
    Kind regards, Rob Dielemans

  • Case insensitive user login

    Hi,
    I am working on a Weblogic portal application (Weblogic 10.3.2) to be deployed in a Weblogic Server 10.3.2. I want to enable case insensitive user name login for my application. Looks like by defaule user name goes for a case sensitive authentication. Is there any way to enable case insensitive authentication? Thanks.
    Regards,
    Ramakrishnan

    Hi
    By default Weblogic Login UserId is Case-InSensitive. For quick testing, open your Weblogic Console and say if your admin user id is "weblogic", just try any combination of this value like "WEBloGiC" with his password. It works and you should be able to login.
    NOW if you have any External LDAP configured, still you can login with your userid as Case InSensitive. BUT if you see that some Visitor Entilements or DAs stuff is not getting triggered or working properly, then you can do one setting. In your Weblogic Console, select your external AD Provider (like LDAP, AD etc) and click on the properties tab, where you set the host, port, userbase dn, groupbase dn etc. There you should see another property like a CheckBox named something like "Use Retrieved Username as Principal". What this means is if you say for example login as "RJegGA", the login will be successfull but the value that gets stored in the session in security subject value will be like "rjegga" where rjegga is the actual name coming from external LDAP.
    So point is, check the above check box and try again. For any users stored in the Default Weblogic Authenticator itself, it is case insensitive.
    Thanks
    Ravi Jegga

Maybe you are looking for

  • Very slow start up Mac OS X v10.6.2

    Hey everyone, Looking for some help here... In the past week, my MacBook (2GHz Intel Core 2 Duo, 2GB RAM) has suddenly gone from a zippy, 20-second start-up to an agonizing 4-minute chug-fest. *Here is the performance:* - it takes about 1 minute to g

  • IPhoto library still 20GB in size, but only shows 500 photos in iPhoto

    HELP! My iPhoto library (which is placed on an external HDD) is about 20GB in size. Unfortunately, everytime I open iPhoto now it has forgotten about 9,500 photos. I know that they are still there due to the size of the file, but iPhoto will not read

  • Why can't I import videos shot with a digital cam?

    I have a 270MB .mov file that was shot with a digital camera on my desktop. An unknown error occurs when I try to import it into the iMovie HD app. Help please, Santiago

  • Map Auto ID field in import manager

    Hello all I need to make a quick fix to the data in our repository. A field needs to be updated based on a small formula. To do so I have syndicated the information and imported it to and SQL database where calculated the result. I exported it to a t

  • Tactic3D Sigma + X-Fi Titanium Fatal1ty ?

    Hello friends, I have a PCI-E X-Fi Titanium Fatalty sound card and I'm thinking in get a good headphone to play during midnight. I know Titanium features in Game Mode the CMSS-3D effect which offer a great improvment in games with any kind of headpho