From the course: Learning PLC Ladder Logic: 2 Diving Deeper
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Solution 2: Use arithmetic instructions - Ladder Logic Tutorial
From the course: Learning PLC Ladder Logic: 2 Diving Deeper
Solution 2: Use arithmetic instructions
- [Instructor] Now for the next step in order to show the time remaining, I'll explain what I'm going to do using this simple visualization. Think about it this way: if I ask you to count from one to 10, 10 being the preset value here, you would start counting from one, two, three until you reach 10, right? Now, if I want you to count backwards, 10, nine, eight and so on, notice here that going backwards is simply subtracting 10 minus the number I was counting up to. So 10 minus one equals nine. 10 minus two equals eight and so on. So I can use the 10 which is my preset value minus the accumulated value in order to show the remaining time. Simply the time remaining equals timer preset minus timer accumulator. For that, we are going to use a subtraction instruction in the run subtracting the preset minus the accumulated value and saving the results in address N7 bit one. And then finally, to send the values to…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Introduction to math instructions1m 25s
-
(Locked)
Types of math instructions1m 40s
-
(Locked)
Considerations with math instructions2m 49s
-
(Locked)
Example: Convert Fahrenheit to Celsius40s
-
(Locked)
Solution: Convert Fahrenheit to Celsius1m 52s
-
(Locked)
Example: Use arithmetic instructions1m 12s
-
(Locked)
Solution 1: Use arithmetic instructions2m 28s
-
(Locked)
Solution 2: Use arithmetic instructions2m 52s
-
(Locked)
ONS: One-shot instruction2m 9s
-
(Locked)
Example: ONS with math instructions3m 22s
-
-
-
-
-