PLC Programming Example: Automatic
- Home >
- articles >
- automation >
- plc programming example automatic
PLC Programming Example, simple manual and automatic control.
This PLC programming example below was written to answer a specific request by a learner, so we thought we would also share it with our website visitors. This PLC programming example is for manual control and automatic control. The manual rung jogs motor only when a momentary jog push button is pressed. The automatic control rung is a simple seal-in circuit. We use even this most simple PLC programming example to pass along and/or re-enforce some of the PLC programming best practices we teach. If you would like to have your employees learn more best practice PLC programming, please request a quote for our on-site PLC training.
Best practice PLC programming would have all real-world input and output addresses (like I:1/0 [I0.0] or O:3/6 [Q0.0]) in their own Cross-Reference subroutine (XREF Sub). But for our classroom purpose, in this programming example, we used real-world I/O in a single subroutine so all logic can be seen on one screen.
Rung 0 comment: Boolean Logic for this rung below is ... If JOG_PB or JOG_HMI then JOG_MOTOR_1
Instruction List - { BST XIC I:1.0/0 NXB XIC B3:0/10 BND OTE B3:0/9 }
Best practice PLC programming requires the seal-in element (instruction/contact) to be the last element in the branch of the seal-in circuit. We used seal-in for this logic because best practice states NEVER use a latching instruction (or set/reset or negate) unless needed. Always defaulting to a seal-in type circuit/logic which helps ensure a safe start-up condition on machine power-up.
Rung 1 comment: Boolean Logic for this rung below is ... If AUTO_PB or AUTO_HMI or RUN_MODE and not STOP_PB, then RUN_MODE
Instruction List - { BST XIC I:1.0/1 NXB XIC B3:0/12 NXB XIC O:3.0/6 BND XIO I:1.0/2 OTE O:3.0/6 }
We will end with a couple more best practice PLC programming tips that will save end-users (company using the finished equipment and PLC program for the next 10 years) millions of dollars in reduced downtime…
#1 Best Practice PLC programming rule: Keep your program easy for the layman to understand.
#2 Best Practice PLC programming rule: Document, document, document!
Every rung should have a detailed description, every element/instruction in rung should have a detailed descriptor too.
#2.a Best Practice PLC programming rule: Do NOT use acronyms in descriptions, spell them out.
Rung 2 comment: Boolean Logic for this rung below is ... If JOG_MOTOR_1 or RUN_MODE and not ESTOP_1, then MOTOR_1_RUN
Instruction List - { BST XIC B3:0/9 NXB XIC O:3.0/6 BND XIO B3:0/8 OTE O:3.0/7 }
Legend: BST=Branch Start, NXB=Next Branch, BND=Branch End
The video below will show you this PLC programming example running in a real PLC for you to better understand the ladder logic processing.
Please share this article:
The more we see people share our content, like and comment on our YouTube video channel, etc., the more we are inspired to share more. So please spread the word. Thanks