取消
显示结果 
搜索替代 
您的意思是: 

terminator character(s)

已解决!
转到解答

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 项奖励
1 条消息(共 9 条)
3,997 次查看
解答
已被主题作者 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 **************************




2 条消息(共 9 条)
3,996 次查看
So... did that help?
-Matt Bradley

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




0 项奖励
3 条消息(共 9 条)
3,965 次查看

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

 

 

下载全部
0 项奖励
4 条消息(共 9 条)
3,951 次查看

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 项奖励
5 条消息(共 9 条)
3,921 次查看
So... did that help?
-Matt Bradley

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




0 项奖励
6 条消息(共 9 条)
3,883 次查看
 
下载全部
0 项奖励
7 条消息(共 9 条)
3,872 次查看

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 项奖励
8 条消息(共 9 条)
3,870 次查看

Hi abasani,

 

the 0x0A is nothing else than a LineFeed which is found among the string constants 眨眼表情

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 项奖励
9 条消息(共 9 条)
3,851 次查看