LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using data in text file as indicator

hi all  

i want to know is there a way to use a text file and use the data in it to represent and name as the label of the indicator ?

i have attached a sample text file , what i want to achieve is that as the first row of the text file is 2 3 4 6 , its should be represented in labview and also all the indicators representing the data should have the label as the data

so when numeric indicator is displaying a value 2 it should also name the indicator 2

also the file i am attaching has only 04 columns what if the number of columns are unknown , then how can i achieve the same thing .

i hope i am clear in describing what i want to achieve

with regards

Regards
0 Kudos
Message 1 of 6
(3,375 Views)

Hide the label on the indicator and show the caption.

 

Now when you read the first line of the text file, write to the Caption.Text property node for that control.

Message 2 of 6
(3,373 Views)
yeah because Label can be edited only when VI is in write mode..
Message 3 of 6
(3,360 Views)

hi ravens fan

 

thanks for your reply , can u tell me how can i do the second part of my question if the number of element are unknow to me or are variable, as in the file i have attached has 04 elements in a row , what about i have the same file and it has 6 elements , i want to write only one program and it should be flexible enough to accomodate any number of elements in a row or column .

 

Regards
0 Kudos
Message 4 of 6
(3,328 Views)

Hi nolsqn,

 

what about reading the file as array of strings (ReadFromSpreadsheetFile as 2D array of strings) and display the content in a table? Here you could easily use the first row of the text file for the column headers...

 

Otherwise it would be a much harder job to "create" new indicators depending on the number of columns...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 6
(3,321 Views)

Yes table is write option for it.. otherwise u can try to synchronise multicolumn listbox with array of numeric display ... in that case array size will change as per elements entry in file .. but u need to synchronise it well with multicolumn listbox ..

 

 

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