Calling Agilent VEE UserFunctions from ATEasy

Knowledge Base Article # Q200234

Read Prior Article Read Next Article
Summary This article provides an example project and an explanation of how to call existing VEE UserFunctions from ATEasy.
  
Login to rate article
Installing Agilent VEE will allow the installation of an ActiveX automation server that can be used to run UserFunction from environments other than the VEE development environment, such as ATEasy and Visual Studio.  An ATEasy driver (VEE.drv) has been created as a wrapper providing an interoperability tool that can perform the majority of the overhead associated with starting and communicating with the VEE Run-time.  This allows you to reuse existing test application code in ATEasy projects with the addition of only a few lines of code.

Example VEE library

For example, we have “VEE_ATEasyExample.vee” which contains three UserFunctions:
  • AddTwo: Adds two numbers and outputs the sum (a+b=result)
  • ExpTwo: Outputs the first input raised to the power of the second input (a^b=result)
  • MultiplyTwo: Multiplies two numbers and outputs the product (a*b=result)
Screenshot of VEE Project Navigator

Image 1: VEE Project Navigator


Flow of data

To call a VEE function from ATEasy, you would implement the following prototype:
VEE Call (sLibFile, sUserFunction, inputs, outputs)

The sLibFile defines the .VEE file that contains the target UserFunction, sUserFunction specifies the VEE function that will be executed, and the inputs and outputs represent the input and output terminals as arrays of variants.

Flow of data between ATEasy and VEE

Image 2: Flow of data between ATEasy and VEE

Example Code

The following code will pass the integers 3 and 5 to the AddTwo function in the VEE_ATEasyExample.vee and should assign the value {8} back to the outputs variable.

sLibFile : String   ! Contains the path to the VEE file
sUserFunction : String   ! Contains the name of the VEE UserFunction
avrInputs : Variant[2]   ! The input parameters, where 2 is the number of parameters passed to the VEE function
vrOutputs : Variant      ! The returned output parameters array stored to a variant

sLibFile=GetDir(0)+"\\VEE_ATEasyExample.vee" ! vee in current directory
sUserFunction="AddTwo"   ! VEE function name
avrInputs={3,5}          ! input parameters
VEE Call(sLibFile, sUserFunction, aVarInputs, vrOutputs)
TestResult=vrOutputs[0]  ! store returned value

ATEasy Project and Example

DownloadATEasy and VEE Example
Article Date 11/26/2012 , 4/16/2014
Keywords ATEasy, HP, Agilent, VEE, ActiveX, Automation, Interoperability


Login to rate article

Read Prior Article Read Next Article
>