HP E8491A manual For i=0 i10 i+=2 Printf%lf\n\n,dataPtri*range/32768

Page 38

//open a VXIplug&play device session and reset the digitizer errStatus = hpe1563_init(E1563,0,1,&vi);

if( VI_SUCCESS > errStatus)

{

hpe1563_error_message( vi, errStatus, err_message); printf("Unable to open %s\n", E1563);

printf("hpe1563_init() returned error message %s\n", err_message); return;

}

//enable digitizer error detection

hpe1563_errorQueryDetect(vi, 1);

//set a 5s timeout period to allow functions to complete errStatus = hpe1563_timeOut(vi, 5000);

check(vi, errStatus);

//configure the digitizer to take 2,000 post-trigger readings

//not to exceed 4V on channel 1

errStatus=hpe1563_configure(vi, 1, 4.0, 2000,1); check(vi, errStatus);

// set an immediate trigger

errStatus = hpe1563_trigEvent(vi, 1, hpe1563_TRIG_IMM, 0.0); check(vi, errStatus);

// set the minimum sample period

errStatus = hpe1563_sampTim(vi, hpe1563_SAMP_TIM_MIN); check(vi, errStatus);

//disable digitizer error detection hpe1563_errorQueryDetect(vi, 0);

//initiate the digitizer

errStatus = hpe1563_initImm(vi);

//pause 3 ms (1.3e-6 * 2000) to allow readings to complete Sleep (3);

//fetch readings from the digitizer’s A24 space

errStatus = hpe1563_fetchAll_Q(vi, dataArrayLen, (ViInt32 *)rdgs, &numRdgs );

//confirm readings transferred are valid by printing first 5 readings dataPtr = (ViInt16 *)rdgs;

//query digitizer reading range

errStatus = hpe1563_range_Q(vi, 1, &range); printf("Reading samples are:\n\n");

for (i=0; i<10; i+=2)

{

printf("%lf\n\n",dataPtr[i]*range/32768);

}

38 VXI Programming Using the IEEE 1394 Serial Bus

Chapter 3

Image 38
Contents Contents Chapter Index Contents HEWLETT-PACKARD Warranty Statement Documentation History Manufacturer’s Name Page Business Reply Mail Page Interface Installation Configuration Component OverviewVXI Programming Using Ieee 1394 Serial Bus Additional InformationInterface Installation and Configuration Installing Ieee Host AdapterLayout of the Adaptec AHA-8940 1394-to-PCI Host Adapter Locating a PCI bus Expansion Slot Connecting the Power Cable Installing HP E8491A Interconnect Where to go NextPage Connecting the HP E8491A to the Host Adapter Installing VXI Instruments InstrumentsInstalling C-size Instruments Installing A- and B-size Instruments Shows the installation of A- and B-size instrumentsPage Interface Installation and Configuration Chapter Configuring the HP E8491A Interconnect 10. The HP IO Libraries Program Group11. The HP IO Libraries IO Config Utility Editing the HP E8491A Configuration 12. Editing the HP E8491A ConfigurationInstrument Drivers InstallingEditing the HP E8491A Configuration on Windows 95 Platforms Verifying the Installation Viewing the Resource Manager Output 17 is a partial listing of a typical resource manager output Page Running the Resource Manager Page VXI Programming Using the Ieee 1394 Serial Bus Optimizing Programs Block Data TransfersBlock Transfers using HP VXIplug&play Drivers For i=0 i10 i+=2 Printf%lf\n\n,dataPtri*range/32768 Comments HP Visa Error checking routine Comments HP E8491A Triggering TTLTRG7 TTLTRG0Configuring the E8491A Trig In and Trig Out Ports ItrigallTurn off the autozero function iprintfe1412, Zeroauto OFF\n Program, ivxitrigroutee8491s, ITRIGEXT0 Using HP E8491A Shared Memory Locating E8491A Shared MemoryLocating Shared Memory Using HP Visa Starting address of E8491A shared Memory hexadecimal Storing Readings Shared Memory HP Visa Example #define E8491 VXI00INSTRUnsigned char ViClosefw E8491 Error handling function Storing Readings Shared Memory Sicl Example Ivxirminfoe8491, 0, &info startaddr = info.memstart Comments Ieee 1394 Fundamentals Interface Overview Ieee 1394 Topology and TerminologyFeatures of the Ieee 1394 Bus Terms shown in -1 are defined in the following tableOptimizing the Configuration Ieee Data Transfer ProtocolIeee 1394 Fundamentals and Interface Overview Chapter Adaptec AHA-8940 Host Adapter Interface Cable HP E8491A PC to VXI Interconnect PIN #Configuration Label Using the HP E8491A With the HP E1406 Command Module HP IO LibrariesInterface Characteristics VXI Characteristics GeneralExternal Trigger Output CLKExternal Trigger Input Cooling Trigger DelaysPower Supply Loading Specifications Appendix a Editing the HP E8491A Resource Manager Configuration Configuration File OverviewPage Page Page Using ivxisc Utility Function OverviewPage Iclear Sicl interface name, logical address Page Index MXI Trig In specifications Index