hexagon logo

Writing probe values

Hi all,
Is it possible to change diameter or offset values of a probe with a code ? (instead of open the probe window / edit / write the values).
Ok, it seems to be dangerous, but it could be useful..... Nauseated face
  • Here's some "proof of concept" code to show it can be done (tested offline). I was able to call this script from a program during execution (offline) - at the end of the program the tip was modified. Would definitely need online testing to verify that the modifications took effect during program execution. And of course, you'll need to arrange things so they work for what you have in mind.

    Sub[SIZE=2][COLOR=#000000] Main()[/COLOR]
    [/SIZE]Dim pcd As Object
    Dim prg As Object
    Dim pd As Object
    Dim diam As Double
    Dim tip As Object
     
    Set pcd = CreateObject("pcdlrn.application", "")
    Set pd = new pcdlrn.pointdata
    Set prg = pcd.ActivePartProgram
    prg.Probes.Visible = False
    Set tip = prg.Probes("STA6").Tips("T1A0B0")
    'Get tip data
    Set pd = tip.MeasXYZ
    diam = tip.MeasDiam
    'Change tip data
    pd.X = pd.X + 0.001
    pd.Y = pd.Y + 0.002
    pd.Z = pd.Z + 0.003
    diam = diam + 0.004
    'Write tip data And save changes
    Set prg.Probes("STA6").Tips("T1A0B0").MeasXYZ = pd
    prg.Probes("STA6").Tips("T1A0B0").MeasDiam = diam
    prg.Probes.SaveChanges
    EndSub
  • As djams says yes it is - It's a technique I'm trying as a workaround for the issues with the qualify and qualify2 methods of the automation language.


    Basically I delete all unwanted tips from the probe file (but store the data from them first)
    Calibrate the remaining ones
    Then add the deleted one back in
  • JEFMAN - I knocked this out in a hurry yesterday. Today I noticed that there is some code that I'd change to make it cleaner.

    From:
    'Write tip data And save changes
    Set prg.Probes("STA6").Tips("T1A0B0").MeasXYZ = pd
    prg.Probes("STA6").Tips("T1A0B0").MeasDiam = diam
    prg.Probes.SaveChanges
    


    To:
    'Write tip data And save changes
    Set tip.MeasXYZ = pd
    tip.MeasDiam = diam
    prg.Probes.SaveChanges

  • Basically I delete all unwanted tips from the probe file (but store the data from them first)
    Calibrate the remaining ones
    Then add the deleted one back in


    Heads up - I was unable to write modified data to uncalibrated tips. When you add the deleted tips back - they may be flagged as uncalibrated.
  • Heads up - I was unable to write modified data to uncalibrated tips. When you add the deleted tips back - they may be flagged as uncalibrated.


    Thanks - I noticed the last one added showed as uncalibrated, but as soon as I clicked off it in the tip list the * disappeared and it all looked okay.
  • Thanks - I noticed the last one added showed as uncalibrated, but as soon as I clicked off it in the tip list the * disappeared and it all looked okay.


    Good to know.

    Sent from my SM-G900P using Tapatalk
  • Thanks again DJAMS !
    I "played" with the code, it works fine ! I'm happy to use "reset to theo values" to find some values close to start one Slight smile !
    Now, don't forget it's friday... Happy week-end, all !!!!!