# Set DO default value based on variable value

**URL:** <https://tech-community.robotics.abb.com/t/set-do-default-value-based-on-variable-value/11507>\
**Category:** RAPID Programming\
**Tags:** defaultvalue, pers, digital-output, program-restart\
**Created:** [July 9, 2024, 8:09am UTC](https://tech-community.robotics.abb.com/t/set-do-default-value-based-on-variable-value/11507 "2024-07-09T08:09:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daper](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@Daper](https://tech-community.robotics.abb.com/u/Daper)\
**Post date:** [July 9, 2024, 8:09am UTC](https://tech-community.robotics.abb.com/t/set-do-default-value-based-on-variable-value/11507/1 "2024-07-09T08:09:51Z")

</div>

Hi everyone,

I have a DO that is sometimes switched during the program execution. It is used for communication with an external PLC.  
At controller restart, the value of the DO is reset to its default value, specified In the system parameters topic I/O system - Signal.  
I want my DO to be set to the value it was before controller shutdown, and not its default value

I was thinking about setting the DO before program restart based on a PERS variable contained in one of the program module.

Can I do something alike ? Is there any alternative ?

---

<div class="post-metadata">

**Author:** ![lemster68](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/lemster68/32/1945_2.png) [@lemster68](https://tech-community.robotics.abb.com/u/lemster68)\
**Post date:** [July 9, 2024, 12:04pm UTC](https://tech-community.robotics.abb.com/t/set-do-default-value-based-on-variable-value/11507/2 "2024-07-09T12:04:15Z")

</div>

See section4.10 of the RW6 system parameter manual for the Type Signal Safe level, particularly:

4.10.6 Action when System Shutdown  
Parent  
Action when System Shutdown belongs to the type Signal SafeLevel, in the topic  
I/O System.  
Cfg name  
ActionWhenShutdown  
Description  
Specifies the value for a logical output signal when the robot system is shutdown.  
Default value  
Set last value  
Allowed values  
Set default value  
Set last value  
Set zero value

---

<div class="post-metadata">

**Author:** ![Daper](https://avatars.discourse-cdn.com/v4/letter/d/8491ac/32.png) [@Daper](https://tech-community.robotics.abb.com/u/Daper)\
**Post date:** [July 9, 2024, 2:37pm UTC](https://tech-community.robotics.abb.com/t/set-do-default-value-based-on-variable-value/11507/3 "2024-07-09T14:37:01Z")

</div>

Many Thanks @lemster68 !! It matches my expectation perfectly
