programming tools for Windows applications development
  Home  |   SwiftForth Archive  |   SwiftX Archive  |

Re: Serial Comm: Xon Control

From: Mike Ghan <MikeGhan_at_logix-controls.com>
Date: Mon, 5 Dec 2005 10:19:41 -0800

See CommResource.F for details on DCBflags bits. Try following
(untested):

SERIAL-PORT BUILDS COM-PORT \ Our Com Port Object

: COMSET: ( StopBits Parity ByteSize DCBflags2ndByte DCBflags1stByte --
)
   CREATE C, C, C, C, C,
   DOES> ( -- ) COM-PORT COMMSTATE DCB-SETTINGS 5 CMOVE ;

0 0 8 $10 $11 COMSET: N,8,1 0 0 7 $10 $11 COMSET: N,7,1
0 1 8 $10 $13 COMSET: O,8,1 0 1 7 $10 $13 COMSET: O,7,1
0 2 8 $10 $13 COMSET: E,8,1 0 2 7 $10 $13 COMSET: E,7,1

: OPEN-COM-PORT1 ( -- )
   Z" \\.\COM1" COM-PORT OPEN ( ior ) 0<> THROW
   COM-PORT GET-COMMSTATE
   N,8,1
   9600 COM-PORT COMMSTATE BaudRate !
   COM-PORT COMMSTATE SET-DCB
   COM-PORT SET-COMMSTATE
   COM-PORT ACTIVATE ;

> -----Original Message-----
> From: sftalk-bounce_at_forth.com
> [mailto:sftalk-bounce_at_forth.com] On Behalf Of Virgil Stamps
> Sent: Monday, December 05, 2005 8:10 AM
> To: sftalk_at_forth.com
> Subject: [sftalk] Serial Comm: Xon Control
>
> I want to implicitly turn the Xon function OFF when I
> initialize a serial port via SF. I am using Commdriver.f,
> Commextend.f and Commresource.f (not SIO.f).
>
> If a PC com port happens to be setup for Xon/Xoff control, SF
> does not touch it. That will cause lost bytes if a binary
> packet such as MODBUS RTU format.
>
> Where/how to set DCBflags in SF?
>
> What is the preferred set of serial routines to use?
>
> Thanks for any help,
> Virgil Stamps, Principal Engineer
> PAC L.P. virgil_at_paclp.com vstamps_at_houston.rr.com 300 Bammel
> Westfield Road Houston, TX 77090
> 713 933-2850
>
>
>
> ----------------------------------------------------------------------
> sftalk_at_forth.com The SwiftForth programming discussion email list
> To unsubscribe, send subject "unsubscribe" to
> sftalk-request_at_forth.com For list command help, send subject
> "help" to sftalk-request_at_forth.com Message archives are
> located at http://www.forth.com/archive/sftalk
> ----------------------------------------------------------------------
> This list is a forum for SwiftForth users. For product
> support and bug reports, please send email to support_at_forth.com
> ----------------------------------------------------------------------
>
>
----------------------------------------------------------------------
sftalk_at_forth.com The SwiftForth programming discussion email list
To unsubscribe, send subject "unsubscribe" to sftalk-request_at_forth.com
For list command help, send subject "help" to sftalk-request_at_forth.com
Message archives are located at http://www.forth.com/archive/sftalk
----------------------------------------------------------------------
This list is a forum for SwiftForth users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Mon Dec 05 2005 - 10:20:31 PST

This archive was generated by hypermail 2.2.0 : Thu Dec 04 2008 - 03:04:20 PST