LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem to sort data in array

hi..im having some problem add my data to array..as u can see the attach picture, my second data for (2222) which is 21 is not inserted properly in my table under 2222 and my data for (5555) is out of my table..can anyone help me

 

apart from that, how can i remove the add case and make the input data automatically insert into my table as my program run?

Download All
0 Kudos
Message 1 of 50
(3,615 Views)

Here's something to try.  The only thing that you might not have expected is that I've got zeros instead of blank spaces.  This is a result of arrays always being square.  Your solution didn't work because you were building all of your inputs into a 1D array.

 

progress2[1].png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 50
(3,561 Views)

ouh i see..is there anyway to make the space blank if no value is entered for that element?

btw, how do i insert the timestamp to each of my output

0 Kudos
Message 3 of 50
(3,554 Views)

You are really digging yourself into a hole here, because you code scales very poorly. Whenever you add a new column (now 5555), you need to rewrite everything. Imagine you have hundreds of tags... Compare with my code: all you need is change the array of column headers, the rest is automatic! (I told you there are better ways!)

 

Make sure to do everything inside the event structure, even the "saving". This way it can be repeated if needed.

 

Here's a quick draft how you could do all this. I assume you want to enter the string several times and hit add to append the new to the old data. Let me know if you have questions.

 

Modify as needed.

 

 

Message 4 of 50
(3,538 Views)

Who loves variants?  I love variants!  This version will scale to any number of tags without needing to know what they are to begin with.

 

progress2[1].png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 5 of 50
(3,526 Views)

I've been known to dabble in variants.  Just a couple of minor quibbles:

 

Using the Value property with the Terminal sitting right there, just itching to be wired....

 

I typically feed the attribute names straight to the ColHdrs[] property and then the For Loop is just creating a 2D array which is ready for transposition followed by connection to the aforementioned Table indicator.

0 Kudos
Message 6 of 50
(3,511 Views)

SInce this is a continuation of this thread, I don't think the variant would be a viable solution.

 

There appears to be only a short list of valid tags, all other entries should be ignored.

 

(QUOTE: "if other than 1111,2222,3333,and 4444 i want to ignore it and it's value

can someone give me example on this")

Message 7 of 50
(3,503 Views)

 


@altenbach wrote:

SInce this is a continuation of this thread, I don't think the variant would be a viable solution.

 

There appears to be only a short list of valid tags, all other entries should be ignored.


au contraire mon frere

 

 

VariantToTable.png

 

Very simple to add or remove valid tags, you can even specify at run time with a few mods.

Message 8 of 50
(3,497 Views)

I should have been more specific. "That particular variant version would not work".

 

Your's is OK. 😄

 

(Still, I don't think it provides any advantage over my solution...)

0 Kudos
Message 9 of 50
(3,492 Views)

 


@altenbach wrote:

I should have been more specific. "That particular variant version would not work".

 

Your's is OK. 😄

 

(Still, I don't think it provides any advantage over my solution...)


No real advantage other than the fact that nothing shows off your LV Ninja skills quite like using Variants. Other acceptable ways include Type Cast, Implies, Feedback Nodes, and Regexes....Smiley Very Happy

 

0 Kudos
Message 10 of 50
(3,484 Views)