Home   |  About Us   |  What's New   |  Products   |  Services   |  Support   |  Other Sites   |  Clients   |  Contact Us
ADS

Applied Data Sciences / cPCIHSD/PCIHSD2® Win NT4.0/2000/XP Driver

This driver is intended for operation under Windows NT Version 4.0, Windows 2000 and Windows XP. The same driver is used for all operating systems. This driver handles all communication with the cPCIHSD or PCIHSD2 on behalf of the calling program. It allows for reading and setting the operating mode of the cPCIHSD or PCIHSD2.

Details of the driver installation are in presented in the section entitled INSTALLATION.

To download a PDF formatted printable version of the driver manual, please click here.

To search the current page for information, please use the box below.  Search help.

CreateDevice Function:

The standard CreateDevice function is called to associate a device handle with the desired PCIHSD device. For example, the most likely parameters to create the PCIHSD device is:

    TCHAR csDeviceName[ ] = "\\\\.\\PCIHSD0";
    DWORD dwAccess = GENERIC_READ|GENERIC_WRITE;
    DWORD dwShareMode = 0;
    DWORD dwCreationDisp = OPEN_EXISTING;
    DWORD dwFlags = FILE_ATTRIBUTE_NORMAL;
    HANDLE hPciHsd;

      hPciHsd = CreateFile( csDeviceName,
        dwAccess,
        dwShareMode,
        NULL, // security attributes
        dwCreationDisp,
        dwFlags,
        NULL // template file handle
    );

It is possible to perform asynchronous operations on the PCIHSD device by specifying the FILE_FLAG_OVERLAPPED flag as part of the dwFlags parameter.

When the device is created, the PCIHSD is reset and the driver sets a five-second timeout default for all I/O operations.

Start PCIHSD Input/Output:

    Function Code: IOCTL_HSD_START
    Input Buffer: pointer to an Encore type IOCB list array
    Input Length: size of the input array
    Output Buffer: pointer to an array that will receive the IOCB list after completed
    Output Length: size of the output array

This function is used to present a list of IOCBs that perform the operation desired by the user. The user must be familiar with the Encore IOCB design and IOCB fields. The IOCB structure is defined in the include file, pcihsdioctl.h.

The IOCB list can be made up of all the commands permitted by the HSD except for a Transfer In Channel (TIC) command. The IOCBs are linked together by either the Command Chain bit or the Data Chain bit as required. The driver processes the entire list, transforming the IOCBs into appropriate PCIHSD descriptors to execute the operation. Since data is moved directly to or from the user's data arrays, those areas of the user's memory are locked into physical memory for the duration of the call.

The Output Array is optional. The only time it is necessary is for those IOCB lists that contain a Device Status Request IOCB. In this case, the device status and residual count is stored in the fourth word of the IOCB. The user must provide an area for the system to return the list to get the device status information.

PCIHSD Timeout Control:

    Function Code: IOCTL_HSD_TIMEOUT_CONTROL
    Input Buffer: pointer to a PCIHSD_TIMECTRL structure with new values
    Input Length: size of PCIHSD_TIMECTRL variable
    Output Buffer: pointer to PCIHSD_TIMECTRL structure for the old values
    Output Length: size of PCIHSD_TIMECTRL variable

This function is the preferred method of setting timeout values to govern Input/Output operations. With this function, the timeout method used by the driver is set to correspond to the units of the time value. If the time value is in milliseconds, then the driver employs a high-speed timer and timeouts can be as short as 20 milliseconds. If the time value is in seconds, then the driver employs a low-speed timer with the minimum timeout being one second. See the description of the PCIHSD_TIMECTRL structure in Section 3 for information on the contents of the structure.

Set Mode Variable:

The variable passed in the Set Mode DeviceIoControl function contains the following groups of items:

Op Mode:

  • Board operating mode code containing one of the following defined values:
  • PCIM_HSD operating as HSD
  • PCIM_IBL operating as IBL

Connect:

  • Board connector configuration code containing one of the following defined values:
  • PCIM_CNRM Normal (HSD) connectors
  • PCIM_CREV Reverse (IBL) connectors

Note: on an IBL link, certain signals must be transposed from one HSD device to the other. This is accomplished by either 1) using a cable with the appropriate wires interchanged and normal connectors on both HSD's or 2) using a straight-through cable and setting one of the HSD devices in a Reverse connector configuration.

Byte Swap:

  • Data swap option containing one of the following defined values:
  • PCIM_BSWAP Swap bytes/words
  • PCIM_NSWAP No swap

Note: byte swapping is dependent on the type of processor running Windows NT. For those systems running on an Intel x86 processor, select PCIM_NSWAP for this option.

Link type:

  • IBL link request mode containing a code specifying the desired IBL link protocol.
  • PCIM_LREQ Always request IBL link when initiating a transfer.
  • PCIM_LACK Never request IBL link when initiating transfer.
  • PCIM_LIBLG Use link protocol of the Encore H.IBLG handler for MPX. (Request link if writing, don't request if reading.)

Link prior:

  • IBL link request priority containing a code specifying the hardware link priority desired.
  • PCIM_HIPRI Set high link priority.
  • PCIM_LOPRI Set low link priority.

Distribution Media:

The PCIHSD device driver is distributed on a CDROM floppy and contains the following components:

  • Device driver code: Part Number 0950110
  • Test HSD example code
The following files should be found in the PCIHSD folder:
  • PCIHSD.sys PCIHSD Device Driver.
  • pcihsd.h Include file that defines structures and constants for programming.
  • pcihsdioctl.h Include file that defines DeviceIoControl function calls and IOCB structure for programming.
  • pcihsd.reg PCIHSD registration file containing the proper entries for the Registry.
  • install.bat Batch file for completing NT 4.0 installation.
  • Pcihsd.inf Driver information file for Windows 2000.

The files, found in the testhsd folder, comprise a complete C++ project which when compiled creates a program for testing the PCIHSD using Applied Data Sciences' HSD Analyzer/Tester. The project is included as an example of PCIHSD programming.

NT 4.0 Driver Loading:

The installation process registers the driver with Windows NT as a manual loading device driver. This is intended as a precaution to ensure that the driver will load properly and not cause the Windows NT system any undue grief. Assuming the PCIHSD board has been physically installed in the desired computer system, load the driver through the following steps.

  1. From the Windows NT Start menu, select Settings.
  2. From Settings, select Control Panel.
  3. From Control Panel, select Devices.
  4. In the Devices window, scroll down to the PCIHSD entry. The PCIHSD entry should show no current Status and Startup should be set to Manual.
  5. Select the PCIHSD entry and click the Start button. The system will now attempt to start the PCIHSD device driver. If it starts properly, the Status for the entry will change to Started. If it does not start properly, use the Event Viewer to examine the Event Log for the reason why the driver failed to load. Correct the problem and retry starting the driver.
  6. Once the driver loads properly, in the Devices window select the PCIHSD entry and click the Startup button. Select the type of start up desired (most likely Automatic) since the driver is not required for proper system operation.

For additional information, please contact us at your convenience.  Copyright 2001 Applied Data Sciences, Inc. All rights reserved.