e1529a/e1422a pnp/vee training note - although this material uses vee, it also demonstrates the...
TRANSCRIPT
E1529A/E1422A PnP/Vee Training
Note - Although this material uses Vee, it also demonstrates the general PnP function call sequence that should be used with Visual Basic or C programming
Epsilon OverviewPage 2
E Trainer forE1529A - E1422A Programming
Tom Conway
Phone
Personal line: 970-679-3863
Loveland VXI support line: 970-679-2545
Loveland, Colorado USA
Office hours 8am-5pm Mountain time zone
Email: [email protected] or
Use the E trainer to:
Answer questions on the E1522A - E1422A Programming material
Epsilon OverviewPage 3
Epsilon System Components
• E1422A (VXI cage related items)
• E1539-66501 SCP
• E1422-80101
• Cable from E1422 to E1529
• Power supply to E1529B
• E1529B
• Gage wires and gages
• Cable from E1529B to Excitation Voltage
• Excitation Voltage Supply
Epsilon OverviewPage 4
Initial System Setup
• IO Libraries
• http://www.tm.agilent.com/tmo/software/English/HP_IO_Libraries.html
• normally come with the interface instrument (1406, 8491)
• Instrument Drivers
• http://www.tm.agilent.com/tmo/datasheets/English/HPVXIdrivers.html
• latest A.01.04 (January 2000) [web has June 1999--- 4 revisions old]
Epsilon OverviewPage 5
E1529A - E1422A System ComponentsExcitation Voltage Connection to Strain Gage
Epsilon OverviewPage 6
Addressing (GPIB,FW,E/C)
• Logical Address
• ex: 160
• GPIB (Logical Address)/8
• GPIB0::22::20::INSTR
• @72220 (GPIB Code 7)
• Firewire (FW Code 16)
• VXIO::160::INSTR
• @16160
1422
1406
GPIB
VXI
Epsilon OverviewPage 7
Addressing in Vee
• Under I/O ---> Instrument Manager
4
3
21
click
Drivers used previously
Instruments found by Vee
Epsilon OverviewPage 8
Addressing in Vee
5
6
7Name it (optional)
Epsilon OverviewPage 9
Addressing Epsilon Programmatically10000
Adapter slot#
Always a 1Channel number
on E1529
Example: 1) Have SCP in slot 3. Which adapter numbers can it use? Answer: 24 & 25
Each SCP slot has two possible adapter slot numbers it can use: (SCP# x 8), (SCP# x 8 +1)
Can specify individual channels or channel lists: (@10001) or (@10102:11631)
Epsilon OverviewPage 10
• Configuration
• Calibration
• EU Conversion Setup
• Define Channel List, Data Return
• Setup Trigger
• Data Retrieval
General Epsilon Usage Model
Epsilon OverviewPage 11
General Epsilon Usage Model
Program Download Process
Step 1 Set Channel Amplifiers Filters, & Current Sources
INP:…& OUTP:...Commands
Step2 Link Engineering UnitConversions to Channels
[SENSe:]FUNC:…Commands
Step 3 Calibrate Channel Set-up *CAL? CommandStep 4 Define and Select Scan List(s) ROUT:SEQ:DEF & ROUT:SCAN
CommandsStep 5 Set Sample Timer SAMP:TIMER CommandStep 6 Select Trigger & Arm Sources TRIG:SOUR Command
ARM:SOUR CommandStep 7 Select Data Format FORMAT CommandStep8 Select FIFO Mode SENS:DATA:FIFO:MODE Command
Step 9 Initiate Trigger System INITiate: ... CommandsTrigger Event--------------------->
Step 10 Retrieve Data SENS:DATA:FIFO:...CommandsSENS:DATA:CVT: ...Commands
Configure
Calibrate
Trigger
Data Setup
Data Return
Epsilon OverviewPage 12
Configuration
• Strain Types (FBEN, HBEN, Q120, Q350, USER)
• sense:func:str:<type> (@<channel#s>)
• NOTE: settling times of up order 0.5 seconds
• Filters (2,10,100, Off) [banks of 8]
• inp:filt:freq <freq> (@<channel#s>)
• inp:filt:stat ON (@<channel#s>)
• GF (floating number.. (ie. 2.2, 2.5))
•sense:str:gfac <value>
(@<channel#s>)
• Excitation (BRID, EXC) [all
channels]
•sense:str:conn <value>
(@<channel#s>)
•sense:str:exc:stat ON
(@<channel#s>)
Epsilon OverviewPage 13
Calibration• E1422 Calibration
• *cal?
• Using plug and play drivers need to set timeout higher:
• cal:set, cal:set? (better as timeout varies with SCP types/numbers)
• E1529B Calibration
• NOTE: cal:tare? NOT used with E1529 system
• cal:rem? (@<channel#s>)
Epsilon OverviewPage 14
EU Conversion
• Algorythm relys on unstrained voltage and the exact excitation voltage. Therefor need to measure those voltages using:
• meas:volt:unst? (@<channel#s>)
• meas:volt:exc? (@<channel#s>)
• NOTE: Both of the commands also store their readings in the fifo. To make sure that these will not conflict with the data reading, it’s probably a good idea to clear the fifo with: sense:data:fifo:reset (unless you specifically want those readings, then you can get them using the fifo data retrieval commands)
Epsilon OverviewPage 15
Channel List, Data Return
• Set route tell where to put data
• rout:seq:def X(@<channel#s>))
• X is channel data modifier
• 0 -throw away (dummy reading)
• 1 - EU reading to CVT only
• 2 - EU reading to FIFO only
• 3 - EU reading to FIFO and CVT
• Set data return format
• form real,64
Epsilon OverviewPage 16
Trigger• Scans per trigger
• trig:coun <num>
• 1 is the default upon reset (*RST)
• Source of trigger (TIMer, IMMediate, TTLTRG, BUS, EXT, HOLD, IMM)
• trig:sour <type>
• Other
• trigger interval (10E-3 is default)
• intersample time (40E-6 is default)
• Watch out for:
• trigger too fast ((intersample*#channels+algorythm) >= trig_inter)
Epsilon OverviewPage 17
Data Retrieval
• Trigger Event (Init)
• Fifo
• sens:data:fifo:count?
• sense:data:fifo:part? <#values>
• CVT
• sense:data:cvt? (@<channel#s>)
Epsilon OverviewPage 18
Command Time (usec)errStatus = hpe1422_init(INSTR_ADDRESS, VI_FALSE, VI_FALSE, &sessn) 20,480,102.04errStatus = hpe1422_cmdInt32_Q(sessn, "*cal?", ptmplong) 30,193,980.65errStatus = hpe1422_cmd(sessn, "cal:set") 64,516.32errStatus = hpe1422_cmdInt32_Q(sessn, "cal:set?", ptmplong) 31,136,325.25errStatus = hpe1422_cmdInt32_Q(sessn, "cal:rem? (@10000)", ptmplong) 7,028,550.75errStatus = hpe1422_cmdInt32_Q(sessn, "meas:volt:exc? (@10000)",ptmplong) 62,288.57
Command Times (firewire w/400MHZ)
Epsilon OverviewPage 19
Command Times (firewire w/400MHZ)Command Time (usec) Return Value #1 Return Value #2errStatus = hpe1422_init(INSTR_ADDRESS, VI_FALSE, VI_FALSE, &sessn) 20,480,102.04errStatus = hpe1422_cmdInt32_Q(sessn, "*cal?", ptmplong) 30,193,980.65 0errStatus = hpe1422_cmd(sessn, "cal:set") 64,516.32errStatus = hpe1422_cmdInt32_Q(sessn, "cal:set?", ptmplong) 31,136,325.25 0errStatus = hpe1422_cmdInt32_Q(sessn, "cal:rem? (@10000)", ptmplong) 7,028,550.75 0errStatus = hpe1422_cmdInt32_Q(sessn, "meas:volt:exc? (@10000)",ptmplong) 62,288.57 1errStatus = hpe1422_cmdInt32_Q(sessn, "meas:volt:exc? (@10000:10031)",ptmplong) 817,581.02 32errStatus = hpe1422_cmdInt32_Q(sessn, "meas:volt:unst? (@10000)", ptmplong) 44,199.08 1errStatus = hpe1422_cmdInt32_Q(sessn, "meas:volt:unst? (@10000:10031)", ptmplong) 761,076.21 32errStatus = hpe1422_cmd(sessn, "sens:data:fifo:res") 664.81errStatus = hpe1422_reset(sessn) 3,437,168.21errStatus = hpe1422_cmd(sessn, "*rst") 3,430,065.94errStatus = hpe1422_dcl(sessn) 39.93errStatus = hpe1422_cmd(sessn, "*cls") 248.13errStatus = hpe1422_downloadAlg(sessn, "ALG1",256, "/**/static float a;writecvt(I100,500);") 82,400.21errStatus = hpe1422_cmd(sessn, "*rst") 3,432,285.37errStatus = hpe1422_downloadAlg(sessn, "ALG1",256, "bigprogram.txt") 53,728.03errStatus = hpe1422_error_query(sessn, ptmplong, tmpstr) 536.38 0 No errorerrStatus = hpe1422_algScal(sessn, "ALG1","a",10) 436.40errStatus = hpe1422_cmd(sessn, "ALG:UPD") 36.09errStatus = hpe1422_cmdString_Q(sessn, "sens:str:conn? (@10000)", 32, tmpstr) 43.71 BRIDerrStatus = hpe1422_cmdInt32_Q(sessn, "sens:str:exc:state? (@10000)", ptmplong) 32.40 1errStatus = hpe1422_cmdString_Q(sessn,"sense:str:brid:type? (@10000)", 32, tmpstr) 30.76 FBENerrStatus = hpe1422_cmdReal64_Q(sessn,"inp:filt:lpas:freq? (@10000)", ptmpdouble) 112.14 10errStatus = hpe1422_cmdReal64_Q(sessn,"sense:str:gfac? (@10000)", ptmpdouble) 93.29 2errStatus = hpe1422_cmdInt32_Q(sessn,"inp:filt:lpas:state? (@10000)",ptmplong) 33.96 1errStatus = hpe1422_timeOut(sessn, 2000) 7.90errStatus = hpe1422_cmd(sessn,"sense:func:str:FBEN (@10000)") 266.52
errStatus = hpe1422_cmd(sessn,"sense:func:str:FBEN (@10000:10031)") 283.15
Epsilon OverviewPage 20
Command Times (firewire w/400MHZ)Command Time (usec) Return Value #1 Return Value #2errStatus = hpe1422_cmd(sessn,"sense:str:gfac 2.12,(@10000)") 219.72errStatus = hpe1422_cmd(sessn,"sense:str:gfac 2.12,(@10000:10031)") 216.19errStatus = hpe1422_cmd(sessn,"inp:filt:lpas:freq 2,(@10000)") 8,830.36errStatus = hpe1422_cmd(sessn,"inp:filt:lpas:freq 2,(@10000:10008)") 8,970.31errStatus = hpe1422_cmd(sessn,"inp:filt:lpas:freq 2,(@10000:10016)") 9,212.00errStatus = hpe1422_cmd(sessn,"inp:filt:lpas:freq 2,(@10000:10024)") 8,945.59errStatus = hpe1422_cmd(sessn,"inp:filt:lpas:state ON,(@10000)") 260.05errStatus = hpe1422_cmd(sessn,"inp:filt:lpas:state ON,(@10000:10031)") 276.92errStatus = hpe1422_cmd(sessn,"sens:str:conn BRIDge,(@10000)") 200.74errStatus = hpe1422_cmd(sessn,"sens:str:exc:state ON,(@10000)") 198.20errStatus = hpe1422_error_query(sessn, ptmplong, tmpstr) 533.07 3079 Algorithm is undefinederrStatus = hpe1422_cmd(sessn,"AnInvalidCommand") 86.44errStatus = hpe1422_error_query(sessn, ptmplong, tmpstr) 490.16 -112 Program mnemonic too longerrStatus = hpe1422_cmd(sessn,"FORM REAL,64") 41.17errStatus = hpe1422_cmd(sessn,"sample:timer 0.00005") 1,103.83errStatus = hpe1422_trigger(sessn, "TIM", 0.004, 1000) 1,905.50errStatus = hpe1422_cmd(sessn,"route:sequence:define (@10000:10031)") 226.02errStatus = hpe1422_initImm(sessn) 422,248.24errStatus = hpe1422_sensDataFifoCoun_Q(sessn, ptmplong) 259.83 32000errStatus = hpe1422_readFifo_Q(sessn,10000,65024, f64_array,ptmplong) 9,422.39errStatus = hpe1422_sensDataFifoCoun_Q(sessn, ptmplong) 188.64 22000errStatus = hpe1422_readFifo_Q(sessn,5000,65024, f64_array,ptmplong) 5,274.66errStatus = hpe1422_sensDataFifoCoun_Q(sessn, ptmplong) 184.62 17000errStatus = hpe1422_readFifo_Q(sessn,2500,65024, f64_array,ptmplong) 4,278.28errStatus = hpe1422_sensDataFifoCoun_Q(sessn, ptmplong) 185.80 14500errStatus = hpe1422_readFifo_Q(sessn,2000,65024, f64_array,ptmplong) 2,866.69errStatus = hpe1422_sensDataFifoCoun_Q(sessn, ptmplong) 179.22 12500errStatus = hpe1422_readFifo_Q(sessn,1250,65024, f64_array,ptmplong) 2,133.52errStatus = hpe1422_sensDataFifoCoun_Q(sessn, ptmplong) 186.30 11250errStatus = hpe1422_readFifo_Q(sessn,1000,65024, f64_array,ptmplong) 1,979.68
Epsilon OverviewPage 21
Common Errors
• Incorrect (or nonexistant) hookup of excitation voltage
• Addressing Problems
• HP I/O Problems
• Command Syntax Errors (check for errors)
• Trigger too fast
• Power Supply not earthed
Epsilon OverviewPage 22
Vee walkthrough (Configuration)
Epsilon OverviewPage 23
Vee program walkthrough (Overview)
Configuration
Calibration
Data Retrieval
EU Setup
Trigger/Route
Epsilon OverviewPage 24
Vee program walkthrough (Calibration)
Epsilon OverviewPage 25
Vee program walkthrough (EU Setup)
Insert a 1 second delay between Vexc and Vunst measurements to settleout residual voltage.
Epsilon OverviewPage 26
Vee program walkthrough (Trigger)
Epsilon OverviewPage 27
Vee walkthrough (Data)
Epsilon OverviewPage 28
Vee Exercise• Configure:
• Filter OFF
• Channel 7 - Half Bridge, gage 2.2
• Channel 8 - Full Bridge, gage 2.2
• Channel 9 - Full Bridge, gage 2.2
• Excitation ON, from BRIDge
• Calibrate both 1422, E1529
• EU conversion
• Trigger TIM
• Read Data from FIFO (bonus: display data nicely)
Epsilon OverviewPage 29
Vee Exercise, a solution (part 1 of 4)
Epsilon OverviewPage 30
Vee Exercise, a solution (part 2 of 4)
Epsilon OverviewPage 31
Vee Exercise, a solution (part 3 of 4)
Epsilon OverviewPage 32
Vee Exercise, a solution (part 4 of 4)
Epsilon OverviewPage 33
Same Exercise in C
• Need to include:
• Using Microsoft C++:
• Project->Settings->Link :Category(General)
• add: hpe1422.lib
• Project->Settings->Link:Category(Input)
• Additional Library Path: d:\vxipnp\winnt\lib\msc
• Project->Settings->C/C++:Category(Preprocessor)
• Additional Include Directories: d:\vxipnp\winnt\include
#include "visa.h"#include "visatype.h"#include "vpptype.h"#include <hpe1422.h>
Epsilon OverviewPage 34
Same Exercise in C (part 1 of 3)/**** * Demo_000313.cpp * * Author: stone (x2782) * Description: Basic configuration and retrieval of Data * * link with the hpe1422.lib - library file ****/
#include "visa.h"#include "visatype.h"#include "vpptype.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <windows.h>#include <hpe1422.h>
#define INSTR_ADDRESS "VXI0::160::INSTR"
ViSession sessn;ViStatus errStatus;ViReal64f64_array[65024];
Epsilon OverviewPage 35
Same Exercise in C (part 2 of 3) void main (void) /* Main function */{
int numsamples = 64;long tmplong;long *ptrTmplong;
ptrTmplong = &tmplong;
/* open connection */printf("initializing\n");errStatus = hpe1422_init(INSTR_ADDRESS, VI_FALSE,
VI_FALSE, &sessn);
/* configuration */printf("configuring..\n");errStatus = hpe1422_cmd(sessn, "sens:func:str:HBEN
(@10007)");errStatus = hpe1422_cmd(sessn, "sens:func:str:FBEN
(@10008)");errStatus = hpe1422_cmd(sessn, "sens:func:str:FBEN
(@10009)"); errStatus = hpe1422_cmd(sessn, "sens:str:gfac 2.2,(@10007:10009)");
errStatus = hpe1422_cmd(sessn, "inp:filt:state OFF,(@10007:10009)");
errStatus = hpe1422_cmd(sessn, "sens:str:conn BRID,(@10007)");
errStatus = hpe1422_cmd(sessn, "sens:str:exc:state ON,(@10007)"); if (errStatus > 0 ) {
printf("Error: %d",errStatus);}
Epsilon OverviewPage 36
Same Exercise in C (part 3 of 3)/* calibration */printf("calibrating..\n");errStatus = hpe1422_cmdInt32_Q(sessn,"*cal?",ptrTmplong);
errStatus = hpe1422_cmdInt32_Q(sessn,"cal:rem? (@10000)",ptrTmplong);
/* EU */printf("EUing..\n");errStatus = hpe1422_cmdInt32_Q(sessn,"meas:volt:exc?
(@10007:10009)",ptrTmplong);errStatus = hpe1422_cmdInt32_Q(sessn,"meas:volt:unst?
(@10007:10009)",ptrTmplong); errStatus = hpe1422_cmd(sessn,"sens:data:fifo:reset");
/* route, trigger */printf("Setting trigger/route..\n");
errStatus = hpe1422_cmd(sessn,"route:seq:def (@2(10007:10009))");
errStatus = hpe1422_cmd(sessn,"form real,64");errStatus = hpe1422_cmd(sessn,"sample:timer 0.00004");errStatus = hpe1422_trigger(sessn,"TIM",0.01,numsamples);
printf("initing..\n"); errStatus = hpe1422_cmd(sessn, "init");
Sleep(2); errStatus = hpe1422_sensDataFifoCoun_Q(sessn, ptrTmplong);
errStatus = hpe1422_readFifo_Q(sessn, numsamples*3, numsamples*3, f64_array, ptrTmplong);
printf("num: %ld\n", tmplong);
/* close connection */hpe1422_close(sessn);
}
Epsilon OverviewPage 37
Same Exercise in VB (part 1 of 4)
• Add module: D:\vxipnp\winnt\hpe1422\hpe1422.bas
Epsilon OverviewPage 38
Same Exercise in VB (part 2 of 4)Private Sub btnStart_Click() Dim tmpdbl As Double Dim tmpvar As Long Dim result As Long Dim f64_array() As Double ' initializing gpibAddress = "VXI0::160::INSTR" numsamples = 64 ReDim f64_array(numsamples * 3) txtStatus.Text = "initializing..." txtStatus.Refresh errStatus = hpe1422_init(gpibAddress, 1, 1, vi) ' configuring txtStatus.Text = "configuring..." txtStatus.Refresh errStatus = hpe1422_cmd(vi, "sens:func:str:HBEN (@10007)") errStatus = hpe1422_cmd(vi, "sens:func:str:FBEN (@10008)") errStatus = hpe1422_cmd(vi, "sens:func:str:FBEN (@10009)") errStatus = hpe1422_cmd(vi, "sens:str:gfac 2.2,(@10007:10009)") errStatus = hpe1422_cmd(vi, "inp:filt:state OFF,(@10007:10009)") errStatus = hpe1422_cmd(vi, "sens:str:conn BRID,(@10007)") errStatus = hpe1422_cmd(vi, "sens:str:exc:state ON,(@10007)")
Epsilon OverviewPage 39
Same Exercise in VB (part 3 of 4) ' calibration txtStatus.Text = "calibrating..." txtStatus.Refresh 'errStatus = hpe1422_cmdInt32_Q(vi, "*cal?", result) 'errStatus = hpe1422_cmdInt32_Q(vi, "cal:rem? (@10000)", result)
' EU txtStatus.Text = "EUing..." txtStatus.Refresh errStatus = hpe1422_cmdInt32_Q(vi, "meas:volt:exc? (@10007:10009)", result) errStatus = hpe1422_cmdInt32_Q(vi, "meas:volt:unst? (@10007:10009)", result) errStatus = hpe1422_cmd(vi, "sens:data:fifo:reset")
' route, trigger txtStatus.Text = "Setting route/trigger..." txtStatus.Refresh errStatus = hpe1422_cmd(vi, "route:seq:def (@2(10007:10009))") errStatus = hpe1422_cmd(vi, "form real,64") errStatus = hpe1422_cmd(vi, "sample:timer 0.00004") errStatus = hpe1422_trigger(vi, "TIM", 0.01, numsamples)
Epsilon OverviewPage 40
Same Exercise in VB (part 4 of 4) ' init txtStatus.Text = "initing....." txtStatus.Refresh errStatus = hpe1422_cmd(vi, "init") txtStatus.Text = "Reading data..." txtStatus.Refresh While Not (result = (numsamples * 3)) errStatus = hpe1422_sensDataFifoCoun_Q(vi, result) Wend txtFIFOCnt.Text = result For varloop = 0 To ((numsamples * 3) - 1) errStatus = hpe1422_readFifo_Q(vi, 1, 1, tmpdbl, tmpvar) f64_array(varloop) = tmpdbl Next varloop txtStatus.Text = "Closing..." txtStatus.Refresh errStatus = hpe1422_close(vi) txtStatus.Text = "Done" txtStatus.Refresh End Sub