Quantcast
Channel: All NI TestStand posts
Viewing all articles
Browse latest Browse all 24417

Re: Reset global/static global variables in DLL loaded by TestStand

$
0
0

Thanks for the reply.  After some testing of unloading ( which doesn't seem to happen ) I concur that not messing with that would be the better route.  The problems I run into are: 1. I now have to add a step to each sequence and my goal was to reduce the number of initialization steps and 2. I don't know of a good way to determine if the initialization should occur without having a parameter be passed around in TS.  For instance, since I need to be able to run a subsequence 5 levels down independently ( for troubleshooting ) and having others skip the steps getting to that point is problematic I'd just tell the person to run sequence X.  That means it has to have the setup and clean up steps the same as the actual top level sequence.  Thus, when running sequence X the call to the reinit function would have to know that it hasn't been reinit and do so.  The problem is that I can't use a static global to track that ( the whole chicken and egg thing we're trying to solve ) so I'd have to have that data come from TS and since it needs passed among sequences it'd need to be a parameter.  While 1 is better than many my goal was to remove parameters that are solely used to hold data between function/step calls.  I want to separate parameter/local usage to data operated on in TS ( can be passed down if necessary but the data originated in TS and is manipulated in TS ) and have code variables/information that has no need to go into TS from going to TS.  Currently, I pass each piece of equipment's init count and handle(s) to TS and pull them back down in every test step.  I also have to pass them among all sequences.  This is error prone ( the order of the parameters, forgetting to check pass by reference, etc. ) and a pain when using the batch model as all the parameters are copied to file globals, updated, copied back, etc.  Maybe I'm trying to have my cake and each it too.  I really hoping someone else had needed to the state of their code to be in a known state and typically runs multiple test executions in a row ( without closing the sequence or TS ).  Is there any way to load test code without being in a DLL and not using LabView?  ( everything is straight C with the potential of C++ compiled in CVI or Visual Studio )  If the code doesn't persist between executions this all goes away.  Thanks.


Viewing all articles
Browse latest Browse all 24417

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>