NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI UserInterface without activex

Hello,

 

I would like to know if it possible to modify variables from a CVI interface in which there are not Activex Control.

From TestStand, I use the DLL created with CVI, and when I quit the interface, I would like modify some variables in different sequences (depending of a LED's state for exemple).
I don't want to have to modify lots of things in my CVI programm (if it is possible).

Is there a way to do this?

 

I tried to do this:
in the cvi QuitBtnCallback, I did a GetCtrlVal to have the value of the LED.
Then if the LED is on:
TS_PropertySetValNumber.


But I don't really have a CAObjhandle. So I have no error but in TestStand nothing happened for my variables.

Regards,

0 Kudos
Message 1 of 6
(3,851 Views)

 

 

You need to pass the CAObjhandle as the parameter to your DLL function to change the Teststand variables.

 

Please check this example :

Examples\AccessingPropertiesUsingAPI\UsingCVI


0 Kudos
Message 2 of 6
(3,836 Views)

Yes I used this exemple to modify my CVI project. 

But now I got a bug each time I call the AccessingProperties function.

 

I let you my code to know what's going wrong with this.

 

Regards,

 

0 Kudos
Message 3 of 6
(3,832 Views)

I could not compile the code due to some error.Since you are able to compile the issue is this :

 

int __stdcall RunDLLUI (double *value, char *message)  this should have one more parameter

int __stdcall RunDLLUI (double *value, char *message, CAObjHandle seqContextCVI) 

 

From Teststand pass container variable "ThisContext"  for this variable  ( you can see it under station global).

 

The  sequencecontext handle must come from the Teststand.You had missed it.You can refer the example test sequence on passing the sequencecontext variable if you still have issues.

 

 

0 Kudos
Message 4 of 6
(3,830 Views)

Thanks, I fixed it

 

But when I call the OkBtnCB CVICallback.

I have a run time error "-17502; System Level Exception" each time I pass in my if condition when ValCheckbox == 1.

 

Do you have an idea how fix this ? 

 

I can compile without any problem ! 

In TestStand, you can use the dll ?

0 Kudos
Message 5 of 6
(3,818 Views)

Ok it works perfectly,

 

In CVI:

I keeped the same prototype for my rundll function.

I just created an other dll function and global variables in my source file.

The second function read the state of the checkbox and is link with TS.

 

In TestStand:

The RunDLL function display my CVI IHM. I choose the state of the checkbox.

Then I quit the interface and I use the same dll in an other TestStand Step

with the second function which update my fileglobals variables.

 

 

0 Kudos
Message 6 of 6
(3,814 Views)