NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

17306 Error accessing item 'Locals'.

I have a sequence called "ProgramAssetData" in the same file as it is being called in.  The first time I call ProgramAssetData, it works fine.  The second time I call ProgramAssetData as part of a loop, I get the error below. The "Run-Time Error" window pops up and I select "Retry" and that always works.

I do not beleive it to be a timing error because stepping through the code does not help.

How can a property name 'Locals' be unknown?   ... and always work in Retry?

What does "Retry" do that is different from normal running?

 

How do I get rid of this error? 

 

FYI- A CVI call in in the previous step.

----------------------------------------------------------------------

Details:

Error calling sequence ProgramAssetData.
Unknown variable or property name 'Locals'.
Error accessing item 'Locals'.

 

Error Code:

-17306; Unknown variable or property name.

 

Handle Current Error

    Retry

                                              OK

---------------------------------------------------------------------

 

17306 = TS_Err_UnknownVariableOrProperty

0 Kudos
Message 1 of 6
(5,180 Views)

Hi EP_MN,

 

Does the location indicate a specific step that the error occurs in? Is it in the sub sequence or main sequence?

 

Is the first time the sub sequence is called inside a loop or is it called once before the loop? Does this error continue to occur every subsequent time the sequence is called?

 

The Retry option causes the step to run again, though this could be the Sequence Call step or a step within the sub sequence. You could add error handling to that step to automatically retry it in the event of an error.

Steven Gloor
Staff Customer Engineer - CTA, CLD
0 Kudos
Message 2 of 6
(5,147 Views)

The error occurs in the calling of the sequence "ProgramAssetData".  The sequence is only called inside of a loop.  The first call always works and all subsequent calls generate the "Run-Time Error" window. The retry option in the window always works.  When I step through, the retry of the sequence call it goes to the first step in the sequence.  A breakpoint on the first step of the called sequence does not occur until the "Retry" is executed.

Adding error handling to automatically retry and get around this problem seems like a "hack" and does not address the source of the problem.  That could be a fix but I really do not like it as a long term solution. 

0 Kudos
Message 3 of 6
(5,119 Views)

Are you perhaps accessing a sequence context from a thread other than the one the sequence is running in? If so, it's possible there is a race condition with the flow of the thread the sequence context belongs to and another thread trying to access that sequence context. Ideally you should access a sequence context only from the same logical thread as that sequence unless the execution is paused at a breakpoint.

 

Another possibility is perhaps there is a bug in ProgramAssetData with how the TestStand API is being used. The easiest way to determine this would be to step through the code in ProgramAssetData and see what it's doing and where in the code the problem might exist.

 

Hope this helps,

-Doug

Message 4 of 6
(5,113 Views)

  I solved the problem.  (I am new to Teststand and am working in code I did not write.) There was a bug in the "ProgramAssetData" sequence.  There is a step that makes an Active X call to rename the next step using the Object reference "RunState.NextStep".  The passed in parameter was using "Locals.name" which was set in the PreExpression. "name" was not defined as a local variable.  My problem was that the error message only identified "Locals" as undefined in the calling of the sequence.  It did not identify the line in the sequence where the variable was undefined.  The other problem was that the first time the sequence "ProgramAssetData" was called, no error was generated.  But then, "Retry" would work on all subsequent calls whjen the Run-Time error window appeared. Why "Retry" would work makes no sense to me.  This all made it very difficult for someone new to Teststand to debug.

 

0 Kudos
Message 5 of 6
(5,091 Views)

I'm not sure why retry wasn't giving you the error again. All it's doing is running the step again, so you should get another error if the property still does not exist.

 

Also, not sure why the error is referring to Locals as missing, you should instead be getting an error about Locals.name missing if that is what is the problem.

 

Also normally teststand will show the runtime error dialog (station option setting) on runtime error at the location in the sequence where the error occurs. Not sure what settings you are using or where you are seeing the error. If you are seeing it just in the report, then perhaps the station options were changed to not show the dialog. I'd recommend changing the settings to show the dialog while you are debugging.

 

Without looking at your code, it's hard for me to know for sure, but the experience you had is likely due to something the sequence you are executing is doing  (or some other customization of TestStand - perhaps a custom error handling dialog) and is not a normal behavior of TestStand.

 

Hope this helps,

-Doug

0 Kudos
Message 6 of 6
(5,064 Views)