From 11:00 PM CST Friday, Apr 11th - 1:30 PM CST Saturday, Apr 12th, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabWindows/CVI

Content Type
Programming Language
Current manual
Table of Contents

SetExecutionTarget

SetExecutionTarget

LabWindows/CVI ActiveX Server Interface

CVI_AppSetExecutionTarget (CAObjHandle objectHandle, ERRORINFO *errorInfo, enum CVIEnum_CVIExecutionTargetType type, const char *machineNameOrIP, long port, long *returnValue);

Purpose

Sets the execution target.

Parameters

Input
Name Type Description
objectHandle CAObjHandle Specifier for a particular ActiveX object that is currently in memory. Obtain this handle from CVI_NewApp, CVI_OpenApp, CVI_ActiveApp, or an ActiveX method or property.

All of the methods that you can apply to a particular object are grouped under a single class in the function tree. The name of the class corresponds to the type of the object to which this handle refers.
type enum CVIEnum_CVIExecutionTargetType The execution target. You can specify one of the following constants:

  • CVI_EXECUTION_TARGET_LOCAL (0)—Target is the local computer.
  • CVI_EXECUTION_TARGET_REMOTE (1)—Target is an external target.
machineNameOrIP const char * The network address of the computer on which the debug executable or DLL is running. LabWindows/CVI rejects debug connections that do not originate from this network address.

This parameter is ignored if type is CVI_EXECUTION_TARGET_LOCAL.
port long The network port for the debug session. The LabWindows/CVI debugger accepts network connections from debuggees on this network port. The default is 3291.

This parameter is ignored if type is CVI_EXECUTION_TARGET_LOCAL.
Output
Name Type Description
errorInfo ERRORINFO * When an ActiveX server function fails with the error code DISP_E_EXCEPTION, descriptive information about the error code is stored in this parameter. The descriptive information can include the error code, source, and description. It also can include a help file and help file context ID.

When an ActiveX server function fails with the error codes DISP_E_PARAMNOTFOUND, DISP_E_TYPEMISMATCH, or E_INVALIDARG, the parameter position of the invalid argument may be stored in the errorParamPos member of this parameter.

You may pass NULL for this parameter.
returnValue long * The value that the LabWindows/CVI ActiveX server function returns. A negative value indicates that the LabWindows/CVI ActiveX server function returned an error.

You can use GetCVIAutomationServerErrorString to get the description of a LabWindows/CVI ActiveX server error code.

Return Value

Name Type Description
status HRESULT A value indicating whether an error occurred. A negative error code indicates function failure.

Error codes are defined in CVIversion\include\cviauto.h and <Program Files>\National Instruments\Shared\MSDTRedistributables\SDKHeaderFiles\8.1\winerror.h.

You can use CA_GetAutomationErrorString to get the description of an ActiveX Library error code.
Was this information helpful?

Help us improve your future ni.com experience.

What are you trying to do?

Submit