EnableAliases

Use EnableAliases to enable the alias feature after configuring the alias index for axes and I/O modules using WriteAxisAlias and WriteIOAlias. Once enabled, the Index parameter in all APIs related to axes and I/O modules will correspond to the alias index.

Syntax

KsError EnableAliases(
     BOOL Active
);

Parameters

Active: this parameter determines whether aliases are used. TRUE to enable, and FALSE to disable aliasing. By default, it is FALSE.

Return value

If the function succeeds, it returns errNoError, otherwise an error code. For more information about the error code, see the KsError list.

Remarks

It gets details for each drive and identifies each drive using vendor, product, and alias. If drives are not plugged in the correct order, rearrange the list of drives. Use it after the KINGSTAR Subsystem is started.

Usable EtherCAT states

ecatOP

Example

Copy
// Define aliases for axes
#define AxisX 101
#define AxisZ 102
#define AxisC 103

// Apply the aliases
nRet = WriteAxisAlias(1, AxisX);
nRet = WriteAxisAlias(2, AxisZ);
nRet = WriteAxisAlias(0, AxisC);
nRet = EnableAliases(TRUE);

Requirements

  RT Win32
Minimum supported version 4.0 4.0
Header ksapi.h ksapi.h
Library KsApi_Rtss.lib KsApi.lib

See also

GetAliasesStatus

ReadIOAlias

WriteIOAlias