Wassup ! can you help me to open a serial port (COM1), and to send a string on it as "@0A 1000,100" (ps : in basic, it is like this : open "com1:9600,n,8,1,RS,DS,CS" as #1 print #1,"@0A 1000,100" thanx
well if you download the Win32 API reference (ftp://ftp.borland.com/pub/delphi/techpubs/delphi2/win32.zip) and look in the communication sections theres a whole load on that. hope that helps. -brad
yourve gotta open the port with CreateFile and for the file name, "COM1",0 or "COM2",0 respectivly. Then to write or read to the port, use the returned handle in a call to WriteFile or ReadFile. However, somewhere in that, you have to set the paremters for port. These are such things as the flow control settings, or port speed, timeouts etc.
in addition: use BuildCommDCBA with f.e. "baud=9600 parity=N data=8 stop=1" and SetCommState to setup the port. beaster.
In addition: Im here to remind you that baud is in bytes so 9600 bytes a second is 9.6 kb a second, which isnt that much, i beleive you can make it as fast as you want though. -brad
Microsoft has an technical excellent article on their web site. There is a link at a prevoius post (maybe under parrallel port) It comes with C code which is quite easy to translate. Cheers fiddler