LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Variable concatenated string size?

Solved!
Go to solution

Hello everyone,

 

I have the following question:

 

In Labview there is a function called concatenate strings. When I want to "add" three strings I can pull the concatenate string to size three for three inputs.

Is there a possibility to implement a numeric control where I can enter a number which varies my inputs for the concatenate string function?

If I want to add three strings I enter 3 into my numeric control and my function gets three inputs. After my program ran I want to have five strings added so I would enter 5. Is there a possibility to achieve this?

 

Thanks for your help in advance.

 

Best regards,

Tresdin

0 Kudos
Message 1 of 9
(4,373 Views)

You might be able to acheive what you are looking for by using an array of strings and then use concatinate strings on the array (with a single input).


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
Message 2 of 9
(4,366 Views)

Thank your crossrulz, I will play a bit around and see if this solves my problem.

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

@crossrulz wrote:

You might be able to acheive what you are looking for by using an array of strings and then use concatinate strings on the array (with a single input).


I had no idea that you could do this. Every time I have needed to do this I just put a ccat in a for loop and indexed the array. I feel a bit silly now.

Matt J | National Instruments | CLA
Message 4 of 9
(4,321 Views)

@Jacobson-ni wrote:

@crossrulz wrote:

You might be able to acheive what you are looking for by using an array of strings and then use concatinate strings on the array (with a single input).


I had no idea that you could do this. Every time I have needed to do this I just put a ccat in a for loop and indexed the array. I feel a bit silly now.


Well Context Help does tell you that you can do it.  All you need to do is read it!  Smiley Wink

 

Message 5 of 9
(4,314 Views)

Thanks everyone for their input.

 

I have a followup question concerning the same problem:

 

Overall I want to sent a string command to an external robot arm. I want to do the following: Before I start I want to enter all the coordinates the arm should drive to, something like:

 

Point 1: (x1,y1,z1)

Point 2: (x2,y2,z2)

..

etc. after I entered all my points I want to start the program. The points shall be entered in my 1D Array as crossrulz explained it to me.

How can I temporary save my input strings? I would have done this with shift registers usually I think, but as I have a varying number of points (for example sometimes I want to driver to 4 different points, sometimes I want to drive to 50 different points). So shift registers don't seem to be the solution here. My question: How can I temporary save my input strings and write them to a 1D array after I finished entering every string.

 

If the mods think this doesn't fit into this thread anymore. I would be grateful if you move this, but I thought it fits because it's still the same problem I'm working on.

 

Thanks everyone again!

0 Kudos
Message 6 of 9
(4,213 Views)
Solution
Accepted by topic author Tresdin

It sounds to me like your program should be in a FOR loop, autoindexing on the array of points.


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
Message 7 of 9
(4,207 Views)

Hi crossrulz,

 

thank you for your fast reply. This sounds a bit embarrassing but what are the points on the left side (I guess a cluster?). I would copy it to my blockdiagram but unfortunately I'm using Labview 2012.

0 Kudos
Message 8 of 9
(4,201 Views)

Points is an array of clusters.  Each element in the array is a cluster with X, Y, and Z numerics.


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
Message 9 of 9
(4,193 Views)