clint78z Posted January 20, 2005 Share Posted January 20, 2005 I am just starting to learn to program the serial port, I have done lots of basic and visual basic and a smidgen of c++. I am trying to make a windows interface for windows for my old dos Accel DFI. First off I got a serial port monitor, it told me what was going on. I understand that the MScomm control is a wrapper for the windows API. I understand baud rate, parity, word length. I am having trouble understanding how to set the flow control and the header insert I don't understand. 9 0.00001537 ntvdm.exe IOCTL_SERIAL_SET_BAUD_RATE Serial0 SUCCESS Rate: 19200 10 0.00000866 ntvdm.exe IOCTL_SERIAL_CLR_RTS Serial0 SUCCESS 11 0.00000922 ntvdm.exe IOCTL_SERIAL_CLR_DTR Serial0 SUCCESS 12 0.00000754 ntvdm.exe IOCTL_SERIAL_SET_LINE_CONTROL Serial0 SUCCESS StopBits: 1 Parity: NONE WordLength: 8 13 0.00000559 ntvdm.exe IOCTL_SERIAL_SET_CHAR Serial0 SUCCESS EOF:0 ERR:0 BRK:0 EVT:0 XON:11 XOFF:13 14 0.00001509 ntvdm.exe IOCTL_SERIAL_SET_HANDFLOW Serial0 SUCCESS Shake:0 Replace:0 XonLimit:2048 XoffLimit:512 15 0.00000559 ntvdm.exe IOCTL_SERIAL_LSRMST_INSERT Serial0 SUCCESS Char: ffffffff The Char: ffffffff I don't understand, is that inserting that into the recieve data stream. Any help hacking this thing would be appreciated, I want to make my old DFI more functional. Quote Link to comment Share on other sites More sharing options...
wheelman Posted January 20, 2005 Share Posted January 20, 2005 Clint87z, Welcome to the sometimes very frustrating world of computer programming. I've been doing embedded programming for about 20 years, most recently working with serial ports on PDAs that are used as control and data analysis modules for handheld xray equipment. First a couple questions: 1. What development system and language are you planning to use? 2. Do you have the MSDN (Micro$oft Developers Network) documentation? 3. Are you planning to replace the DOS program or create a Windows shell around it? To answer your question regarding the the ffffffff in the IOCTL_SERIAL_LSRMST_INSERT call. This call turns on a mode in the comm driver that inserts line and modem status information into the data stream and also sets the escape character the program will use to identify that data. I hope that made sense. In simpler terms the call tells the comm driver to insert data into the data read by the ReadFile function that indicates modem and coontrol line status and also tells the comm driver to precede that data with the ffffffff. Your other question about flow control really depends on what language you're using. If VB then the use the "handshaking" property of the MSComm control to enable or disable flow control or the "CTSHolding" and "RTSEnable" properties to directly manipulate the hardware flow control lines. If you're using C++ then its a whole different ballgame and will take more space then we have here to explain. PM me with a description of what you're trying to do and we'll go from there. Wheelman Quote Link to comment Share on other sites More sharing options...
Nismo280zEd Posted January 20, 2005 Share Posted January 20, 2005 i'm takn' c++ now so maybe i an answer your question in a couple months lol Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.