Teledyne LeCroy Using PCIUW from C++ Code User Manual

Using pciuw from a c++ code

Advertising
background image

Using PCIUW from a C++ Code

The PCIUW utility may be executed from within a C program code. The functions below describe how to
read, save and write back to the registers. These functions are for Microsoft C++ compilers. The
PCIUW.EXE and necessary DLLs must reside in the directory where this program is executed from.
The necessary steps are:

1- Read all devices
2- Search for the desired device in the CFG file
3- Save the information for the device to a file, by specifying the bus number and the device number in

the save command

4- Write from the file to reload the hardware

The format of the CFG file is described below to allow locating the desired device(s).

A- Description of function calls to read, save and reload devices

void CTestDlg::OnButtonRun()
{

/*run the utility to read all devices */
int ReturnCode = 0 ;
ReturnCode=WinExec("pciuw",SW_SHOW);
/*run the utility to show help dialog */
// ReturnCode=WinExec("pciuw /?",SW_SHOW);
/*run the utility to save the device configuration information of the device on BusNo = 1 and
device No = 0 */
// ReturnCode=WinExec("pciuw /s 1 0",SW_SHOW);
/* Bus number=1 and Device = 0 here are examples, to find the specific of what your device
number is search the CFG file to located your device, using the cfg file description below, after
you run the utility to read all devices. The device related information may also be located from a
command line outside of the c program and then used in the code, so long as the system
configuration does not change. */
/*run the utility to load configuration information from the last saved file into the hardware */

// ReturnCode=WinExec("pciuw / w",SW_SHOW);
if(ReturnCode < 31)
AfxMessageBox ("run command failed.");

}

B- CFG file description

PCIUW program when executed saves its configuration information in “set@@@.cfg” file. This document
describes the format of this file.

Advertising