11-30-2011 09:56 PM
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.
11-30-2011 10:02 PM
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.
11-30-2011 10:14 PM - edited 11-30-2011 10:16 PM
Here is a very basic example:
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.
12-01-2011 09:36 AM
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:
12-01-2011 09:59 AM
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".
12-01-2011 01:58 PM
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.
12-02-2011 12:01 PM
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
12-02-2011 01:30 PM
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.
12-02-2011 03:00 PM
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.