NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting step error during Post-Step substep execution

Hi Jett,
 
Yes this workaround is running, very nice.
But in my case i decide to use UserSteptypes to avoid workrounds produced by using the codemodules.
 
Are there some more information about performing substebcalls than in TS Manual?
 
Greetings
 
Juergen
 
 
 
 
--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 11 of 19
(2,567 Views)
Hey Juergen,

Here are some links to a couple tutorials that walk you through making a custom substep.  "Creating Step Types - A Tutorial Using the CVI Standard Prototype Adapter" and "How Do I Make a Custom Step Type?".  Do you know exactly what kind of information are you looking?  I hope this helps!  Let me know.
Best Regards,
Software Engineer
Jett R
0 Kudos
Message 12 of 19
(2,551 Views)
Hi Jett
 
Thanks for Reply.
I am not interrested how creating a Type i am interrested how TS performed the substepcalls.
 
If you take a look at the manual at Table 3-4 Order of Actions that a Step Perform
 
You will see at action Nr.15 your sub call. What is going on there? Our Tpye will will be executed (15a) and there would be done the String adding on ErrorOccured (15b)!  You will find this String in ErrorStrings.ini

Your workaround will act in Nr.16
 
Have a nice weekend
 
Juergen
--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 13 of 19
(2,548 Views)
Hey Juergen,

The code module from the post-sub step gets called as action number 15.  (see TestStand 4.0 reference manual page 50)  If this post-step code returns with an error, TestStand will skip to TestStand's error handling code (such as the SequenceFilePostStepRuntimeError Engine callback etc...), and it will not execute the post-expression, action number 16.  If the code does not return with an error, then the post-expression will execute, which will set the step with an error.  After the post-expression, TestStand's error handling code will get called.  Since the error handling code is getting called after the post-expression instead of the post-step sub-step, the string "Error executing substep 'Post'.\n" is not prepended to the beginning of the string.

There is yet another option to remove this unwanted substring.  You can let the post-step code module send a true for Error.Occurred, and then parse the Error.Message string in a SequenceFilePostStepRuntimeError Engine Callback to remove the unwanted substring.  You do not need a post-expression for each step using this method.  See the screen shot below for an example of this option.  I hope this helps.  Have a great day!




Message Edited by JettR on 03-31-2008 01:16 PM
Best Regards,
Software Engineer
Jett R
Message 14 of 19
(2,513 Views)

Hi Jett,

Thanks for your reply. I see you have spent some time with performing step calls. Time to give some 5!
If I would use the engine callbacks (Nr.18 in table). I would set a precondition to filter only my user StepType.

But now i think misha can select from two solutions.

Greetings

Juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 15 of 19
(2,507 Views)

Jett, Jurgen,

Thanks for spending the time for my problem, but unfortunately I cannot use none of both proposed solutions. Both are actually not a solutions but workarounds. Using them will require to maually edit all client sequence files, which contain steps of this step type. Instead of this I would prefer to provide solution on substep code level and replace only substep DLL on all involved PCs. Can anyone explain how its works in standard NI Step Types (NI_MultipleNumericLimitTest's Post-Step, for example) ? I already asked this (Message 7).

thanks.misha

0 Kudos
Message 16 of 19
(2,489 Views)
Hi Misha,
 
Yes you are right! I have tested it. if you place your dll-function to NI-Stuff same result.  But if use the original dll-function and produce an internal error. (Wrong Comp string) you get rid of !
 
At moment i am looking at the source code of CommonSubsteps.dll But now my lunch break is over!
 
I think this is also a task for Jett Smiley Tongue
 
Greetings
 
Juergen
 
--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 17 of 19
(2,477 Views)
It appears that this prefix disappears when the type has the NI_InstalledType flag enabled.  As far as I know, there is not a way to disable the text for user created step types.

Allen P.
NI
0 Kudos
Message 18 of 19
(2,458 Views)
Hey Mishaw,

If you are looking for a solution that will allow you to only replace the .dll on all of the machines, you can modify my first option (in post 10).  In your post-step code, you still will not set the Error.Occured property.  If an error has occurred, you can use the Step.PostExpression property to programmatically append ", Step.Result.Error.Code != 0 ? Step.Result.Error.Occurred = True : Nothing" to the steps current post-expression.  You will need a little logic to determine if the post-expression is empty or not which changes whether or not this string has a preceding comma or not.   With this solution, all you will have to change is the .dll on the computers.  I hope this helps.  Have a great day!
Best Regards,
Software Engineer
Jett R
0 Kudos
Message 19 of 19
(2,452 Views)