12-09-2013 06:20 AM
12-09-2013 06:27 AM
I know this works:
But why not the other one, and is this operation time consuming for LabVIEW, it builds a new string every loop cycle....
Regards,
Thijs
12-09-2013 06:46 AM - edited 12-09-2013 06:48 AM
Hi Thijs,
the error message of the broken wire is quite unique: "incompatible arrays connected"...
The help only mentions arrays to be connected by an output tunnel. Scalar strings aren't mentioned anywhere!
That's the "traditional" way:
Use ConcatStrings to concatenate an array of strings into a single string...
12-09-2013 07:08 AM - edited 12-09-2013 07:10 AM
@ThijsBoeree wrote:
Hi
Does anybody knows why does this doesn't work?
Strings are a bit funny with the concatinating tunnel. LabVIEW concatanating tunnels only work on rectangular arrays. An array of strings is really a 2D ragged array since each string is an array of U8s and each string has its own length. Concatinating "On the fly" inside the loop tunnel then is no more effecient than building the string on a SR since a new buffer must be allocated for each iteration. Use Gerd's snipette to concat outside the loop for best performance.
12-09-2013 07:23 AM
Thank you so much!
It's clear now
Regards,
Thijs
12-09-2013 03:12 PM
@JÞB wrote:
An array of strings is really a 2D ragged array since each string is an array of U8s and each string has its own length.
Not exactly. The array itself is a simple 1D array of pointers, where each pointer points to the relevant string - http://zone.ni.com/reference/en-XX/help/371361K-01/lvconcepts/how_labview_stores_data_in_memory/
12-09-2013 06:28 PM - edited 12-09-2013 06:33 PM
Well, I'll take my lumps and a bit of new knowledge. Thanks again Yair!
But, then why does the concat tunnel have the problem the OP alluded to... if it does.???....OK FUN, I'm going to learn something! (Really, I enjoy it!)
12-10-2013 06:49 AM
@JÞB wrote:
But, then why does the concat tunnel have the problem the OP alluded to...
Because it's meant to concat arrays, not strings. It's true that the same term is used for both, and there's no reason in principle why NI can't make a concat tunnel concat strings as well, but since the code for concatting strings is so easy, I don't see the point. If anything, what's surprising there is that the wire coming out of the tunnel is not broken.