06-26-2025 08:27 AM
wiebe@CARYA wrote:
Probably a Monday morning ( 🌴😑 :palmface:) issue, but honestly I never use the output configuration.
It can be important for Boolean array to number. It defaults to a U32 output but at least the help documentation mentions that you can change the output type through that property window.
06-26-2025 10:00 AM - edited 06-26-2025 10:44 AM
@Jacobson wrote:
It can be important for Boolean array to number. It defaults to a U32 output but at least the help documentation mentions that you can change the output type through that property window.
If you decide to configure the output, another complication is however the hard to find "sign extension mode" which is ONLY available in the right-click menu, but completely absent from the properties page (where it belongs!!!!!!!!). It defaults to "If output is signed" so if you e.g. convert a short array (e.g. T, F, T), you end up with a I32 of "-3"
So of you think you need an I32 output because you want to wire it to an array index without coercion dot, you will NOT get any existing array element unless you change the sign extension mode first
This actually belongs in this thread and I will also post i there. Don't forget to vote for this idea!
07-05-2025 03:27 PM
wiebe@CARYA wrote:
@altenbach wrote:Somebody just kudoed this old post here and it is probably important to mention that this method is only fully safe for integer arrays. For example if the input is DBL and contains NaN, they would remain NaN and could cause unexpected results downstream.
This returns 0 regardless the input or numeric type.
Not sure what it does to performance. *0 might be slower that initialize array too though. Who knows without testing...
You'll loose the ability to inline the VI, for undisclosed reasons (probably "no priority").
24 years ago (when I first saw LabVIEW) my first two questions were:
I might have learned some things. 😀
07-05-2025 03:31 PM
wiebe@CARYA wrote:
@altenbach wrote:
I always forget about that output configuration...
You could argue that a To Unsigned Byte integer is clearer, but actually I don't even know how to get the output configuration working 🙄...
The output stays a double or breaks the wire when connected to a Join Number:
Probably a Monday morning ( 🌴😑 :palmface:) issue, but honestly I never use the output configuration.
I forgot about that output configuration ONCE! "ALWAYS " seems like an excessive number of times to make the same mistake 😕
07-07-2025 03:37 AM
@JÞB wrote:
wiebe@CARYA wrote:
@altenbach wrote:
I always forget about that output configuration...
You could argue that a To Unsigned Byte integer is clearer, but actually I don't even know how to get the output configuration working 🙄...
The output stays a double or breaks the wire when connected to a Join Number:
Probably a Monday morning ( 🌴😑 :palmface:) issue, but honestly I never use the output configuration.
I forgot about that output configuration ONCE! "ALWAYS " seems like an excessive number of times to make the same mistake 😕
In my defense, outside the forum, I've only seen this being used a few times over the past decades.
08-06-2025 06:44 AM
wiebe@CARYA wrote:
In my defense, outside the forum, I've only seen this being used a few times over the past decades.
In some projects they were overly ambitious at avoiding coercion dots (like converting a U32 to an I32 before sending it to an Index array) so there i used it a few times to save some block diagram objects.
08-07-2025 04:10 AM
@Yamaeda wrote:
wiebe@CARYA wrote:
In my defense, outside the forum, I've only seen this being used a few times over the past decades.
In some projects they were overly ambitious at avoiding coercion dots (like converting a U32 to an I32 before sending it to an Index array) so there i used it a few times to save some block diagram objects.
That is tricky stuff.
I usually choose I32s for counts and such, because I know array inputs are (and should be) I32s and I don't want coercion dots... But things like counts are clearly unsigned... I can live with it, but it is a compromise I'm not entirely happy with.
08-07-2025 07:15 AM - edited 08-07-2025 07:19 AM
wiebe@CARYA wrote:
@Yamaeda wrote:
wiebe@CARYA wrote:
In my defense, outside the forum, I've only seen this being used a few times over the past decades.
In some projects they were overly ambitious at avoiding coercion dots (like converting a U32 to an I32 before sending it to an Index array) so there i used it a few times to save some block diagram objects.
That is tricky stuff.
I usually choose I32s for counts and such, because I know array inputs are (and should be) I32s and I don't want coercion dots... But things like counts are clearly unsigned... I can live with it, but it is a compromise I'm not entirely happy with.
If you add a U8 to a I32, to you explicitly convert the U8 first? 😉 I mean, the code is more correct, but the extra blocks makes it a little harder to read, since i always think "why are they doing this explicit conversion?"
I have the same reaction when people add a 0 constant to Index array, it's the same as not having it connected, but it makes me think and wonder why they index.
08-08-2025 07:57 AM
@altenbach wrote:
Look ma, I finally found all the "variables"!!! 😮
Look at the navigation windows for the scale of it all. Yes, the main code only contains local variables (for write) and value properties (for read). Not sure why there are two sequence frames. 😄
Try makespace without the inherent grouping the FSS provides. 😉
08-13-2025 12:15 PM - edited 08-13-2025 12:17 PM
@Yamaeda wrote:
If you add a U8 to a I32, to you explicitly convert the U8 first? 😉 I mean, the code is more correct, but the extra blocks makes it a little harder to read, since i always think "why are they doing this explicit conversion?".
In addition, an explicit conversion is sometimes more expensive. (Example, but you would think the compiler should create identical code. I have not tested in recent version)