hexagon logo

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!!!
  • Hmm, the code you have above - it isn't working?

    Have you tried moving the tracefields code to the beginning of the program?
  • Its not working the way i thought it would.

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



    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?
  • 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.

  • 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.






  • 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.

  • No luck with the method above Confused

    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:

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

    If VARIABLE("REP_TYPE")=="R" Then ...
  • 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
  • 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!
  • 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.