ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

NI TestStand

取消
显示结果 
搜索替代 
您的意思是: 

Expression for an empty array

已解决!
转到解答

Hello,

 

I want to reset an Array. Numeric 1D.

 

It's getting written on in my Sequence and when the sequence is ended I want to reset it as an empty Array. I want to do this through a statement. Can someone please send me the propper Expression I Need to use to make it empty again? 

0 项奖励
1 条消息(共 4 条)
4,205 次查看
解答
已被主题作者 Riesengross 接受

Hello Riesengross,

 

You can just set the number of elements in the array to 0, with this kind of statement:

 

Locals.MyArray.SetNumElements(0, 0x0)

 

Make sure your sequence is handling properly the empty array you've just reset.

 

Regards,

2 条消息(共 4 条)
4,182 次查看

Thanks, that worked.

 

Another easy way is, as I found out,

simply to write:

Locals.MyArray = {}

 

Simple assign Nothing like in SCALA.

0 项奖励
3 条消息(共 4 条)
4,167 次查看

Funny. "{}" seems to be interpreted as an "Array of Numbers(64-bit Floating Point)". Whenever you try to reset an array of a different type than that, it won't work. At least not in my Value expression that I'm trying to pass as a Parameter into a subsequence.

 

Static typing for the win!

 

So tell me NI, what's the literal for "empty array of containers"?

0 项奖励
4 条消息(共 4 条)
3,068 次查看