|
comOpen |
|
comOpen( const devname, // name of async device [const logfile]) // optional communication logfile Opens a communication line and returns a handle. The handle returned by comOpen is needed in subsequent calls to other COM functions. devname is usually something like com1, com2 etc. Please note that Win32 requires a special notation for device names other than com1...com9. You will have to write \\.\ in front of all non-standard device names. For example you might have to write \\.\com10 instead of com10. Devices are always initialized to these settings by comOpen:
These settings may be altered by calling comBps, comBits, comParity, comStops and comReadTimeout after opening the device. Optionally all communications can be traced into a logfile. The logfile is plain ASCII and may be inspected by any text editor. Example:
var hdl = comOpen('com1','com1.log');
comBps(hdl,9600);
comWrite(hdl, 'hello world');
comWaitForOutput(hdl);
comClose(hdl);
|
||||||||
| Copyright © IBK Landquart | Last revision: 27.05.2002 | << Back Top Next >> |