Library.DestroyMainDevice Method
Destroys a MainDevice, causing all handles derived from the corresponding MainDevice to become invalid.
Namespace:
IntervalZero.MaxRT.Ecat.Api.NetApi
Assembly:
IntervalZero.MaxRT.Ecat (in IntervalZero.MaxRT.Ecat.dll) Version: 1.0.0.0 (File version: 1.1.0)
Syntax
public EcatErrorCode DestroyMainDevice(
EcatHandle mainDevice
)
Parameters
mainDevice
Type: EcatHandle
A handle to a MainDevice. To retrieve the corresponding handle, use CreateMainDevice or OpenMainDevice.
Return Value
EcatErrorCode is thrown when any of these errors occur:
| Error code | Meaning |
|---|---|
|
ecatErrNoError |
The function succeeded. |
|
ecatErrWrongParameter |
Parameter mainDevice is invalid. |
|
ecatErrMainDeviceNotReady |
The MainDevice instance does not exist. |
Remarks
When a MainDevice is destroyed, all associated handles, such as an axis handle, derived from that MainDevice become invalid. Nevertheless, it's still recommended to use CloseHandle to explicitly close these handles before using DestroyMainDevice.
See Also: