Jump to content

writing to a text file


star

Recommended Posts

Changing the "access (0:read/write)" Enum input to the "Open/Create Replace File" function from "write-only (truncate)" to "write-only" seemed to solve the problem. I don't know if that item was available with that Enum in an older version of LabVIEW, but on my copy of LV 8.6 that Enum caused a coercion dot. Here's a slightly cleaned up version of your VI and a screenshot (in case you don't have LV 8.6). You might also want to concatenate a LineFeed at the end of each number.

Link to comment

Yeah i am using version 8.5(thats ok), but the new number which i saved is on the same line as the previous one and i want it to be save on the next line. And if i want to save more numbers, it would be on the next line. I was thinking of using the tab function but i don't have alot of knowledge about it.

Thank you anyways

Link to comment

QUOTE (star @ Feb 23 2009, 12:30 AM)

when i did it, it work however it takes a while to execute and i have to keep the write button on before i run it and leave it on until it the code finishes. Is it possible for the code to run faster and also when i run the code, i want to wait until the user press write button and then end when the information is saved to the file.

The code will be faster if you open the file once and work with the reference.

Look at the event structure to realize the user interaction.

regards,

nicolas

Link to comment

QUOTE (nicolasB @ Feb 23 2009, 07:19 AM)

The code will be faster if you open the file once and work with the reference.

Look at the event structure to realize the user interaction.

regards,

nicolas

Hi nicolasB

I have done some tutorials on events srtructures, however i don't know how to use it in this example.

Link to comment

It works, however this code was smaller part of a bigger code and when I executed the big code it work until it reached the writing file.vi. The reason why is the writing file.vi doesn't stop or the bigger code needs to be in an event structure. I attached the whole code so you could look it.

Thank you for version 8.5

Link to comment

QUOTE (star @ Feb 24 2009, 03:09 PM)

It works, however this code was smaller part of a bigger code and when I executed the big code it work until it reached the writing file.vi. The reason why is the writing file.vi doesn't stop or the bigger code needs to be in an event structure. I attached the whole code so you could look it.

Thank you for version 8.5

Can someone start me off to make this code in a sequence structure and using event structure as well.

Please

Link to comment
  • 1 month later...

Hello star,

So are you saying the 'Write File Y.vi' or 'Write File X.vi' hangs? If so, where does it hang? To troubleshoot this, in a 'hung' piece of code, put the 'highlight execution' tool on. A green arrow will be over the 'vi' that is hung. Could you try this, and provide a little more detail with regards to your request?

Best of Luck,

Justin

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.