LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Take input strings and display them in a table

I would like to take the input from several string controls and display them in a table.  Sounds simple enough but I'm been playing around for a few hours and can't figure out a reliable way of doing this.

0 Kudos
Message 1 of 9
(2,703 Views)

Can y ou post what you have done so far? A table is basically a 2D array. So if you are comfortable working with arrays you can simply create the array and wore that to the table.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 9
(2,702 Views)

Here is a very basic example:

 

Table Example.png

 

This is a very contrived example but it show show you the general concepts. Obviously you need to format each string for your purposes using the appropriate inputs.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 3 of 9
(2,699 Views)

Hi Mark - Thanks for the response!

 

That diagram makes sense for the most part.  The only thing I don't understand is what the the loop iteration is doing after it adds one to the current count.  Is that some kind of formatting? 

 

BTW, would it be easier to take the contents of each row of a column from a table and then display that in an indicator string?  I came up with this, but it's not very efficent and I think it needs to be in a for loop:

 

0 Kudos
Message 4 of 9
(2,680 Views)

I see no reason to separate the values from the table and then put them into individual indicators. Simply use the table as the display. If nothing else it is a cleaner looking UI.

 

As for the +1 on the loop count it is strictly there for display purposes. Zero based operations are nice for code but if a human is looking at it then one based makes more sense. As an illustration I included the loop count in the data in the table. Rather than seeing "0: Data" in the first row it makes more sense to display "1:Data".



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 5 of 9
(2,671 Views)

The reasoning behind that is because we'll have 17 channels being read in, each channel representing a different gauge.  I'd like to be able to have the user enter in the name of the port plugged into each gauge on the table and then have that information displayed on the relevant gauge.


Another way would be to have the user label each gauge with the port name and then have all the names put into a table for reporting purposes.  

 

But the way I had it setup didn't seem to work.

0 Kudos
Message 6 of 9
(2,657 Views)

I am not sure exactly what you are trying to accomplish.  Do you want to pull the actual string indicator labels and put them in the table?  If so, you can do that with the property nodes.  On your block diagram, right click on the string indicator, select create>property node.  From there you can select label and text.  This will provide the label text and then you can put that in your table.

 

Ryan

 

 

Applications Engineer
National Instruments
0 Kudos
Message 7 of 9
(2,631 Views)

What I wanted was a string indicator that would act as a label for a gauge (each representing a channel coming from a DAQ).  Then all the labels would be put into a table and then exported to the TDMS file so the user could determine what label was given for each gauge. 

 

What I ended up doing was Creating a 1D table with a row for each channel.  When the user starts the application a pop-up tells the user to fill out the table with the name of each gauge.  Then when the program is started the table is written to a TDMS file and also exported to string constants that act as labels on each gauge. 

 

 

0 Kudos
Message 8 of 9
(2,622 Views)

Ok, gotcha!  You would be able to do that by placing a string control above each Gauge, then keep track of which indicator goes with which Guage.  You could do this by making them a cluster, so the data stays tied together until you ready to write to the tdms file.

Applications Engineer
National Instruments
0 Kudos
Message 9 of 9
(2,612 Views)