Read binary values from the serial port.
INPUTBIN var1 [,var2]
INPUTBIN #dev, var1 [,var2]
The variable that is assigned with the characters from the serial port.
An optional second (or more) variable that is assigned with the characters from the serial.
Device number. For use with OPEN and CLOSE. Dev is the device number.
The number of bytes to read is depending from the variable you use.
When you use a byte variable, 1 character is read from the serial port.
An integer will wait for 2 characters and an array will wait wait until the whole array is filled.
Note that the INPUTBIN statement doesn't wait for a <RETURN> but just for the number of bytes.
Dim a as Byte, C as Integer
INPUTBIN a, c 'wait for 3 characters
'This code only for 80517 and 80537 with dual serial port
Open "COM2:" For Binary As #1 'open serial channel 1
INPUTBIN #1, a