From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW features that nobody uses


@Thoric wrote:

 However, the expression node doesn't accept arrays, so how can you use this command?


Yes it does! 

 

I actually use it quite often for small transformations such as this.

0 Kudos
Message 21 of 27
(8,220 Views)

I get a specific error "Array Operation not allowed here" when using the array dimension size function sizeOfDim. I can't find any help on how to use this function, other than this which isn't helpful, so advice is much appreciated!

 

I'd expect to be able to pipe an array in and get a scalar out representing the dimension size (in this case an NaN because I've asked for the second ("1") dimension of a 1D array by accident).

 

expression_node.png

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 22 of 27
(8,211 Views)

Try "x+sizeOfDim(x,0)"

 

Richard wrote "I'd expect to be able to pipe an array in, and get a scalar out---"

 

I, on the other hand,  would never expect the datatype to change in an expression node.


"Should be" isn't "Is" -Jay
0 Kudos
Message 23 of 27
(8,206 Views)

An expression node can't change the data type.  This is because it is actually x = f(x), where f(x) is whatever you put inside of the expression node.  So array in, array out.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 24 of 27
(8,203 Views)

@JÞB wrote:

Interesting thread.  Witch prompted me to scan through some of the less frequently used menu items and generated a possible "Feature" request.  

 

View>>Getting Started Window...

 

 


While I'm thinking of this thread-----

Change Getting Started Window Behavior When opened from View>>Getting Started Window.

Don't delay Vote today!


"Should be" isn't "Is" -Jay
0 Kudos
Message 25 of 27
(8,193 Views)

@JÞB wrote:

Try "x+sizeOfDim(x,0)"

 


Nope.

expressionnode2.png

 


Richard wrote "I'd expect to be able to pipe an array in, and get a scalar out---"

 

I, on the other hand,  would never expect the datatype to change in an expression node.


I can see that it shouldn't change now, given x = f(x) is the rule   (Thanks Tim).

 

But the help explicitely lists sizeOfDim as a valid function and I cannot get it to work. Maybe this isn't supported in the expression node? Afterall, if it can't return the value as an output then I don't see it has much use anyway.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 26 of 27
(8,182 Views)

@Thoric wrote:

@JÞB wrote:

Try "x+sizeOfDim(x,0)"

 


Nope.

 

But the help explicitely lists sizeOfDim as a valid function and I cannot get it to work. Maybe this isn't supported in the expression node? Afterall, if it can't return the value as an output then I don't see it has much use anyway.


Can't add a scaler with an array in an expression node.  It isn't like the LabVIEW primitives that are fully polymorphic like that.  When dealing with the expression node and the formula node, you need to go back to your C programming thought process.

 

I'm not able to come up with any good way to use the sizeOfDim in the expression node.  But it also works with the Formula Node.  And since both nodes use the same functions (possibly even use the same code under the hood), then it is automatically in the Expression Node.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 27 of 27
(8,172 Views)