//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

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