hexagon logo

Multiple Selection Option - Using Forms

Okay GURU's. I am looking for the easiest way to have the operator select multiple items at the beginning of the program in order to inspect certain features. We have a part with 18 different features and instead of running the entire program for 1 feature that was adjusted I would like to prompt the question "Which blocks would you like to check....1, 2, 3, 4..etc " and so on.

I don't have much expierence in this area and I know that you can use VB but with my skills I am not getting it. Any help would be apprieciated.
  • Use marked sets? (see helpfile)

    Use if-then-else clauses? (see helpfile)
  • Marked sets would handle that but you could have an infinite number of combinations from the sounds of it if you want to check more than 1.

    One way that occurs to me is to use YES/NO inputs and CHECK commands.
    c1: do you want to check feature #1 (yes/no)
    c2: do you want to check feature #2 (yes/no)
    etc.
    on the executable side, evaluate each comment before the feature.

    before feature 1, check the c1.input.
    If YES, it runs the feature.
    If NO, it skips to the next feature.

    continue for all features.

    the problem I foresee with this though is report commands tend to ignore logic statements. EX: you may have skipped over feature #5 but feature #5 will get reported anyway if you have a DIM command for it.
    Don't know how to get around that yet (unless using marksets)

    I don't know about the VB scripting, I've never gotten into that.
  • I would suggest using a visual basic script to allow them to see all options at once. Rather than just one at a time.

    I use something like that to control the information displayed at the beginning of each program. You could try checking the Code Sample section for it.
  • Yes, I want to avoid using 18 different prompts asking if you want to run the certain feature. I have created form for all the additiional part input information and thought maybe using a check box. This way there could be 18 different check boxes and depending on the circumstance they could then select which ones they want to run. As you stated one time it might be number 1 and 15 other times it could be 1, 5, 10 and 14.

    Still doing some research on how to get it to function correctly using the checkboxes.
  • I would (and have) used forms to handle this sort of problem. It isn't too difficult to setup and it is intuitive to the user.

    The program would start by opening a form containing a number of check box options (each option is a different part of the PC-DMIS program)

    The PC-DMIS program would have an IF/END_IF surrounding the different sections listed on the form. Only sections are executed if they were checked by the operator.

    Some advantages:

    - You can set default values for the options to check in the PC-DMIS program.

    - All options are presented at once as opposed to asking a series of questions (Do you want to check ..., over and over). You can make this look quite professional with a little more effort (title block, pictures, help, etc.)

    - You don't need to deal with VB. Basically, you need to know how to pass the state of a checked option to and from the PC-DMIS program (done in the form command itself; i.e. OPTION.CHECK=<name_of_pcdmis_variable>Wink
  • It all sounds simple, and I understand the concept but I really don't understand how to get there. I do apprieciate your input and I will continue to research some examples. Just need to see an example to see how it works.
  • It all sounds simple, and I understand the concept but I really don't understand how to get there. I do apprieciate your input and I will continue to research some examples. Just need to see an example to see how it works.



    ASSIGN/OPTION1=0
    ASSIGN/OPTION2=1
    ASSIGN/OPTION3=0
    CS1 =FORM/FILENAME= FORM1.FORM
    PARAM/CHECKBUTTON1.CHECK=OPTION1
    PARAM/CHECKBUTTON2.CHECK=OPTION2
    PARAM/CHECKBUTTON3.CHECK=OPTION3
    PARAM/=
    ENDFORM/
    IF/OPTION1
    COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
    Option1 running
    END_IF/
    IF/OPTION2
    COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
    Option2 running
    END_IF/
    IF/OPTION3
    COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
    Option3 running
    END_IF/


    Start by creating a form in PC-DMIS. Add three check boxes (default names of the check boxes are CheckButton1, CheckButton2, CheckButton3). I would suggest you save the form in the same directory as the part program with the same name as the program (makes the program easier to move between machines). Close the form editor when done.

    Add variables at the top of the program. The default values (=0, or =1) determines if the check box will be initially checked or not.

    Insert the form created earlier in the program (Insert - Reporting Command - Form). Don't forget to mark it if it is unmarked. Also, remove the path part of the file name. By doing this PC-DMIS will always try to load the form from the directory of the part program wherever it happens to be (it makes the program easier to move from machine to machine).

    Modify the empty PARAM line to link your PC-DMIS variable with the check boxes on the form. When you edit this line a new 'param' line will appear automatically.

    PARAM/CHECKBUTTON1.CHECK=OPTION1


    where:
    - CheckButton1 is the name of the control
    - .CHECK is the property (this can be anything available. i.e. .TEXT, .VISIBLE, ...)
    - OPTION1 is the name of the *existing* variable in the PC-DMIS program.

    Finally, surround the sections of the program you wish to associate with the option:


    IF/OPTION1
    ... <whatever code represents option 1>
    END_IF/


    You do not need to be verbose here (i.e. you don't need to write 'IF/OPTION1 <> 0' or something so specific). The IF statement will be true if the variable value is non-zero so just putting the name of the variable in the IF statement is fine.


    What I usually do is add a 'RUN' button to the form so it is easier for the operator (they don't have to find the execution dialog to press the continue button). For added touch you can color it green and change the text to 'Run' or 'Continue' or whatever. To add this option:

    - Add a button to the form

    - Under the button Properties - Events - EventClick add the following code:

    TheView.Cancel


    This will close the form when the button is clicked and PC-DMIS will continue running the part program. I would highly recommend adding this.
  • I really apprieciate the information. That was a HUGE help. Now it all all makes sense to me seeing how they are connected.
  • Hi,
    I saw one of your posts where you were explaining to another member about
    how you might do a form. (6-10-14)

    I do mine slightly different, but have you ever had an issue with the forms not
    loading properly? I mean they will not load at all. I have ran this program at least
    75 times and sometimes the forms will load properly and sometimes they will not.
    They either all load or none of them load.
    When they do not I go in and make a change to the form, save it, and then take the
    change out, resave it...., now the forms will load properly, all of them, even though I only
    "edited" one of them.

    I have a probe file photo come up at the beginning of the program, then a "TOPMENU"
    that comes up and displays choices to the operator with radio buttons, and then I build from
    there with other choices ..etc.

    Have you experienced this at all, and if not, can you help me with my code and see if
    I am doing something that 2011 MR1 does not like (some of the time).lol

    Thanks for your time. I can post code if you are willing to give it a look.
  • Hi,
    I saw one of your posts where you were explaining to another member about
    how you might do a form. (6-10-14)

    I do mine slightly different, but have you ever had an issue with the forms not
    loading properly? I mean they will not load at all. I have ran this program at least
    75 times and sometimes the forms will load properly and sometimes they will not.
    They either all load or none of them load.
    When they do not I go in and make a change to the form, save it, and then take the
    change out, resave it...., now the forms will load properly, all of them, even though I only
    "edited" one of them.

    I have a probe file photo come up at the beginning of the program, then a "TOPMENU"
    that comes up and displays choices to the operator with radio buttons, and then I build from
    there with other choices ..etc.

    Have you experienced this at all, and if not, can you help me with my code and see if
    I am doing something that 2011 MR1 does not like (some of the time).lol

    Thanks for your time. I can post code if you are willing to give it a look.


    One possible reason might be if the form is already open when you run the program. If it is already open I don't think it will automatically move to the top (it will stay in the background). When this happens see what is under the 'Window' menu.