PC-DMIS 2019 R2 Object Library
ExecuteCustomCommand Method
See Also  Send Topic Feedback | See Object Hierarchy Chart
CommandNumber

The command to execute. Each command may require a number of input and output values, these value can be integer or double.

The following commands are currently available:

60 (Get CMM serial number) : retrieve the cmm serial number.

Input: command_number (value 60 decimal), int_in_data = NULL, int_in_data_cnt = 0, double_in_data = NULL , double_in_data_cnt = 0

Output: int_out_data (must be defined as an array of dimension one - integer) and will return the SN value, int_out_data_cnt will return 1, double_out_data = NULL, double_out_data_cnt = 0

Command affected: NONE

The serial number is returned as an integer value, first value of int_out_data array. No measurement routine command is affected.

70 (Set part temp) : set the part temperature value.

Input: command_number (value 70 decimal), int_in_data = NULL, int_in_data_cnt = 0, double_in_data (must be defined as an array of dimension one - double) contains the part temperature value, double_in_data_cnt = 1

Output: int_out_data = NULL, int_out_data_cnt = 0, double_out_data = NULL, double_out_data_cnt = 0

Command affected: TEMPCOMP

InputIntArray
An array containing the command integer input values, the dimension of the array depends on the command. If no input is required, this must be set to NULL.
InputDoubleArray
An array containing the command double input values, the dimension of the array depends on the command. If no input is required, this must be set to NULL.
OutputIntArray
An array containing the command integer output values. the dimension of the array depends on the command. If no output is required, this must be set to NULL.
OutputDoubleArray
An array containing the command double output values. the dimension of the array depends on the command. If no output is required, this must be set to NULL.
PCDLRN ActiveX DLL > Machine Object : ExecuteCustomCommand Method

Glossary Item Box

Description

This command lets you execute special operations in the Leitz interface.

Syntax

Visual Basic
Public Function ExecuteCustomCommand( _
   ByVal CommandNumber As Long, _
   ByVal InputIntArray As VariableArray, _
   ByVal InputDoubleArray As VariableArray, _
   ByVal OutputIntArray As VariableArray, _
   ByVal OutputDoubleArray As VariableArray _
) As Boolean

Parameters

CommandNumber

The command to execute. Each command may require a number of input and output values, these value can be integer or double.

The following commands are currently available:

60 (Get CMM serial number) : retrieve the cmm serial number.

Input: command_number (value 60 decimal), int_in_data = NULL, int_in_data_cnt = 0, double_in_data = NULL , double_in_data_cnt = 0

Output: int_out_data (must be defined as an array of dimension one - integer) and will return the SN value, int_out_data_cnt will return 1, double_out_data = NULL, double_out_data_cnt = 0

Command affected: NONE

The serial number is returned as an integer value, first value of int_out_data array. No measurement routine command is affected.

70 (Set part temp) : set the part temperature value.

Input: command_number (value 70 decimal), int_in_data = NULL, int_in_data_cnt = 0, double_in_data (must be defined as an array of dimension one - double) contains the part temperature value, double_in_data_cnt = 1

Output: int_out_data = NULL, int_out_data_cnt = 0, double_out_data = NULL, double_out_data_cnt = 0

Command affected: TEMPCOMP

InputIntArray
An array containing the command integer input values, the dimension of the array depends on the command. If no input is required, this must be set to NULL.
InputDoubleArray
An array containing the command double input values, the dimension of the array depends on the command. If no input is required, this must be set to NULL.
OutputIntArray
An array containing the command integer output values. the dimension of the array depends on the command. If no output is required, this must be set to NULL.
OutputDoubleArray
An array containing the command double output values. the dimension of the array depends on the command. If no output is required, this must be set to NULL.

Return Type

Boolean value. This returns TRUE if the command completed successfully, FALSE otherwise.

Example

Example Title Copy Code
Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click
' This example shows a subroutine tied to a click event on a button
' that allows you to set a part's temperature using automation
' instead of using the machine's controller sensor to get the temperature.
' Before using this example, you will need to set ContinuousTempSensor
' registry to FALSE. This is located in the Leitz section of the PC-DMIS
Settings Editor.

Dim app As PCDLRN.Application
app = CreateObject("PCDLRN.Application")
Dim part As PCDLRN.PartProgram
part = app.ActivePartProgram

If part Is Nothing Then
MsgBox("Please open a measurement routine!", MsgBoxStyle.Exclamation)
Exit Sub
End If

Dim Machine As PCDLRN.Machine
Machine = part.ActiveMachine

Dim mystring As String
Dim command_number As Integer

Dim intarray As PCDLRN.VariableArray
intarray = Machine.GetArray()

Dim doublearray As PCDLRN.VariableArray
doublearray = Machine.GetArray()

Dim out_int_array As PCDLRN.VariableArray
out_int_array = Machine.GetArray()

Dim out_double_array As PCDLRN.VariableArray
out_double_array = Machine.GetArray()
Dim stringa As String

If Len(PartTemp.Text) < 1 Then
MsgBox("Insert a valid Part Temperature value!", MsgBoxStyle.Exclamation)
Exit Sub
End If

Dim PartTempDouble As Double
doublearray.SetSize((1))
PartTempDouble = CDbl(PartTemp.Text)
Call doublearray.SetValue(1, PartTempDouble)

Dim ret As Boolean
command_number = 70
ret = Machine.ExecuteCustomCommand(command_number, intarray, doublearray, out_int_array, out_double_array)

Text1.Text = CStr(ret)

See Also

Copyright © 2019. Hexagon Manufacturing Intelligence – Metrology Software, Inc. All Rights Reserved.