From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

1D array to a 2D array

Solved!
Go to solution

untitled.PNG

 

I have constants of an Array.. I want to insert the an element to each of those contants, like FAILED OR PASSED. Can someone show me how to create 2D array? thanks

Best regards,
Krispiekream
0 Kudos
Message 1 of 8
(3,533 Views)

You don't need a 2-D array.  Use a cluster to hold both the number, and string values, and then create an array of that cluster.

Machine Vision, Robotics, Embedded Systems, Surveillance

www.movimed.com - Custom Imaging Solutions
0 Kudos
Message 2 of 8
(3,528 Views)

In fact, you CAN'T have a 2D array like you want, because all the items in an array have to be of the same data type. So, you can have a 2-item cluster of 1-D arrays (separate number and P/F arrays) or a 1-D array of 2-item clusters (number-P/F clusters), whichever way your application would work with easier (the packing order will determine which characteristics are easier to get to).

 

Unless, you wanted to code Pass = 1, Fail = 0, then you could have a 2-D array.

 

Then, there's always a database Smiley Wink .

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 3 of 8
(3,512 Views)

i have changed my numbers to string so it is seen as text.

 

Best regards,
Krispiekream
0 Kudos
Message 4 of 8
(3,505 Views)

@krispiekream wrote:

i have changed my numbers to string so it is seen as text.

 


It would make more logical sense to use a cluster, unless you are displaying this in a table.

 

If you create an array of your Pass/Fail results, then you need to use Build Array (make sure concatinating is turned off).  You may have to use Transpose 2D Array to get it to display the way you want.


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

i am actually trying to print out the table of pass/failed devices.

i am just having a problem inserting the FAIL/PASS into the current CONSTANTS ARRAY OF DEVICES.

 

Best regards,
Krispiekream
0 Kudos
Message 6 of 8
(3,499 Views)
Solution
Accepted by topic author krispiekream

Something like this?


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

yes!!1

thanks you!

thats exactly all i needed.

 

Best regards,
Krispiekream
0 Kudos
Message 8 of 8
(3,483 Views)