Have mutiple SPC directories within 1 program.

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

  • jaymunday
    started a topic Have mutiple SPC directories within 1 program.

    Have mutiple SPC directories within 1 program.

    So I have to write a macro CMM program where 1 program will be used to measure numerous different part numbers. Every part number is a little bit different that the other. My issue is data collection. I will be using QC.Calc to record data & report real time run charts at the CMM. I need to have a separate QCCALC file for each part #. How do I do this when I am only writing 1 CMM program. Usually your QCCALC file is named whatever your CMM program is named in the top left corner of the CMM program. I need to make that name changeable. Anyone have any idea????


    Will be using the newest version of PCDMIS
    Will be using QC.Calc real time for SPC collection.

  • BKulpa
    commented on 's reply
    Saw your script last week and thought it would be useful.
    Put into action this morning.

  • mrnoname
    replied
    I use the tracefield command in the code below to do this. You will have to change the file name where the red X's are. I have programs where there are 5 or more parts in the same program and just use this to toggle between them.

    Code:
    TRACEFIELD/NO_DISPLAY,LIMIT=20 ; DBSWITCH : XXXXXX

    Leave a comment:


  • Thiyagu_Raj
    replied
    here is the sample Code and Script

    Code:
    C1         =COMMENT/INPUT,NO,FULL SCREEN=NO,
                Ener Serial Number to Select Part.....
    
                            1.) 111111
                            2.) 222222
                            3.) 333333
    
    
                SELECT/C1.INPUT
                  CASE/1
                    ASSIGN/PART_NUM="111111"
                    ASSIGN/PART_DES="XXXXXX"
                  END_CASE/
                  CASE/2
                    ASSIGN/PART_NUM="222222"
                    ASSIGN/PART_DES="YYYYYY"
                  END_CASE/
                  CASE/3
                    ASSIGN/PART_NUM="333333"
                    ASSIGN/PART_DES="ZZZZZZ"
                  END_CASE/
                END_SELECT/
    Code:
    Sub main()
    Dim Prg As Object
    Dim PartProgram As Object
    Set Prg = CreateObject("pcdlrn.application")
    Set PartProgram = Prg.activepartprogram
    Dim Cmds As Object
    Set Cmds = PartProgram.Commands
    Dim Cmd As Object
    
    
    
    '___________________________________________________
    
    Set partname = PartProgram.GetVariableValue("PART_DES")
    strpartname = partname.stringvalue
    PartProgram.partname   = strpartname
    '___________________________________________________
    
    
    Set Partnum = PartProgram.GetVariableValue("PART_NUM")
    strPartNum = PartNum.stringvalue
    PartProgram.SERIALNUMBER = strPartNum
    
    '___________________________________________________
    End Sub

    Leave a comment:


  • SABarber
    replied
    Probably create/execute a script that changes the name in the header based on input before executing the stats on command?
    how is the current stats output generate?

    Leave a comment:


  • InspectorJester
    replied
    I don't know about that.
    However I do believe that you could create one program with an operator comment, flow control, and File/IO commands to run one program, that in turn runs any program you want.

    Otherwise, you would have to use File/IO commands to rename the file to whatever it is you want.

    EDIT:
    E.g. Save it in a single directory, with a single name.
    Have a File/Copy command at the bottom to copy the created QC-Calc file to the new location with the new name
    Have a File/Delete command below that to delete the original, bogus file

    Leave a comment:

Related Topics

Collapse

Working...
X