Jump to content

Open a file


Recommended Posts

Hi!

I like to open a spezial file (open visually, I would like to see the written text in the file). I created a file with a own path and I would like to open this file with a click on a button.

I took "open/create/replace file.vi" and wired the path as a proberty node and a constant named "open", too.

If I click the open file button it displays me a win dialog I should choose a file to open it.

How could I open it "real"?

:unsure:

Link to comment

If you need to open file just for editing, in notepad, f.example, commandline vill be look like this : "notepad c:/mypath/myfile.txt"

so, using concateate string, you can open every textfile you need..

If you want to open it in LabVIEW, you should use functions like "OpenFile" etc. While path calculations can be automated in many ways..

Say some more ..

/Proximableu

Link to comment
Hi!

I like to open a spezial file (open visually, I would like to see the written text in the file). I created a file with a own path and I would like to open this file with a click on a button.

I took  "open/create/replace file.vi" and wired the path as a proberty node and a constant named "open", too.

If I click the open file button it displays me a win dialog I should choose a file to open it.

How could I open it "real"?

:unsure:

2552[/snapback]

Hi,

I could not see the image you attached.

Have you checked the error cluster if an error is returned from the open create replace file.vi? Maybe the filepath is spelled wrong. If you do not want the advisory dialog you can disable this option at the VI.

althoug more info would help to get to the core of our question.

have fun

LX

Link to comment
Hi!

I like to open a spezial file (open visually, I would like to see the written text in the file). I created a file with a own path and I would like to open this file with a click on a button.

I took  "open/create/replace file.vi" and wired the path as a proberty node and a constant named "open", too.

If I click the open file button it displays me a win dialog I should choose a file to open it.

How could I open it "real"?

:unsure:

2552[/snapback]

Why don't you do this way:

post-833-1099593657.png?width=400

Link to comment
OK, now I try something like this.

But so far I get a failure message:

Failure 10 arisen at new file in serial test....

Possible reasons: LV: path doubly

NI-488: New I/O expected with old I/O in range.

2570[/snapback]

The error is comming from another VI that is trying to write to the same file you are trying to read. When you use the "read characters from file.vi" it sets the read-only flag on the file. This means while you are reading the file, all other vi's accessing the file will give an error.

post-2-1099723398.gif?width=400

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.