paralelle oder serielle Schnittstelle in c oder c++
-
Hallo,
ich suche ein Programmbeispiel, um Daten unter einer win32 umgebung an die parallele oder serielle Schnittstelle zu schicken und empfangen. Zur Not kann es auch eine reine DOS umgebung sein.
Ich arbeite mit Borland 5 und Visual C++ 6, falls das eine Rolle spielt.
Vielen Dank
Freez
-
Serial Communications in Win32
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnfiles/html/msdn_serial.aspSending Commands in Visual C++ ( With MFC ) to ADR Interfaces
http://www.ontrak.net/mfc.htm5.3.3. How do I read/write the serial port?
http://www.iseran.com/Win32/FAQ/section5.html#86HANDLE hPort; // open COM1 for read and write hPort = CreateFile( "COM1", GENERIC_READ | GENERIC_WRITE, // bidirectional 0, NULL, // no security OPEN_EXISTING, // this must be set; the ports are already created FILE_ATTRIBUTE_NORMAL, // maybe with | FILE_FLAG_OVERLAPPED NULL );
Standard ReadFile() and WriteFile() functions can then be used to read or write to the port. To set the port up reliably, COM port specific functions need to be used, so look up the online help for details on the following functions:- GetCommModemStatus(), SetCommState(), SetCommMask(), SetupComm(), PurgeComm(), ClearCommError(), SetCommTimeouts() and EscapeCommFunction()
-
Vielen Dank erst mal. :c)))