LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

generated .exe file has a bug, which doesnot work after stop and runt the program but not close the window

I generate a exe file which is used to exchange information with compactRIO through shared variables. I have deployed them in CRIO. Then I run into a problem, after generating exe file, when I open and run it firstly, the program can work successfully, and then stop it (click the red stop button in the top left corner, note that I didnot close the window), And run it again, the value didnot change but sustained the previous value  in the program. And I found it looks like after the time series reached the last time value, the program began update and use the new value. But if I closed this exe file and opened it to run again, the program worked. But the same problem appeared, when I stop it and run again, the program still had the problem above. It is realy a bug. Does anyone have solution?

0 Kudos
Message 1 of 4
(1,673 Views)

Is it an exe on your PC or on your cRIO?

 

First error:

The stop button should NOT be visible in an executable. That is a debug tool from the IDE. You should NOT stop an exe with this button. Never Ever! Pressing this button is like stopping your car by driving it against a wall instead of slowly braking till standstill, turning off the motor and leaving your car.

 

Further errors: I have no idea, because I cannot follow your explanation.

 

Regards, Jens

Kudos are welcome...
0 Kudos
Message 2 of 4
(1,662 Views)

As JensG69 said you should not be using the Stop button in the top left corner to stop your program. That should only be used during development/debugging, and NEVER in an executable. You need to build code to properly shut down your program. If you need to program to stop and start back then you need to also build code to do this (don't exit, just stop the processing). It sounds like a simple state machine architecture would work.

If you post your code you might get better help.

0 Kudos
Message 3 of 4
(1,654 Views)

Just to be clear:

The "stop" button is more properly referred to as the "abort" button.  Just like that big, red, physical button you see on (properly outfitted) test stations, it should be treated with the same respect.  You wouldn't stop a test in progress by hitting that big red button; you should stop your test using the "abort" button on your executable, either - and for similar reasons.  Both buttons stop things in their tracks (although one is obviously more drastic than the other).

 

Do yourself a favor.  Create a stop button.  When it is pressed, shut things down properly - that is, close all open references, return any instruments to an idle state with any outputs turned off, etc.  That is the root cause of your problem.

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 4 of 4
(1,644 Views)