LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

No Auto-concatenated strings in a (For / While) Loop ?

I saw that "auto-concatenated" was added to the Tunnel-mode of a For Loop.  I was positively surprised as it looked very convenient to put it directly into use.  However, the string characters I wanted to concatenate caused an error.  Upon looking closer at this recently added feature I saw that it could concatenate arrays only.  Of course I can convert the string into a byte array and (afterwards) back again, but it seemed an omission which might be added in a new Labview version.

0 Kudos
Message 1 of 9
(3,951 Views)

Hi Ettepet,

 

you probably know you can do this easily like this:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 9
(3,942 Views)

I think issue may be because string lenght is not fixed.

For loop preallocates the memory locations for arrays depending upon the datatype.

But because of variable string length it will be difficult to implement in for loop. ( ofcourse concatenate and build array function do not preallocate memory ) 

0 Kudos
Message 3 of 9
(3,934 Views)

@GerdW wrote:

Hi Ettepet,

 

you probably know you can do this easily like this:

check.png


Of course.  But what does it do? 🙂  Couldn't even find the function you use after the Loop (unless it is squashed).

0 Kudos
Message 4 of 9
(3,927 Views)

Hi Ettepet,

 

my picture is a snippet.

 

Btw. that function is ConcatenateStrings...

 

@Neos:

You surely can concatenate arrays of varying length in the loop. So that shouldn't be the problem. Concatenation is memory-inefficient anyway, regardless of using a (new) output tunnel or the "traditional" way of BuildArray or ConcatString...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 9
(3,921 Views)

@GerdW wrote:

Btw. that function is ConcatenateStrings...


Ah, easy really. 😉

 

If a Loop in Labview needs to have "preallocated memory locations" and for that reason excludes variable length strings then it is clear.  There already was the fact that single character strings don't exist as an enitity so there would be no natural progression from "indexed" to "Auto-concatenated" like there is for elements and "arrays of elements".

0 Kudos
Message 6 of 9
(3,915 Views)

GerdW,

The original question was if the conditional index option is working for arrays so why not for strings.

I am sure original poster knows how to do things ( myself also )

May be you missunderstood ( or me )

No disrespectSmiley Happy

0 Kudos
Message 7 of 9
(3,910 Views)

The original question was about  "auto-concatenated"...  😉

0 Kudos
Message 8 of 9
(3,906 Views)

The original question was about "auto-concatenated"...


 

oops.........

meant sameSmiley Very Happy

0 Kudos
Message 9 of 9
(3,904 Views)