LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need some advices to merge two array-manipulation functions

Solved!
Go to solution

Hi guys!

 

Thanks to Johnsold, Helmut O'Brian and Jcarmody, who helped me through a complicated (for me, the LV noob) string function, I got further on with my project and I'm very close to an end.

As I descibed here I wanted to search an array for words combined with -, i.e. C1-C10. From the help I got there I was able to do so. I also learned a few tricks and was able to do the following stuff:

Original Array:                               New array:

R1                                                       R1

R2                                                       R2

C1-C3                                                  C1

K1                                                       C2

                                                           C3

                                                           K1

 

I was also able to to this:

Original array:                               New array:

R1                                                       R1

R2,R4,R7                                             R2

C1                                                       R4

K1                                                       R7

                                                           C1

                                                           K1

 

I was also able to combine those two functions:)

 

Now back to my problem.

Until now this was just an 1D array I worked with. Actually it's a 2D array I read from a .CSV file:

1.png

 

As you can see there are some places where stuff is combined with either - or comma. I need to expand the first column as described above and as solved in the thread I mentioned. Done! No problem. I extract the first column into and 1D array. Then I expand it. Now I need to put it back into the original array and also expand the whole thing.

It should then look something like this:

1.png

 

Then I only need to copy the line from the R6 position and paste it into the blank fields:

1.png

 

I have attached two VIs below. Open the main.vi first. Then copy.vi after. I have tried to describe the problem there also. You can see what I have accomplished and what's missing.

Tasks:

1. Put the expanded column back into the original array and expand the whole thing.

2. Copy the needed lines.

 

In the main.vi I do the 1D expansion, but I have problem with the 2D array expansion. In copy.vi I manage to copy the lines. So that part is done.

I basically need some advices on the expansion I do and how to get the 2D array also expanded. Since I haven't got so much experience I feel most comfortable to work with 1D arrays. But I can't seem to get any further with this 1D -> 2D expansion.

I also can't really seem to find a smart way to implement my line-copy-function into the main.vi.

 

P.S the attached VIs are made in LV2010.

 

Luckily I can attend some Core courses at NI here in Norway, but until then I'm still self-learning and I think sometimes I try to do stuff that is way out of my league:( 

 

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
Download All
0 Kudos
Message 1 of 3
(2,424 Views)

I don't want to be rude and bump this thread, but I was able to make a better line-copy-function.

I think that solved the problem of implementing it into the main.vi.

 

All I need now is to merge the 1D array with the 2D array and make the expansion:)

 

 

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
0 Kudos
Message 2 of 3
(2,400 Views)
Solution
Accepted by topic author EvenDeejay

I don't know what I did, but it works now:)

 

Thanks for the help, Even!

 

You're welcome Even!

 

🙂

 

Have attached the file if someone wants to see what I did.

Regards,
Even
_________________________________
Certified LabVIEW Associate Developer

Automated Test Developer
Topro AS
Norway
0 Kudos
Message 3 of 3
(2,388 Views)