NexMotion  1.4.0
Open Robots & Machines [WIP]
Device_Open_Shutdown

Device Open up and Shut Down. More...

Collaboration diagram for Device_Open_Shutdown:

Functions

RTN_ERR FNTYPE NMC_DeviceOpenUp (I32_T DevType, I32_T DevIndex, I32_T *PRetDevID)
 Open up the device (Blocking call). More...
 
RTN_ERR FNTYPE NMC_DeviceShutdown (I32_T DevID)
 Shut down the device (Blocking call). More...
 
RTN_ERR FNTYPE NMC_DeviceOpenUpRequest (I32_T DevType, I32_T DevIndex)
 Request the device open up (Non-blocking call). More...
 
RTN_ERR FNTYPE NMC_DeviceWaitOpenUpRequest (U32_T WaitMs, I32_T *PRetDevID)
 Wait for device open up (Blocking call). More...
 
RTN_ERR FNTYPE NMC_DeviceShutdownRequest (I32_T DevID)
 Request the device shut down (Non-blocking call). More...
 
RTN_ERR FNTYPE NMC_DeviceWaitShutdownRequest (I32_T DevID, U32_T WaitMs)
 Wait for device shut down (Blocking call). More...
 

Detailed Description

Device Open up and Shut Down.

Function Documentation

RTN_ERR FNTYPE NMC_DeviceOpenUp ( I32_T  DevType,
I32_T  DevIndex,
I32_T PRetDevID 
)

Open up the device (Blocking call).

Parameters
DevTypeThe specified device type. 0: Simulator, 1: EtherCAT
DevIndexThe specified index of device which is set to 0
[out]PRetDevID[Output] The device ID (DevID) after the function is called successfully
Returns
Return an error code. If the function is called successfully, the return value is ERR_NEXMOTION_SUCCESS (0). Otherwise, the return value is an error code. All error codes are defined in the header file, NexMotionError.h

Usage:
NMC_DeviceOpenUp() can be called to control a device before the other control APIs are called. The function is a blocking call. It costs a short time to process the initialization, including the loading of configuration file, and returns after the device is in the operation state.

Refence:
NMC_DeviceShutdown()

RTN_ERR FNTYPE NMC_DeviceOpenUpRequest ( I32_T  DevType,
I32_T  DevIndex 
)

Request the device open up (Non-blocking call).

Parameters
DevTypeThe specified device type
DevIndexThe specified index of device which is set to 0
Returns
Return an error code.
If the function is called successfully, the return value is ERR_NEXMOTION_SUCCESS (0). Otherwise, the return value is an error code. All error codes are defined in the header file, NexMotionError.h.

Usage:
The function will return immediately after called. NMC_DeviceWaitOpenUpRequest() or NMC_DeviceGetState() shall be used to read the device state, in order to check if the device is in the operation state.

Reference:
NMC_DeviceWaitOpenUpRequest()

RTN_ERR FNTYPE NMC_DeviceShutdown ( I32_T  DevID)

Shut down the device (Blocking call).

Parameters
DevIDThe device ID of the machine that request to be shutdown.
Returns
Return an error code.
If the function is called successfully, the return value is ERR_NEXMOTION_SUCCESS (0). Otherwise, the return value is an error code. All error codes are defined in the header file, NexMotionError.h

Usage:
After the application is closed, the function shall be called to shut down the device and release system resources. After called, the function will block the application until the application is closed.

Reference:
NMC_DeviceOpenUp()

RTN_ERR FNTYPE NMC_DeviceShutdownRequest ( I32_T  DevID)

Request the device shut down (Non-blocking call).

Parameters
DevIDThe device ID of the machine that request to be shutdown.
Returns
Return an error code.
If the function is called successfully, the return value is ERR_NEXMOTION_SUCCESS (0). Otherwise, the return value is an error code. All error codes are defined in the header file, NexMotionError.h.
RTN_ERR FNTYPE NMC_DeviceWaitOpenUpRequest ( U32_T  WaitMs,
I32_T PRetDevID 
)

Wait for device open up (Blocking call).

Parameters
WaitMsWaiting time for device open up (unit: ms). It can be set to the NMC_WAIT_TIME_INFINITE (0xFFFFFFFF) to wait for the completion of open up.
[out]PRetDevID[Output] The device ID (DevID) after the function is called successfully.
Returns
Return an error code.
If the function is called successfully, the return value is ERR_NEXMOTION_SUCCESS (0). Otherwise, the return value is an error code. All error codes are defined in the header file, NexMotionError.h.

Usage:
Generally, the function is used to check if the device open up is successful, and called after NMC_DeviceOpenUpRequest(). After called, the function will block the application until the device is in the operation or error state.

Reference:
NMC_DeviceOpenUpRequest()

RTN_ERR FNTYPE NMC_DeviceWaitShutdownRequest ( I32_T  DevID,
U32_T  WaitMs 
)

Wait for device shut down (Blocking call).

Parameters
DevIDThe device ID of the machine that request to be shutdown.
WaitMsWaiting time for device open up (unit: ms). It can be set to the NMC_WAIT_TIME_INFINITE (0xFFFFFFFF) to wait for the completion of open up.
Returns
Return an error code.
If the function is called successfully, the return value is ERR_NEXMOTION_SUCCESS (0). Otherwise, the return value is an error code. All error codes are defined in the header file, NexMotionError.h.

Usage:
Generally, the function is used to check if the device shut down is successful, and called after NMC_DeviceShutdownRequest(). After called, the function will block the application until the device is in the operation or error state.

Reference:
NMC_DeviceShutdownRequest()