Retrieve the device ID, then the device can be accessed.
Ret = ZmInit ( DeviceName , Id )
DeviceName
[ C, C++: char * ] [ Python: ctypes.c_char_p ]
Specify the device name set with the setup tool(config). Device name is maximum 50 characters(NULL is included).
Id
[ C, C++: short * ] [ Python: ctypes.POINTER(ctypes.c_short) ]
A device ID is returned. By using this device ID, you can access the device in the following functions.
Ret [ C, C++: long ] [ Python: ctypes.c_long ]
Definition |
Value |
Description |
ZM_ERR_SUCCESS |
0 |
Normality completion |
ZM_ERR_INI_MEMORY |
3 |
Failed in the allocation of the memory. |
ZM_ERR_INI_REGISTRY |
4 |
Failed in the access of registry. |
ZM_ERR_INI_BOARD_ID |
5 |
Board ID is duplicated. |
ZM_ERR_DLL_DEVICE_NAME |
10000 |
Device name which isn't registered in setting file is specified. |
ZM_ERR_DLL_CALL_DRIVER |
10002 |
Driver can't be called (Failed in the ioctl). |
ZM_ERR_DLL_CREATE_FILE |
10003 |
Failed in the creation of the file (Failed in open). |
ZM_ERR_INFO_INVALID_DEVICE |
10050 |
Specified device name is not found. Please check spelling. |
ZM_ERR_INFO_NOT_FIND_DEVICE |
10051 |
Not find the available device. |
The others (See also: Details of Error Code)
None
Retrieves the device ID, then the device can be accessed.
By using this device ID, you can access the device in the following functions.
When accessing more than one device, please prepare corresponding variables to store the IDs.
After ZmInit completed normally, and before ZmExit is called, every function can be used.
Up to 16 processes can access one device.
There are no restrictions when accessing from multiple threads in the same process.
Initialize the device "ZM000" and retrieve the Id.
C, C++ |
long Ret; |
Python |
Ret = ctypes.c_long() |