NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Pass NULL into .NET Code Module (without showing red/error)

How do you pass in a NULL value for a parameter in .NET code module (without showing red error)?

 

For example, I have a method that takes a string and contains logic that can accept NULL values.  When I use Nothing, it appears to work.  However, the parameter is flagged red with the error "Expected String, found Object Reference.".  This can cause confusion when seeing the red.  It will also flag sequence analyzers (and though I could ignore those, it would take lots of maintenance over time to ignore them).

 

Is there other wording to use instead of Nothing to make this work and not show the red/errors?

 

Any help/examples will be appreciated.

0 Kudos
Message 1 of 3
(110 Views)
0 Kudos
Message 2 of 3
(80 Views)

This should only be happening with strings because TestStand does not natively support null strings. For class data types and the object data type you should not be getting a red validation error. It's a valid feature request to allow Nothing for strings as well.

 

Hope this helps,

-Doug

0 Kudos
Message 3 of 3
(63 Views)