You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old January 25th, 2023, 01:58 AM   #1
Technology
Member
United States

Technology is offline
 
Join Date: Jan 2023
Location: USA
Posts: 5
Program Management, Timers, and Counters in Ladder Logic

https://www.youtube.com/watch?v=zTOOYWMJg9M . Specifically see 1:46 to 2:11.

3. The Cell PLC is in constant communication with two other field devices; the Cell Robot and Conveyor PLC. The Cell PLC communicates with the Cell Robot through the RobotInputs and RobotOutputs registers. The Cell PLC communicates with the Conveyor PLC through the ConveyorInputs and ConveyorOutputs registers.
4. System I/O:
a. Inputs
i. X0 – Cycle Start Button
ii. X1 – Cycle Stop Button
iii. X2 – Emergency Stop Button
iv. X3 – Perimeter Fence Gate Closed
v. X4 – Package ready for pickup at conveyor #1
vi. X5 – Package ready for pickup at conveyor #2
vii. X6 – Package ready for pickup at conveyor #3
viii. X7 – Package ready for pickup at conveyor #4
ix. X8 – Exit conveyor #5 full
x. X9 – Exit conveyor #6 full
xi. X10 – Exit conveyor #7 full
xii. X11 – Exit conveyor #8 full
b. Outputs
i. Y0 – System Running Lamp (Green)
ii. Y1 – System Error Lamp (Yellow)
iii. Y2 – System E-stop Lamp (Red)
iv. Y3 – Robot Running Automatic Operation (Blue)
c. Robot Inputs (Cell PLC -> Robot)
i. RobotInputs0-2 - Pickup Conveyor Selection (3-bit signal)
ii. RobotInputs3-5 - Place Conveyor Selection (3-bit signal)
iii. RobotInputs6 – Cycle Start
iv. RobotInputs7 – Cycle Stop
v. RobotInputs8 – Pick and Place Complete Handshake
d. Robot Outputs (Robot -> Cell PLC)
i. RobotOutputs0 – Robot Ready
ii. RobotOutputs1 – Robot Busy
iii. RobotOutputs2 – Robot E-stop
iv. RobotOutputs3 – Robot Cycle Start Handshake
v. RobotOutputs4 – Robot Pick and Place Complete
e. Conveyor Outputs (Conveyor PLC -> Cell PLC)
i. ConveyorOutputs0 – Place location for Infeed conveyor 1
ii. ConveyorOutputs1 – Place location for Infeed conveyor 2
iii. ConveyorOutputs2 – Place location for Infeed conveyor 3
iv. ConveyorOutputs3 – Place location for Infeed conveyor 4
f. Conveyor Inputs (Cell PLC -> Conveyor PLC)
i. ConveyorInputs0 – Conveyor 1 is full
ii. ConveyorInputs1 – Conveyor 2 is full
iii. ConveyorInputs2 – Conveyor 3 is full
iv. ConveyorInputs3 – Conveyor 4 is full

Program Requirements:
1. Count the number of packages picked from each of the four conveyors, and count the number of packages placed on each of the four conveyors. The result of each of the eight counters should be stored in registers D0 – D7.
2. Set the appropriate ConveyorInputs bit ON when sensor bits X4 - X7 are ON, to signal to the Conveyor PLC not to send additional packages until the robot has unloaded the conveyor.
3. The sequence of operations is as follows:
a. Packages arrive at random intervals on the four incoming conveyors, setting sensor inputs X4 – X7 ON.
b. The Cell PLC program will call the robot to pick up the package and place it on the exit conveyor. Once the robot has completed the pick and place operation, the PLC program will loop and call the robot to pick and place the next package.
i. Set the Pickup Conveyor Selection bits to a value of 1-4 according to which conveyor the package is to be picked up from. The Cell PLC may unload the conveyors in any order.
ii. Set the Place Conveyor Selection bits to a value of 1-4 specified by the appropriate ConveyorOutputs register.
iii. The PLC will then set the robot Cycle Start output ON until the Cycle Start Handshake is returned from the robot.
iv. The PLC will set the Cycle Start output OFF.
v. The robot will set Robot Busy ON, then proceed to perform the pick and place operation.
vi. When the robot is finished with the pick and place operation, the robot will set the Pick and Place Complete signal ON.
vii. The PLC will then set the Pick and Place Handshake signal ON. When the robot subsequently turns the Pick and Place Complete signal OFF, the Cell PLC will turn the Handshake signal OFF.
4. Create an additional subprogram called “System Status Outputs” and add ladder logic that performs the following functions. Call the new subprogram on the first rung of the Main ladder logic program.
a. While cell is actively running automatic cycles, turn on output Y0.
b. While any exit conveyor is not ready to accept a package, turn on output Y1.
c. While the emergency stop button input is OFF, turn on output Y2.
d. While the robot is busy, flash output Y3 on a 500ms pulse interval (500ms on, 500ms off).


Store a running count of the number of packages picked and placed on all four conveyors together in register D10.



Any help will be greatly appreciated! Thank you so much!
(Note: we normally use the 'Do-more Designer' program if that helps.
Attached Images
File Type: jpg Untitled.jpg (127.8 KB, 10 views)
Attached Files
File Type: pdf Program Management, Timers, and Counters in Ladder Logic.revised.pdf (233.0 KB, 17 views)
  Reply With Quote
Old January 25th, 2023, 03:04 AM   #2
Ken Roach
Lifetime Supporting Member + Moderator
United States

Ken Roach is offline
 
Ken Roach's Avatar
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 16,856
If you want help on a specific bit of logic, show your work in detail.

Posting your class assignment verbatim is more likely to result in a round of criticism about your personality and ethics than in someone doing your homework for you.
  Reply With Quote
Old January 25th, 2023, 03:49 AM   #3
cardosocea
Member
United Kingdom

cardosocea is offline
 
Join Date: Nov 2016
Location: Fields of corn
Posts: 2,259
Quote:
Originally Posted by Ken Roach View Post
Posting your class assignment verbatim is more likely to result in a round of criticism about your personality and ethics than in someone doing your homework for you.
Some call it **** taking... LOL

I'll pitch in with some help though. You're going to have to use edge detection to count the number of packages.
  Reply With Quote
Old January 25th, 2023, 04:58 AM   #4
Technology
Member
United States

Technology is offline
 
Join Date: Jan 2023
Location: USA
Posts: 5
Here is as far as I could get on my own. Any help would be greatly appreciated.
Attached Images
File Type: jpg lab4.jpg (58.4 KB, 100 views)
  Reply With Quote
Old January 25th, 2023, 05:07 AM   #5
Ken Roach
Lifetime Supporting Member + Moderator
United States

Ken Roach is offline
 
Ken Roach's Avatar
 
Join Date: Apr 2002
Location: Seattle, WA
Posts: 16,856
Oh, bull. That's not "showing your work".

Quote:
>not many resources around including people to teach and help.
If your class doesn't include enough lectures, textbooks, or instruction to get you further than "call a subroutine", then you need to drop that class and take it again when you have sufficient time to read the materials and analyze the project, or consider getting out of the program entirely because the institution can't teach the subject.
  Reply With Quote
Old January 25th, 2023, 05:20 AM   #6
chud
Member
South Africa

chud is offline
 
chud's Avatar
 
Join Date: Oct 2007
Location: KALAHARI
Posts: 1,077
Quote:
Originally Posted by Ken Roach View Post
Oh, bull. That's not "showing your work".



If your class doesn't include enough lectures, textbooks, or instruction to get you further than "call a subroutine", then you need to drop that class and take it again when you have sufficient time to read the materials and analyze the project, or consider getting out of the program entirely because the institution can't teach the subject.
  Reply With Quote
Old January 25th, 2023, 10:50 AM   #7
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 6,147
Quote:
Originally Posted by cardosocea View Post
... You're going to have to use edge detection to count the number of packages.
Excellent; what a fantastic segue!

@Technology:

6) Do you understand all of the individual words in that sentence?

6.1) Do you understand all of the phrases and concepts in that sentence e.g. "edge detection?"

6.2) @carosocea is right of course, but can you, @Technology, tell me why your PLC program will need to use edge detection to count the number of packages?
__________________
_
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
v) I probably have the highest ratio of forum posts to actual applications in the field (∞).
vi) Hakuna matata.
  Reply With Quote
Old January 25th, 2023, 04:52 AM   #8
Technology
Member
United States

Technology is offline
 
Join Date: Jan 2023
Location: USA
Posts: 5
I understand. My career is not in PLC, but in CADD. This course for my Mechanical degree, and many students are struggling. I also consider this to be really hard, as I'm not a coder. I just want to learn, and there's not many resources around including people to teach and help. Which is why I posted here. Even a start and an explaination would help. I know I'm taking up peoples time, but do trust when I say I want to learn.

If we all had to learn the hard way, we won't need a forum. This is why this is here, or at least is my belief. I just need more help then a regular. I recognize that, and am taking action in every possible way I know how.
  Reply With Quote
Old January 25th, 2023, 06:16 AM   #9
cardosocea
Member
United Kingdom

cardosocea is offline
 
Join Date: Nov 2016
Location: Fields of corn
Posts: 2,259
Quote:
Originally Posted by Technology View Post
This course for my Mechanical degree, and many students are struggling. I just want to learn, and there's not many resources around including people to teach and help.
You don't need us then... you need a very good lawyer to bring your school to court over fraud.

Quote:
Originally Posted by Technology View Post
Which is why I posted here. Even a start and an explaination would help. I know I'm taking up peoples time, but do trust when I say I want to learn.
If we all had to learn the hard way, we won't need a forum. This is why this is here, or at least is my belief.
The forum is here to help. Doing your homework is not helping, it's the exact opposite. Sure, it's also morally wrong in an academic setting, but the main point is that by doing this for you, you're the one being screwed even if it doesn't look like that now.

Quote:
Originally Posted by Technology View Post
I just need more help then a regular. I recognize that, and am taking action in every possible way I know how.
You need a teacher. Without going into a lot of detail, you have to break down each of those individual requirements into separate problems and solve them one by one and then group them together into your solution. Sure, it sounds ridiculously easy, but it really is how you start.

Example, write the logic where you take the start/stop buttons and create a variable that remains high after start is pushed and goes low when stop is pushed. You can then use this variable as a condition for all other problems to work since it's the Machine Running indication.
  Reply With Quote
Old January 25th, 2023, 06:47 AM   #10
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 6,147
1) Do you any programming experience (it sounds like the answer is no)?

2) Has the class covered the PLC scan cycle?
3) Do you understand any of these?
__________________
_
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
v) I probably have the highest ratio of forum posts to actual applications in the field (∞).
vi) Hakuna matata.
  Reply With Quote
Old January 25th, 2023, 09:31 AM   #11
AustralIan
Member
Germany

AustralIan is offline
 
Join Date: Jan 2013
Location: Leipzig, Germany
Posts: 1,357
> picked and placed on all four conveyors


But there are eight conveyors...
  Reply With Quote
Old January 25th, 2023, 10:40 AM   #12
drbitboy
Lifetime Supporting Member
United States

drbitboy is offline
 
drbitboy's Avatar
 
Join Date: Dec 2019
Location: Rochester, NY
Posts: 6,147
4) Do you understand the difference between
  • a discrete variable that, at any given time, can have only two possible values, 0 or 1 (input or output or internal bit; also called a boolean), and
  • an "analog" variable that, at any given time, can have one of many (typically 655536) different numerical values (input or output or internal register; also called an integer)?
4.1) Do you understand how the registers (RobotInputs, RobotOutputs, ConveyorOutputs, ConveyorInputs) are integers that comprise (i.e. are made up of) bits?

5) Do you have a mental model of how this system is supposed to work?

5.1) Can you identify the inputs to the Cell PLC?

5.2) Can you identify the outputs from the Cell PLC?

5.3) If not the whole system, do you understand any of the individual subsystems?

5.3.1) For example, task "2. Set the appropriate ConveyorInputs bit ON when sensor bits X4 - X7 are ON," is a straightforward task:
  • X4-X7 are discrete inputs to the Cell PLC;
  • ConveyorInputs is a register output (that is not a typo) from the Cell PLC;
  • the task involves assigning a single (integer) value to register ConveyorInputs that is dependent on the current state of the four discrete inputs X4-X7.
  • Can you say what the value of the ConveyorInputs register would be
    • if all of the discrete inputs X4-X7 are 0s (zeros)?
    • if all of the discrete inputs X4-X7 are 1s (ones)?
__________________
_
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
v) I probably have the highest ratio of forum posts to actual applications in the field (∞).
vi) Hakuna matata.
  Reply With Quote
Old January 25th, 2023, 05:22 AM   #13
MarkNightingale
Lifetime Supporting Member + Moderator
United Kingdom

MarkNightingale is offline
 
Join Date: Sep 2010
Location: In The VAT Shed
Posts: 706
That has got to be the best PLC program I have ever seen.

I can't actually believe it's not working as intended.
  Reply With Quote
Old January 25th, 2023, 01:56 PM   #14
TheWaterboy
Lifetime Supporting Member + Moderator
United States

TheWaterboy is offline
 
TheWaterboy's Avatar
 
Join Date: May 2006
Location: State of Denial
Posts: 1,538
Its missing the DWIM command.
__________________
. . .Nostalgia used to be so much better . . .
  Reply With Quote
Old January 25th, 2023, 02:02 PM   #15
John Morris
Lifetime Supporting Member
United States

John Morris is offline
 
John Morris's Avatar
 
Join Date: Sep 2015
Location: San Antonio
Posts: 682
Followed by

"THAT's NOT WHAT I MEANT"
__________________
"When nothing is going right, go left."

"Even a fish wouldn't get into trouble if it kept its mouth shut."
(I should probably look into this)
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Timers and counters annicat1 LIVE PLC Questions And Answers 1 August 20th, 2013 05:58 AM
I need help with simple ladder logic. dennisc LIVE PLC Questions And Answers 44 December 14th, 2007 01:48 PM
I need help with simple ladder logic. dennisc LIVE PLC Questions And Answers 3 December 11th, 2007 03:44 PM
Questions abt Siemens S7 200 Preeya LIVE PLC Questions And Answers 3 April 9th, 2007 09:39 AM
counters and Timers of Allen Bradley Program ronpittc LIVE PLC Questions And Answers 15 July 4th, 2003 04:12 AM


All times are GMT -4. The time now is 02:28 AM.


.