LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read ASCII file

The error dialog comes up because you have automatic error handling turned on. I personally despise that feature and is one of the first things I turn off with new LabVIEW installs.

 

If you're going to get a subset of the string as you are currently doing you don't need Scan From String. You can simply use the standard string to numeric function Fract/Exp String to Number function. That function will ignore spaces that occur before numeric characters.

Message 21 of 28
(1,870 Views)
Thanks all. The problem has been fixed.
0 Kudos
Message 22 of 28
(1,863 Views)
I have another problem in reading ASCII file when I transfer a file in another format (.lbv). When I run the program, the program asks me the file path, though it is already there.
0 Kudos
Message 23 of 28
(1,824 Views)

It's asking for a file path because you have a Write Characters to File VI where you have nothing wired to the file path input.  If there is no file path, then it pops up a dialog.

 

You say "though it is already there".  Where?  Your original file dialog is only wired to the Read File VI.

0 Kudos
Message 24 of 28
(1,805 Views)

Sorry I upload the wrong vi. This is the correct one. Even I input the file path, it still asks me to input the file path again when I run the program. Sorry the raw data cannot be uploaded because it is not permitted by the forum.

 

Thanks.

0 Kudos
Message 25 of 28
(1,797 Views)

You are using the File Dialog function. As the context help, and the online help (documentation) for that function, say :

  "Displays a dialog box ... "

 

So, obviously, you're going to get a dialog box. The path you provide is a starting path. If you cancel out of this dialog, then the output is an empty path, so the read VI will get an empty path, and you'll get another dialog. The function you want is Open File, or you can just wire the path directly to the Read VI.

Message 26 of 28
(1,793 Views)

Thanks for the message. But I don't understand what you mean. Would you mind to do the little change in the vi and upload in the web?

 

I tried to start with a string and change to a file dialogue box, see attached, but the same problem happened.

 

Thanks again.

0 Kudos
Message 27 of 28
(1,775 Views)

What you are doing and asking for is just plain silly. If you do not want a popup asking the user for a file name, don't call the File dialog function. No matter what you pass to it, you will get a popup. Read the help for the function if you don't believe what others have told you. If you want a front panel control or a diagram constant for a path, then wire that directly to the file read function. Using a string constant and converting that to a path is also unnecessary. Just use a path constant.

 

You should really take some of the tutorials before trying to write any code and before posting any more questions.

Message 28 of 28
(1,764 Views)