Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: using wait on a serial device

From: bo:rebol at: 6-Nov-2000 10:06

The 'file scheme for a serial port probably isn't a bad thing. This is probably because it is handled much like a file port. You shouldn't need a special serial-port refinement to open a serial port. You should only need to call serial:// The default values for opening serial ports are: device: port1 speed: 9600 data bits: 8 parity: none stop bits: 1 URL's are encoded with the different fields separated by slashes. For example, serial://port1/9600/8/none/1 The order of fields is not significant, as the type of field can be determined by the content. Above, 'port1' is the name of your serial port. On Windows, this may be something like com1. On Linux, it may be something like ttyC0. The ports available on your particular machine should be noted in the following path: system/ports/serial Hope this helps! -Bo On 3-Nov-2000/15:54:36-8:00, [dlhawley--home--com] wrote:
>I am now using REBOL/core (Experimental) 2.4.37.22 which suports >the no-wait open refinment, but my open still return a port >with scheme set to `file. Is there an open refinment to open a serial >port? And how does one set the port settings? > >Previously, you (Holger Kruse) wrote: >> On Thu, Nov 02, 2000 at 02:50:53PM -0800, David Hawley wrote: >> > I am building at least a prototype of an instrument which reports >> > it's data collection via e-mail using REBOL. Currently it runs on >> > QNX4, but probably will run on QNX RTP/Nto. >> > >> > I have several instruments which are connecteded via serial ports >> > as well as a LCD/keypad display. I have writing to the display working >> > and can read characters from the keypad, but am having trouble building >> > a loop around a wait statement. >> > >> > I open the lcd with the following: >> > >> > lcd-fp: open/mode %/dev/ser1 [ direct write read binary ] >> > >> > writing works as expected using insert. To read chars I use: >> > >> > char: first lcd-fp >> > >> > but doing a: wait [lcd-fp] >> > >> > I get: >> > >> > >> wait [lcd-fp] >> > ** Script Error: Invalid argument: ?port?. >> > ** Where: wait [lcd-fp] >> > >> type? lcd-fp >> > == port! >> > >> >> >> For file ports REBOL currently does not distinguish between streams >> and disk-based files. That's why 'wait does not work for them, and also >> why 'skip'ping is slow and only works in one direction. Both are issues >> that we plan to resolve in the future, by using different behaviors for >> streams and disk-based files. >> >> For serial i/o try one of the more recent experimental builds. They >> support "serial:" ports (currently for all operating systems except MacOS >> -- that to be supported soon). "serial:" ports support 'wait, and also >> let you adjust port setting such as flow control and transfer rate. > >Is this documented any where? > >-- >David L. Hawley D.L. Hawley and Associates 1.503.274.2242 >Software Engineer [David--L--Hawley--computer--org] > >-- >To unsubscribe from this list, please send an email to >[rebol-request--rebol--com] with "unsubscribe" in the >subject, without the quotes. >
-- Bohdan "Bo" Lechnowsky REBOL Adventure Guide REBOL Technologies 707-467-8000 (http://www.rebol.com) The Official Source for REBOL Books (http://www.REBOLpress.com)