PC-Dmis V4.0 Report out problems.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PC-Dmis V4.0 Report out problems.

    Hello all. I would like to thank everyone in advanced. I have no one to ask questions to, or anyone's brain to pick. I can't seem to figure out why when my report saves into my directory that it is always blank. I was trying to output to pdf format so that the report could not be modified, but if i could get it to work in rtf format I will take what i can get. Here is my entire base program that I use. I do not know if it is a settings issue or what, I can't figure it out. The report prints just fine. I have no issues with it. I just can't get an electronic copy to save in anyway other than blank.

    Code:
    STARTUP    =ALIGNMENT/START,RECALL:,LIST=YES
                ALIGNMENT/END
    Refresh_Report_BAS=SCRIPT/FILENAME= C:\PROGRAM FILES\WAI\PC-DMIS V40\PART PROGRAMS\REPORT REFRESH.BAS
                FUNCTION/Main,SHOW=YES,,
                STARTSCRIPT/
                ENDSCRIPT/
    $$ NO,Change Readout Parameters if needed.
                FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL, , 
                DISPLAYPRECISION/5
    $$ NO,Verify Correct Probe is loaded, and Parameters set accordingly.
                LOADPROBE/1x27w20extn
                TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
                PREHIT/ PROBEDATA("Diam")/2
                RETRACT/ PROBEDATA("Diam")/2
                CHECK/ 1,1
                MOVESPEED/ 100
                TOUCHSPEED/ 2
                ACCELERATION/MAXACCELX=200, MAXACCELY=200, MAXACCELZ=200
                PROBECOM/ON
    $$ NO,====================================================
         ,PART INFORMATION
         ,====================================================
                ASSIGN/CMMPROGRAM = "Name of Program, What you're checking"
                ASSIGN/PRINTREV1 = "PART # OFF PRINT"
                ASSIGN/PARTNAM = "NAME OFF PRINT"
                ASSIGN/PARTNUM = "Our Reference #,"
    $$ NO,====================================================
         ,PROGRAM DISPLAY @ EXECUTION
         ,====================================================
    EXECUTE    =COMMENT/YESNO,YES,
                                 ,==================================
                                 ,CMMPROGRAM
                                 ,==================================
                                 ,
                                 ,
                                 ,THIS PROGRAM INSPECTS THE FOLLOWING PART:  
                                 , 
                                 ,PARTNUM
                                 ,PARTNAM
                                 , 
                                 ,"PRINT: " + PRINTREV1
                                 , 
                                 , 
                                 ,DO YOU WISH TO CONTINUE ?
                IF/EXECUTE.INPUT == "NO"
                GOTO/END
                END_IF/
    $$ NO,INPUT PICTURE FOR SETUP OR BRIEFLY DESCRIBE SETUP
    C1         =COMMENT/YESNO,NO,Do you wish to see the Setup Notes?
                IF/C1.INPUT=="YES"
                END_IF/
    $$ NO,====================================================
         ,PART INFORMATION - INPUT BY OPERATOR
         ,====================================================
    INPUT      =LABEL/
    CS1        =SCRIPT/FILENAME= C:\PROGRAM FILES\WAI\PC-DMIS V40\PART PROGRAMS\BASIC SCRIPTS\BASIC INPUT.BAS
                FUNCTION/Main,SHOW=YES,,
                STARTSCRIPT/
                ENDSCRIPT/
                ASSIGN/OPERATOR = ""
                ASSIGN/JOB = ""
                ASSIGN/SERNO = ""
                ASSIGN/SAMP = SERNO
                ASSIGN/EMPID = OPERATOR
    $$ NO,Begin Alignment
    ALIGNMENT  =LABEL/
    END_ALIGNMENT=LABEL/
    $$ NO,Begin Main Program
    MAIN_PROGRAM=LABEL/
    END_PROGRAM=LABEL/
    $$ NO,Safe move
    $$ NO,Move up and then out of the way.
    SAFE_MOVE  =LABEL/
    RECALL_STARTUP=ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                ALIGNMENT/END
                MOVESPEED/ 100
    RD1        =FEAT/POINT,RECT
                THEO/12.00007,14.00253,-3.00163,0,0,1
                ACTL/11.99861,13.99674,-3.00123,0,0,1
                READPOINT/
                MOVE/POINT,NORMAL,RD1.X,RD1.Y,-3
                TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
                MOVE/POINT,NORMAL,RD1.X,RD1.Y,-3
                MOVE/POINT,NORMAL,12,14,-3
    $$ NO,End of Program, Save and Report Functions
    $$ NO,Begin Report
                FORMAT/TEXT,OPTIONS, ,HEADINGS,SYMBOLS, ;NOM,TOL,MEAS,DEV,OUTTOL, , 
                DISPLAYPRECISION/5
    START_REPORT=LABEL/
    $$ NO,====================================================
         ,ASSIGNS DATE & TIME FOR REPORTING
         ,====================================================
                ASSIGN/TIME = SYSTEMTIME("HH:mm:ss")
                ASSIGN/DATE = SYSTEMDATE("MMddyyyy")
    $$ NO,DATA ONLY 
                TRACEFIELD/NO_DISPLAY,LIMIT=15 ; Part # : PARTNUM
                TRACEFIELD/NO_DISPLAY,LIMIT=15 ; Operator # : EMPID
                TRACEFIELD/NO_DISPLAY,LIMIT=15 ; Sample # : SAMP
                TRACEFIELD/NO_DISPLAY,LIMIT=15 ; Job # : JOB
                TRACEFIELD/NO_DISPLAY,LIMIT=15 ; Run Date : DATE
                TRACEFIELD/NO_DISPLAY,LIMIT=15 ; Run Time : TIME
    SETPAGE    =LABEL/
    $$ NO,Number of pages
                ASSIGN/PG = 0
                ASSIGN/PG = PG+1
                ASSIGN/PGS = 3
    $$ NO,Report Info
    $$ NO,Change Name of Part, and change Nam to "Customer\\Part Reference #\\"
                ASSIGN/TIME = SYSTEMTIME("HHmmss")
                ASSIGN/DATE = SYSTEMDATE("MMddyyyy")
                ASSIGN/INFO = "_"+DATE+"_"+TIME+"_"+ JOB +"_"+ SAMP +"_"+ EMPID +"_"
                ASSIGN/NAM = "_" 
                ASSIGN/NAME = PARTNAM+INFO
    $$ NO,Verify RPTPath is to the appropiate location
                ASSIGN/DEFAULTPATH = "W:\\Quality\\CMM Reports\\"
                ASSIGN/RPTPATH = DEFAULTPATH + NAM + NAME+".RTF"
                ASSIGN/B60 = "                                                             "
                PRINT/REPORT,EXEC MODE=START,$
                  TO_FILE=ON,APPEND=RPTPATH,$
                  TO_PRINTER=OFF,$
                  TO_DMIS_REPORT=OFF,FILE_OPTION=APPEND,FILENAME=NAME,$
                  REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                  PREVIOUS_RUNS=KEEP_INSTANCES
                COMMENT/REPT,———————————————————————————————————————————————————————————————————————————————————————————
                            ,"DATE: "+DATE +" "+"Time: "+TIME +(MID(B60,0,(30-LEN(DATE))))+ "                              PAGE " +PG+" OF "+ PGS 
                            ,——————————————————————————————————————————————————————————————————————————————————————————— 
                            ,"PART NUMBER            : "+PARTNUM+(MID(B60,0,(32-LEN(PARTNUM))))+"SAMPLE NUMBER : "+SAMP                               
                            ,"PART NAME              : "+PARTNAM+(MID(B60,0,(32-LEN(PARTNAM))))+"JOB NUMBER    : " + JOB            
                            ,"PRINT NUMBER           : "+PRINTREV1+(MID(B60,0,(32-LEN(PRINTREV1))))+"INSPECTOR     : "+EMPID
                            ,"PROGRAM NUMBER         : "+CMMPROGRAM+(MID(B60,0,(32-LEN(CMMPROGRAM))))                         
                            ,——————————————————————————————————————————————————————————————————————————————————————————— 
                ASSIGN/PG = PG+1
                COMMENT/REPT,———————————————————————————————————————————————————————————————————————————————————————————
                            ,"PART NUMBER  : "+PARTNUM+(MID(B60,0,(30-LEN(PARTNUM))))+"SAMPLE NUMBER : "+SAMP + "                  PAGE " +PG+" OF "+ PGS                               
                            ,"DATE         : "+DATE +"  "+"Time: "+TIME +(MID(B60,0,(14-LEN(TIME))))+"JOB NUMBER    : "+JOB                               
                            ,——————————————————————————————————————————————————————————————————————————————————————————— 
                COMMENT/REPT,———————————————————————————————————————————————————————————————————————————————————————————
                            ,                                     END OF REPORT
                            ,"PART NUMBER : "+PARTNUM+(MID(B60,0,(35-LEN(PARTNUM))))+"SAMPLE : " + SAMP
                            ,———————————————————————————————————————————————————————————————————————————————————————————
    END_REPORT =LABEL/
    REPORT_PRINT=LABEL/
    $$ NO,F3 to turn on/off, turn on when Ready to Run.  Turns on Auto-Print/Save
    C4         =COMMENT/YESNO,NO,Do you wish to print the report?
                IF/C4.INPUT=="YES"
                ASSIGN/TOPRINT = "ON"
                END_IF/
                IF/C4.INPUT=="NO"
                ASSIGN/TOPRINT = "OFF"
                END_IF/
                PRINT/REPORT,EXEC MODE=END,$
                  TO_FILE=ON,APPEND=RPTPATH,$
                  TO_PRINTER=TOPRINT,$
                  TO_DMIS_REPORT=OFF,FILE_OPTION=APPEND,FILENAME=NAME,$
                  REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMENSIONS=NO,$
                  PREVIOUS_RUNS=KEEP_INSTANCES
    Report_View=SCRIPT/FILENAME= C:\PROGRAM FILES\WAI\PC-DMIS V40\PART PROGRAMS\BASIC SCRIPTS\PDF VIEW AFTER EXECUTE.BAS
                FUNCTION/Main,SHOW=YES,ARG1=RPTPATH,,
                STARTSCRIPT/
                ENDSCRIPT/
    END        =LABEL/
    the first basic script is as follows. it is to refresh the report screen upon execution.

    Code:
    Sub Main()
    
    
    '************PC-DMIS declarations************
    Dim pcdApp As Object
    Set pcdApp = CreateObject("PCDLRN.Application")
    
    Dim pcdPart As Object
    Set pcdPart = pcdApp.ActivePartProgram
    
    Dim pcdReportWindow As Object
    Set pcdReportWindow = pcdPart.ReportWindow
    
    '***********Repaint the report window*********
    pcdReportWindow.RefreshReport
    
    '********************Cleanup**********************
    Set pcdReportWindow = Nothing
    Set pcdPart = Nothing
    Set pcdApp = Nothing
    
    End Sub
    the last basic is to pull up the report using windows, or adobe if i can get the pdf format to work. I can switch in and out of it as needed.

    Code:
    Sub Main(strFileName As String)
    
    Shell "C:\Program Files\Microsoft Office\Office12\WinWord.exe " & strFileName
    
    End Sub

  • #2
    any help or ideas would be appreciated.

    Comment


    • #3
      If i take out the print commands completely it works.

      edit: well it did once. It seems rather glitchy. I can get it to work once or twice then it just stops working entirely. Now it still saves it as a blank. I am going to try using a completely new program, and see if my code is just being buggy.

      edit: Alright, If i don't use print commands in my report and just use the menu print and save function everything works fine. Idk if it is something I am doing or not, but I will take what i can get.
      Last edited by Rploughe; 12-30-2013, 07:36 AM.

      Comment

      Related Topics

      Collapse

      Working...
      X