Jump to content

Recommended Posts

Hi 
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.

Share this post


Link to post
Share on other sites

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:

image.png.cd878a7c6c2ea7148591a7c6e81e0703.png

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Actually , there is no specific time when the PLC is going to be powered ON , it may be ON in anytime throughout the day . That's why it seems a bit more complicated to manage that.

Share this post


Link to post
Share on other sites

This will fail if the PLC is powered off for exactly one month, but otherwise should work.

image.png.5540a2ca83bffe7fdac3dc67112278d3.png

 

Ignore the image below - it cannot be deleted:

image.png.c0edaa66e9a197ae3812b77d84686b9a.png

Share this post


Link to post
Share on other sites
On 6/21/2020 at 11:13 AM, Flex727 said:

This will fail if the PLC is powered off for exactly one month, but otherwise should work.

image.png.5540a2ca83bffe7fdac3dc67112278d3.png

image.png

It doesn't seems a big problem to me if it fails in that case, So I can use it for my purpose.

Thank you very much .

Share this post


Link to post
Share on other sites

Untitled.png.ae9ada2f943c851ac160eef2fcee586b.png

I tried to increment a value when it is ON first, just for testing , but it doesn't seem to work.
MI4095 has the inital value 20 to simulate the 20th day of the month .

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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 .
Untitled.png.a34fda2754d4a11e8c1018934774caef.png

Untitled1.png.e3a4281c9dccb052ea5ebe3c5d3f8c0c.png

 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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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.

Guest
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...