When using multiple devices at the same time, it is necessary to initialize each device and obtain a different ID.
Execute functions by specifying the ID of each device. At the time of termination, perform termination processings for each device.
Here is an example of using multiple devices.
Use two ZM-C2H-PE, and each device is set to the following device name.
The variables that store the ID of each device are ID_ZM1, ID_ZM2
ZM-C2H-PE 1st : ZM000
ZM-C2H-PE 2nd : ZM001
Example in C
Device |
ZM-C2H-PE 1st |
ZM-C2H-PE 2nd |
DeviceName |
ZM000 |
ZM001 |
ID Declaration |
short ID_ZM1; |
short ID_ZM2; |
Init |
Ret = ZmInit("ZM000" ,&ID_ZM1); |
Ret = ZmInit("ZM001" ,&ID_ZM2) |
Other Functions |
Ret = Zm***( ID_ZM1, *** ); |
Ret = Zm***( ID_ZM2, *** ); |
Example in Python
Device |
ZM-C2H-PE 1st |
ZM-C2H-PE 2nd |
DeviceName |
ZM000 |
ZM001 |
ID Declaration |
ID_ZM1 = ctypes.c_short() |
ID_ZM2= ctypes.c_short() |
Init |
Ret.value = czm.ZmInit ( b"ZM000" , ctypes.byref(ID_ZM1)) |
Ret.value = czm.ZmInit ( b"ZM001" , ctypes.byref(ID_ZM2)) |
Other Functions |
Ret.value = czm.Zm***( ID_ZM1, *** ) |
Ret.value = czm.Zm***( ID_ZM2, *** ) |