User`s manual
Software Manual • EKF Intelligent I/O Controller Family On
CompactPCI
- 33 -
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
Get Port Status: IOCTL_SERIAL_GET_COMMSTATUS
This I/O control request returns the current communication status of a serial or CANbus port.
This includes the number of characters in the read and write buffers, the error status and so
on.
Call: DeviceIoControl(
handle, // handle returned by
CreateFile
IOCTL_SERIAL_GET_COMMSTATUS,
NULL,
0,
pStatus, // pointer to a SERIAL_STATUS or SJA1000_STATUS
// structure
1
)
sizeof(*pStatus),
&unused, // pointer to a DWORD variable
pOverlapped // optional pointer to overlapped buffer (may be NULL)
);
Notes:
1
) The status is returned in these structures. Use SERIAL_STATUS for serial ports and
SJA1000_STATUS for CANbus ports. These structures are defined in the C header file
“ntddekf.h” delivered with the driver installation package. See also section
“
SERIAL_STATUS
” in this chapter and section “
SJA1000_STATUS
” in the chapter “
Board
Level Interface Description
”.
2
) The error status word kept by the driver and returned in the status record is cleared after
this request was executed.
Get DTR/RTS Status: IOCTL_SERIAL_GET_DTRRTS
This I/O control request returns the current status of the modem lines
Data Terminal Ready
(DTR) and
Request To Send
(RTS) of a serial port.
Call: DeviceIoControl(
handle, // handle returned by
CreateFile
IOCTL_SERIAL_GET_DTRRTS,
NULL,
0,
&Status, // pointer to a DWORD variable
1
)
sizeof(Status),
&unused, // pointer to a DWORD variable
pOverlapped // optional pointer to overlapped buffer (may be NULL)
);