LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error code 2 when trying to Abort VI

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. 

0 Kudos
Message 1 of 6
(2,743 Views)

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

0 Kudos
Message 2 of 6
(2,718 Views)

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?

0 Kudos
Message 3 of 6
(2,702 Views)

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.

0 Kudos
Message 4 of 6
(2,318 Views)

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.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 5 of 6
(2,315 Views)

@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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 6
(2,306 Views)