Riceman Posted June 24, 2005 Report Share Posted June 24, 2005 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? Quote Link to comment
m3nth Posted June 24, 2005 Report Share Posted June 24, 2005 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. Quote Link to comment
Riceman Posted June 24, 2005 Author Report Share Posted June 24, 2005 Thanks, I've already been looking in the Write to SGL File VI, but didn't want to change it. Copying and editing is a good idea! Thanks! :thumbup: Quote Link to comment
Simon Kelly Posted June 24, 2005 Report Share Posted June 24, 2005 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. Quote Link to comment
Riceman Posted June 24, 2005 Author Report Share Posted June 24, 2005 And how exactly do I add this error handler, considering that this VI does not have an "Error Out" output? Quote Link to comment
Simon Kelly Posted June 24, 2005 Report Share Posted June 24, 2005 Hmm, didn't notice that. I guess your only option then is what m3nth said Quote Link to comment
Michael Aivaliotis Posted June 25, 2005 Report Share Posted June 25, 2005 Thanks, I've already been looking in the Write to SGL File VI, but didn't want to change it. Copying and editing is a good idea! Thanks! :thumbup: 5120[/snapback] 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. Quote Link to comment
m3nth Posted June 25, 2005 Report Share Posted June 25, 2005 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: Quote Link to comment
i2dx Posted June 25, 2005 Report Share Posted June 25, 2005 maybe this helps ... ? Download File:post-885-1119717443.zip Quote Link to comment
Rolf Kalbermatter Posted June 27, 2005 Report Share Posted June 27, 2005 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 Quote Link to comment
Riceman Posted June 27, 2005 Author Report Share Posted June 27, 2005 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! Quote Link to comment
m3nth Posted June 27, 2005 Report Share Posted June 27, 2005 You could always select the checkbox in the File Dialog "Save a copy without updating callers". 5136[/snapback] Wow... I have never seen that before. Probably because I wasn't looking. :thumbup: Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.