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.
Parents
  • 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.
Reply
  • 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.
Children
No Data