NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStend SequentialModel.seq

Hi,

 

In my sequence I have used the Process Cleanup Callback in the SequentialModel.seq to store two commands very useful for my sequence:

RunState.Engine.StationOptions.BreakpointsEnabled = True

RunState.Engine.UnloadAllModules()

In my mind I have supposed that even if an error or an exception arise during an execution this callback will be called for sure for ensuring the releases of the Code Modules, Vi and DLL called in the sequence. Unfortunately, it doesn’t seem to work like that. What have I missed in my analysis?

Since it appears also that moving UnloadAllModules() around in the sequence does not produce the wanted effect I start reading about the command here: https://www.ni.com/docs/en-US/bundle/teststand/page/tsapiref/reftopics/engine_unloadallmodules_m.htm. Where I have found this sentence “Typically, you only call this method when no executions are running.” So what the purpose to have it as a function that can be called in a sequence during an execution? And how can I automate its use? I can think only to a vi that continuously what the execution status, but that vi can’t be lunched by the sequence so how can I manage this thing?

 

Thank you for the help!

 

Best Regards,

Zuc

0 Kudos
Message 1 of 4
(353 Views)

Out of curiosity…. I have not yet found a situation which made me unload all modules from a Test Sequence, so what makes you want to do this?

 

Oli

0 Kudos
Message 2 of 4
(312 Views)

Hi,

 

because i'm not the only one running the sequences. When an interruption, a problem or an exception happens some DLLs called by TS remain with the connection opened and that cause failures if someone run again the sequence without having unloaded the modules on the TS interface file menu. So in order to avoid any unclean end, i need to unload the codes saved by TS.

 

Best Regards,

Zuc

0 Kudos
Message 3 of 4
(295 Views)

Hi Zuc,

 

I understand the use case now, thanks. Yet I am afraid that UnloadAllModules is not the remedy to this problem, since it will unload not only code modules of your sequences, but also (to my understanding) the code modules of the process model.

 

If you can't get your sequences and the included code modules robust enough to handle the problems you are describing, you could create yourself a recovery sequence, consisting only of the UnloadAllModules and is run without a process model

 

BR

Oli

0 Kudos
Message 4 of 4
(284 Views)