NexMotion  1.4.0
Open Robots & Machines [WIP]
Advanced_Device_Open_Shutdown

Advanced Device Open up and Shut Down. More...

Collaboration diagram for Advanced_Device_Open_Shutdown:

Functions

RTN_ERR FNTYPE NMC_DeviceCreate (I32_T DevType, I32_T DevIndex, I32_T *PRetDevID)
 Create the device ID. More...
 
RTN_ERR FNTYPE NMC_DeviceDelete (I32_T DevID)
 Delete the device ID. More...
 
RTN_ERR FNTYPE NMC_DeviceLoadIniConfig (I32_T DevID)
 Load the device configurations. More...
 
RTN_ERR FNTYPE NMC_DeviceResetConfig (I32_T DevID)
 Reset the device configurations. More...
 
RTN_ERR FNTYPE NMC_DeviceStart (I32_T DevID)
 Start the device (Blocking call). More...
 
RTN_ERR FNTYPE NMC_DeviceStop (I32_T DevID)
 Stop the device (Blocking call). More...
 
RTN_ERR FNTYPE NMC_DeviceStartRequest (I32_T DevID)
 Request the device start (Non-blocking call). More...
 
RTN_ERR FNTYPE NMC_DeviceStopRequest (I32_T DevID)
 Request the device stop (Non-blocking call). More...
 
RTN_ERR FNTYPE NMC_DeviceGetState (I32_T DevID, I32_T *PRetDeviceState)
 Get the device state. More...
 

Detailed Description

Advanced Device Open up and Shut Down.

Function Documentation

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

Create the device ID.

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:
Please refer to the section, Advanced System Initializeation.

Reference:

RTN_ERR FNTYPE NMC_DeviceDelete ( I32_T  DevID)

Delete the device ID.

Parameters
DevIDDevice ID
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:
Please refer to the section, Advanced System Initializeation.

Reference:

RTN_ERR FNTYPE NMC_DeviceGetState ( I32_T  DevID,
I32_T PRetDeviceState 
)

Get the device state.

Parameters
DevIDDevice ID (DevID)
PRetDeviceStateReturn the state of the device after 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:

Reference:

RTN_ERR FNTYPE NMC_DeviceLoadIniConfig ( I32_T  DevID)

Load the device configurations.

Parameters
DevIDDevice ID (DevID)
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 load the device configurations in accordance with the file, NexMotionLibConfig.ini. The file, NexMotionLibConfig.ini, is saved in the default path, C:\\NEXCOBOT. Users must not create the file, nor modify the file name or content in order to avoid the loading error. NMC_DeviceLoadIniConfig() will search the file, NexMotionLibConfig.ini, in the following path in order:

1 NexMotion.dll folder
2 C:\\NEXCOBOT
3 C:\\Windows\System32

To specify a new path for the file, NexMotionLibConfig.ini, NMC_SetIniPath() can be called. After NMC_DeviceLoadIniConfig() is called successfully, the device is in the ready state and ready to start.

Reference:
NMC_SetIniPath()

RTN_ERR FNTYPE NMC_DeviceResetConfig ( I32_T  DevID)

Reset the device configurations.

Parameters
DevIDDevice ID (DevID)
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_DeviceResetConfig() is used to reset the device configurations. After the function is called successfully, the device will return to the init state. If the device is in the operation state, the fuction shall not be called.

Reference:

RTN_ERR FNTYPE NMC_DeviceStart ( I32_T  DevID)

Start the device (Blocking call).

Parameters
DevIDDevice ID (DevID)
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:
If the device is in the ready state, the function can be called to start the device. After the function is called and returned successfully, the device is in operation state. Please refer to the section, Advanced System Initialization.

Reference:

RTN_ERR FNTYPE NMC_DeviceStartRequest ( I32_T  DevID)

Request the device start (Non-blocking call).

Parameters
DevIDDevice ID (DevID)
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:
If the device is in the ready state, the function can be called to send the request for device start, and the function will be returned immediately. NMC_DeviceGetState(), can be used to used to read the device state, in order to check if the device is not in the operation state.

Reference:

RTN_ERR FNTYPE NMC_DeviceStop ( I32_T  DevID)

Stop the device (Blocking call).

Parameters
DevIDDevice ID (DevID)
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:
If the device is in the operation state, the function can be called to stop the device. After the function is called and returned successfully, the device is in ready state.

Reference:

RTN_ERR FNTYPE NMC_DeviceStopRequest ( I32_T  DevID)

Request the device stop (Non-blocking call).

Parameters
DevIDDevice ID (DevID)
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:
If the device is in the operation state, the function can be called to send the request for device stop, and the function will be returned immediately. NMC_DeviceGetState(), can be used to used to read the device state, in order to check if the device is not in the ready state.

Reference: