NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Statement sometime errores "Index out of bound" using Testsockets

Hello,

i am using a Batchmodel with 5 testsockets.

In the testplans are some statements where i access some 1D/2D arrays in the StaionGlobals with RunState.TestSockets.MyIndex.

Sometimes the statement seems to be wrong (TestStand messages something with Index Out Of bounds.

When putting the whole Statement in #NoValidation(xxx) then the testplan works without problems,

Also when the statement error popups up and i select "Continue" it is working.

 

Question is:

Why is the statement sometimes ok and sometimes not? Do i have to reset the MyIndex variable somehow?

Can i copy the variable in another pre statement so that the real statement can be run without NoValidation?

 

Thanks

0 Kudos
Message 1 of 3
(2,608 Views)

Hello,

 

Probably its to do with StationGlobals used by all the threads at the same.

There is only one stationglobals.ini to which all the updates\read happens.

 

Is it possible that you are updating the station globals and reading at the same time?Try locking all Station globals read\write so that its accessed by only one thread at a given time (You can use a sub sequence to do this.

 

Try if this resolves the issue.

 

Ravi

0 Kudos
Message 2 of 3
(2,522 Views)

Yes, the statements are updating (writing) the StationGlobals.

But it must be something else. When changing the Synchronisation-Properties to "Serial (one thread at a time" then i still have this error.

 

The problem is not during executing. It is when testplan is stopped and i see the statement-expression window.

When i click there on the icon "Check expresion for errors" then them message appears and alo a part of the expression is red marked.

 

0 Kudos
Message 3 of 3
(2,472 Views)