Click here to Skip to main content
15,881,380 members

opening a serial port in a specific way

major konig asked:

Open original thread
hi here!
sorry for askin that but maybe someone has time for a rookie .
need to open a com port in that way:
I/O Request (DOWN) 
IOCTL_SERIAL_SET_BAUD_RATE: Set baud rate 
Baud Rate=38400 

I/O Request (UP) 
IOCTL_SERIAL_SET_BAUD_RATE: Set baud rate 

I/O Request (DOWN) 
IOCTL_SERIAL_CLR_RTS: Clear RTS 

I/O Request (UP) 
IOCTL_SERIAL_CLR_RTS: Clear RTS 

I/O Request (DOWN) 
IOCTL_SERIAL_SET_DTR: Set DTR 

I/O Request (UP) 
IOCTL_SERIAL_SET_DTR: Set DTR 

I/O Request (DOWN) 
IOCTL_SERIAL_SET_LINE_CONTROL: Set line control 
WordLength=8 
StopBits=1 stop bit 
Parity=No parity 
I/O Request (UP) 
IOCTL_SERIAL_SET_LINE_CONTROL: Set line control 

I/O Request (DOWN) 
IOCTL_SERIAL_SET_CHARS: Set special characters 
EofChar=0x0 
ErrorChar=0x0 
BreakChar=0x0 
EventChar=0x0 
XonChar=0x7f 
XoffChar=0x7e 
I/O Request (UP) 
IOCTL_SERIAL_SET_CHARS: Set special characters 

I/O Request (DOWN) 
IOCTL_SERIAL_SET_HANDFLOW: Set handshake information 
ControlHandShake=1 
FlowReplace=0 
XonLimit=2048 
XoffLimit=512 

I/O Request (UP) 
IOCTL_SERIAL_SET_HANDFLOW: Set handshake information 

I/O Request (DOWN)IOCTL_SERIAL_SET_TIMEOUTS: Set timeouts 
ReadIntervalTimeout=1 
ReadTotalTimeoutMultiplier=0 
ReadTotalTimeoutConstant=0 
WriteTotalTimeoutMultiplier=30 
WriteTotalTimeoutConstant=100 

I/O Request (UP) 
IOCTL_SERIAL_SET_TIMEOUTS: Set timeouts 

I/O Request (DOWN) 
IOCTL_SERIAL_PURGE: Purge requests 
Purge mask=TXCLEAR: Write requests, RXCLEAR: Write buffer 

I/O Request (UP) 
IOCTL_SERIAL_PURGE: Purge requests 

I/O Request (DOWN) 
IOCTL_SERIAL_SET_WAIT_MASK: Set current event mask 
WaitMask=RXCHAR: Any Character received 

I/O Request (UP) 
IOCTL_SERIAL_SET_WAIT_MASK: Set current event mask 

Write Request (DOWN) 
Buffer size: 0x1 bytes 
F0  

Write Request (DOWN) 
Buffer size: 0x2 bytes 
28 01  

I/O Request (DOWN) 
IOCTL_SERIAL_PURGE: Purge requests 
Purge mask=TXCLEAR: Write requests, RXCLEAR: Write buffer 

I/O Request (UP) 
IOCTL_SERIAL_PURGE: Purge requests

(down) means data sent to com port
(up) means confirmation from com port, i added just in case .

need a small app(vb/32bit) to run settings above.
the app it should start with a small gui window where com port number can be set manually and an "ok " button to confirm .


closing the app, com port must return to windows default settings .
thank you
Tags: Scripting, Serial

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900