Browse FAQs

How to use the RTC of an M221 controller to turn ON and OFF an output

Published date: 30 September 2019

Issue
Use the %RTC function block to turn ON and then OFF an output every day at the same time.

Product Line
TM221 controllers


Environment
EcoStruxure Machine Expert-Basic

Cause
Customers want to control a process based on the built-in RTC of an M221 controller by turning ON or OFF an output.

Resolution
The step by step procedure below shows an example on how to use the RTC of an M221 controller to turn ON or OFF an output.
1. Add a rung. From the toolbar select and add the RTC function block to your rung.
2. Connect the Enable and RD input pins to the left rail to update the RTC every scan or use your own logic that will enable those two input pins and update the RTC registers.
2. Add another rung. From the toolbar select and add comparison blocks for the hour, minute and second you want to use to turn ON an output.
3. Add another rung. From the toolbar select and add comparison blocks for the hour, minute and second you want to use to turn OFF an output.

As an example. if we want to turn ON output Q0.0 at exactly 10:00am and then turn it OFF five seconds later we will need to have the following components and syntax:

Rung 1:
RTC block (with Enable and RD input pins enabled)

Rung 2:
comparison block: %RTC0.HOURS = 10, then comparison block: %RTC0.MINUTES = 0, then comparison block: %RTC0.SECONDS = 0,  then SET COIL Q.0.0

Rung 3:
comparison block: %RTC0.HOURS = 10, then comparison block: %RTC0.MINUTES = 0, then comparison block: %RTC0.SECONDS = 5,  then RESET COIL Q.0.0

 

Was this helpful?

What can we do to improve the information ?

Can't find what you are looking for?

Reach out to our customer care team to receive information on technical support, assistance for complaints and more.