int GetComStat (int COMPort);
Returns information about the status of a COM port.
The library accumulates COM port conditions until you call GetComStat.
GetComStat returns a negative error code if you have not opened the port of if you pass an invalid value for COMPort.
Input | ||
Name | Type | Description |
COMPort | integer | A number that indicates the COM port on which to operate. This number is paired with deviceName, which represents the COM port, during the OpenComConfig function call. Default Value: 1—COM1 Valid Range: 1—1,000 |
Name | Type | Description | |||||||||||||||||||||||||||||||||||
comPortStatus | integer | Hardware-specific information about the status of the selected port. The status word is comprised of individual bits, each with a different meaning. Several bits can indicate the presence of more than one condition. The following table shows the hexadecimal value of the bit and its corresponding description:
Notice the ambiguity in this status information. If an error occurs on the indicated port, your application program knows that one or more bytes are invalid. Your program cannot determine from the status word which byte read is invalid. GetComStat returns a negative error code if you have not opened the port of if you pass an invalid value for COMPort. |