How to toggle comm port DTR and RTS lines in W2Kpro

R

Rod Robbins

Is there any way for me to toggle the DTR and RTS high/low states in
W2Kpro?

I used to do this easily with a QBASIC routine in DOS and W98, i.e.

OUT &H3FC, 3 ' Toggles RTS and DTR to ON.
OUT &H3FC, 0 ' Toggles RTS and DTR to OFF.

Now that my client has upgraded the PC using this routine to
W2KPro_sp4, it doesn't work anymore since W2K apparently doesn't allow
direct access to the ports.

The comm port is still working in W2K. If I simply open a
Hyperterminal session to the comm port, this toggles RTS and DTR, even
though nothing is typed into the session window. When I close
Hyperterminal, they toggle back to their initial state. Exactly what
I'm looking for...

Can anyone suggest a way that I can do this with a simple BAT or
command file?

Thanks,
-- Rod
 
V

Vance Green

Rod Robbins said:
Is there any way for me to toggle the DTR and RTS high/low states in
W2Kpro?

I used to do this easily with a QBASIC routine in DOS and W98, i.e.

OUT &H3FC, 3 ' Toggles RTS and DTR to ON.
OUT &H3FC, 0 ' Toggles RTS and DTR to OFF.

Now that my client has upgraded the PC using this routine to
W2KPro_sp4, it doesn't work anymore since W2K apparently doesn't allow
direct access to the ports.

The comm port is still working in W2K. If I simply open a
Hyperterminal session to the comm port, this toggles RTS and DTR, even
though nothing is typed into the session window. When I close
Hyperterminal, they toggle back to their initial state. Exactly what
I'm looking for...

Can anyone suggest a way that I can do this with a simple BAT or
command file?

Thanks,
-- Rod

Try the Mode command (the following is from the W2K helpfile):

(specifically see the handshake commands near the end)
------------------------------------------------------------

Mode (Configure Serial Port)
Configures a serial communications port.
This version of the mode command sets the
parameters for a serial port (COM1, COM2, COM3, etc).
mode comm[:] [baud=b] [parity=p] [data=d] [stop=s]
[to=on|off] [xon=on|off] [odsr=on|off] [octs=on|off]
[dtr=on|off|hs] [rts=on|off|hs|tg] [idsr=on|off]

Parameters
comm:
Specifies the number of the asynchronous-communications (COM) port.
baud=b
Specifies the transmission rate in bits per second. The following
list shows valid abbreviations for b and its related rate:
11 110 baud
15 150 baud
30 300 baud
60 600 baud
12 1200 baud
24 2400 baud
48 4800 baud
96 9600 baud
19 19,200 baud
parity=p
Specifies how the system uses the parity bit to check for
transmission errors. The p value can be one of the following:
n (none), e (even), o (odd), m (mark), or s (space). The default
value is e. Not all computers support the values m and s.
data=d
Specifies the number of data bits in a character. Valid values for
d are in the range 5 through 8. The default value is 7. Not all
computers support the values 5 and 6.
stop=s
Specifies the number of stop bits that define the end of a character:
1, 1.5, or 2. If the baud rate is 110, the default value is 2; otherwise,
the default value is 1. Not all computers support the value 1.5.
to=on|off
Specifies whether infinite time-out processing is on or off.
The default is off.
xon=on|off
Specifies whether the xon or xoff protocol for data-flow
control is on or off.
odsr=on|off
Specifies whether output handshaking that uses the Data Set
Ready (DSR) circuit is on or off.
octs=on|off
Specifies whether output handshaking that uses the Clear To
Send (CTS) circuit is on or off.
dtr=on|off|hs
Specifies whether the Data Terminal Ready (DTR) circuit is
on or off, or set to handshake.
rts=on|off|hs|tg
Specifies whether the Request To Send (RTS) circuit is set
to on, off, handshake, or toggle.
idsr=on|off
Specifies whether the DSR circuit sensitivity is on or off.
 
R

Rod Robbins

Vance,

Thanks for your reply. I've tried the MODE command as you suggested.
It does indeed toggle the RTS and DTR lines. Unfortunately, it only
lasts for about four and a half seconds, then they revert back to
their default states. I've tried every variant of the MODE parameters
that I could think of, but I still can't get the toggled state to
"stick".

???

Regards,
-- Rod


Vance Green said:
Rod Robbins said:
Is there any way for me to toggle the DTR and RTS high/low states in
W2Kpro?

I used to do this easily with a QBASIC routine in DOS and W98, i.e.

OUT &H3FC, 3 ' Toggles RTS and DTR to ON.
OUT &H3FC, 0 ' Toggles RTS and DTR to OFF.

Now that my client has upgraded the PC using this routine to
W2KPro_sp4, it doesn't work anymore since W2K apparently doesn't allow
direct access to the ports.

The comm port is still working in W2K. If I simply open a
Hyperterminal session to the comm port, this toggles RTS and DTR, even
though nothing is typed into the session window. When I close
Hyperterminal, they toggle back to their initial state. Exactly what
I'm looking for...

Can anyone suggest a way that I can do this with a simple BAT or
command file?

Thanks,
-- Rod

Try the Mode command (the following is from the W2K helpfile):

(specifically see the handshake commands near the end)
------------------------------------------------------------

Mode (Configure Serial Port)
Configures a serial communications port.
This version of the mode command sets the
parameters for a serial port (COM1, COM2, COM3, etc).
mode comm[:] [baud=b] [parity=p] [data=d] [stop=s]
[to=on|off] [xon=on|off] [odsr=on|off] [octs=on|off]
[dtr=on|off|hs] [rts=on|off|hs|tg] [idsr=on|off]

Parameters
comm:
Specifies the number of the asynchronous-communications (COM) port.
baud=b
Specifies the transmission rate in bits per second. The following
list shows valid abbreviations for b and its related rate:
11 110 baud
15 150 baud
30 300 baud
60 600 baud
12 1200 baud
24 2400 baud
48 4800 baud
96 9600 baud
19 19,200 baud
parity=p
Specifies how the system uses the parity bit to check for
transmission errors. The p value can be one of the following:
n (none), e (even), o (odd), m (mark), or s (space). The default
value is e. Not all computers support the values m and s.
data=d
Specifies the number of data bits in a character. Valid values for
d are in the range 5 through 8. The default value is 7. Not all
computers support the values 5 and 6.
stop=s
Specifies the number of stop bits that define the end of a character:
1, 1.5, or 2. If the baud rate is 110, the default value is 2; otherwise,
the default value is 1. Not all computers support the value 1.5.
to=on|off
Specifies whether infinite time-out processing is on or off.
The default is off.
xon=on|off
Specifies whether the xon or xoff protocol for data-flow
control is on or off.
odsr=on|off
Specifies whether output handshaking that uses the Data Set
Ready (DSR) circuit is on or off.
octs=on|off
Specifies whether output handshaking that uses the Clear To
Send (CTS) circuit is on or off.
dtr=on|off|hs
Specifies whether the Data Terminal Ready (DTR) circuit is
on or off, or set to handshake.
rts=on|off|hs|tg
Specifies whether the Request To Send (RTS) circuit is set
to on, off, handshake, or toggle.
idsr=on|off
Specifies whether the DSR circuit sensitivity is on or off.
 
V

Vance G

Try again using the commands in conjunction with the

ODSR=

XON=

TO=

IDSR=

commands (i.e. all on one line)
one at a time to see if any of these in combination
have any effect.

Bear in mind I haven't tried this either, so we're both
in the dark...I just thought it might work.

On my other suggestion, here's a link:

http://www.direct-io.com/

might give you somewhere to start.

Rod Robbins said:
Vance,

Thanks for your reply. I've tried the MODE command as you suggested.
It does indeed toggle the RTS and DTR lines. Unfortunately, it only
lasts for about four and a half seconds, then they revert back to
their default states. I've tried every variant of the MODE parameters
that I could think of, but I still can't get the toggled state to
"stick".

???

Regards,
-- Rod


"Vance Green" <[email protected]> wrote in message
Rod Robbins said:
Is there any way for me to toggle the DTR and RTS high/low states in
W2Kpro?

I used to do this easily with a QBASIC routine in DOS and W98, i.e.

OUT &H3FC, 3 ' Toggles RTS and DTR to ON.
OUT &H3FC, 0 ' Toggles RTS and DTR to OFF.

Now that my client has upgraded the PC using this routine to
W2KPro_sp4, it doesn't work anymore since W2K apparently doesn't allow
direct access to the ports.

The comm port is still working in W2K. If I simply open a
Hyperterminal session to the comm port, this toggles RTS and DTR, even
though nothing is typed into the session window. When I close
Hyperterminal, they toggle back to their initial state. Exactly what
I'm looking for...

Can anyone suggest a way that I can do this with a simple BAT or
command file?

Thanks,
-- Rod

Try the Mode command (the following is from the W2K helpfile):

(specifically see the handshake commands near the end)
------------------------------------------------------------

Mode (Configure Serial Port)
Configures a serial communications port.
This version of the mode command sets the
parameters for a serial port (COM1, COM2, COM3, etc).
mode comm[:] [baud=b] [parity=p] [data=d] [stop=s]
[to=on|off] [xon=on|off] [odsr=on|off] [octs=on|off]
[dtr=on|off|hs] [rts=on|off|hs|tg] [idsr=on|off]

Parameters
comm:
Specifies the number of the asynchronous-communications (COM) port.
baud=b
Specifies the transmission rate in bits per second. The following
list shows valid abbreviations for b and its related rate:
11 110 baud
15 150 baud
30 300 baud
60 600 baud
12 1200 baud
24 2400 baud
48 4800 baud
96 9600 baud
19 19,200 baud
parity=p
Specifies how the system uses the parity bit to check for
transmission errors. The p value can be one of the following:
n (none), e (even), o (odd), m (mark), or s (space). The default
value is e. Not all computers support the values m and s.
data=d
Specifies the number of data bits in a character. Valid values for
d are in the range 5 through 8. The default value is 7. Not all
computers support the values 5 and 6.
stop=s
Specifies the number of stop bits that define the end of a character:
1, 1.5, or 2. If the baud rate is 110, the default value is 2; otherwise,
the default value is 1. Not all computers support the value 1.5.
to=on|off
Specifies whether infinite time-out processing is on or off.
The default is off.
xon=on|off
Specifies whether the xon or xoff protocol for data-flow
control is on or off.
odsr=on|off
Specifies whether output handshaking that uses the Data Set
Ready (DSR) circuit is on or off.
octs=on|off
Specifies whether output handshaking that uses the Clear To
Send (CTS) circuit is on or off.
dtr=on|off|hs
Specifies whether the Data Terminal Ready (DTR) circuit is
on or off, or set to handshake.
rts=on|off|hs|tg
Specifies whether the Request To Send (RTS) circuit is set
to on, off, handshake, or toggle.
idsr=on|off
Specifies whether the DSR circuit sensitivity is on or off.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top