Print binary content of a variable to the serial port.
PRINTBIN var [ ; varn]
PRINTBIN #dev, var ; [,varn]
The variable which value is sent to the serial port.
Optional variables to send separated by a ;.
Device number for use with OPEN and CLOSE
PRINTBIN is equivalent to PRINT CHR(var); but whole arrays can be printed this way.
When you use a Long for example, 4 bytes are printed.
Dim a(10) as Byte, c as Byte
For c = 1 To 10
a(c) = a 'fill array
PRINTBIN a(1) 'print content
'This code only for 80517/80537 with dual serial port
Open "COM2:" For Binary As #1 'open serial channel 1
PRINTBIN #1 , a(1) ; a(2) ; a(3) 'note that the channel is separated by a , and the vars by ;