02-09-2009 10:59 PM
Hello,
I would like to create a custom error handler in a model file similar to the ErrorHandlerExample.seq.
In my case, I will be handing errors genereated in several different dlls. We are trying to avoid writing wrappers around the dll functions to fill in the TestStand error strings. However, this information is available by calling a "get error message" function in the dll. Since I have more than one dll and more than one handle that I will need to check the errors for, I need to know the information about the step that caused the error. Is there a way to get more information about the step that caused the error? I might have a dll function call that had the format:
kiOpenVSA(StationGlobals.KiManager, StationGlobals.VsaSession, StationGlobals.VsaResourceString, StationGlobals.DisplayEnable, StationGlobals.SendInitCommands)
Based on the parameters of the function call, I would be able to call the correct error handling function.
Thanks,
Mike
Solved! Go to Solution.
02-10-2009 12:41 AM
Hi,
What particular information about the step do you need to know?
Regards
Ray Farmer
02-10-2009 09:27 AM
I would need to know the name of the DLL that was called and also the names of the parameters that were sent in the call. I think I could get the parameters from the text of the function call shown in the original post.
MIke
02-10-2009 05:01 PM - edited 02-10-2009 05:07 PM
Hi Mike,
If you want to pragmatically get the name of the DLL file, DLL function and parameters that were called in a previous step, you will first need to reference the step in which the DLL call was made and use the following TestStand API.
Assuming that the DLL was called in the previous step you can use the following expressions using TestStand 4.1.
Access the dll function expression
RunState.PreviousStep.Module.CommonCModule.FunctionCall
Access the dll function name
RunState.PreviousStep.Module.CommonCModule.FunctionName
Access the parameters
RunState.PreviousStep.Module.AsDllModule.Parameters.item(index)
Note that if you are using an older version of TesStand, these functions may not work and you may have to use the ActiveX/COM steps to access this information.
I hope this helps.
02-10-2009 05:34 PM
This looks exactly like what I need. I'll try it out and let you know how it works.
Thanks,
Mike