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
  • The message was something like, the variable FINALFILENAME exists. Does this refer to this variable. I answered yes to that. And when I put the cursor over the variable in the PRINT command code, it comes up with the filename I want. I even copied the filename and entered it into the address bar to make sure it was a valid path.

    PC-DMIS seems to be counting the PRINT commands as finished even though it doesn't execute them. It gets to the IF statements, reads YES, and right after that, the PRINT code immediately turns green in the edit window like it has been executed, though nothing has been done. Not even a pause like it is thinking about the code.

    I know it would be very easy to screw up the PDF printing section, with its variables and operator inputs creating the filename. But this is also skipping right over the print to Printer command. So whatever the problem is, it is affecting both of these. I imagine there is a lot less that could cause PC-DMIS to screw up a basic printing command rather than a custom PDF printing command. But so far everything I try only works for 1 execution.
Reply
  • The message was something like, the variable FINALFILENAME exists. Does this refer to this variable. I answered yes to that. And when I put the cursor over the variable in the PRINT command code, it comes up with the filename I want. I even copied the filename and entered it into the address bar to make sure it was a valid path.

    PC-DMIS seems to be counting the PRINT commands as finished even though it doesn't execute them. It gets to the IF statements, reads YES, and right after that, the PRINT code immediately turns green in the edit window like it has been executed, though nothing has been done. Not even a pause like it is thinking about the code.

    I know it would be very easy to screw up the PDF printing section, with its variables and operator inputs creating the filename. But this is also skipping right over the print to Printer command. So whatever the problem is, it is affecting both of these. I imagine there is a lot less that could cause PC-DMIS to screw up a basic printing command rather than a custom PDF printing command. But so far everything I try only works for 1 execution.
Children
No Data