![]() ZBasic System Library
308
ZBasic Microcontrollers
Type
Function returning Byte
Invocation
StatusCom(chan)
Parameter
Method
Type
Description
chan
ByVal
Byte
The serial channel of interest.
Discussion
This function returns a set of flag bits that indicate the status of the specified serial channel. The meaning
of each of the flag bits is shown in the table below.
Serial Channel Status Bit Values
Value
Meaning
&H01
The channel number is valid but may or may not be open.
&H02
The channel is open.
&H04
The channel has data yet to be transmitted.
&H08
The channel is a software UART channel.
&H10
The channels receive flow control pin is in the inactive state.
&H20
The channels transmit flow control pin is in the inactive state.
The remaining bits are currently undefined but may convey additional information in the future. It is
strongly advised that you apply an AND mask to the returned value before comparing it to a fixed value.
Doing so will prevent the future addition of bits from affecting your existing code.
Note that the &H04 bit will be set if there are any unsent characters in the transmit queue associated with
the channel as well as if a character is currently being transmitted.
Example
' wait until all characters are transmitted
Do While CBool(StatusCom(chan) And &H04)
Loop
Compatibility
This function is not available in BasicX compatibility mode.
See Also
|