# Codesys 3.5 'First Scan' variable? WAGO PLC 'Run & Stop Switch' variable?

**URL:** <https://www.wago.community/t/codesys-3-5-first-scan-variable-wago-plc-run-stop-switch-variable/1190>\
**Category:** CODESYS\
**Created:** [September 4, 2024, 3:28pm UTC](https://www.wago.community/t/codesys-3-5-first-scan-variable-wago-plc-run-stop-switch-variable/1190 "2024-09-04T15:28:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacob](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/jacob/32/642_2.png) [@Jacob](https://www.wago.community/u/Jacob)\
**Post date:** [September 4, 2024, 3:28pm UTC](https://www.wago.community/t/codesys-3-5-first-scan-variable-wago-plc-run-stop-switch-variable/1190/1 "2024-09-04T15:28:54Z")

</div>

Hello,

Is there a “first scan” system variable available in Codesys 3.5?

Also, looking for a WAGO system variable for monitoring the run and stop switch on the PLC.

Thanks,

---

<div class="post-metadata">

**Author:** ![Michael](https://sea2.discourse-cdn.com/flex016/user_avatar/www.wago.community/michael/32/271_2.png) [@Michael](https://www.wago.community/u/Michael)\
**Post date:** [September 5, 2024, 6:22am UTC](https://www.wago.community/t/codesys-3-5-first-scan-variable-wago-plc-run-stop-switch-variable/1190/2 "2024-09-05T06:22:51Z")

</div>

Hi Jacob,

1. Yes, you can setup systemevents in the taskconfiguration:  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/wago/original/1X/f3fcfd62ddf998e03769d1432afdcf67a2919394.png)

2. You cannot read the plc-switch directly in the codesys programm. Because it will be stopped.  
But you choose a systemevent, for example PrepareStop or StopDone, where you can set you plc-variable.  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/wago/original/1X/fc0897dd37db68b3295553b0522710279c4cd41e.png)

Best Regards  
Michael
