RtecatCreateMainDevice

RtecatCreateMainDevice creates a MainDevice.

Syntax

Copy
RTECAT_ERROR RtecatCreateMainDevice(
  [out]   RTECAT_HANDLE* pMainDevice,
  [in]    ULONG Instance,
);

Parameters

[out] pMainDevice

A pointer to a MainDevice handle.

[in] Instance

The index of a MainDevice instance.

Return Values

The function returns an RTECAT_ERROR value. If the function succeeds, it returns ecatErrNoError. If the function fails, it returns a different value.

Possible return values:

Return value Meaning

ecatErrNoError

The function succeeded.

ecatErrNullParameter

Parameter pMainDevice is NULL.

ecatErrWrongParameter

Parameter Instance is less than 0 or greater than or equal to 63.

ecatErrNoLicense

One of the following conditions occurred:

  • No E-CAT Fieldbus license is available.
  • The number of E-CAT Fieldbus instances exceeds the limit of your current license when the value of Instance is greater than 1. A MaxRT wRTOS E-CAT Multiple MainDevices license is required to support multiple MainDevice instances.

ecatErrTimeout

Can't launch the MainDevice instance properly.

Remarks

RtecatCreateMainDevice is a synchronous function that executes immediately and returns a result upon completion.

Requirements

Minimum supported version Header Library

wRTOS 1.0 SDK

RtecatApi.h

RtecatApi_W64.lib (Windows), RtecatApi.lib (RTSS)

See Also: