OPEN COM

From QB64 Wiki
Revision as of 21:07, 16 September 2009 by imported>Clippy (Created page with 'The '''OPEN COM''' statement is used to access a comuter's Serial port address. ''Syntax:'' OPEN "COMn: Speed, Parity, Bits, Stopbit, Options*" FOR mode AS #f LEN = bytesize …')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The OPEN COM statement is used to access a comuter's Serial port address.


Syntax: OPEN "COMn: Speed, Parity, Bits, Stopbit, Options*" FOR mode AS #f LEN = bytesize

COLOR 11: LOCATE 10, 4: PRINT " 0 to 4 standard options can be used. Listed in order(must use 4 commas)"

  • Speed(baud rate): 75, 110, 150, 300, 600, 1200, 1800, 2400 or 9600 maximum.
  • Parity: N (none), E (even), O (odd), S (space) or M (mark). Note: If Bits is 8 bits use parity N. Numeric data needs this setting!
  • Bits = number of bits/byte: Valid numbers: 5, 6, 7 or 8
  • Stopbit = number of stop bits: Valid numbers: 1, 1.5 or 2
  • OPEN options are optional and in any order separated by commas.
* ASC : ASCII mode. End of line = CHR$(13). End of file = CHR$(26)
* BIN : Binary mode. Default mode if not used.
Note: m is the time in milliseconds 0 to 65535. 0 is ignore timeout. Default m = 1000
CDm : Time until timeout of DCD line in. If timeout port access stops!
CSm : Time until timeout of CTS line in. If timeout port access stops!
DSm : Time until timeout of DSR line in. If timeout port stops!
OPm : Time until lines become active. If timeout then OPEN fails!
RBs : Size of receive buffer when used. Default = 512
TBs : Size of transmit buffer when used. Default = 512"
RS : Supress detection of RTS (Ready to Send) line"
  • Mode: INPUT, OUTPUT or RANDOM. Random mode can use INPUT #, PRINT #, GET or PUT. Note: If random use LEN = to set size of random buffer(default = 128)