Function
Retrieves the status of specified channel. Supports multi-processing.
Format
Ret = CntReadStatusEx ( Id , ChNo , Sts )
Parameters
Id
[ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short
]
Specify the device ID retrieved from CntInit.
ChNo
[ VB.NET: Short ] [ C, C++: short ] [ C#: short ] [ Python: ctypes.c_short
]
Specify the channel number for retrieving.
Sts
[ VB.NET: Integer ] [ C, C++: unsigned long * ] [ C#: out uint ] [ 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 [ VB.NET: Integer ] [ C, C++: long ] [ C#: int ] [ Python: ctypes.c_long ]
Definition |
Value |
Description |
CNT_ERR_SUCCESS |
0 |
Normality completion |
CNT_ERR_SYS_RECOVERED_FROM_STANDBY |
7 |
Execute the function CntResetDevice to return from the standby mode. |
CNT_ERR_DLL_INVALID_ID |
10001 |
Invalid ID was specified. |
CNT_ERR_DLL_CALL_DRIVER |
10002 |
CNT driver can't be called (Failed in the device I/O control). |
CNT_ERR_DLL_BUFF_ADDRESS |
10101 |
Invalid data buffer address. |
CNT_ERR_SYS_NOT_SUPPORTED |
20001 |
This function can't be used by this device. |
CNT_ERR_SYS_CH_NO |
20201 |
Channel number is out of range. |
The others: (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.
Please use CntReadStatus, except for "Device with sampling function".
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 CntNotifyCounterError
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 CntNotifyCountUp function
when you want to recognize the edge of "Counter match" on the
case for the faster frequency pulse.
CPSN-MC271 + 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) |
Disconnection alarm error is not detected. D11:ALM will always be "0:Alarm error undetection".
|
|||||||||||||||||||||||||||||||||||||||
CNT-3208M-PE CNT32-8M(PCI) |
|
Example
Retrieves the status of channel 0.
VB.NET |
Dim Ret As Integer |
C, C++ |
long Ret; |
C# |
int Ret; |
Python |
Ret = ctypes.c_long() |
See Also
CntInputDIByte CntReadStatus CntNotifyCounterError CntNotifyCountUp