hexagon logo

Detect presence of articulating probe head (and probe type also)

I'm trying to write a subroutine that I can call to have my CMMs run a quick check on a ring gage with tip 1. I want to be able to use the same subroutine on any machine, regardless of wether it has a Tesastar-m probe head, or a probe fixed to the quill. I'll add some other safe guards later to check the vector and diameter of the tip, incase it's pointing sideways or is a large disc and won't fit in the small ring gage.

To accomplish this, I think I need to test ifthere is a wrist present on the machine so I know to set the tip command to "TIP1" or "T1A0B0". I have a Basic script that can report what type of probe is in use, so I can easily tell if I'm using an LSP-X1s or X1c, and therefore, if there is an articulating probehead. However, I'd like to make the script robust enough so if I have, say an SP25 (which our sister company has), it can tell if its "quill-mounted" with a PH6M or on a probe head such as a PH10 or Tesastar-m. Anyone have any recommendations?
Parents
  • I actually made some progress yesterday afternoon, but didn't see your post until this morning. This is what I've made so far, though passing a variable back into the program was giving me some grief:

    Sub Main
    	CHECKBUSH
    End Sub
    
    Sub CHECKBUSH
    	'Declare local variables
    	Dim DmisApp As Object
    	Dim DmisPart As Object
    	Dim Probe As Object
    	Dim tempstr as String
    	Dim Var as Object
    
    
    	'Set application objects
    	Set DmisApp = CreateObject ("PCDLRN.Application")
    	Set DmisPart = DmisApp.ActivePartProgram
    	Set Probe = DmisPart.Probes(DmisPart.CurrentProbeName)
    	Set Var = DmisPart.GetVariableValue ("V1")
    	Var.LongValue = 0
    
    
    	'Iterate through probe components looking for probehead
    	For i = 0 to Probe.ConnectionCount() - 1
    
    		tempstr = Ucase(Probe.ConnectionDescription(i))
    
    		If InStr(1, tempstr, "TESASTAR_M") Then
    			Var.LongValue = 1
    			Exit For
    		ElseIf InStr(1, tempstr, "TESASTAR_SM") Then
    			Var.LongValue = 1
    			Exit For
    		ElseIf InStr(1, tempstr, "PH8") Then 
    			Var.LongValue = 1
    			Exit For
    		ElseIf InStr(1, tempstr, "PH9") Then
    			Var.LongValue = 1
    			Exit For
    		ElseIf InStr(1, tempstr, "PH10") Then
    			Var.LongValue = 1
    			Exit For
    		End If
    
    	Next
    
    	DmisPart.SetVariableValue "V1", Var
    	DmisPart.RefreshPart
    
    	'Clear objects
    	Set Var = Nothing
    	Set Probe = Nothing
    	Set DmisPart = Nothing
    	Set DmisApp = Nothing
    
    End Sub
    
Reply
  • I actually made some progress yesterday afternoon, but didn't see your post until this morning. This is what I've made so far, though passing a variable back into the program was giving me some grief:

    Sub Main
    	CHECKBUSH
    End Sub
    
    Sub CHECKBUSH
    	'Declare local variables
    	Dim DmisApp As Object
    	Dim DmisPart As Object
    	Dim Probe As Object
    	Dim tempstr as String
    	Dim Var as Object
    
    
    	'Set application objects
    	Set DmisApp = CreateObject ("PCDLRN.Application")
    	Set DmisPart = DmisApp.ActivePartProgram
    	Set Probe = DmisPart.Probes(DmisPart.CurrentProbeName)
    	Set Var = DmisPart.GetVariableValue ("V1")
    	Var.LongValue = 0
    
    
    	'Iterate through probe components looking for probehead
    	For i = 0 to Probe.ConnectionCount() - 1
    
    		tempstr = Ucase(Probe.ConnectionDescription(i))
    
    		If InStr(1, tempstr, "TESASTAR_M") Then
    			Var.LongValue = 1
    			Exit For
    		ElseIf InStr(1, tempstr, "TESASTAR_SM") Then
    			Var.LongValue = 1
    			Exit For
    		ElseIf InStr(1, tempstr, "PH8") Then 
    			Var.LongValue = 1
    			Exit For
    		ElseIf InStr(1, tempstr, "PH9") Then
    			Var.LongValue = 1
    			Exit For
    		ElseIf InStr(1, tempstr, "PH10") Then
    			Var.LongValue = 1
    			Exit For
    		End If
    
    	Next
    
    	DmisPart.SetVariableValue "V1", Var
    	DmisPart.RefreshPart
    
    	'Clear objects
    	Set Var = Nothing
    	Set Probe = Nothing
    	Set DmisPart = Nothing
    	Set DmisApp = Nothing
    
    End Sub
    
Children
No Data