# Actions after stop press?

**URL:** <https://mworks.discourse.group/t/actions-after-stop-press/609>\
**Category:** Support\
**Created:** [October 28, 2013, 1:46pm UTC](https://mworks.discourse.group/t/actions-after-stop-press/609 "2013-10-28T13:46:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 28, 2013, 1:46pm UTC](https://mworks.discourse.group/t/actions-after-stop-press/609/1 "2013-10-28T13:46:18Z")

</div>

Hi Chris,

Is it possible to run actions after the state system is stopped/interrupted?

I tried this at the end of my experiment XML file and none of the messages get displayed after I press the Stop button.  
I’m looking for some kind of try/finally construct that can run actions after state system stop, whether it was correct or the result of an error/interrupt.

Thanks,  
Mark

```
     </task_system_state>	
     <action type="report" message="end 1"/>
   </task_system>
   <action type="report" message="end 2"/>
 </trial>
 <action type="report" message="end 3"/>

```

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 30, 2013, 2:09pm UTC](https://mworks.discourse.group/t/actions-after-stop-press/609/2 "2013-10-30T14:09:05Z")

</div>

Hi Mark,

No, I don’t think there’s a way to do this at present. Setting `interruptible="NO"` on a block/trial/state will ensure that all enclosed actions complete even after you press the stop button, but that doesn’t really help you here.

I can think of a couple ways we could provide this functionality. Should I add it to the to-do list?

Chris

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [October 30, 2013, 2:35pm UTC](https://mworks.discourse.group/t/actions-after-stop-press/609/3 "2013-10-30T14:35:52Z")

</div>

Yes, please add it.  
As with try/finally, this would be used often to clean up hardware device state at the end of every trial.  
M

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [July 19, 2022, 11:21pm UTC](https://mworks.discourse.group/t/actions-after-stop-press/609/4 "2022-07-19T23:21:33Z")

</div>


