Jump to content

Schedule a task to happen everyday

Recommended Posts

I need to fill a data table with information throughout the day and the information should be cleared once when the next day starts .
So basically , I need a bit to be ON once a day when PLC is on (not every time that PLC is one in that day) , so I can send the information of that data table via email, and the information  has to be cleared once, so it can be filled again with information.
Is there anyone who can help me with this task , please.

Link to comment
Share on other sites

  • MVP 2023

There are a number of ways to do this. One easy way is to compare SI 35 to a number from 0-23 and activate a bit when the compare is true. If you want something to happen every day at midnight, it might look something like this:


I didn't complete ladder rung 2 - you would place the task(s) you want to accomplish there.

Link to comment
Share on other sites

  • MVP 2023
20 minutes ago, Arberhaziri said:

(not every time that PLC is one in that day)

This leads me to believe that the PLC might not be on at midnight on occasion. In that case it gets a bit more complicated. If that's the case, I'll leave it to you to attempt that and you can let us know if you need help.

Link to comment
Share on other sites

6 minutes ago, Joe Tauser said:

Based on the values on your screenshot, MB 34 didn't come on so the INC block was not called. 

SI 37 is equal to MI 4095 so the Not Equal block is false.

Joe T.

I want to address another problem related with this one that am presenting with photos . I think this is an issue that others can also find difficult to understand and solve . I do not know really why this problem is taking place but I want to know both of your opinions  on that .


 The  difference between the first and the second photo is just a 3 sec delay timer . The timer is activated when the PLC is on and the bit TB 383 is on after 3 sec. 
The second photo is the same as the first one but the signal is ON from the beginning and not just after 3 seconds from beginning.
MI4095 has an initial value of 20 and as for the time we are speaking  (21/06/2020)  , every time that I will turn the PLC on it is going to increment MI4094 and after that MI4095 will take the value 21(I am simulating as the date has changed from 20th to 21th).
The same thing happens at both photos but at the first one (with delay) incrementation takes place as the signal is ON all the time but after 3 seconds from when PLC is ON
and  at the second photo(without delay) incrementation doesn't take place as the signal is ON all the time from beginning.

Link to comment
Share on other sites

  • MVP 2023

I'd be changing your strategy. 

Use 2 (or more) tables that work under FIFO.  Power up bit compares the time to a certain 24 hour period, and if appropriate makes the other table become primary, sends out the just changed over from one, and once the send completes clears the table ready for next time.  Before clearing, it could also store it into the SD for safe keeping as a backup.

The power up bit could act via some sets/resets that don't have any power up values, that then dictate appropriate other actions.  Or they alternate using (some?) Toggle Coils.

cheers, Aus

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...