Storing Readings In Shared Memory - Sicl Example - HP AHA-8940 Configuration And User's Manual

Ieee 1394 pc link to vxi
Table of Contents

Advertisement

Storing Readings in
Shared Memory - SICL
Example
// SHAR_SICL.CPP - This program demonstrates how to access the
// HP E8491A's shared memory. The program stores readings taken by
// the HP E1410 multimeter in HP E8491A shared memory, and then
// transfers those readings from shared memory to the computer.
#include "sicl.h"
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
// project files: SHAR_SICL.cpp, SICL32.lib
// set up byte swap function for readings transferred from
// E8491A shared memory to the PC
#define SWAP_FLOAT64(rdgs) \
{ unsigned char src[8];
*((double *)src) = *((double *)rdgs);
((unsigned char *) (rdgs))[0] = ((unsigned char*) (src))[7]; \
((unsigned char *) (rdgs))[1] = ((unsigned char*) (src))[6]; \
((unsigned char *) (rdgs))[2] = ((unsigned char*) (src))[5]; \
((unsigned char *) (rdgs))[3] = ((unsigned char*) (src))[4]; \
((unsigned char *) (rdgs))[4] = ((unsigned char*) (src))[3]; \
((unsigned char *) (rdgs))[5] = ((unsigned char*) (src))[2]; \
((unsigned char *) (rdgs))[6] = ((unsigned char*) (src))[1]; \
((unsigned char *) (rdgs))[7] = ((unsigned char*) (src))[0]; \
}
void main(void)
{
INST e8491;
INST e1410;
struct vxiinfo info;
unsigned long start_addr;
double rdgs[8000];
short i;
unsigned long map;
54 VXI Programming Using the IEEE 1394 Serial Bus
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.
This example uses the HP E1410 VXIplug&play driver to configure the
multimeter, take the readings, and store them in E8491A shared memory.
SICL functions are used to transfer the readings from shared memory to the
PC.
// handle for SICL session to E8491
// handle for SICL session to E1410
// structure for data returned by ivxirminfo
// starting address of shared memory
// array for readings from shared memory
// memory map space
\
\
Chapter 3

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

E8491aIeee 1394

Table of Contents