12-19-2011 06:10 PM
I tried the examples, but couldn't learn anything useful.
I have a DLL from LabWindows/CVI of the following and I'm able to use (select) the DLL functions in Action Steps in TestStand.
int DLLEXPORT OpenSession (unsigned long *session, signed long *ErrorCode, char *ErrorMessage)
{
*session = fnThatReturnsInt(0,OPT1,1,1);
return 911;
}
int DLLEXPORT CloseSession (unsigned long sessionHandle, signed long *ErrorCode, char *ErrorMessage)
{
deviceSessionCloserFn(sessionHandle, 0);
return 912;
}
The C tester works excellent. How do I tell TestStand to store/use that session in following Action Steps from the same DLL?
Many thanks!
Solved! Go to Solution.
12-20-2011 09:53 AM
Feeling more like Mr. Edison... "I have not failed. I've just found 10,000 ways that won't work."
Any guidance in the right direction or outright solution is 10000x appreciated!
12-20-2011 11:03 AM
In LabVIEW there are two function to pass a session to teststand and back again called "Session to RefNum" and "RefNum to Session". Cannot remember if you have something similar for CVI. You can look in the Utilities library.
12-20-2011 12:47 PM
Hey ObiCaban,
Is it possible to pass in the session 'By Reference' as a parameter in the module settings of TestStand?
Kind Regards,
Luke W
12-21-2011 09:39 AM
Checking both answers... Will let you know. Thanks!
01-12-2012 04:09 PM
It is as easy as passing the referernce! Thanks!
I was doing it wrong. One has to make sure the session is being handled correclty in the dll.
Then, in TestStand one passes the session reference (aka pointer) as a PARAMETER variable. In my case it was a numeric reference. It ended up being something like "Parameter.session", Number (by reference)
I called the DLL function that assigned the value to the session before calling the other functions, of course.
Thanks, all!
Please forgive my ridiculous delay to reply back.