LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding elements to an array and having the Front Panel Table display correctly

Solved!
Go to solution

Hello Everyone,

 

I am working on creating an .vi that will take an old instrument and allow the operators on the floor to save data automatically instead of reading the data off of the instrument and having to enter them into the computer manually.

 

The instrument is setup using an RS232 comms port, I can communicate with the instrument and I have full control of all of the functions.

 

My problem comes in when I am trying to collect data and add it to an existing array and then having the front panel table display the information correctly.  At the end this entire array will be saved to an excel template in an existing format, so I can't adjust the way I need the table to display.

 

Please take a look at the images and lend me a hand if possible.  I will not be able to post the .vi due to the nature of my work and I am reading information from the instrument.

 

Thank you in advance for all of the help!!

 

 

Download All
0 Kudos
Message 1 of 6
(3,656 Views)
Solution
Accepted by topic author Tera-Engineer

There is no way to solve this by looking at pictures. Please attach a simplfied version of the VI. Is the "FG table" just an action engine?

 

What is the size of the 2D string array coming out of the FG table? Maybe it should be wide enough to contain all fields as empty strings, then you can (re)place values using "replace array subset" at the desired locations.

0 Kudos
Message 2 of 6
(3,630 Views)

Thank you for your reply, I cannot as you suggest create an NaN array large enough as the size of the table array is dynamic and varies with each test being conducted.  Could be 10 rows or could be 1000's, but it will always remain the same # of columns.

 

Any of the FG sub vi.'s are a simple Functional Global routine: Set takes an input and stores it in a global memory to be used else where within the same .vi or in others, read reads the value stored in the FG, and reset sets the FG value back to 0 or NaN depending on the FG type.

 

I will try to create a simplified version of the program tomorrow.

 

Again thank you for your reply.

~Dan

0 Kudos
Message 3 of 6
(3,624 Views)
Solution
Accepted by topic author Tera-Engineer

NaN is for numerics. You are dealing with string arrays.

 

OK, so you have a fixed number of columns and grow one row at a time. Should be trivial to adapt the code.

 

You are currently only adding a row with two elements, so how can it be "up there"?

0 Kudos
Message 4 of 6
(3,618 Views)

altenbach,

 

Thank you for your replies, your previous messages gave me an idea to try this morning.  Since I know it will always be 5 columns, I will try padding the extra columns that are not needed in the first measurement with " " and then use the replace array when I make the second measurement to fill them in.

 

When I go to save down the data I can use the search array function and delete any element that has just " " in it.  This way when I go to save down the data it won't populate cells in Excel and create issues with importing it.

 

If it works I will mark your reply with as a solution.

 

I know it isn't helpful that I can't post the .vi. 

 

To help explain, the first row of data is Measurement 1; the second row of data is Measurement 2 for the same DUT (Device Under Test).  Sometimes Measurement 2 is conducted and sometimes it is not.  For this reason I have the measurements being conducted in series, updating the table inbetween measurements of the DUT so that the operator knows the data was saved into the array.

 

Thank you again,

~Dan

0 Kudos
Message 5 of 6
(3,579 Views)

Hello altenbach,

 

Thank you for your replies, they were very informative and crucial for me to find the solution to my problem that I was having.

 

I was able to have the # of columns by dynamic, and in doing so if I was conduction the second measurement there will be 5 columns and if not then there would be 3 columns.  I then used your suggestion to pad the extra 2 columns (if being used) with " " and used the replace array function to add the necessary data into the array and table.

 

Thank you again,

~Dan

 

0 Kudos
Message 6 of 6
(3,562 Views)