02-18-2016 07:30 PM
We are using TestStand 2013 and LabWindows 2013. Using TestStand, we test multiple products, within an environmental chamber, which take hours to run. We have an issue, where occassionally a unit will fail and we lose communication to it. The timeout delays, waiting for a communication response which will never happen, are causing major issues. My soution is to add a StationGlobal, array of integers- one for each unit being tested, in which I set one of the array elements to indicate that the unit being tested should be aborted. Within TestStand, I check the array element, for the unit under test, to determine if it has aborted or to continue with the testing. TestStand calls a LabWindows module which performs the communication write and read. Within Labwindows, I want to set the FileGlobal to abort when there is a communication failure. The inherited code is far worst than this but that was the simplistic explaination and easiest approach to fix the problem. I do not seek help on how to do the testing as I do not have the luxury of rewritting it.
What I need help on is the exact sequence of calls (module names in order) to connect to the TestStand runtime engine, that is calling the LabWindows module, whatever other modules that I need to execute, the call to the function to set the StationGlobal (I think it is shown below), and then release all of the handles that I used. Without stopping the other threads that are running the other units under test.
TS_PropertySetValNumber (TSSeqContext, NULL, "StationGlobals.ManualSlotAbort[0]", 0, 1);
Or better yet or in addition to, is there a link to a manual that explains what the calls are and what they do, in detail?
Thank you for your help.
02-19-2016 02:25 PM
Hey Bill,
Can you clirify a bit on wether or not you have access to the sequence file to edit it?
You're going to be in a tight spot if you're unable to edit it.
Can you clarfy as well how you want the operation to perform?
Do you just want a unit test to abort if communication has been lost?
I'd check out this as well to see if this is along the lines of what you're thinking:
http://digital.ni.com/public.nsf/allkb/65AACD1BC06D6D3986256BC80050CFE2
02-19-2016 03:59 PM
After more searching of the internet, the NI forums, and looking through the .h files, I finally found what I needed. I am enclosing the code to help others and to keep a record in the event that I may need this information in the future.
ViStatus EndOfResponse = VI_FALSE;
CAObjHandle EngineHandle = 0;
ERRORINFO errorInfo;
CAObjHandle GlobalsHandle = 0;
// Loss of communications? STOP the testing for the slot
if (EndOfResponse == VI_FALSE)
{
TS_NewEngine(NULL, &EngineHandle);
if (EngineHandle != 0)
{
// get a handle to the StationGlobals
TS_EngineGetProperty (EngineHandle, &errorInfo, TS_EngineGlobals, CAVT_OBJHANDLE, &GlobalsHandle);
switch (Slot)
{
case 0:
TS_PropertySetValBoolean (GlobalsHandle, &errorInfo, "ManualSlotAbort[0]", 0, 1);
break;
case 1:
TS_PropertySetValBoolean (GlobalsHandle, &errorInfo, "ManualSlotAbort[1]", 0, 1);
break;
case 2:
TS_PropertySetValBoolean (GlobalsHandle, &errorInfo, "ManualSlotAbort[2]", 0, 1);
break;
case 3:
TS_PropertySetValBoolean (GlobalsHandle, &errorInfo, "ManualSlotAbort[3]", 0, 1);
break;
}
CA_DiscardObjHandle(GlobalsHandle);
CA_DiscardObjHandle(EngineHandle);
}
return VI_ERROR_CONN_LOST; // Return an error condition
}