
adccommunitymod (AutomationDirect) asked a question.
Created Date: April 09,2015
Created By: Ron S
**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****
We recently purchased a DL205 controller with Do More software. I watched the training videos and successfully completed a program to cycle a cylinder back and forth for 1000 cycles. Now I am trying to create a Do More PLC program to cycle a cylinder back and forth, using limit switches to stop extension/retraction. I am trying to use the Repeat/Until feature to do this, but it seems like the program ignores the Until and just continues the rest of the program and either direction can be activated by either of the switches. Does someone have something similar I can work from?
Created Date: April 09,2015
Created by: BobO
I find the best way to test logic like this is to stick INC instructions at each level.
The loops appear to be working as expected...at least once I changed the default timeslice for $Main to something other than 65535.
Created Date: April 09,2015
Created by: BobO
...and in testing this, I just discovered a very curious bug in the ladder editor. We'll definitely be fixing that.
Created Date: April 09,2015
Created by: Ron S
Cycle Hyd cyl with limit switches
Then why am I able to enable Y13 output before enabling Y12 output? I nested a second repeat inside of the first to force the completion of the Y12 enabling before going on to the Y13 enabling. This would allow the cylinder to extend until it hits the extension limit switch, then retract until it hits the retract limit switch, then repeat until the requested number of cycles has occurred (not added to the program yet). Thanks for your time.
Created Date: April 09,2015
Created by: BobO
If X1 is on while executing the outer loop, Y12 gets turned on and off immediately, so it could have easily been on before Y13.
Try the attached one.
X0 clear the counters.
X1 is the inner loop condition.
X2 is the outer loop condition.
Created Date: April 09,2015
Created by: Ron S
Cycle Hyd cyl with limit switches
Bob O,
Thanks for the sample program. It is a little closer to what I am looking for. However, this program increases D2 regardless of whether X1 and X2 are enabled and D1 and D3 increase only when X1 is enabled. I am looking for a function that would increase D2 (cylinder extend) until X1 is enabled (hitting the extend limit switch), then increase D3 (cylinder retract) until X2 is enabled (hitting the retract limit switch), then increase D2 and continue looping until XX cycles have been completed. Thanks again for your time with a noob.
Created Date: April 09,2015
Created by: BobO
Bob O,
Thanks for the sample program. It is a little closer to what I am looking for. However, this program increases D2 regardless of whether X1 and X2 are enabled and D1 and D3 increase only when X1 is enabled. I am looking for a function that would increase D2 (cylinder extend) until X1 is enabled (hitting the extend limit switch), then increase D3 (cylinder retract) until X2 is enabled (hitting the retract limit switch), then increase D2 and continue looping until XX cycles have been completed. Thanks again for your time with a noob.
You need to write this in stage. That is exactly what it was written for. Write down the flowchart...then render the flowchart in stage. I'm happy to help.
Created Date: April 09,2015
Created by: plcnut
Here is a little sample that should get you going in the right direction.
EDIT: The counter in this sample did not work because when a counter is located in a stage, then the stage termination logic runs, the counter is reset. See the CNT Help topic.
Created Date: April 09,2015
Created by: Ron S
Cycle Hyd cyl with limit switches
Bob O,
Thanks again for your help. I will set the program up in stage format and give that a try. I'm learning that ladder logic is mostly just becoming familiar with the code and knowing when/how to use it. I appreciate having a source of knowledge to tap into. I'll be back if I run into any snags. Thanks.
Created Date: April 09,2015
Created by: BobO
Bob O,
Thanks again for your help. I will set the program up in stage format and give that a try. I'm learning that ladder logic is mostly just becoming familiar with the code and knowing when/how to use it. I appreciate having a source of knowledge to tap into. I'll be back if I run into any snags. Thanks.
Definitely check out plcnut's sample...
Created Date: April 09,2015
Created by: Ron S
Hyd cyl with limit switches
I did! This is exactly what I am looking for. Thanks Bob O and plcnut!