10-01-2020 12:30 PM
I am trying to save video I take from a camera to a AVI file in my project. I found that if I open my front panel second time and try to do again. It gave me error saying that not able to access the file. I trying to delete the AVI file and it said that the file was still opened by LabView, which mean that it was not closed properly. I did use AVI2 Close at the end of my code. Do I need to dispose any other things before I can create a AVI with the same name again?
10-01-2020 01:10 PM
@Jacobier wrote:
I am trying to save video I take from a camera to a AVI file in my project. I found that if I open my front panel second time and try to do again. It gave me error saying that not able to access the file. I trying to delete the AVI file and it said that the file was still opened by LabView, which mean that it was not closed properly. I did use AVI2 Close at the end of my code. Do I need to dispose any other things before I can create a AVI with the same name again?
I guess you probably did something wrong, but it's hard to give even an educated guess without seeing the code. I could think of a zillion ways this could happen, but sharing the code would probably narrow it down to one or two.
10-01-2020 01:43 PM
Sorry, I think I figure out where is the error. I abort the program instead of using code to stop the program. Let me ask a side question. Can I set an event case with abortion as a trigger? I could not find it.
10-02-2020 01:54 PM
Never, EVER think about the abort button as a normal way to exit your code. That being said, there are always exceptions to the rule. Why don't you share the reason why you are so wedded to stopping your code using the abort button (or some code equivalent)?
10-02-2020 04:42 PM
@Jacobier wrote:
Can I set an event case with abortion as a trigger?
No. By definition: When you abort the code, it stops running, so any event structure that would look for an abort would be forced to stop before it would have a chance to react to it.
This post, Can I generate a boolean output whenever I abort a VI?, follows the topic in depth, and also discusses some preferable (i.e. safer) alternatives.
@billko wrote:
That being said, there are always exceptions to the rule. Why don't you share the reason why you are so wedded to stopping your code using the abort button (or some code equivalent)?
But if you think you have an exception, please feel free to answer @billko's question - from everything I've seen, he's quite good at what he does and wants to help you succeed.
-joeorbob