ni.com is currently experiencing issues.

Support teams are actively working on the resolution.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

open write and save a txt file

i'm trying make a vi to open and write in a txt file

 

my level of LabView is very basic and, i'm looking for help for open (or create) a txt file in a specfication folder, write a value and save this file in a another folder

0 Kudos
Message 1 of 10
(4,512 Views)

Hello Imemendes

 

Refer to the Write-Read Text File VI in the labview\examples\general\functions\File IO directory for an example of using the Write to Text File function

 

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 10
(4,497 Views)

Sounds like you should go through some of the online tutorials.  Or you could use the LabVIEW Example Finder (Help->Find Examples) and do a search for Write File.

LabVIEW Basics

LabVIEW 101


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 10
(4,496 Views)

i'm grateful by your response

i achieved a solution to my problem but it seem is not enough

now i need to make three graphics but i'm stuck in a string

i read a file with three line, which every line gives me a different values, i want make three different graphics with that, but i need to separate the string, since lab view show me only one line

in the file is like this

0.0
24.1
40.2

in the lab view is like this

0.0 24.1 40.2

i would like if possible your help to separate this string

i upload mine vi to see how i was

0 Kudos
Message 4 of 10
(4,471 Views)

Can you upload it in LV 2011 version?

 

From what i have understood, try something like this to seperate and use your stirng

Thanks

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 5 of 10
(4,464 Views)

the use of string format to separate....

 

Spoiler
vti[1].png

 

0 Kudos
Message 6 of 10
(4,438 Views)

 

code.png

 

 

sorry i could'nt save in lbv 11

 

this is my code 

 

my second objective is read the information in file values.txt, then make them appear in three graphics

in first attempt i try to take da string and convert to number by a array (not in the image) then transforming in a cluster e after in graphic but all have de same have the same value, seems it was made like in the image, but made by a more complicate way.

i use de vi that Nghtcrwlr send and i have two problems, first the values appear like integer and i couldn't make the graphics

i try to use the "edit scan string" but i obtained the error " Scan failed. The input string does not contain data in the expected format

using the %f%f%f the same error ocurred

0 Kudos
Message 7 of 10
(4,436 Views)

Now that your format constant is using "\" display, get rid of the extra slashes.  It should read "%f\n%f\n%f"


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 10
(4,418 Views)

you are not closing the the file in use, that is why you get the messege and your string format....

 

Spoiler
Example_VI.png

 

Spoiler
vti[1].png

 

0 Kudos
Message 9 of 10
(4,412 Views)

apok there are two differents files 

 

the first "setpoint.txt" that the only problem is the decimal values but i think the problem are the the difference between "." and ","

 

the second file is "values.txt" this file is in constant actualization and this the base to may graphics

 

 

 

 

 

%f/n%f/n%f

0 Kudos
Message 10 of 10
(4,401 Views)