![]() ![]() ![]() ![]() ![]() ![]() |
||
![]() |
||
![]() ![]() ![]() ![]() This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
![]() |
![]() |
#1 |
Member
![]() ![]() Join Date: Jan 2022
Location: tamworth
Posts: 7
|
Logo! help on task
Hi i have recently been studying PLC for work and i have had a task now which i believe i am close to finishing but i cannot think how to correct my problem. Any help would be much appreciated.
I need to run the mixing tank for 10 seconds and then empty the tank after but i can only manage to get them both to come on at the same time but i need the empty tank to come on after the 10 seconds. I cant see where i am going wrong as i have tried several ways and i just end up braking the rest of the circuit. this is what i have been given if anyone could see a solution to my problem or let me know if i am way off. • When the Start ‘push to make’ (not toggle) switch (I1) is pressed/released and gets latched on (B1: RS latch), the start ‘fill’ pump (Q1) will be energized and the tank will start to fill. • The pulses generated by flow meter 1 (B5: pulse generator) should be used to increment the counter (B6: Up/down). Tank level full is when the counter function on = 10 and tank low level is when counter off = 1. These values can be used as feedback to control the pumps (instead of the high/low level sensors shown above) and can be called the ‘tank high/low level count indicator’ (Q5 or use a flag M1) • When the full liquid level in the tank is sensed by the tank high/low level count indicator (Q5), the fill pump will be shut-off and the FULL light (Q2) on the control panel is to be energized. • When the tank is full, start the mixer (Q3) and run for 10 seconds (B8: off-delay timer). • When the 10 seconds has expired, stop the mixer (Q3) and start ‘empty’ pump P3 (Q4). • Pump 3 (Q4) will be required to run until the tank is empty. Tank empty can be detected using the low-level sensor (I3). • The pulses generated by flow meter 3 (B15) should be used to decrement the counter (B6: Up/down). Tank empty can be detected by the high/low level count indicator (Q5 or use a flag M1) to switch off the pump • When the stop button (I2) is operated, the process must stop immediately (Q1, Q3, Q4). Thanks Last edited by aidan5192; January 10th, 2022 at 06:34 PM. |
![]() |
![]() |
#2 |
Lifetime Supporting Member
|
This could be done with ladder easily enough, but the principles should be the same.
Inputs
There are four states
Also, when Stop=1, always transition to Idle. We could maintain states either
So the state map looks like this:
I haven't seen this exact style of logic before, but it seems pretty straightforward. Suggestion You have probably figured it out by now, but I think the Off Parameter on the Up/Down Counter should be 2, not 1, so the Q bit will change to 0 when the count reaches 1, otherwise the Q bit will continue to be 1. yyy.png Although from what you wrote, your problem seems to be before that i.e. the mixer.
__________________
_ Brian T. Carcich i) Take care of the bits, and the bytes will take care of themselves. ii) There is no software problem that cannot be solved with another layer of indirection. iii) Measurement is hard. iv) I solemnly swear that I am up to no good ![]() |
![]() |
![]() |
#3 |
Lifetime Supporting Member
|
Possible solution, but there is a problem if the system is reset (e.g. I2 Stop pressed) while the counter output (Q) is 1, because the next time I1 Start is pressed, there can be no rising edge to Reset the Filling State. That can probably be fixed by removing the AND-edge of the counter output Q, but then the mixer will run when Start is pressed if that counter Q is 1.
xxx.png
__________________
_ Brian T. Carcich i) Take care of the bits, and the bytes will take care of themselves. ii) There is no software problem that cannot be solved with another layer of indirection. iii) Measurement is hard. iv) I solemnly swear that I am up to no good ![]() Last edited by drbitboy; January 11th, 2022 at 02:29 AM. |
![]() |
![]() |
#4 |
Member
![]() ![]() Join Date: Jan 2022
Location: tamworth
Posts: 7
|
Thanks for commenting , i will have another look at it now. Also everything that is on there
like the " (Q5) high/low tank indicator" and flow meters all been set up for the task ive had to fill in the rest haha, also never tried ladder actually thought that would of been harder (only been shown FBD). All that said thank you for taking some time to answer me. much appreciated |
![]() |
![]() |
#5 |
Lifetime Supporting Member
|
I just re-read the OP, I did not notice there an input, I3, that indicates a low level, presumably that is a level switch. I was wondering about that, because counting filling flowmeter pulses up and emptying flowmeter pulses down will eventually not represent the actual level. So my logic will not work.
Also, I realized the diagram in the OP uses Asynchronous Pulse Generators (see this link)as proxies, in B002 and B01, for the filling and emptying flowmeters' pulses. There is also the question of what to do next after the [I2] Stop momentary is pressed somewhere in the middle of the sequence:
__________________
_ Brian T. Carcich i) Take care of the bits, and the bytes will take care of themselves. ii) There is no software problem that cannot be solved with another layer of indirection. iii) Measurement is hard. iv) I solemnly swear that I am up to no good ![]() Last edited by drbitboy; January 11th, 2022 at 10:10 AM. |
![]() |
![]() |
#6 |
Member
![]() ![]() Join Date: Jan 2022
Location: tamworth
Posts: 7
|
yeah its an assignment for work but they gave me this to work out. been told i have to get all 3 stages to work , print screen etc all individual outputs working/ not working and copy of the program .
1 - tank has to fill and energise Q1 2 - When tank full Q5 & Q2 energize and DE-energize & start mixer Q3 for 10 seconds 3 - when 10 seconds expire, shut off Mixer (Q3) & energize Empty pump Q2 4 - assuming empty pump for 10 seconds (Not quite sure with advice i got given) as 5 - need to energize Q5 again When tank empty so need to decrement counter 6 - I2 ( stop button) needs to shut off ( Q1 , Q2 & Q3 immediately) That is the advice i got when i asked trainer at work so wasn't really helpful in the slightest. 4 - |
![]() |
![]() |
#7 |
Lifetime Supporting Member
|
I am starting to read the LOGO! syntax better, so I looked at the OP code again. It was very close, only two things needed fixing:
Sidebar/minor issue: Is B006 needed? Can Q5 instead be connected directly to both B009/1 and B007/2? xxx.png
__________________
_ Brian T. Carcich i) Take care of the bits, and the bytes will take care of themselves. ii) There is no software problem that cannot be solved with another layer of indirection. iii) Measurement is hard. iv) I solemnly swear that I am up to no good ![]() |
![]() |
![]() |
#8 |
Lifetime Supporting Member
|
Also, here is a similar approach, it's basically the same thing, but saves one block by using only a single pulse generator for both filling and emptying.
xxx.png
__________________
_ Brian T. Carcich i) Take care of the bits, and the bytes will take care of themselves. ii) There is no software problem that cannot be solved with another layer of indirection. iii) Measurement is hard. iv) I solemnly swear that I am up to no good ![]() |
![]() |
![]() |
#9 |
Lifetime Supporting Member
|
Reduce it by one more block, assuming the Fill/Mix/Empty sequence should repeat automatically once the process has been started with [I1 Start switch].
Also, B008 may not be necessary, if the [I2 Stop switch] to [B006 Reset] leaves B006 output in a 0 state after [I2] is released when the Tank Mixer is running, which would get us down to 7 blocks total. Untested, of course.
__________________
_ Brian T. Carcich i) Take care of the bits, and the bytes will take care of themselves. ii) There is no software problem that cannot be solved with another layer of indirection. iii) Measurement is hard. iv) I solemnly swear that I am up to no good ![]() |
![]() |
![]() |
#10 |
Member
![]() ![]() Join Date: Jan 2022
Location: tamworth
Posts: 7
|
Yeah i realized about the inverter. had a read through the manual etc and couple of youtube videos, made me realized thats what i was missing. also the latching relay did the job instead of the pulse relay thanks.
But i see what your on about ill give it a try see what happens, i know ive tried the "and-edge" b006 instead of the "or" but it did not work out with the circuit for some reason so had to go back tho the "or" I can see you put some thought into this now which is amazing since im new to all of this and i found it very confusing to be honest but i do value your input and have found it informative ![]() also i cannot try the last diagram you have presented as the 4 outputs and the 3 inputs (Q5 included) is what i have been told i must present and cant remove any of them, but thanks anyways, you have definitely showed me how i could make it much simpler if i had the choice. This is what i have come up with, and it works, except the stop does not stop Q2 & Q5 now |
![]() |
![]() |
#11 |
Lifetime Supporting Member
|
Whoops, B006 is the wrong kind of timer; it should be the edge-tirggered wiping relay
__________________
_ Brian T. Carcich i) Take care of the bits, and the bytes will take care of themselves. ii) There is no software problem that cannot be solved with another layer of indirection. iii) Measurement is hard. iv) I solemnly swear that I am up to no good ![]() |
![]() |
![]() |
#12 |
Lifetime Supporting Member
|
Yes, my code blows off the Q2/Q5 outputs; those are only indicators
![]()
__________________
_ Brian T. Carcich i) Take care of the bits, and the bytes will take care of themselves. ii) There is no software problem that cannot be solved with another layer of indirection. iii) Measurement is hard. iv) I solemnly swear that I am up to no good ![]() |
![]() |
![]() |
#13 | |
Lifetime Supporting Member
|
Quote:
I think that is as it should be; in the OP it said that the Stop Switch should stop the process and specifically called out Q1, Q3, and Q4, but did not call out Q2 or Q5. Q2 and Q5 indicate that the tank either is full, or was full and has not since been emptied; why should stopping the process (pumps and mixer) somehow "declare" the tank not full?
__________________
_ Brian T. Carcich i) Take care of the bits, and the bytes will take care of themselves. ii) There is no software problem that cannot be solved with another layer of indirection. iii) Measurement is hard. iv) I solemnly swear that I am up to no good ![]() Last edited by drbitboy; January 11th, 2022 at 06:48 PM. |
|
![]() |
![]() |
#14 |
Member
![]() ![]() Join Date: Jan 2022
Location: tamworth
Posts: 7
|
You are absolutely correct , i have been so tunneled visioned trying to finish this task i forgot what was actually stating in the task. Thank you very much for support you have given me , i do appreciate you taking the time to help.
|
![]() |
![]() |
#15 | |
Lifetime Supporting Member
|
Quote:
Here it is in ladder, with a few extra twists. P.S. well done, you fixed your code yourself, which code was almost working. It is very difficult to learn a new language like that; after a while you will know to look for things like edge detection, but for now just keep reading the manuals and asking questions. I am a "code golfer," and that rarely makes for maintainable production code. The next step I would suggest is commenting the code; if LOGO! doesn't allow for it in the app, copy screenshots into a document and write the comments. Comments are crucial three months down the road when summat changes in the process and you have to troubleshoot a problem. Also, often when I write comments I find subtle bugs. Comments should be process-focused, not code-focused e.g. "Start mixer and mixer timer when tank reaches full," not "Start B009 timer when B006 output has a rising edge."
__________________
_ Brian T. Carcich i) Take care of the bits, and the bytes will take care of themselves. ii) There is no software problem that cannot be solved with another layer of indirection. iii) Measurement is hard. iv) I solemnly swear that I am up to no good ![]() Last edited by drbitboy; January 11th, 2022 at 08:17 PM. |
|
![]() |
![]() |
Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Flying windows button for RSView32 security | Deer | LIVE PLC Questions And Answers | 9 | September 23rd, 2018 03:01 PM |
just wondering about event tasks | escoplcguy | LIVE PLC Questions And Answers | 19 | July 9th, 2011 05:10 AM |
Siemens Logo AM2 PT100 powered by main logo unit? | hop | LIVE PLC Questions And Answers | 3 | December 25th, 2009 10:37 AM |
ControlLogix L-55 Scan Problem | MorphuisOGrady | LIVE PLC Questions And Answers | 19 | July 15th, 2009 09:34 AM |
Logo 230rc | finskhan | LIVE PLC Questions And Answers | 7 | April 27th, 2008 12:10 AM |