Security - in using this workstation as a multi-media server - Plex Ubooquity and NAS - for both the home private network and with enabled remote access - I am conscious of opening up ports and access I really do not fully understand. set default timeout values for read and write operationsĬommTimeOuts.ReadTotalTimeoutMultiplier = 0 ĬommTimeOuts.ReadTotalTimeoutConstant = 100 ĬommTimeOuts.WriteTotalTimeoutMultiplier = 0 ĬommTimeOuts.I am looking at the configuration and settings of Defender Firewall for the dual reasons of. PurgeComm((HANDLE)*h_drv, PURGE_TXABORT | PURGE_RXABORT | clear the comm buffers of any pending read/write data If (SetCommState ((HANDLE)*h_drv, &CommDCB) = FALSE) } CommDCB.Parity = u32_parity CommDCB.ByteSize = (U8)u32_data_bits ĬommDCB.fRtsControl = RTS_CONTROL_ENABLE ĬommDCB.fRtsControl = RTS_CONTROL_DISABLE ĬommDCB.fDtrControl = DTR_CONTROL_ENABLE If (GetCommState ((HANDLE)*h_drv, &CommDCB) = FALSE) make sure all other DCB fields are set correctly also set the baud rate, data size, parity, and stop bits LLastError = GetLastError() printf("last error %d \n", lLastError) open the comm port by calling CreateFile Waiting eagerly for some clue from you, as I have tried so many things in past 2-3 days and nothing worked out. Here is the code, but it is a legacy code which i am using just as test software. Code pieces are only indended to explain something particualar. It is also possible that they do not work in all situations. This document is rather old (1995) but everything described there is still valid:īest regards Bordon Note: Posted code pieces may not have a good programming style and may not perfect. Please tell us also the used communication parameters / and handshake. Is ~20% slower baud in comparsion to the real port, even with "optimized" timeout settings.Ĭan you please post your code you wrote to read and write the date on the CP, I assume that there is the problem you have. The only difference I found out, that the FTDI There are from Windows programming side no differences between a real serial port and such a FTDI USB - Serial Converter. I can tell you that your problem is not related to the FTDI - Serial Converter. USB Serial converters - when Windows 2000 was a modern OS) With other hardware devices I faced problems (at least in the early days of In my experience the FTDI solution is the most stable way to connect a serial port to a USB port. I know the FTDI USB - Serial converters very well, I use them since years. Therefore, some help in terms to pursue this issue would be of great help. I am not windows programmer, as I deal with micro-controllers. [On controller side, it is all right because we can see data on hyper-terminal. It is surprising, because write works but read doesn't although data is there on line.ĭata is on the line, because when I use normal hyper-terminal software, I am able to read the data correctly form controller and it is visible. I tried using API monitor software, which shows kernel api Ntreadfile(.), returnsĮrror as "STATUS_TIMEOUT". When I call readfile(.) api, it returns status as TRUE but ZERO bytes are read. > SURPRISINGLY, I am not able to read from serial port to application. (So, Tx on PC is working fine), Application first opens the connection using createfile(.) API and then uses writefile(.) windows apis to write into > I am able to send data from application/PC to hardware and it is received correctly. > I am able to connect to port properly. On PC, I have simple VC++ application which tries to communicate to hardware over Virtual COM port (VCOM : typically COM7). I use embedded hardware (by TI : Piccolo Control Stick xx圆9) which uses FTDI usb to serial converter hardware.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |