VBA Function | Returns | Description |
---|---|---|
start_com_port |
Boolean 1 |
Starts com port with existing settings |
read_com_port |
String |
Returns all 2 waiting characters from com port |
read_com_port(6) |
String |
Returns up to 2 specified number (6) of waiting characters from com port |
send_com_port($B$5) |
Boolean 1 |
Sends 3 contents of Cell $B$5 to com port (Excel Worksheet Only) |
send_com_port("QWERTY") |
Boolean 1 |
Sends 4 supplied character string to com port |
send_com_port(COMMANDS) |
Boolean 1 |
Sends 4 character string defined in VBA constant or variable COMMANDS to com port |
stop_com_port |
Boolean 1 |
Stops com port and returns its control back to Windows |
Private Const COM_PORT_NUMBER as Long = 1
Footnotes
-
Function returns
True
if successful, otherwiseFalse
↩ ↩2 ↩3 ↩4 ↩5 -
Maximum characters returned = read buffer length (fixed value)
More waiting characters beyond read buffer length may remain unread until next read_com_port call. ↩ ↩2 -
Excel will re-send if cell $B$5 contents change. ↩
-
Function will block until all characters are sent or write total constant timer expires.
Maximum characters sent limited by timerWrite_Total_Timeout_Constant
value. ↩ ↩2