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 CNT24-4D(PCI)H and one CNT-3204IN-USB, and each device is set to the following device name
The variables that store the ID of each device are ID_CNT1, ID_CNT2, and ID_USBCNT1
CNT24-4D(PCI)H 1st : CNT000
CNT24-4D(PCI)H 2nd : CNT001
CNT-3204IN-USB : CNT002
Visual Basic .NET
Device |
CNT24-4D(PCI)H 1st |
CNT24-4D(PCI)H 2nd |
CNT-3204IN-USB |
DeviceName |
CNT000 |
CNT001 |
CNT002 |
ID Declaration |
Dim ID_CNT1 As Integer |
Dim ID_CNT2 As Integer |
Dim ID_USBCNT1 As Integer |
Init |
Ret = CntInit("CNT000" ,ID_CNT1) |
Ret = CntInit("CNT001" ,ID_CNT2) |
Ret = CntInit("CNT002" ,ID_USBCNT1) |
Other Functions |
Ret = Cnt***( ID_CNT1, *** ) |
Ret = Cnt***( ID_CNT2, *** ) |
Ret = Cnt***( ID_USBCNT1, *** ) |
Visual C#
Device |
CNT24-4D(PCI)H 1st |
CNT24-4D(PCI)H 2nd |
CNT-3204IN-USB |
DeviceName |
CNT000 |
CNT001 |
CNT002 |
ID Declaration |
short ID_CNT1; |
short ID_CNT2; |
short ID_USBCNT1; |
Init |
Ret = cnt.Init("CNT000" ,out ID_CNT1); |
Ret = cnt.Init("CNT001" ,out ID_CNT2); |
Ret = cnt.Init("CNT002" ,out ID_USBCNT1); |
Other Functions |
Ret = cnt.***( ID_CNT1, *** ); |
Ret = cnt.***( ID_CNT2, *** ); |
Ret = cnt.***( ID_USBCNT1, *** ); |
Visual C++ (MFC)
Device |
CNT24-4D(PCI)H 1st |
CNT24-4D(PCI)H 2nd |
CNT-3204IN-USB |
DeviceName |
CNT000 |
CNT001 |
CNT002 |
ID Declaration |
short ID_CNT1; |
short ID_CNT2; |
short ID_USBCNT1; |
Init |
Ret = CntInit("CNT000" ,&ID_CNT1); |
Ret = CntInit("CNT001" ,&ID_CNT2); |
Ret = CntInit("CNT002" ,&ID_USBCNT1); |
Other Functions |
Ret = Cnt***( ID_CNT1, *** ); |
Ret = Cnt***( ID_CNT2, *** ); |
Ret = Cnt***( ID_USBCNT1, *** ); |
Python
Device |
CNT24-4D(PCI)H 1st |
CNT24-4D(PCI)H 2nd |
CNT-3204IN-USB |
DeviceName |
CNT000 |
CNT001 |
CNT002 |
ID Declaration |
ID_CNT1 = ctypes.c_short() |
ID_CNT2 = ctypes.c_short() |
ID_USBCNT1 = ctypes.c_short() |
Init |
Ret.value = ccnt.CntInit ( b"CNT000" , ctypes.byref(ID_CNT1)) |
Ret.value = ccnt.CntInit ( b"CNT001" , ctypes.byref(ID_CNT2)) |
Ret.value = ccnt.CntInit ( b"CNT002" , ctypes.byref(ID_USBCNT1)) |
Other Functions |
Ret.value = ccnt.Cnt***( ID_CNT1, *** ) |
Ret.value = ccnt.Cnt***( ID_CNT2, *** ) |
Ret.value = ccnt.Cnt***( ID_USBCNT1, *** ) |