Different header outputs in one program

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

  • Different header outputs in one program

    ALL RIGHT PCDMIS GURUS I NEED SOME HELP! I HAVE A PROGRAM THAT WILL BE USED FOR RECEIVING INSPECTION AS WELL AS PRODUCTION FLOOR. THE NAMING CONVENTIONS FOR WHAT SHOULD APPEAR IN THE HEADER ARE DIFFERENT DEPENDING ON WHERE THE PROGRAM WAS RAN. MY QUESTION WOULD BE IS THERE A WAY TO VARIABLIZE THE CELL EXPRESSIONS IN THE HEADER LABEL SO IT WILL ONLY PICK UP THE TRACEFIELDS THAT WERE USED DURING THAT EXECUTION. I AM AWARE I COULD JUST USE A SIMPLE HEADER AND PUT MY NAMING CONVENTIONS BELOW THE HEADER USING COMMENTS BUT THAT IS NOT THE ROUTE I WANT TO TAKE. USING ONE PROGRAM IS A REQUEST FROM MANGEMENT, OTHERWISE I WOULD SAVE TWO PROGRAMS WITH DIFFERNT .LBL FILES.


    THIS IS MY CODE:


    Z1 =COMMENT/YESNO,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
    IS THIS FOR RECEIVING INSPECTION
    IF_GOTO/Z1.INPUT=="NO",GOTO = PRODUCTION
    RECEIVING =LABEL/
    Z2 =COMMENT/INPUT,NO,FULL SCREEN=NO,
    OPERATOR
    ASSIGN/V1=Z2.INPUT
    Z3 =COMMENT/INPUT,NO,FULL SCREEN=NO,
    MATERIAL NO.
    ASSIGN/V2=Z3.INPUT
    Z4 =COMMENT/INPUT,NO,FULL SCREEN=NO,
    BATCH NO.
    ASSIGN/V3=Z4.INPUT
    Z5 =COMMENT/INPUT,NO,FULL SCREEN=NO,
    MAT. DOC. NO.
    ASSIGN/V4=Z5.INPUT
    Z6 =COMMENT/INPUT,NO,FULL SCREEN=NO,
    SAMPLE NO.
    ASSIGN/V5=Z6.INPUT
    TRACEFIELD/NO_DISPLAY,LIMIT=15 ; OPERATOR : V1
    TRACEFIELD/NO_DISPLAY,LIMIT=8 ; MATERIAL NO. : V2
    TRACEFIELD/NO_DISPLAY,LIMIT=9 ; BATCH NO. : V3
    TRACEFIELD/NO_DISPLAY,LIMIT=10 ; MAT.DOC. NO. : V4
    TRACEFIELD/NO_DISPLAY,LIMIT=15 ; SAMPLE NO. : V5
    ASSIGN/U="_"
    ASSIGN/N=V3
    ASSIGN/S=Z3.INPUT+U+Z4.INPUT+U+Z5.INPUT+U+Z6.INPUT
    ASSIGN/PATH="T:\Shared\Quality_Engineering\CMM\Master\H-BLD_JOSH pc811\PCDMIS_2014\PRODUCTION"+N+""+S+".PDF"
    ASSIGN/PATH2="T:\Shared\Quality_Engineering\CMM\Master\H-BLD_JOSH pc811\PCDMIS_2014\PRODUCTION"+N
    CS1 =SCRIPT/FILENAME= T:\SHARED\QUALITY_ENGINEERING\CMM\MASTER\H-BLD_JOSH PC811\PCDMIS_2014\PC-DMIS SCRIPT\CREATE_FOLDER.BAS
    FUNCTION/Main,SHOW=YES,,
    STARTSCRIPT/
    ENDSCRIPT/
    GOTO/START
    PRODUCTION =LABEL/
    Z7 =COMMENT/INPUT,NO,FULL SCREEN=NO,
    OPERATOR
    ASSIGN/V6=Z7.INPUT
    Z8 =COMMENT/INPUT,NO,FULL SCREEN=NO,
    PROD. ORD. NO.
    ASSIGN/V7=Z8.INPUT
    Z9 =COMMENT/INPUT,NO,FULL SCREEN=NO,
    MAT. NO.
    ASSIGN/V8=Z9.INPUT
    Z10 =COMMENT/INPUT,NO,FULL SCREEN=NO,
    BATCH NO.
    ASSIGN/V9=Z10.INPUT
    Z11 =COMMENT/INPUT,NO,FULL SCREEN=NO,
    SAMPLE NO.
    ASSIGN/V10=Z11.INPUT
    TRACEFIELD/NO_DISPLAY,LIMIT=15 ; OPER : V6
    TRACEFIELD/NO_DISPLAY,LIMIT=10 ; PROD ORD # : V7
    TRACEFIELD/NO_DISPLAY,LIMIT=8 ; MATERIAL : V8
    TRACEFIELD/NO_DISPLAY,LIMIT=19 ; BATCH : V9
    TRACEFIELD/NO_DISPLAY,LIMIT=15 ; SAMPLE NO. : V10
    ASSIGN/U="_"
    ASSIGN/N=V9
    ASSIGN/S=Z9.INPUT+U+Z10.INPUT+U+Z8.INPUT+U+Z11.INPUT
    ASSIGN/PATH="T:\Shared\Quality_Engineering\CMM\Master\H-BLD_JOSH pc811\PCDMIS_2014\PRODUCTION"+N+""+S+".PDF"
    ASSIGN/PATH2="T:\Shared\Quality_Engineering\CMM\Master\H-BLD_JOSH pc811\PCDMIS_2014\PRODUCTION"+N
    CS2 =SCRIPT/FILENAME= T:\SHARED\QUALITY_ENGINEERING\CMM\MASTER\H-BLD_JOSH PC811\PCDMIS_2014\PC-DMIS SCRIPT\CREATE_FOLDER.BAS
    FUNCTION/Main,SHOW=YES,,
    STARTSCRIPT/
    ENDSCRIPT/
    START =LABEL/
    PRINT =LABEL/
    PRINT/REPORT,EXEC MODE=END,$
    TO_FILE=ON,OVERWRITE=PATH,AUTO OPEN REPORT=OFF,$
    TO_PRINTER=OFF,COPIES=1,$
    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
    REPORT_THEORETICALS=NONE,REPORT_FEATURE_WITH_DIMEN SIONS=NO,$
    TO_EXCEL_OUTPUT=OFF,
    PREVIOUS_RUNS=DELETE_INSTANCES






    SO IN SHORT IF THE OPERATOR ANSWERS "YES" FOR THE FIRST QUESTION I WANT THE FIRST SET OF TRACEFIELDS TO APPEAR IN THE HEADER. IF "NO" THEN THE SECOND SET TO APPEAR.

    THANKS IN ADVANCE FOR ANY HELP ON THIS TOPIC!!!
    Last edited by mcintyrej; 02-23-2020, 01:52 PM.

  • #2
    Hmm, the code you have above - it isn't working?

    Have you tried moving the tracefields code to the beginning of the program?
    PC-DMIS CAD++ 2o19 R1 SP11

    Comment


    • #3
      Its not working the way i thought it would.

      My cell expressions in my header file are labeled as such;

      Capture3.JPG

      Using tracefields is new to me so I have been experimenting with how they function. I assumed that if the operators answered "no" to the initial comment and the program jumped to "Production Label" it would recognize those tracefields executed as (1)-(5) and insert those naming conventions in the header upon generating the report. However, it still recognizes the first set of tracefields and places those in the header every time. I haven't tried moving the tracefields. If PCDMIS always recognizes the second set of tracefields as (6)-(10) is there another way to code it in the cell expression to achieve the end result i'm hoping for?

      Comment


      • #4
        Create two separate header labels (one for receiving one for production).

        In the rule tree for the report you can add a conditional expression evaluating Z1.INPUT and calling the appropriate label.

        Automettech - Automated Metrology Technology

        Comment


        • #5
          When adding in the conditional expression in the rule tree how would i format the expression? I've never used the rule tree before so its a learning experience for me. I tried this and it did not work, the report generated with no header.


          Rules Tree Editor.JPG



          Rules Tree Editor.JPG

          Comment


          • #6
            I may have made an assumption here (sorry I was too busy to test it).

            You may need to (in your program)

            ASSIGN/REP_TYPE=Z1.INPUT

            then modify the conditional expression to

            IF VARIABLE("REP_TYPE")=="YES" Then Use Template "FILE_HEADE_RECEIVING.lbl"


            Again I've not tested this so sorry if I'm wasting your time.

            If it doesn't work I have another method but it's not quite as slick.

            Automettech - Automated Metrology Technology

            Comment


            • #7
              No luck with the method above

              It places the "Receiving" header file at the top no matter which portion is executed.

              Thank you for taking the time to give some input, it is much appreciated!


              This is how i input the conditional expression, just wanted to make sure its not something i am inputting wrong:

              RULES TREE EDITOR ..JPG

              Comment


              • #8
                TO access a pc-dmis assignment in the reporting expression language use the VARIABLE function

                If VARIABLE("REP_TYPE")=="R" Then ...
                Automettech - Automated Metrology Technology

                Comment


                • mcintyrej
                  mcintyrej commented
                  Editing a comment
                  Got busy and didn’t have a chance to test this before I left today. I’ll test it in the morning and give an update. Thanks again for your help!

              • #9
                What if you set the tracefields with if/else statements....Then Tracefield2 could be filled by Z2 when 'R' is selected and Z7 when 'P' is selected:
                duplicate as little as possible for your input boxes.

                When looking through, it appears like you're really just trying to change the save location. You probably don't need 2 sets of tracefields to work through. You can change the save location with If/else statements just as well based on the 'R' and 'P' selections.

                HTH

                Comment


                • mcintyrej
                  mcintyrej commented
                  Editing a comment
                  I haven’t tried using if/else statements yet. This project came about because my company has decided to start retaining all CMM data electronically for Production as well as Receiving Insp. We will have a dedicate server for this so the save location will be the same. The assignments in my code before the script file are used in conjunction with the script and print command to create/name a folder in the directory as well as name the pdf and place it in the folder created upon execution. The operators will be scanning from a shop order to obtain the data necessary for each input comment. The naming conventions scanned on orders which will maintain traceability are different depending on where the program is used. The outliers being Receiving Insp. has a Mat. Doc. Number and Production has a Prod. Order Number. These are both Unique Identifiers for our traceability. Each input comment will also have conditional formatting to make sure the operators can not scan the wrong data.

                • R2ah1ze1l
                  R2ah1ze1l commented
                  Editing a comment
                  mcintyrej :
                  Instead of using tracefield, you can enter variable names to your label locations. Then in program it would become something like:

                  Code:
                  $$ NO,
                  
                  SELECTION_1  =LABEL/
                  PROJECT      =COMMENT/INPUT,NO,FULL SCREEN=NO,
                                What inspection to perform?
                  
                                Recieving
                                Production
                  
                                Must pick from the option above 
                                IF_GOTO/PROJECT.INPUT=="Recieving" OR PROJECT.INPUT=="Production",GOTO = FILL_TRACE
                                COMMENT/OPER,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
                                You must enter 1 of the required texts properly to continue.
                              GOTO/SELECTION_1
                    $$ NO,
                  
                  FILL_TRACE   =LABEL/
                                IF/PROJECT.INPUT=="Recieving"
                                  ASSIGN/TRACE3_TITLE="Recieving Inspection"
                                  ASSIGN/TRACE3_FILL=BATCH.INPUT
                                END_IF/
                                IF/PROJECT.INPUT=="Production"
                                  ASSIGN/TRACE3_TITLE="Production Inspection"
                                  ASSIGN/TRACE3_FILL=BATCH.INPUT
                                END_IF/
                  This is still similar in nature to what was being attempted for the header, but now the conditions are handled in your program. You can adjust on the fly if a 3rd variation appears for 'In-process' or something. HTH

              • #10
                Instead of using tracefields I use variables in the header label
                Instead of using 1 cell with =tracefield(2) use 2 cells: = VARIABLE("NAME_2") and =VARIABLE("V2")

                In program:

                RECEIVING=LABEL\
                ASSIGN/NAME_2="MATERIAL NO. : "
                Z3=COMMENT/INPUT,NO,FULL SCREEN=NO
                MATERIAL NO.
                ASSIGN/V2=Z3.INPUT

                PRODUCTION=LABEL/
                ASSIGN/NAME_2="PROD ORD # : "
                Z8=COMMENT/INPUT,NO,FULL SCREEN=NO
                PROD ORD NO
                ASSIGN/V2=Z8.INPUT

                Keeping 1 cell:

                In header label:
                =VARIABLE("EXPRESSION_1")

                Extra in program:
                ASSIGN/EXPRESSION_1=NAME_2 + V2
                Last edited by Martijn; 02-27-2020, 03:00 AM.

                Comment

                Related Topics

                Collapse

                Working...
                X