NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Sequence context becomes invalid when execution time is longer

Solved!
Go to solution

I have a sequence that loops for around 70k iterations (which is pretty huge). The sequence calls a sub-sequence where the called sequence's locals are modified. Issue is, around 65k th iteration, I am getting an error stating that Local's reference passed is invalid. The iteration count when error occurs  varies from PC to PC but always in the 65k range. When I try to run another sequence(simple one) consecutively, I get an "out-of memory" error. I guess the reason why Local's reference getting invalid is because the TS execution stops when TS memory gets full making Sequence Context and thus Local's reference invalid.

I would like to know how to reduce the TS memory consumption since I have disabled the result recording for all sequences(Configure->Station Options->Execution), disabled result recording for each iteration in the loop, Optimize non-reentrant Calls to thi sequence is also enabled. I even tested with just this sequence running and I am wondering if there is a maximum count for execution threads when looping.

 

PC Configuration

RAM-12 GB

LabVIEW and Teststand 2010 SP1

 

I will not be able to post the code but the looping is a custom step that has Sequence Call as its adapter.

 

0 Kudos
Message 1 of 8
(5,193 Views)

Hi Ranjani,

 

Are you calling the sub sequence in the context of the main sequence or a new thread or a new execution.

New threads\execution can lead to many simultaneous instances running leading to shortage of memory.

 

Ravi

0 Kudos
Message 2 of 8
(5,159 Views)

The subsequence is called in context with the main sequence and not as a seperate thread/execution. I did notice that the Sequence context is valid but the execution reference is invalid rendering the Local variable's reference invalid too.

0 Kudos
Message 3 of 8
(5,157 Views)
Solution
Accepted by Ranjani_R

Hi,

 

I tried this :

 

Main sequence calls a sub sequence which has 3 statement steps.

I looped the sub sequence to 75k with result logging enabled.

TS runs succesfully - no issues.

 

Try skipping  steps (one at a time) in the sub sequence to find out which step is leading to this issue.

 

Also try reproducing using a simple sequence (which you can post online).

 

 

Ravi

0 Kudos
Message 4 of 8
(5,154 Views)

Have you checked the memory usage of seqedit.exe when you are getting this error? It sounds like there might be a memory leak in one of your code modules or elsewhere.

 

-Doug

0 Kudos
Message 5 of 8
(5,145 Views)

But I have disabled the result recording in the station and I have also unchecked the result recording for each iteration of th eloop. This must disable the result collection. Is that not so?

0 Kudos
Message 6 of 8
(5,137 Views)
Solution
Accepted by Ranjani_R

@Ranjani_R wrote:

But I have disabled the result recording in the station and I have also unchecked the result recording for each iteration of th eloop. This must disable the result collection. Is that not so?


Yeah, sorry, I didn't fully read your post before responding (I updated my post once I realized you already disabled result collection). I'm now thinking it's more likely there is a memory leak in one of your code modules or something else that your sequence is doing. I think trying to narrow it down like Ravi suggested is probably the best approach.

 

-Doug

0 Kudos
Message 7 of 8
(5,135 Views)

I think so too. Weird thing is I am using LabVIEW code module. But when I face this error, I see that LabVIEW has barely used 0.1GB of process memory. And when a sequence is executed immediately after this error, TestStand throws "out-of-memory" error which made me think TestStand is the culprit. But I will re-visit my code and check. Thanks for all the help. 

0 Kudos
Message 8 of 8
(5,133 Views)