HP E8491A manual Storing Readings Shared Memory Sicl Example

Page 54

Storing Readings in

Shared Memory - SICL

Example

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.

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

// handle for SICL

session to E8491

INST e1410;

// handle for SICL

session to E1410

struct vxiinfo info;

// structure

for data returned

by

ivxirminfo

unsigned long start_addr;

// starting address of shared

memory

double rdgs[8000];

 

//

array

for readings from

shared memory

short i;

 

 

 

 

 

 

unsigned long map;

 

//

memory map space

 

 

54 VXI Programming Using the IEEE 1394 Serial Bus

Chapter 3

Image 54
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 ConfigurationInstalling Editing the HP E8491A Configuration on Windows 95 PlatformsInstrument Drivers 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 GeneralCLK External Trigger InputExternal Trigger Output Trigger Delays Power Supply LoadingCooling 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