Example Program - VTI Instruments EX1000A User Manual

Hide thumbs Also See for EX1000A:
Table of Contents

Advertisement

VTI Instruments Corp.
E
P
XAMPLE
ROGRAM
#include <stdio.h>
#include <windows.h>
#include <vtex10xxA.h>
#define INSTR_RESRC_STR"TCPIP::192.168.0.127::INSTR"
#define TYPE_V
#define TYPE_T
#define TYPE_E
#define NUM_CHANNELS
#define NUM_V_CHANNELS
#define NUM_E_CHANNELS
#define NUM_T_CHANNELS
#define TRIG_TIMER
#define MAX_SCANS
#define MAX_DATA
int main( int argc, char **argv )
{
ViSession
vi;
ViStatus
status;
/* scanlist entries for EX1032A */
/* channel 0 - 15: voltage channels, 16 - 47: thermocouple channels */
ViInt32
channels[NUM_CHANNELS] = {0,1,3,6,10,15,24,30,31,32,35};
ViInt32
v_channels[NUM_V_CHANNELS] = {0,1};
ViInt32
e_channels[NUM_E_CHANNELS] = {3,6,10,15};
ViInt32
t_channels[NUM_T_CHANNELS] = {24,30,31,32,35};
ViInt32
i, j;
ViReal64
ts_secs[MAX_SCANS], ts_fsecs[MAX_SCANS];
ViInt32
numscans;
ViReal64
data[MAX_DATA];
ViInt32
numdata;
/* open a session */
status = vtex10xxA_init(INSTR_RESRC_STR, VI_ON, VI_ON, &vi);
if(status != VI_SUCCESS)
{
printf("ERROR OPENING CONNECTION\n");
return -1;
}
printf("Connection opened to %s\n", INSTR_RESRC_STR);
/* configure the scan list */
status = vtex10xxA_set_scanlist(vi, channels, NUM_CHANNELS);
if(status != VI_SUCCESS)
{
printf("ERROR CONFIGURING SCAN LIST\n");
return -1;
}
/* configure the EU conversions */
status = vtex10xxA_set_channel_conversion(vi, v_channels, NUM_V_CHANNELS, TYPE_V);
if(status != VI_SUCCESS)
{
printf("ERROR CONFIGURING EU CONVERSIONS\n");
return -1;
122
VTEX10XXA_CONV_MV
VTEX10XXA_CONV_THERMO_TYPE_T
VTEX10XXA_CONV_THERMO_TYPE_E
11
2
4
5
0.2
/* (5 readings per sec) */
1000
(NUM_CHANNELS * MAX_SCANS)
EX10xxA Programming

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the EX1000A and is the answer not in the manual?

Questions and answers

Table of Contents