Your Products have been synced, click here to refresh
Set app = CreateObject("PCDLRN.Application") Set part = app.ActivePartProgram Set prb = part.Probes(part.CurrentProbeName) For I = 0 To prb.ConnectionCount prb.ActiveConnection = I For J = 0 To prb.ComponentCount Debug.Print I, J, prb.ConnectionDescription(I), prb.ComponentDescription(J) Next Next
0 0 PROBEPH10MQ 1mm_FIXEDBALLwithSTEM 0 1 PROBEPH10MQ 25.41-BT40(Shank) 0 2 PROBEPH10MQ 25.41-BT50(Shank) 0 3 PROBEPH10MQ 25.41-CAT40(Shank) 0 4 PROBEPH10MQ 25.41-CAT50(Shank) 0 5 PROBEPH10MQ 25.41-HDR(Body) 0 6 PROBEPH10MQ 25.41-HSK100A(Shank) 0 7 PROBEPH10MQ 25.41-HSK63A(Shank) 0 8 PROBEPH10MQ 25.44-TMPHDR(Body) 0 9 PROBEPH10MQ 2mm_FIXEDBALL 0 10 PROBEPH10MQ 2mm_FIXEDBALLwithSTEM 0 11 PROBEPH10MQ 30mm_FIXEDBALLwithSTEM 0 12 PROBEPH10MQ 3mm_FIXEDBALL 0 13 PROBEPH10MQ 3mm_FIXEDBALLwithSTEM 0 14 PROBEPH10MQ 40.00-BT30(Shank) 0 15 PROBEPH10MQ 40.00-BT40(Shank) 0 16 PROBEPH10MQ 40.00-CAT40(Shank) 0 17 PROBEPH10MQ 40.00-HSK40E-36-TI-V1(ThermoBlockShank)) 0 18 PROBEPH10MQ 40.00-HSK40E-L36(Shank)
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
Dim DmisApp As Object Dim DmisPart As Object Dim Commands as Object Sub Main OpenPCDMISConnection GetProbeData ClosePCDMISConnection End Sub Sub OpenPCDMISConnection 'Populate Application Objects Set DmisApp = CreateObject ("PCDLRN.Application") Set DmisPart = DmisApp.ActivePartProgram Set Commands = DmisPart.Commands End Sub Sub ClosePCDMISConnection 'Destroy Application Objects Set Commands = Nothing Set DmisPart = Nothing Set DmisApp = Nothing End Sub Sub GetProbeData 'Returns information regarding probe and probe head 'Sets OptionProbe parameters for analog probes 'Declare Local Variables Dim Probe As Object Dim ProbeHeadVar as Object Dim ScanningEnabled as Object Dim tempstr as String Dim temp as string 'Populate Local Objects Set Probe = DmisPart.Probes(DmisPart.CurrentProbeName) Set ProbeHeadVar = DmisPart.GetVariableValue ("V1") ProbeHeadVar.LongValue = 0 Set ScanningEnabled = DmisPart.GetVariableValue ("V9") ScanningEnabled.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 ProbeHeadVar.LongValue = 1 Exit For ElseIf InStr(1, tempstr, "TESASTAR_SM") Then ProbeHeadVar.LongValue = 1 Exit For ElseIf InStr(1, tempstr, "PH8") Then ProbeHeadVar.LongValue = 1 Exit For ElseIf InStr(1, tempstr, "PH9") Then ProbeHeadVar.LongValue = 1 Exit For ElseIf InStr(1, tempstr, "PH10") Then ProbeHeadVar.LongValue = 1 Exit For End If Next For j = 0 to Probe.ConnectionCount() - 1 tempstr = Ucase(Probe.ConnectionDescription(j)) If InStr(1, tempstr, "SP25") Then 'msgbox "Probe Type: SP25" SetOptProbeParams(1) ScanningEnabled.LongValue = 1 Exit For ElseIf InStr(1, tempstr, "SP600") Then 'msgbox "Probe Type: SP600" SetOptProbeParams(2) ScanningEnabled.LongValue = 1 Exit For ElseIf InStr(1, tempstr, "SP80") and Not InStr(1, tempstr, "SP80_") Then 'msgbox "Probe Type: SP80" SetOptProbeParams(3) ScanningEnabled.LongValue = 1 Exit For ElseIf InStr(1, tempstr, "LSPX1S") Then 'msgbox "Probe Type: LSP-X1s/c" SetOptProbeParams(4) ScanningEnabled.LongValue = 1 Exit For ElseIf InStr(1, tempstr, "LSPX1C") Then 'msgbox "Probe Type: LSP-X1s/c" SetOptProbeParams(4) ScanningEnabled.LongValue = 1 Exit For ElseIf InStr(1, tempstr, "LSPX1M") Then 'msgbox "Probe Type: LSP-X1m/e" SetOptProbeParams(5) ScanningEnabled.LongValue = 1 Exit For ElseIf InStr(1, tempstr, "LSPX1E") Then 'msgbox "Probe Type: LSP-X1m/e" SetOptProbeParams(5) ScanningEnabled.LongValue = 1 Exit For ElseIf InStr(1, tempstr, "LSPX3") or InStr(1, tempstr, "LSPX5") Then 'msgbox "Probe Type: LSP-X3/X5" SetOptProbeParams(6) ScanningEnabled.LongValue = 1 Exit For Else End If Next 'Set PC-DMIS part program variable values DmisPart.SetVariableValue "V1", ProbeHeadVar DmisPart.SetVariableValue "V9", ScanningEnabled DmisPart.RefreshPart 'Clear Local Objects Set ProbeHeadVar = Nothing Set Probe = Nothing End Sub Sub SetOptProbeParams(ProbeType as integer) 'Sets OptionProbe parameters for analog probes 'Declare Local Application Objects Dim cmds as Object Dim cmd as Object 'Declare Local Variables Dim MaxForce as Object, LowerForce as Object, UpperForce as Object Dim TriggerForce as Object, ReturnSpeed as Object, ScanOffsetForce as Object Dim TouchSpeed as Object 'Populate Local Application Objects Set cmds = DmisPart.Commands 'Populate Local Variables Set MaxForce = DmisPart.GetVariableValue ("V2") Set LowerForce = DmisPart.GetVariableValue ("V3") Set UpperForce = DmisPart.GetVariableValue ("V4") Set TriggerForce = DmisPart.GetVariableValue ("V5") Set ReturnSpeed = DmisPart.GetVariableValue ("V6") Set ScanOffsetForce = DmisPart.GetVariableValue ("V7") Set TouchSpeed = DmisPart.GetVariableValue ("V8") 'Populate Local Variables Select Case ProbeType Case 1 'Set parameters for SP25 MaxForce.DoubleValue = 0.15 LowerForce.DoubleValue = 0.025 UpperForce.DoubleValue = 0.075 TriggerForce.DoubleValue = 0.05 ReturnSpeed.DoubleValue = 1.0 ScanOffsetForce.DoubleValue = 0.05 TouchSpeed.DoubleValue = 4 Case 2 'Set parameters for SP600 MaxForce.DoubleValue = 0.36 LowerForce.DoubleValue = 0.06 UpperForce.DoubleValue = 0.18 TriggerForce.DoubleValue = 0.12 ReturnSpeed.DoubleValue = 1.0 ScanOffsetForce.DoubleValue = 0.12 TouchSpeed.DoubleValue = 5 Case 3 'Set parameters for SP80 MaxForce.DoubleValue = 0.6 LowerForce.DoubleValue = 0.04 UpperForce.DoubleValue = 0.16 TriggerForce.DoubleValue = 0.1 ReturnSpeed.DoubleValue = 0.6 ScanOffsetForce.DoubleValue = 0.2 TouchSpeed.DoubleValue = 4 Case 4 'Set parameters for LSP-X1s/c MaxForce.DoubleValue = 0.072 LowerForce.DoubleValue = 0.0096 UpperForce.DoubleValue = 0.048 TriggerForce.DoubleValue = 0.015 ReturnSpeed.DoubleValue = 0.4 ScanOffsetForce.DoubleValue = 0.036 TouchSpeed.DoubleValue = 2 Case 5 'Set parameters for LSP-X1m/e MaxForce.DoubleValue = 0.036 LowerForce.DoubleValue = 0.0048 UpperForce.DoubleValue = 0.024 TriggerForce.DoubleValue = 0.01 ReturnSpeed.DoubleValue = 0.4 ScanOffsetForce.DoubleValue = 0.018 TouchSpeed.DoubleValue = 2 Case 6 'Set parameters for LSP-X3c/t & LSP-X5 MaxForce.DoubleValue = 0.5 LowerForce.DoubleValue = 0.04 UpperForce.DoubleValue = 0.25 TriggerForce.DoubleValue = 0.15 ReturnSpeed.DoubleValue = 0.4 ScanOffsetForce.DoubleValue = 0.2 TouchSpeed.DoubleValue = 2 Case 7 Case 8 Case 9 End Select 'Set PC-DMIS part program variable values DmisPart.SetVariableValue "V2", MaxForce DmisPart.SetVariableValue "V3", LowerForce DmisPart.SetVariableValue "V4", UpperForce DmisPart.SetVariableValue "V5", TriggerForce DmisPart.SetVariableValue "V6", ReturnSpeed DmisPart.SetVariableValue "V7", ScanOffsetForce DmisPart.SetVariableValue "V8", TouchSpeed End Sub
$$ NO, Declare variables ASSIGN/V1=0 ASSIGN/V2=0 ASSIGN/V3=0 ASSIGN/V4=0 ASSIGN/V5=0 ASSIGN/V6=0 ASSIGN/V7=0 ASSIGN/V8=0 ASSIGN/V9=0 $$ NO, Determine probe and probehead type CS1 =SCRIPT/FILENAME= PROBEPARAMS.BAS FUNCTION/Main,SHOW=YES,, STARTSCRIPT/ $$ NO, Set active tip, enabling/disabling articulating probe head IF/V1==1 ASSIGN/V10="T1A0B0" END_IF/ IF/V1==0 ASSIGN/V10="TIP1" END_IF/ TIP/V10, SHANKIJK=0, 0, 1, ANGLE=0 $$ NO, Set OPTIONPROBE parameters OPTIONPROBE/MAXFORCE=V2,LOWFORCE=V3,UPPERFORCE=V4,TRIGGERFORCE=V5, PROBEACCURACY=0.1,POSACCURACY=0.1,#RETURNDATA=7, RETURNSPEED=V6,SCANPNTDENSITY=2, SCANACCELERATION=10,SCANOFFSETFORCE=V7, PROBINGMODE=DFL,MANFINEPROBING=NO MOVESPEED/ 100 TOUCHSPEED/ V8 SCANSPEED/5 PREHIT/0.05 RETRACT/0.05
$$ NO,
Set active tip, enabling/disabling articulating probe head
IF/V1==1
ASSIGN/V10="T1A0B0"
END_IF/
IF/V1==0
ASSIGN/V10="TIP1"
END_IF/
TIP/V10, SHANKIJK=0, 0, 1, ANGLE=0
ASSIGN/WHATPROBE=GETSETTING("PH9 PRESENT") IF/WHATPROBE==1 ASSIGN/TNAME="T1A0B0" END_IF/ IF/WHATPROBE==0 ASSIGN/TNAME="TIP1" END_IF/ LOADPROBE/PROBE_83715-XXX TIP/TNAME, SHANKIJK=0, 0, 1, ANGLE=0
© 2024 Hexagon AB and/or its subsidiaries. | Privacy Policy | Cloud Services Agreement |