Function
Retrieves the status of specified channel. Supports multi-processing.
Format
Ret = CntReadStatusEx ( Id , ChNo , &Sts )
Parameters
Id
[ C, C++ : short] [Python: ctypes.c_short]
Specifies the device ID retrieved from CntInit.
ChNo
[ C, C++ : short] [Python: ctypes.c_short]
Specifies the channel number which you want to get for.
Sts
[ C, C++ : int *] [Python: ctypes.POINTER(ctypes.c_int)] [ Python: ctypes.POINTER(ctypes.c_ulong)
]
Specify the address of the variable that retrieves the status. Each bit
is defined as the following Definition.
D11 |
D10 |
D9 |
D8 |
D7 |
D6 |
D5 |
D4 |
D3 |
D2 |
D1 |
D0 |
ALM |
AI |
FE |
CA |
BO |
Z |
A |
B |
U/D |
EQ1 |
EQ0 |
U |
Return Value
Ret [ C, C++ : long] [Python: ctypes.c_long]
Definition |
Value |
Description |
CNT_ERR_SUCCESS |
0 |
Normal Complete |
CNT_ERR_DLL_INVALID_ID |
10001 |
Invalid ID is specified. |
CNT_ERR_DLL_CALL_DRIVER |
10002 |
Driver cannot be called (failed in ioctl). |
CNT_ERR_DLL_BUFF_ADDRESS |
10101 |
Invalid data buffer address. |
CNT_ERR_SYS_CH_NO |
20201 |
Channel number is outside the range. |
The other errors: (See also: Details of Error Code)
Initial Value
0
Remarks
Retrieves the status of specified channel.
Status can be used to confirm whether the signal of each phase of the
counter operates.
As for a general-purpose input, it is more convenient to use specific function
CntInputDIByte.
For "Device with usual counter", please use CntReadStatus.
When the status was read, "Filter error"(D9:FE),
"Abnormal input error"(D10:AI), "Disconnection alarm error"(D11:ALM)
are cleared.
But, if the notify of counter error is enabled by CntSetCountErrorEvent
function , these status is always 0.
"Count match register 0"(D1:EQ)
is "0:Matched" on the moment which the count value is equal
as "Count match register".
On the other case, "Count match register 0"(D1:EQ) is "1:Not
matched".
Please use CntSetCountMatchEvent
function when you want to recognize the edge of "Counter match"
on the case for the faster frequency pulse.
CPSN-CNT-3201I2 |
Filter error is not supported. D9:FE will always be "0:Filter error undetection".
Disconnection alarm error is not detected. D11:ALM will always be "0:Alarm error undetection".
|
|||||||||||||||||||||||||||||||||||||||
CNT-3204IN-ETH CNT-3204IN-USB CNT-3204MT-LPE CNT32-4MT(LPCI) CPI-CNT-3201I |
Disconnection alarm error is not detected. D11:ALM will always be "0:Alarm error undetection".
|
|||||||||||||||||||||||||||||||||||||||
CNT-3208M-PE CNT32-8M(PCI) |
|
Example
C, C++ |
Ret = CntReadStatusEx
( Id , ChNo , &Sts ); |
Python |
Ret = ccnt.CntReadStatusEx
( Id , ChNo , ctypes.byref(Sts) ) |
See Also
CntStartCount CntReadStatus CntSetCountErrorEvent CntSetCountMatchEvent