User`s manual

Software Manual • EKF Intelligent I/O Controller Family On
CompactPCI
- 21 -
EKF Elektronik GmbH * Philipp-Reis-Str. 4 * D-59065 HAMM (Germany)
Tel. +49 (0)2381/6890-0 * Fax. +49 (0)2381/6890-90 * E-Mail info@ekf.de * Internet http://www.ekf.de
Loading / Unloading The Driver
At boot time the system will automatically load and start the driver. The driver then looks in
the registry for the installed hardware it supports, initializes all ports and makes them visible
to the system.
The driver also supports its unload from the system. This can be made under Windows NT4
from the
Devices Menu
of the
Control Panel
. The devices administrated by the driver will be
disabled, all allocated resources like memory and interrupt vectors are returned to the
system. Last the devices will be deleted from the system making them invisible to any
application.
Opening / Closing Of Devices
An application opens a port on an EKF Intelligent I/O Controller using the C function
CreateFile
. An individual port is referenced by its WIN32 device name, e.g. COM11. Opening
a device for overlapped operation is always possible.
On device opening the driver purges the port’s read and write buffers and clears the
performance counters and the event mask. For serial devices additional the escape
character is cleared and the thresholds for the flow control are set to XoffLimit = 511 and
XonLimit = 2046.
If the port was opened the first time after system boot, the port has, dependent on its type,
the following default parameters:
Serial ports: 9600 Baud, 8 data bits, 1 stop bit, no parity, the valid data mask is
0xFF, XOFF character is 0x13 (CTRL S), XON character is 0x11
(CTRL Q), any flow control is turned off, all timeout timers are turned
off.
CANbus ports: 250 kBaud, acceptance filter as set up in the driver’s registry key, all
timeout timers are turned off.
Note, that if these device parameters are modified by IoControls, their values will remain
across opens. They will never return to their initial values as found on the first open.
Example: handle = CreateFile(
“\\\\.\\COM11",
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
OPEN_EXISTING,
FILE_FLAG_OVERLAPPED,
NULL
);