Jump to content

Write to SGL File


Recommended Posts

Hi,

I'm using Write to SGL File VI to stored an 1D-array of doubles I need for my program to run. I'm saving it always to the same file and overwriting it all the time I need to save, so the user does not have control over where to save it.

This VI, as the file already exists, presents a question whether the user want to overwrite the file. Presenting the question is not the problem, this is fine. The problem is if the user answers No, LabView Raises Error 43 and presents a screen saying that this error has ocurred and asks Continue or Stop?

How do I avoid this Error Message from appearing?

Link to comment

I have had similiar file error problems with the LabVIEW VI's. I just copy the guts of it to my own wrapper then add or delete what I want in terms of error handling. I like to get rid of the general error handler so I can pass errors in and out of the file routines without getting the pre-canned dialogs.

So for you, I would go into the "Write to SGL File.vi" and copy everything into a new VI and save it in your own directory as Write to SGL File 2.vi or something (whatever works). Then either remove the general error handler at the end that will cause a popup, or use another general error handler directly before it with the option set to cancel any error 43 messages that come result from your file operations.

Link to comment

Or you could just add a simple error handler to the output of the Write to SGL file and set the dialog option to 'no dialog'.

If you want you can even add a case structure that checks if the error is 43, if it is the error gets handled as above (ignored) and if it isn't then you can choose some other method to handle the error.

Link to comment
I know this is just symantics but in situations like this you can just open the original VI and do a "save as" then give it a different name.

5125[/snapback]

That's not entirely semantics, I just tend to use the cut & paste method since I usually have large apps open and don't want every reference to the opened VI automatically updated to the new file that results from the "Save As"... the one caveat of using that method. Besides that though you're right, it is better than cut and paste if you have nothing else open and want to make a copy. :thumbup:

Link to comment
That's not entirely semantics, I just tend to use the cut & paste method since I usually have large apps open and don't want every reference to the opened VI automatically updated to the new file that results from the "Save As"... the one caveat of using that method.  Besides that though you're right, it is better than cut and paste if you have nothing else open and want to make a copy.  :thumbup:

5127[/snapback]

You could always select the checkbox in the File Dialog "Save a copy without updating callers".

Rolf Kalbermatter

Link to comment

Thanks everyone! :thumbup:

I solved the problem as soon as m3nth answered the question, but thanks for adding other points of view to the question, learning new thinks is never too much.

I really appreciate the help of everyone who posted here! :)

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.