hexagon logo

Get current tip position to variable in PC-DMIS

I need the current tip position to variable for safety reasons in PC-DMIS.

I know, that the current tip position is shown in the status bar.

But I would like to calculate automatically with the values of the tip.

Do any of you know a way to transfer the current position of the tip into a variable?

I thank you in advance

Parents Reply Children
  • I was also playing with this, and it is essentially giving you the X, Y, Z of the last hit of the feature you measured. If you have avoidance moves, clearplanes or move increments after features this won't truly be your probe tip's X, Y, and Z. But this was definitely on my radar. I tested it and it did not update the X, Y, Z after any move commands. This could still work, so long as you know that it's the last position the probe physically touched the part. Readpoint is more accurate like Dismas said, because it gets active probe tip location, and doesn't need to move or touch anything to acquire it.

  • yep, you're right, mine updates, but randomly. 

  • It's actually quite frustrating, because you can get the Tip A angle, B angle, IJK, and last parameter "Angle", but you cannot get the XYZ. If there is a secret way to find the X, Y, and Z this way please share. These are displayed in the status window. So I feel like there IS a way.

                TIP/T1A0B0, SHANKIJK=0, 0, 1, ANGLE=0
                ASSIGN/V1=GETCOMMAND("Set Active Tip", "UP",1)
                ASSIGN/WRIST=GETTEXT(3, "TOP", V1)
                ASSIGN/TIPI=GETTEXT(229, "TOP", V1)
                ASSIGN/TIPJ=GETTEXT(230, "TOP", V1)
                ASSIGN/TIPK=GETTEXT(231, "TOP", V1)
                ASSIGN/TIPANG=GETTEXT(38, "TOP", V1)
                COMMENT/REPT,
                "Active Tip is " +WRIST+ " ShankIJK is " +TIPI+","+TIPJ+","+TIPK+" and angle is " +TIPANG

  • There is a way, but it involves scripting. The object model includes a "machine" object. You would have to create an instance of that class and monitor the Readout Event. It just doesn't seem to be exposed to the pc-dmis program itself. If you were automating, however, and responding already to application events, you could always add that in.

  • This in the program ...

    ASSIGN/CURRENTPOSITION=MPOINT(0,0,0)
    A3         =ALIGNMENT/START,RECALL:STARTUP,LIST=YES
                  ALIGNMENT/TRANS_OFFSET,XAXIS,25
                  ALIGNMENT/TRANS_OFFSET,YAXIS,50
                  ALIGNMENT/ROTATE_OFFSET,30,ABOUT,YPLUS
                ALIGNMENT/END
                MOVE/POINT,NORMAL,<21.6506,50,12.5>
    CS1        =SCRIPT/FILENAME= "C:\PATH_TO_SCRIPTS\FINDPOSITION.BAS"
                FUNCTION/Main,SHOW=YES,ARG1="A3",ARG2="CURRENTPOSITION",,
                STARTSCRIPT/
                COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
                CURRENTPOSITION.X

    This in the script ...

    Option Explicit
    
    Public pcdApp As Object
    Public pcdProgram As Object
    Public pcdMachine As Object
    Public pcdPointData As Object
    Public pcdAlignment As Object
    Public pcdMatrix As Object
    Public pcdCommands As Object
    
    Public PD As PointData
    
    Sub Main(Alignment As String, Assign As String)
    Set pcdApp = GetObject(Chr$(0), "PCDLRN.Application")
    Set pcdProgram = pcdApp.ActivePartProgram
    Set pcdCommands = pcdProgram.Commands
    Set pcdMachine = pcdProgram.ActiveMachine
    Set pcdPointData = pcdMachine.ProbePosition
    Set pcdAlignment = pcdProgram.Commands(Alignment)
    Set pcdMatrix = pcdAlignment.AlignmentCommand.CadToPartMatrix
    
    pcdMatrix.TransformDataForward pcdPointData, 0&, 0&
    
    Set PD = pcdPointData
    
    Dim pcdCommand As Object
    For Each pcdCommand In pcdCommands
      If pcdCommand.Type = 195 Then
        If pcdCommand.GetText(133, 0) = Assign Then
          pcdCommand.PutText "MPOINT(" & PD.X & "," & PD.Y & "," & PD.Z & ")", 134, 0
          pcdCommand.ReDraw
          Exit For
        End If
      End If
    Next
    
    Set pcdMatrix = Nothing
    Set pcdAlignment = Nothing
    Set pcdPointData = Nothing
    Set pcdCommands = Nothing
    Set pcdMachine = Nothing
    Set pcdProgram = Nothing
    Set pcdApp = Nothing
    End Sub

    The script will fill the variable passed as the second argument with the current probe position in the alignment passed as the first argument.