GetErrorText Method

NI Vision for Visual Basic

GetErrorText Method

Syntax

CWIMAQVision.GetErrorText ErrorCode

Return Type

String

The error text corresponding to the error code input.

Purpose

A hidden method that returns the error text corresponding to an error code. The error text is a description of what the error code signifies.

Remarks

This method allows you to get the error text corresponding to an error code when you have set the ExceptionOnError property of the CWIMAQVision control to False.

Parameters

ErrorCode As Long

The error code whose error text the method returns. This value is the return value of a method on the CWIMAQVision control.

Example

Dim errorString As String
Dim errorCode As Long
Dim point As New CWIMAQPoint

' First turn off ExceptionOnError
CWIMAQVision1.ExceptionOnError = False

' Call some method on CWIMAQVision and set the value of errorCode.
point.Initialize 1000, 1000
errorCode = CWIMAQVision1.SetPixel(CWIMAQViewer1.Image, point, 255)

' Find the error text corresponding to the error code
errorString = CWIMAQVision1.GetErrorText(errorCode)