07-20-2017 11:08 AM
Hello,
I have a VI, lets call it events.vi, which has an event structure inside of a while loop. I have another VI that calls events.vi as a screen to display and under certain conditions will abort it using Abort VI from an invoke node that is referencing events.vi. When none of the events are met in the event structure, I get Error code 2 from the invoke node and I'm not sure why. I'm not using System Exec in events.vi. Does anyone know why I would be getting this error? I am unable to attach the VIs since they are part of a larger project and I cannot isolate this.
07-20-2017 12:36 PM
Another important note that I should have included. I do not receive an error when I run the source code. The error only occurs when I build it into an EXE and then run that
07-20-2017 01:11 PM
I don't know why you're getting error 2 specifically but I do know that using "Abort VI" is generally a bad idea. I assume this VI is launched asynchronously at some point?
Is it possible for you to add a User Event called "Abort" or something like that and send that as a signal telling the VI to finish what it's doing and end itself?
12-12-2018 12:37 PM
I realize this thread is over a year old, but did you find a solution to this? I'm having the same problem where it works as intended until I build it into an EXE.
12-12-2018 12:45 PM
Use Kyle's solution. Don't call the Abort.vi invoke node. That is the equivalent of stopping your car by slamming into a brick wall at full speed. Yes it will stop the car, but it isn't a very good idea to do it that way.
12-12-2018 02:00 PM
@Mark_Yedinak wrote:
Use Kyle's solution. Don't call the Abort.vi invoke node. That is the equivalent of stopping your car by slamming into a brick wall at full speed. Yes it will stop the car, but it isn't a very good idea to do it that way.
Just to clarify Mark's post a bit, the Abort.vi is the exact equivalent of pressing the abort button on the tool bar. Although I've known this for years now, I still had to have someone point it out to me, so I'm kind of paying it forward.