LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Limit the charecter length of cell in listbox

Solved!
Go to solution

Dear Sir,

 

Please help me to implement the logic for limit the characters length of each cell in listbox.

 

Thanks & Regards,

S Nagaraju

0 Kudos
Message 1 of 8
(4,267 Views)

Hi S,

 

pseudocode:

FOR EACH cell in listbox
   cell.string := StringSubset(datastring, 0, MAXLENGTH)
NEXT

 What have you tried so far?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(4,265 Views)

Dear Sir,

 

I am reading data line by line from .txt file and displaying the lines in listbox. Plz find the enclosed VI & text file for more clarity.

 

The representation of listbox should be Emitter Name, Date & time.

 

 

S Nagaraju

Download All
0 Kudos
Message 3 of 8
(4,251 Views)
Solution
Accepted by topic author Sonti_11532

Hi Sonti,

 

that's no MultiColumn listbox, it's a simple listbox…

 

Just apply the logic presented above: limit string length for line in your text file BEFORE writing them into the property node of the listbox!

It just requires a FOR loop and a StringSubset function…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(4,242 Views)

Thank you for the solution.

 

As you mentioned here i am able to display Enitter no, data & time.

 

But, based on selection I have to process entire data that means full line.

 

How to get the full data of line if i select one emitter from listbox?

 

S Nagaraju

0 Kudos
Message 5 of 8
(4,222 Views)
Solution
Accepted by topic author Sonti_11532

Hi Sonti,

 

the listbox gives you the index of the selected line. Use that index for getting the element from your array of lines using IndexArray…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(4,212 Views)

Dear Sir,

 

Thank you very much its going fine.

 

And i am able to remove the empty lines from listbox also.

 

 Listbox.png

S Nagaraju

0 Kudos
Message 7 of 8
(4,156 Views)
Solution
Accepted by topic author Sonti_11532

Hi S,

 

it's a bit dangerous to read the Listbox value before you set the listbox elements…

And you don't need the "value" property node, just use the Listbox terminal!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 8
(4,136 Views)