Visual Basic |
---|
Public Property ActiveComponent As Long |
The following VB code illustrates how to create a probe containing a PH9, a TP2, and a 5 mm tip, from scratch in the active measurement routine.
Option Explicit
Dim DmisApp As PCDLRN.Application
Dim DmisPart As PCDLRN.PartProgram
Dim DmisProbes As PCDLRN.Probes
Dim DmisProbe As PCDLRN.probe
Dim DmisTips As PCDLRN.Tips
Dim DmisTip As PCDLRN.Tip
Sub BuildProbe()
Dim iCnt As Long
Dim sProbe As String
sProbe = "VGS102"
Set DmisApp = CreateObject("PCDLRN.Application")
If DmisApp Is Nothing Then
MsgBox ("DmisApp is Nothing")
Exit Sub
End If
Set DmisPart = DmisApp.ActivePartProgram
If DmisPart Is Nothing Then
MsgBox ("DmisPart is Nothing")
Exit Sub
End If
Set DmisProbes = DmisPart.Probes
If DmisProbes Is Nothing Then
MsgBox ("DmisProbes is Nothing")
Exit Sub
End If
DmisPart.Probes.Add (sProbe)
Set DmisProbe = DmisProbes.Item(sProbe)
If DmisProbe Is Nothing Then
MsgBox ("DmisProbe is Nothing")
Exit Sub
End If
DmisProbe.ActiveComponent = 0
DmisProbe.ActiveConnection = 0
For iCnt = 1 To DmisProbe.ComponentCount
If (DmisProbe.ComponentDescription(iCnt) = "PROBEPH9") Then
DmisProbe.ActiveComponent = iCnt
Exit For
End If
Next iCnt
For iCnt = 1 To DmisProbe.ComponentCount
If (DmisProbe.ComponentDescription(iCnt) = "PROBETP2") Then
DmisProbe.ActiveComponent = iCnt
Exit For
End If
Next iCnt
For iCnt = 1 To DmisProbe.ComponentCount
If (DmisProbe.ComponentDescription(iCnt) = "TIP5BY50MM") Then
DmisProbe.ActiveComponent = iCnt
Exit For
End If
Next iCnt
End Sub
Private Sub Command1_Click()
BuildProbe
End Sub