Methods
About this topic
The topic describes the following methods:
Abort
Close
Ignore
Jog
Retry
Abort
long Abort(void)
Description
Aborts a current task that is in the error state and clears the error.
Parameters
None
Return
0 if successful
Other value if there was an error
Visual C++ example
long lres = m_Minihub.Abort();
Visual Basic .NET example
Dim ires as Integer
ires = Minihub1.Abort()
AboutBox
void AboutBox(void)
Description
Displays the Labware MiniHub About dialog box that contains the ActiveX version number.
Parameters
None
Return
None
Visual C++ example
m_Minihub.AboutBox();
Visual Basic .NET example
Minihub1.AboutBox()
Close
long Close(void)
Description
Closes the intialized Labware MiniHub profile and disconnects from the Labware MiniHub.
Parameters
None
Return
0 if successful, and fires the CloseComplete event
Other value if there was an error
Visual C++ example
long lres = m_Minihub.Close();
Visual Basic .NET example
Dim ires as Integer
ires = Minihub1.Close()
DisableMotor
long DisableMotor(void)
Description
Turns off the MiniHub’s motor.
Parameters
None
Return
0 if successful, and fires the DisableMotorComplete event
Other value if there was an error
Visual C++ example
long lres = m_Minihub.DisableMotor();
Visual Basic .NET example
Dim ires as Integer
ires = Minihub1.DisableMotor()
EnableMotor
long EnableMotor(void)
Description
Turns on the MiniHub’s motor.
Parameters
None
Return
0 if successful, and fires the EnableMotorComplete event
Other value if there was an error
Visual C++ example
long lres = m_Minihub.EnableMotor();
Visual Basic .NET example
Dim ires as Integer
ires = Minihub1.EnableMotor()
EnumerateProfiles
VARIANT EnumerateProfiles(void)
Description
Retrieves a list of defined profiles. The strings in this array are the profile names that should be used for the Initialize method.
Parameters
None
Return
An array of profile names
Visual C++ example
VARIANT vProfiles = m_Minihub.EnumerateProfiles();
SAFEARRAY *psa = vProfiles.parray;
BSTR* bstrArray;
if
(FAILED(SafeArrayAccessData(psa,reinterpret_cast<void**>( &bstrArray))))
{
VariantClear(&vProfiles);
return;
}
for (ULONG i = 0; i < psa->rgsabound[0].cElements; i++)
{
MessageBox(CString(bstrArray[i])));
}
SafeArrayUnaccessData(psa);
VaraintClear(&vProfiles);
 
Visual Basic .NET example
Dim i as Integer
Dim profileNames() As String
profileNames = Minihub1.EnumerateProfiles()
For i = 0 To profileNames.GetLength(0) - 1
MsgBox profileNames(i)
Next
GetActiveXVersion
BSTR GetActiveXVersion(void)
Description
Retrieves the MiniHub ActiveX software version number.
Parameters
None
Return
ActiveX software version number (string)
Visual C++ example
CString ActiveXVer = m_Minihub.GetActiveXVersion();
Visual Basic .NET example
Dim sVersion As String
sVersion = Minihub1.GetActiveXVersion()
GetCassetteCount
long GetCassetteCount(short *nCassetteCount)
Description
Retrieves the cassette count.
Note: In this version, the cassette count is always 4.
Parameters
short *nCassetteCount
Cassette count value
Return
0 if successful, and fires the GetCassetteCountComplete event
Other value if there was an error
Visual C++ example
short ncassettes;
long lres = m_Minihub.GetCassetteCount(&ncassettes);
Visual Basic .NET example
Dim ires as Integer
Dim shCassCount As Short = 0
ires = Minihub1.GetCassetteCount(shCassCount)
GetCurrentCassette
long GetCurrentCassette(short* nCassetteIndex)
Description
Retrieves the ID of the cassette that is currently at the home position.
Parameters
short* nCassetteIndex
The ID of the cassette that is currently at the MiniHub’s home position
Return
0 if successful, and fires the GetCurrentCassetteComplete event
Other value if there was an error
Visual C++ example
short curcas;
long lres = m_Minihub.GetCurrentCassettePosition(&curcas);
Visual Basic .NET example
Dim ires as Integer
Dim shCassette As Short = 0
ires = Minihub1.GetCurrentCassette(shCassette)
GetCurrentPosition
long GetCurrentPosition(float* fPositionInDegree)
Description
Retrieves the MiniHub’s current position.
Parameters
float* fPositionInDegree
The current position (0–360) in degrees
Return
0 if successful, and fires the GetCurrentPositionComplete event
Other value if there was an error
Visual C++ example
short curpos;
long lres = m_Minihub.GetCurrentPosition(&curpos);
Visual Basic .NET example
Dim ires as Integer
Dim siPos As Single = 0
ires = Minihub1.GetCurrentPosition(siPos)
GetFirmwareVersion
BSTR GetFirmwareVersion(void)
Description
Retrieves the Agile controller firmware version number.
Parameters
None
Return
Agile controller version number (string)
Visual C++ example
CString str = m_Minihub.GetFirmwareVersion ();
Visual Basic .NET example
Dim sFirmVer As Strings
sFirmVer = Minihub1.GetFirmwareVersion()
GetHomePositionOffset
long GetHomePositionOffset(float* fPosition)
Description
Retrieves the MiniHub’s home position offset, which is the encoder counter value.
Parameters
float* fPosition
The home position offset value
Return
0 if successful, and fires the GetHomePositionOffsetComplete event
Other value if there was an error
Visual C++ example
float homepos;
long lres = m_Minihub.GetHomePositionOffset(&homepos);
Visual Basic .NET example
Dim ires as Integer
Dim siOffset As Single
ires = Minihub1.GetHomePositionOffset(siOffset)
GetLastError
BSTR GetLastError(void)
Description
Retrieves the last known error condition.
Parameters
None
Return
An error string
Visual C++ example
CString str = m_Minihub.GetLastError();
Visual Basic .NET example
Dim sError As String = ""
sError = Minihub1.GetLastError()
GetMotorStatus
long GetMotorStatus(VARIANT_BOOL* bServoStatus)
Description
Checks to see whether the motor is on.
Parameters
VARIANT_BOOL* bServoStatus
The state of the motor:
VARIANT_TRUE (C++) or True (Visual Basic .NET) if motor is on
VARIANT_FALSE (C++) or False (Visual Basic .NET) if motor is off
Return
0 if successful, and fires the GetMotorStatusComplete event
Other value if there was an error
Visual C++ example
VARIANT_BOOL ismotoron;
long lres = m_Minihub.GetMotorStatus(&ismotoron);
Visual Basic .NET example
Dim ires as Integer
Dim bMotorStatus As Boolean
ires = Minihub1.GetMotorStatus(bMotorStatus)
GetSlotCount
long GetSlotCount(short *nSlotCount)
Description
Retrieves the slot count (the total number of slots in a cassette).
Parameters
short *nSlotCount
The slot count value
Return
0 if successful, and fires the GetSlotCountComplete event
Other value if there was an error
Visual C++ example
short nslots;
long lres = m_Minihub.GetSlotCount(&nslots);
Visual Basic .NET example
Dim ires as Integer
Dim shSlots As Short
ires = Minihub1.GetSlotCount(shSlots)
GetSpeed
long GetSpeed(short* pSpeed);
Description
Retrieves the MiniHub’s current speed.
Parameters
short* pSpeed
The current speed: 0 (slow), 1 (medium), or 2 (fast).
Return
0 if successful
Other value if there was an error
Visual C++ example
short nSpeed;
long lres = m_Minihub.GetSpeed(&nSpeed);
Visual Basic .NET example
Dim ires as Integer
Dim shSpeed As Short
ires = Minihub1.GetSpeed(shSpeed)
Ignore
long Ignore(void)
Description
Ignores the previously issued error and moves to the next step in the task. This is not a recommended course of action, as the errors are issued for a reason. However, ignoring some errors can be appropriate if the operator understands the implications.
Parameters
None
Return
0 if successful
Other value if there was an error
Visual C++ example
long lres = m_Minihub.Ignore();
Visual Basic .NET example
Dim ires as Integer
ires = Minihub1.Ignore()
Initialize
long Initialize(BSTR Profile)
Description
Initializes the profile and starts communication with the Labware MiniHub using the parameters set in the profile. The profile specifies the serial connection used to communicate with the Labware MiniHub. The parameters for each profile can be adjusted in the Diagnostics dialog box on the Profiles page (by calling the ShowDiagsDialog method).
Parameters
BSTR Profile
The name of the profile to be used for initialization.
Return
0 if successful, and fires the InitializeComplete event
Other value if there was an error
Visual C++ example
// connect via serial connection specified in the profile
long lres = m_Minihub.Initialize(_bstr_t("MiniHubprofile"));
Visual Basic .NET example
‘connect via serial connection specified in the profile
Dim ires as Integer
ires = Minihub1.Initialize(“MiniHub profile")
Jog
long Jog(float fDegree, VARIANT_BOOL bClockwise)
Description
Rotates the MiniHub a specified number of degrees from its current position.
Parameters
float fDegree
The number of degrees relative to the current position.
VARIANT_BOOL bClockwise
The direction of the rotation. Set Clockwise to VARIANT_TRUE (C++) or True (Visual Basic .NET) to rotate the stage clockwise. Set Clockwise to VARIANT_FALSE (C++) or False (Visual Basic .NET) to rotate the stage counterclockwise.
Return
0 if successful, and fires the JogComplete event
Other value if there was an error
Visual C++ example
long lres = m_Minihub.Jog(30.0, VARIANT_TRUE);
Visual Basic .NET example
Dim ires as Integer
ires = Minihub1.Jog(30.0,True)
Retry
long Retry(void)
Description
Retries the last action after an error occurred.
Parameters
None
Return
0 if successful
Other value if there was an error
Visual C++ example
long lres = m_Minihub.Retry();
Visual Basic .NET example
Dim ires as Integer
ires = Minihub1.Retry()
RotateToCassette
long RotateToCassette(short nCassetteIndex)
Description
Rotates the MiniHub so that the specified cassette is at the 0° position.
Parameters
short nCassetteIndex
The cassette number: 1, 2, 3, or 4.
Return
0 if successful, and fires the RotateToCassetteComplete event
Other value if there was an error
Visual C++ example
long lres = m_Minihub.RotateToCassette(1);
Visual Basic .NET example
Dim ires as Integer
ires = Minihub1.RotateToCassette(1)
RotateToDegree
long RotateToDegree(float fDegree)
Description
Rotates the MiniHub a specified number of degrees.
Parameters
float fDegree
The number of degrees to rotate the MiniHub. A positive value rotates the MiniHub clockwise. A negative value rotates the MiniHub counterclockwise.
Return
0 if successful, and fires the RotateToDegreeComplete event
Other value if there was an error
Visual C++ example
long lres = m_Minihub.RotateToDegree(90.0);
Visual Basic .NET example
Dim ires as Integer
ires = Minihub1.RotateToCassette(90.0)
RotateToHomePosition
long RotateToHomePosition(void)
Description
Rotates the MiniHub so that cassette 1 is at the 0° position. This method is equivalent to the Go Home command in MiniHub Diagnostics.
Parameters
None
Return
0 if successful, and fires the RotateToHomePositionComplete event
Other value if there was an error
Visual C++ example
long lres = m_Minihub.RotateToHomePosition();
Visual Basic .NET example
Dim ires as Integer
ires = Minihub1.RotateToHomePosition()
SetSpeed
long SetSpeed(short nSpeed)
Description
Sets the MiniHub’s rotation speed.
Parameters
short nSpeed
The speed value: 0 (slow), 1 (medium), or 2 (fast).
Return
0 if successful
Other value if there was an error
Visual C++ example
long lres = m_Minihub.SetSpeed(0);
Visual Basic .NET example
Dim ires as Integer
ires = Minihub1.SetSpeed(0)
ShowDiagsDialog
void ShowDiagsDialog (VARIANT_BOOL modal, short securityLevel)
Description
Displays the Diagnostics dialog box that allows the operator to troubleshoot and correct problems. This method can be called before the Initialize method to create a profile. Contents displayed are based on the operator’s access level.
Parameters
VARIANT_BOOL modal
The mode of the dialog box. The dialog box displayed can be modal (does not permit users to access the parent window) or modeless (permits users to access the parent window). If the modal mode is desired, set modal to VARIANT_TRUE (C++) or True (Visual Basic .NET). If the modeless mode is desired, set modal to VARIANT_FALSE (C++) or False (Visual Basic .NET).
short securityLevel
The security level the operator has in the dialog box:
0 = Administrator
1 = Technician
2 = Operator
3 = Guest
-1 = No access
Return
0 if successful
Other value if there was an error
Visual C++ example
m_Minihub.ShowDiagsDialog(VARIANT_TRUE,0);
Visual Basic .NET example
Dim ires as Integer
ires = Minihub1.ShowDiagsDialog(True,0)
TeachHome
long TeachHome(void)
Description
Sets the teachpoint at the MiniHub’s current position. The home position should be when cassette 1 is at the 0° position.
Parameters
None
Return
0 if successful, and fires the TeachHomeComplete event
Other value if there was an error
Visual C++ example
long lres = m_Minihub.TeachHome();
Visual Basic .NET example
Dim ires as Integer
ires = Minihub1.TeachHome()
Related information
 
For information about...
See...
MiniHub ActiveX control
Integrating the MiniHub ActiveX control
Installation instructions in the release notes
MiniHub ActiveX properties
MiniHub ActiveX events