Put a counter on the measurement routine?

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

  • Put a counter on the measurement routine?

    So, we are running PC-DMIS 2015 on our machines and have a front end program where we input the operator details, serial no.,etc and then execute the programs from there. I have been recently trying to save some time by doing only couple of features from the whole program and thus using IF/GOTO commands I have achieved that.

    So, now the operators gets an option every time he runs the program of either to run short program or full program, and he selects accordingly. However, we want to put a condition on the program that it shouldn't ask operator the 5th time and just run the full program after every 4 parts thus also resetting the counter to 0 for the next program to have an option to the operator for short or full program.

    Please let me know if you need more information understanding the question.

    P.S. I am posting for the first time

  • #2
    What does your front end look like? May be able to incorporate it in there.
    PcDmis 2015.1 SP10 CAD++
    Global 7-10-7 DC800S

    Comment


    • sim4191
      sim4191 commented
      Editing a comment
      That is from an outside supplier who wrote the programs in the first place and I don't think they will be changing that. The values from that are stored in a file and then that file is opened in the pcdmis to send the values to qc-calc.

      PS: Loved your picture.
      Last edited by sim4191; 12-07-2017, 07:50 AM.

  • #3
    At the beginning of the program after the variable for short or long program is entered, use file I/O commands to open a file and read the value into a variable if they've selected short version (pretend it's called V1). Evaluate that value, if it exceeds the number of times you want the short program to run (IF/V1>5), open the file for output using overwrite, write a zero to the file, close it, assign V1=0, then force program to run long program.

    At the end of the program, after the report, open the file for output, write V1+1 if it was short version, close file.

    Comment


    • sim4191
      sim4191 commented
      Editing a comment
      Thanks for your reply.
      Ok, please tell me if I have got everything right from what you said, there will be one text file from which 'V1' variable will get the value and check it if the value of 'V1' is less than 5, before the short/long program question so that I can make it skip over the question if the value is = 5 ?
      Then, after the question, if the value was indeed equal to 5, I should use write to file command to make the value of 'V1' to 0
      And then at the end of the program after the report, I should use file open and write again to increment the value of 'V1' by 1 and save it so that every time I run the program, the value will keep incrementing and ones it reaches 5, it will be changed to 0 after the question?

      Sorry, for the long message, just wanted to make it clear?
      Also, this is how my question looks like:

      C10 =COMMENT/YESNO,NO,FULL SCREEN=YES,AUTO-CONTINUE=NO,
      DO YOU WANT TO RUN SHORT PROGRAM?
      ASSIGN/SHORT1=IF(C10.INPUT=="YES",1+0,0+0)

      then I use the following command to skip over features:

      IF_GOTO/SHORT1==1,GOTO = SKIP_5212

      Please let me know if you have any questions for me.

  • #4
    Originally posted by RandomJerk View Post
    At the beginning of the program after the variable for short or long program is entered, use file I/O commands to open a file and read the value into a variable if they've selected short version (pretend it's called V1). Evaluate that value, if it exceeds the number of times you want the short program to run (IF/V1>5), open the file for output using overwrite, write a zero to the file, close it, assign V1=0, then force program to run long program.

    At the end of the program, after the report, open the file for output, write V1+1 if it was short version, close file.
    +1
    A separate text file will be the way to go.
    PC-DMIS 2016.0

    Jeff

    Comment


    • #5
      Something like this. There's a check at the beginning of the program (the V! assignment and nested IF that follow) to see if the file exists, then an opportunity to create it if it doesn't. The downside is the file name is hard coded, so if you use it and don't use the same file name you're evaluating.... the solution is to make sure you create the file where you want it and not use this option.

      Code:
      V1         =FILE/EXISTS,G:\qa\CMM\CMM_Programming_Files\Part123.txt
                  IF/V1==0
      C1           =COMMENT/INPUT,NO,FULL SCREEN=NO,
                    Enter file name for short program tracker
      FPTR         =FILE/OPEN,G:\qa\CMM\CMM_Programming_Files\Part123,WRITE
                    FILE/WRITELINE,FPTR,0
                    FILE/CLOSE,FPTR,KEEP
                  END_IF/
      FPTR       =FILE/OPEN,G:\qa\CMM\CMM_Programming_Files\Part123,READ
      V2         =FILE/READLINE,FPTR,
                  FILE/CLOSE,FPTR,KEEP
                  ASSIGN/SHORT1=IF(V2<5,1,0)
                  IF/SHORT1==1
      C2           =COMMENT/YESNO,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                    Do you want to run the short program?
                    IF/C2.INPUT=="NO"
                      ASSIGN/SHORT1=0
                    END_IF/
                  END_IF/
      $$ NO,
                  Run the program with the short1 evaluations wherever you want it
                  |
                  |
                  |
                  PRINT/REPORT,EXEC MODE=END,$
                    TO_FILE=OFF,AUTO=1,AUTO OPEN REPORT=OFF,$
                    TO_PRINTER=OFF,COPIES=1,$
                    TO_DMIS_REPORT=OFF,FILE_OPTION=INDEX,FILENAME=,$
                    REPORT_THEORETICALS=ALL,REPORT_FEATURE_WITH_DIMENSIONS=YES,$
                    TO_EXCEL_OUTPUT=OFF,
                    PREVIOUS_RUNS=DELETE_INSTANCES
                  ASSIGN/V3=IF(SHORT1==1,SHORT_COUNT+1,SHORT_COUNT)
      FPTR       =FILE/OPEN,G:\qa\CMM\CMM_Programming_Files\part123.txt,WRITE
                  FILE/WRITELINE,FPTR,V3
                  FILE/CLOSE,FPTR,KEEP

      Comment


      • sim4191
        sim4191 commented
        Editing a comment
        Thanks a lot for the help, really appreciate it.
    Working...
    X