Home   Archive   Permalink



How can i use two serial ports?

I use that script:
    
System/ports/serial:[com4]
mx: open/binary/direct/no-wait serial://port1/38400/8/none/1
    
it works fine, but i need a second port on com3 to read data - how can i do this.
close mx and set a new port does´t work
    
many thanks

posted by:   Ed     21-May-2015/10:39:52-7:00



I would advise reading through the info on serial ports on http://www.codeconscious.com/rebol/rebol-net.html#SerialPorts
    
see the following:
    
1) You must be running REBOL as ROOT (or somehow change the permissions
     on the serial ports beforehand) as this is a security feature of
     most multi-user systems.
    
2) Try setting system/ports/serial to the different naming conventions
     of your system. For example:
    
     system/ports/serial: [ttyC0 ttyC1]
     -or-
     system/ports/serial: [ttyS0 ttyS1]
     -or-
     system/ports/serial: [cua0 cua1]
    
     You can include as many serial ports as there are on your system in
     this block.
    
3) Open the serial port like this:
    
     serial-port: open serial://port1/9600/8/none/1
Use the word PORT1 above (don't replace with the serial port name)
as it refers directly to a location in the system/ports/serial
block. You can also use PORT2 or PORT3, etc. (if applicable to your
system).

posted by:   kealist     21-May-2015/10:59:02-7:00



in other words, use PORT1 and PORT2 to refer to different ports from the system/ports/serial block and see if that works. I don't have all my serial devices out to play with to confirm.

posted by:   kealist     21-May-2015/11:00:54-7:00



Thank you for the fast reply !

posted by:   Ed     22-May-2015/2:02:50-7:00