05-08-2017 09:53 AM
A friend of mine wrote the CLD recently where one requirement was to handle an abort execution. I know the Abort Execution is purely for development purpose but the application states that a device is considered to be plugged into power socket if the run is pressed and disconnected if the Abort button is pressed. The disconnect event should write a condition to a configuration file that the device was not properly shutdown. I am aware of the Panel Close? where I could do this but how could I handle an Abort execution.
Goku
05-08-2017 10:17 AM
I may be wrong here because I rarely use Event structures but...
I would guess that is what "Application Instance Close" would to?
05-08-2017 10:20 AM - edited 05-08-2017 10:25 AM
@GoKu25 wrote:
A friend of mine wrote the CLD recently where one requirement was to handle an abort execution. I know the Abort Execution is purely for development purpose but the application states that a device is considered to be plugged into power socket if the run is pressed and disconnected if the Abort button is pressed. The disconnect event should write a condition to a configuration file that the device was not properly shutdown. I am aware of the Panel Close? where I could do this but how could I handle an Abort execution.
Goku
I think you misunderstood something. I imagine that CLD exam project refers to an "Abort" button on the Front Panel. Simply you handle the Abort in your state machine, when you capture the button was pushed.
The CLD exam for sure not referring to the red Abort button in the top of the VI window, since this is a NOT TO DO. A finished LabVIEW application should never show this button to the end user (hide it), plus you need to handle (discard then programmatically shut down) the Panel Close event as you mentioned!
edit: so this part should never be visible to the end user:
edit2: check with a VI how it looks like when you set its "Window appearance" to "Top-level application Window". Do you see the red abort button?
05-11-2017 01:54 PM
The run and abort button simulated the socket connect/disconnect. There was another boolean slide switch that simulated power on/off for the device. Both the power off and disconnect should shut down the device. But disconnect without power off is considered bad and a condition is written to configuration file saying that it's not a regular shut down. This is again read during initialization and handled next time.