09-05-2012 10:11 AM
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,
09-06-2012 10:24 AM
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
09-06-2012 11:57 AM
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,
09-06-2012 12:23 PM
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.
09-07-2012 04:03 AM
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 ?
09-07-2012 10:30 AM - edited 09-07-2012 10:33 AM
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.