Arberhaziri Posted June 21, 2020 Report Share Posted June 21, 2020 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. Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted June 21, 2020 MVP 2023 Report Share Posted June 21, 2020 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 More sharing options...
MVP 2023 Flex727 Posted June 21, 2020 MVP 2023 Report Share Posted June 21, 2020 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 More sharing options...
Arberhaziri Posted June 21, 2020 Author Report Share Posted June 21, 2020 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. Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted June 21, 2020 MVP 2023 Report Share Posted June 21, 2020 So you want the event to occur every day the first time the PLC is powered on? Link to comment Share on other sites More sharing options...
Arberhaziri Posted June 21, 2020 Author Report Share Posted June 21, 2020 1 minute ago, Flex727 said: So you want the event to occur every day the first time the PLC is powered on? Yes , that's right Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted June 21, 2020 MVP 2023 Report Share Posted June 21, 2020 This will fail if the PLC is powered off for exactly one month, but otherwise should work. Ignore the image below - it cannot be deleted: Link to comment Share on other sites More sharing options...
Arberhaziri Posted June 21, 2020 Author Report Share Posted June 21, 2020 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. 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 . Link to comment Share on other sites More sharing options...
Arberhaziri Posted June 21, 2020 Author Report Share Posted June 21, 2020 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 . Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted June 21, 2020 MVP 2023 Report Share Posted June 21, 2020 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. Link to comment Share on other sites More sharing options...
Arberhaziri Posted June 21, 2020 Author Report Share Posted June 21, 2020 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 More sharing options...
MVP 2023 Ausman Posted June 22, 2020 MVP 2023 Report Share Posted June 22, 2020 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 More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now