From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

terminator character(s)

Solved!
Go to solution

Good day,

 

I am using Labview 7.0 to develop my application which will select items from multicolumn listbox and display them in another multicolumn listbox then the contents will be saved to atext file.

 

I have problem when the data includes the Characters  0x09 or 0x0A because they won't show in the txt file and also it will shift the data in the listbox and in the output file and as aresult that will cause an error.

 

is there any technique to handel those characters?

 

Thanks in advance for your time and effort.

 

 

0 Kudos
Message 1 of 9
(3,045 Views)
Solution
Accepted by topic author abasani

You could use the "Search and Replace" string function to convert all 0x0A's to 0x20's, then do the same with the 0x09's.  Does that give you enough of a head start?  (I'm on my way out the door and can't provide too many details)...

 

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




Message 2 of 9
(3,044 Views)
So... did that help?
-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 3 of 9
(3,013 Views)

Matt,

 

here is my code for your review.

 

I want to use Edit.vi to create a code.

this code will be saved to new.txt after that I'll load it to 3 arrays in the file script_array.vi

 

I have problem with 0xA because as you can see in the attached files it always shift the line.

 

Thanks

 

 

Download All
0 Kudos
Message 4 of 9
(2,999 Views)

OK, here you go...  there's a couple of extra things in here I forgot to delete, but this works.

 

First, I used the read from spreadsheet file vi.  If you look at the "all rows" indicator, you'll see why that doesn't work.  And you can't fix it with delimeters.

 

So then we go through each row of the array.  If it's an even row, we put the data in column 0 in Extracted Row and the data in column 1 in Extracted row 2.  If it's an odd row, we put the data in column 1 in Extracted row 3.

 

I've attached the VI (in version 8.6.1) and also the PNG files.  There might be an easier way, but this should work.

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 5 of 9
(2,969 Views)
So... did that help?
-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 6 of 9
(2,931 Views)
 
Download All
0 Kudos
Message 7 of 9
(2,920 Views)

Good day Matt,

Many thanks for your time and effort.

To solve the problem with 0x09, I used (+) as Delimiter.
The tricky one is the 0x0A.

I used search and replace string function as you suggested which helped me to save the data in the TXT file in the correct order.

You will see when you run the code the 0x0A won't show because it will be replaced with nothing which is ok for now but when I am going to implement the second phase of this project I'll have some problems because I have to send the full string on a serial port and if the 0X0A is missing there will be errors.

I guess I have to figure out how to insert the 0x0A in the string before sending it.

 

Kind Regards

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

Hi abasani,

 

the 0x0A is nothing else than a LineFeed which is found among the string constants Smiley Wink

Best regards,
GerdW


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