LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Append two arrays, without a while loop

Solved!
Go to solution

 

Looking from your perspective I agree it has to be more clear. However one would mention nX1 or just 'n' for a 1 D array. Even though 1xn is supposed to be an array/ vector technically. I observed labview terminology where it considered to be a 2D array.

0 Kudos
Message 11 of 19
(3,805 Views)

You actually only have 1D array initially (and reshaping them to 2D and all the other Rube Goldberg stuff(!) does not change that.)

 

So all you need is implement the original suggestion.

 

concatenate1Darrays.png

 

And yes, also in your main VI, most of the reshaped 2D arrays should be 1D arrays! try to fix that!

0 Kudos
Message 12 of 19
(3,801 Views)

And yes, looking at you DAQ-temp-Press VI, you really need to go gack to the drawing board and do some introductory LabVIEW tutorials. This thing is full of race conditions and greedy loops (why do you need that loop in the upper left??? Just to consume more battery/electricity and heat the room? 😮 What's up with all the vestigial one-iteration FOR loops? Why are there so many local variables and value property nodes?)

0 Kudos
Message 13 of 19
(3,793 Views)

Altenbach

 

I got my answer and I accepted it. 

 

I mentioned to you before there is a reason, why one would do things the way they do - probably because they have other vi's or future stuff they were planning to implement that you are not aware of. I do know I have a 1D array and I was intentionally converting to 2D (again no need to restate the obvious), it is visible in both of my main and test vi's.

 

If you think, I have to do the only way you suggested, thank you for the suggestion - but I will pass.

 

0 Kudos
Message 14 of 19
(3,790 Views)

Why would you convert a 1-D array to a 2-D array to just do more steps to undo it?

 

Use the original 1-D arrays to append them.  If you need those to be made into 2-D arrays for use elsewhere, then split the wires and do that.

0 Kudos
Message 15 of 19
(3,787 Views)

@looser_engineer wrote:

 

I mentioned to you before there is a reason, why one would do things the way they do - probably because they have other vi's or future stuff they were planning to implement that you are not aware of. I do know I have a 1D array and I was intentionally converting to 2D (again no need to restate the obvious), it is visible in both of my main and test vi's.

 


If you want to convert to a 2D array, all you need is insert another "built array" of height=1. All that song and dance with reshaping is just plain silly and nothing in your code would indicate that this is obvious and necessary. Almost nowhere in your code are 2D arrays needed, except when you build them into a 2D array for the graph and table, and a single "built array" would suffice there. (you can use reshape to trim/pad 1D arrays if needed).

I am very aware that your code is inefficient and overly complicated because I've been looking at LabVIEW code for over 20 years. Your overall design makes it much harder to expand in the future and since you are using 10x too much code, making the program even larger will make it unmanageable. Your program is a nightmare!

 

A greedy loop has no justification anywhere. Ever!

 

LabTOON06132008

 

 


@looser_engineer wrote:

 

If you think, I have to do the only way you suggested, thank you for the suggestion - but I will pass. 


I will strongly urge you to reconsider my advice. It is much harder to lose bad habits later. At this time you are not in a position to judge the quality of the various suggestion made here so you need to trust us. Attitude does not advance your skills. Maybe in a few month you could "upgrade" your username once it is no longer appropriate. 😄

 

 

Message 16 of 19
(3,779 Views)

Altenbach,

 

He/she named him/herself "Looser" (as in "not up-Tighter"), not "Loser" Engineer, but given the size of the on-shoulder Chip, I understand how you mis-understood ...

 

BS

0 Kudos
Message 17 of 19
(3,450 Views)

I was going by the assumption that the spelling skills of the user correlated with the LabVIEW skills and extrapolated from there ... :D.

0 Kudos
Message 18 of 19
(3,442 Views)

Dang -- you'd think, by now, I'd know better than to try to outwit Altenbach ... still have a ways to go!

 

BS

Message 19 of 19
(3,420 Views)