LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Rotate Multiple 1d String Arrays

Solved!
Go to solution

Hello,

 

I have a vi that eventually writes certain data to a log (.txt) file.  Within the data that gets written, there are a few arrays.  In one particular section, I have three string arrays that I am attempting to manipulate with no luck.  Below is an example of what I have now, and subsequently, where I want to be:

 

Present:

x1

x2

x3

y1

y2

y3

z1

z2

z3

 

Desired:

x1 y1 z1

x2 y2 z2

x3 y3 z3

 

Where x, y, and z represent the three sepreate string arrays.  These arrays are then concatenated with other data to produce the log file.  It seems that no matter what I do ( build, transpose, index, etc...) I still end up with the vertical arrangement in my log file -- I am sure that I am overlokking something trivial, but it is eluding me at the moment.

 

I cannot post my code due to security, but will provide any more detais that are needed.  Thanks in advance.

0 Kudos
Message 1 of 8
(3,487 Views)
Solution
Accepted by topic author Adam_RF_Engineer

I think you're looking to do a Build Array followed by a transpose.

 

Your build array should have 3 inputs.

Feed it X, Y, and Z and you should get

 

x1, x2, x3

y1, y2, y3

z1, z2, z3

 

Hit that result with the transpose and you should get

x1 y1 z1

x2 y2 z2

x3 y3 z3

 

What are you using to write to the log file?

Message 2 of 8
(3,479 Views)

Let me make sure I have this straight.  You have 3 arrays of string: {x1, x2, x3}, {y1, y2, y3}, and you want a 2D array in the end:

x1 y1 z1

x2 y2 z2

x3 y3 z3

 

?

 

If I'm correct, then you should just use a Build Array with "Concatinate Inputs" off (it is a right-click option for the build array) and then transpose.


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 3 of 8
(3,474 Views)

Thanks.  That got me a little further.  I now have the data grouped, which is better, but it is not how I would like it... cosmetically speaking.  Now it is:

 

x1

y1

z1

x2

y2

z2

 

It seems as though Labview is coercing the data into a single cloumn and will not write more than one piece of data to the row.

 

To write the log file, I am using a "File Dialog" coupled with a "Write to Text File".

0 Kudos
Message 4 of 8
(3,469 Views)

Can you show up your code for this little operation.  It still seems to me that you are using the "Concatinate Inputs" on the Build Array.


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 5 of 8
(3,457 Views)

I cannot post the code, but the the inputs are not concatenated.

0 Kudos
Message 6 of 8
(3,447 Views)
Message 7 of 8
(3,439 Views)

So after reading NUMEROUS posts and replies all with good input, I determined that there must be something I was overlooking -- as the solution seemed so trivial and and was reiterated by numerous labview experts.

 

Turns out that the build array and transpose was the correct solution.

 

In my case, I dug back into my code and found where I had concatenated the string AND a carriage return constant (on three separate occasions).  Labview was always coercing to the next line because I had told it to do so.

 

Thanks for the quick replies.  Amazing forums!

0 Kudos
Message 8 of 8
(3,434 Views)