hexagon logo

Dmis Skips Printing Commands?

EDIT: THE SOLUTION TO THIS IS ON PAGE 2




I wrote a bit of code based off of information on this message board for printing at the end of a program.

SAVE       =COMMENT/YESNO,NO,Do you want to save this report?
                            ,This will save a PDF of the report
                            ,on the computer.
            IF/SAVE.INPUT=="YES"
            PRINT/REPORT,EXEC MODE=END,$
              TO_FILE=ON,APPEND=FINALFILENAME,$
              TO_PRINTER=OFF,$
              TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
              REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
              PREVIOUS_RUNS=DELETE_INSTANCES
            END_IF/
PRINT      =COMMENT/YESNO,NO,Do you want to print a report?
            IF/PRINT.INPUT=="YES"
            PRINT/REPORT,EXEC MODE=END,$
              TO_FILE=OFF,AUTO=1,$
              TO_PRINTER=ON,$
              TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
              REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
              PREVIOUS_RUNS=DELETE_INSTANCES
            END_IF/


The variable FINALFILENAME is assigned earlier in the code:

WORKORDER  =COMMENT/INPUT,NO,'Enter the workorder #,
                            ,using a period instead of a slash.'
SERIALNUMBER =COMMENT/INPUT,NO,'Enter the Serial # of the piece being inspected.
                              ,If there is no serial number, leave this blank.'
CLOCKNUMBER =COMMENT/INPUT,NO,'Enter your clock #.'
            ASSIGN/PART=STR(GETTEXT(191,1,{FILEHEDR}))
            ASSIGN/DATE=SYSTEMDATE ("MMddyy")
            ASSIGN/TIME=SYSTEMTIME ("HHmm")
            ASSIGN/FILESTORE="C:\PROGRAM FILES\WAI\PC-DMIS V4.3 MR1\PROGRAM FILES\PROGRAM REPORTS\056-000-460-6\ "
            ASSIGN/FILENAME=PART + "_" + WORKORDER.INPUT + "_" + DATE + "_" + TIME + ".PDF"
            ASSIGN/FINALFILENAME=FILESTORE + FILENAME


I have a program that utilizes marked sets to execute different part operations. All of the marked sets go to the print options at the end. The problem is that when you say YES to print PDF, it just skips over it and moves on. Same thing with YES to the print to Printer. When I hold my mouse over the IF statements, it confirms that it "read" the comment answer as Yes, it just chooses not to execute the PRINT/REPORT statements.

I CAN get it to print to PDF and Printer ONCE. For the PDF print, I just modify the name. Change it to SAVE1. Whatever. And it prints to file, for 1 Execution. For the printer print, I change the printer to another printer and then change it back. And it prints 1 time. AngryAngryAngry

Am I screwing this up somehow with how it is using the variables? Or maybe the marked sets? I am totally lost here, because it worked beautiful in my test program I created.
Parents
  • I FINALLY found a way to use these print commands in marked sets. First, I had to turn on print to printer in the global print report settings. Then, select a marked set, and change the individual marked set print report settings to Use Global Settings.

    Then, in order to avoid printing a report no matter what at the end of a marked set execution, go back and turn the print to Printer off in the global print report settings.

    There is no way to select the Use Global Settings box in marked sets unless a global print option is specified, so the box grays out. So setting the marked sets up with a global print option, and then unchecking all global print settings, will leave the Use Global Settings box greyed out, but checked, in individual marked sets.

    This gets PC-DMIS to read the Print code line in marked sets, and doesn't print twice, or fail for one of the inputs.

    That is a fair bit to do to change over my old programs, but at least it's doable. Thought I would share that.
Reply
  • I FINALLY found a way to use these print commands in marked sets. First, I had to turn on print to printer in the global print report settings. Then, select a marked set, and change the individual marked set print report settings to Use Global Settings.

    Then, in order to avoid printing a report no matter what at the end of a marked set execution, go back and turn the print to Printer off in the global print report settings.

    There is no way to select the Use Global Settings box in marked sets unless a global print option is specified, so the box grays out. So setting the marked sets up with a global print option, and then unchecking all global print settings, will leave the Use Global Settings box greyed out, but checked, in individual marked sets.

    This gets PC-DMIS to read the Print code line in marked sets, and doesn't print twice, or fail for one of the inputs.

    That is a fair bit to do to change over my old programs, but at least it's doable. Thought I would share that.
Children
No Data