hexagon logo

Looping question: Unique Input for Each Part plus Skipping Stations

I'd like to write a program capable of inspecting 4 identical parts mounted to fixtures, pitched 100mm apart from one another.
The user will be asked where each part came from (location on on the CNC machine)
Each report pdf will be named to identify where each part came from.
It will be possible to skip one or several of the parts.

The program I have allows me to do all of this except for the looping.

Manual alignment
Ask user part location
DCC alignment
Features
Dimensions
Report with pdf name identifying part location


Using the help file, I can create a simple looping program to measure the four parts, but I'm not sure how to include part identification and part skipping. I'd rather not have to have the program pause between parts while waiting for user input.
Parents
  • Now the next two tricks are how to get Operator Input for information for report and report name - the Production Machine ID per part, and how to skip empty stations.

    The most AWESOME way to accomplish this is by creating a PC-DMIS form that pops up with four neat boxes that visually correspond to the four fixture stations, and inside each box are test boxes where they type in the required information. Then Visual Basic code written into the background of the form takes those entries and passes them to PC-DMIS as the current values of variables, and if a station is left empty the current value of the variable is null (or "") and this information can easily be used to skip an empty station.
    However, there's literally no way for me to train you on Form creation via this forum. It would take me 2 days of solid work, creating screenshots and typing. Instead I'm just going to tell you to sign up for PC-DMIS for CMMs 301 class where we teach it.

    The next way would be do a similar custom operator input system using a Visual Basic .BAS script. This provides fewer formatting options, and being text-based doesn't have the editing flexibility of the Form, and is also beyond "forum training". Check the
    http://www.pcdmisforum.com/forum/pc-dmis-enterprise-metrology-software/pc-dmis-code-samples
    section for examples of BAS files.

    The other way is to simply have a series of Operator Input Comments at the very beginning of the program before the looping, asking for the info for each station.
    The biggest drawback to this method is that the Comments retain their last-entered values and lazy operators simply hit the enter key without bothering to edit the input!


    Once you've got the input method down, then it's time to use it to direct PDF printing.
    For this, a Print Command combined with variable concatenation might work:
                ASSIGN/DATE=SYSTEMDATE("ddMMMyyyy")
                ASSIGN/TIME=SYSTEMTIME("HHmm")
                ASSIGN/PARTNAME=STR(GETTEXT(191,1,{FILEHEDR}))
                ASSIGN/PDFNAME="C:\Users\Public\Documents\\"+PARTNAME+"_"+MACHINE_ID+"_"+TIME+"_"+DATE+".PDF"
    
                PRINT/REPORT,EXEC MODE=END,$
                  TO_FILE=ON,OVERWRITE=PDFNAME,AUTO OPEN REPORT=OFF,$
                  TO_PRINTER=OFF,COPIES=1,$
                  TO_DMIS_REPORT=OFF,FILE_OPTION=OVERWRITE,FILENAME=,$
                  REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                  TO_EXCEL_OUTPUT=OFF,
                  PREVIOUS_RUNS=KEEP_INSTANCES
    
Reply
  • Now the next two tricks are how to get Operator Input for information for report and report name - the Production Machine ID per part, and how to skip empty stations.

    The most AWESOME way to accomplish this is by creating a PC-DMIS form that pops up with four neat boxes that visually correspond to the four fixture stations, and inside each box are test boxes where they type in the required information. Then Visual Basic code written into the background of the form takes those entries and passes them to PC-DMIS as the current values of variables, and if a station is left empty the current value of the variable is null (or "") and this information can easily be used to skip an empty station.
    However, there's literally no way for me to train you on Form creation via this forum. It would take me 2 days of solid work, creating screenshots and typing. Instead I'm just going to tell you to sign up for PC-DMIS for CMMs 301 class where we teach it.

    The next way would be do a similar custom operator input system using a Visual Basic .BAS script. This provides fewer formatting options, and being text-based doesn't have the editing flexibility of the Form, and is also beyond "forum training". Check the
    http://www.pcdmisforum.com/forum/pc-dmis-enterprise-metrology-software/pc-dmis-code-samples
    section for examples of BAS files.

    The other way is to simply have a series of Operator Input Comments at the very beginning of the program before the looping, asking for the info for each station.
    The biggest drawback to this method is that the Comments retain their last-entered values and lazy operators simply hit the enter key without bothering to edit the input!


    Once you've got the input method down, then it's time to use it to direct PDF printing.
    For this, a Print Command combined with variable concatenation might work:
                ASSIGN/DATE=SYSTEMDATE("ddMMMyyyy")
                ASSIGN/TIME=SYSTEMTIME("HHmm")
                ASSIGN/PARTNAME=STR(GETTEXT(191,1,{FILEHEDR}))
                ASSIGN/PDFNAME="C:\Users\Public\Documents\\"+PARTNAME+"_"+MACHINE_ID+"_"+TIME+"_"+DATE+".PDF"
    
                PRINT/REPORT,EXEC MODE=END,$
                  TO_FILE=ON,OVERWRITE=PDFNAME,AUTO OPEN REPORT=OFF,$
                  TO_PRINTER=OFF,COPIES=1,$
                  TO_DMIS_REPORT=OFF,FILE_OPTION=OVERWRITE,FILENAME=,$
                  REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                  TO_EXCEL_OUTPUT=OFF,
                  PREVIOUS_RUNS=KEEP_INSTANCES
    
Children
No Data