NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Runtime error not notified, it's a Bug of TestStand 4.2.1?

Hi All,

I found an issue during setting the precondition of a steps in Teststand 4.2.1

I have a Statement Step named "Cleanup if WRONG barcode"

 

AnyOf(
RunState.Sequence.Main["ID#:NPMo1DuN+0KuxglET/DQiD"].Result.Status == "Error", 
RunState.Sequence.Main["ID#:gv4JwcInbU2jx2Ek6SsJ2A"].Result.Status == "Error", 
RunState.Sequence.Main["ID#:nUMiG7Q3Q0mOkCtVRok26C"].Result.Status == "Error", 
RunState.Sequence.Main["ID#:5KBfxx3r+ki+2TaRkv0Z3D"].Result.Status == "Error",
Parameters.Socket_Data.Product.OrderNumber < 8)

the last argument is Parameters.Socket_Data.Product.OrderNumber that contain the string of the Order number.

The error is the following:

Type_error.jpg

 

But When I execute the code the Runtime error is not notified, as expected.

Note: in the station Option I have On Runtime error notification "Show Dialog".

 

Could you please tell me why ?

Thank you very much

0 Kudos
Message 1 of 3
(4,048 Views)

It's because Parameters.Socket_Data.Product.OrderNumber is a string value that is empty so it cannot be coerced to a number so the expression:

 

Parameters.Socket_Data.Product.OrderNumber < 8

 

gives the error you are seeing, but at runtime, the string is set to a number which can then be coerced to an actual number so the expression succeeds at runtime.

 

You can see this same issue if you create a local variable in a sequence that's a string that's empty and create statement step as follows:

 

Locals.string < 8

 

If you do, you will get the same error you are seeing. Then edit the local variable and set it to 10 and look at your expression again. The error is now gone.

 

You can avoid the error in the statement by either setting the string to an initial value that contains a number (e.g. 0) or change the data type of that variable to a number rather than a string.

 

Hope this helps,

-Doug

Message 2 of 3
(4,027 Views)

OK, I see...

Thank you

 

0 Kudos
Message 3 of 3
(4,009 Views)