From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Question on "CAObjHandle seqContextCVI"

  I know in Teststand, in order to use the function like "TS_PropertyGetValBoolean", I need to have the parameters  like "CAObjHandle seqContextCVI" in exported DLL function. However, sometimes I don't want this, while still being able to use Teststand API functions like TS_PropertyGetValBoolean in the body of that exported DLL function. How can do it? See below.
 
Common use:
----------------------------------------------------------------------------------------------------------------
void DLLEXPORT CAN846_Post(CAObjHandle seqContextCVI,short *errorOccured,short *errorCode,char errorMsg[1024] ) 
{
 int error=0;
 ERRORINFO errorInfo ;
 ErrMsg errMsg="";
 VBOOL temp;
 seqContextCVI=seq;
 
 
 tsErrChk(TS_PropertyGetValBoolean(seqContextCVI,&errorInfo,"Step.Configure.initialize",0,&temp));
 if (temp==VTRUE)
  MessagePopup("execute","we will execute intialize operation according to your choice");
  
......
------------------------------------------------------------------------------------
My special use :no
void DLLEXPORT CAN846_Post(short *errorOccured,short *errorCode,char errorMsg[1024] ) 
{
 int error=0;
 ERRORINFO errorInfo ;
 ErrMsg errMsg="";
 VBOOL temp;
 seqContextCVI=seq;
 
 // here, need to add some in order to declare seqContextCVI

 tsErrChk(TS_PropertyGetValBoolean(seqContextCVI,&errorInfo,"Step.Configure.initialize",0,&temp));
 if (temp==VTRUE)
  MessagePopup("execute","we will execute intialize operation according to your choice");
0 Kudos
Message 1 of 2
(3,124 Views)

Hi,

Not really sure what you are hoping to gain.

But as you say "I know in Teststand, in order to use the function like "TS_PropertyGetValBoolean", I need to have the parameters  like "CAObjHandle seqContextCVI" ".

You could pass the CAObjHandle seqContextCVI as a seperate function call, someway at the beginning of you execution, and store it in a global held in you dll. But the best solution is to pass it as part of the function call for the step, as you are doing. That way, you ensure its a valid handle all the time.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 2 of 2
(3,116 Views)