beautypg.com

HP IEEE 1394 User Manual

Page 57

background image

56

VXI Programming Using the IEEE 1394 Serial Bus

Chapter 3

// transfer the (8000) readings from the multimeter using the SICL
// function iblockmovex - the parameters are id, source handle, source
// offset, source width, source increment, destination handle, destination
// offset, destination width, destination increment, count, and swap

iblockmovex(e8491, map, 0, 8, 1, 0, (unsigned long) rdgs, 8, 1, 64000, 0);

// swap the bytes once they are transferred from shared memory
for (i=0;i<7999;i++)
{

SWAP_FLOAT64(&rdgs[i]);

}

// print some readings to verify the transfer was successful
for (i=0; i<10; i++)

{
printf("%lf\n", rdgs[i]);
}

// unmap memory
iunmapx(e8491, map, I_MAP_SHARED, 0, 1);

// close the device sessions
iclose(e8491);// close SICL interface session
iclose(e1410);// close SICL device session

}

Comments

1. Because of the E1410 multimeter data storage format (eight bytes /
reading), the readings are transferred from shared memory to the PC in
bytes. Therefore, it is necessary to swap each byte in order to re-construct
the reading. Depending on the storage formats of your particular
instruments, swapping may not be necessary.

2. This manual is included on the HP I_O Libraries CD. By viewing the
manual from the CD, you can cut and paste this program into your
development environment.

Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com

This manual is related to the following products: