Shadowing Practice: PLC Programming Tutorial - Ladder Logic #3: Math and Calculations - Learn English Speaking with Video

Kies een oefenmodus

Elke modus opent een volledig scherm oefenruimte.

184 zinnen
Als zinnen te kort of te lang zijn, klik op Bewerken om ze aan te passen.
1
Hello and welcome back to Lemaster Tech
2
and in today's video we'll be continuing our series on the basics of PLC programming in ladder logic programming language.
3
Today we'll focus on basic math operations including multiplication, division, addition, subtraction, and then we'll talk about the calculate block which combines many of these operations together.
4
If you like the content in this video
5
and you've been finding these tutorials helpful please consider leaving a like on the video
6
and subscribing to the channel it helps me out a ton.
7
Now let's get into this tutorial.
8
okay so for today's video i've just gone ahead
9
and made some empty integer tags in my plc
10
so we're gonna use integers we don't need reels or floats but the math that we're doing in today's video,
11
you could make these floats or decimal values and they will still work.
12
We're just going to use integers today to keep it simple.
13
So let's go into our ladder tutorials binary block.
14
It doesn't matter if you still have some of the binary code from past videos in there.
15
Today, we're going to start from scratch.
16
Concepts covered in these videos are applicable to generally every PLC programming platform in the world.
17
Ladder diagram.
18
These are standard blocks.
19
Um...
20
So today we're going to talk about when you hit an empty block, pretty much every PLC programming software has some version of all the basic mathematical operations.
21
They have an add block.
22
They have a subtract block.
23
They have a...
24
division block and a multiplication block And a cool thing about Tia, most platforms have some version of this.
25
But if you have a block, it's very easy to change in between one and the other.
26
To make this a little bit more readable, I'll put add and subtract up top.
27
and I'll put multiply and divide.
28
in the bottom.
29
And just to talk about the sort of the variables that you're seeing on these blocks, um you're seeing input one and input two and then an output
30
The easiest thing we can do to showcase these working is use one variable like my in zero.
31
and put a hard -coded value in input 2.
32
and then put a new integer in the output here and say myInt1.
33
So what this should do is say one plus two goes into the output.
34
Now let's go ahead and set all of these up at once because this isn't really the super interesting part.
35
I'm gonna just sort of jump ahead to where I have my values added into each block
36
so you don't have to watch it.
37
Okay, and you don't have to use the same, actually it's probably better if I don't, you don't have to use the same constant for every block just to be clear.
38
This is just me entering a number.
39
And you could enter another variable in here too.
40
If you're doing something dynamic scaling or checking states of sequence steps or anything else like that, this could also be a variable and you see addition
41
and multiplication are ones where they're also okay with you adding multiple operands.
42
So obviously to do addition you have to add at least two things together.
43
Same with multiplication.
44
But you could do a long string of multiple values, addition and multiplication on these blocks.
45
It isn't there for subtraction and division because the order matters, and they can't necessarily tell if you want to divide this by this by this by this,
46
or subtract this by this by this by this in what order.
47
But addition and multiplication you can.
48
And in just a minute we'll talk about a more complicated block that does let you combine all of these functions.
49
But let's go ahead and download to the PLC just to showcase these four simple mathematical blocks.
50
And we'll go ahead and write some values to these integers and we'll see what happens to the outputs.
51
Okay.
52
So here we see my in zero currently set to zero.
53
If I change it to 50, you see my int one is just 50 plus 10.
54
It's 60.
55
If I change this to...
56
75 My int 1 is 85.
57
So the output is simply the addition of 1 plus 2.
58
A little bit different over here.
59
If you look at the subtract block, it's 1 minus 2.
60
A little bit different, but not really.
61
And if you do 20 minus 8, it's 12.
62
Okay, so input 1 minus input 2 goes into input 3.
63
Multiplication, 32 times 6 is 195.
64
Pretty straightforward.
65
You know, five times six should be 30.
66
So there you go.
67
Division zero divided by four zero.
68
Let's make it something more interesting than zero like 26 And you see something interesting now with Tia Portal.
69
If you're dividing an integer by an integer and putting it in an integer value, it will still allow that, but it's going to give you the nearest integer value.
70
And so 26 divided by four.
71
is obviously 6 .5.
72
And if we went to 27, you're getting 6 .75, but you see it's doing floor division.
73
It's rounding down.
74
There's one block I wasn't necessarily going to cover because it's a little less common here, but the modulus block is sort of the fifth math block.
75
And if we took this input six and we still put four down here, and we put it in a new integer value, my in eight, let's say,
76
and we divide or download.
77
There we go.
78
You can see that if you're using integer values because booleans or sorry floats decimal values use up more memory.
79
Sometimes you do just want to use an integer and know what the remainder is.
80
That's what the mod block is.
81
Modulus is the remainder of a division system.
82
So 27 divided by four, where you want the integer value will round down to six, and so will 26 and so will 25.
83
but what's changing is the remainder, so you can get the remainder separately using this modulus block.
84
Okay?
85
So there's addition, subtraction, multiplication, division, and modulus.
86
Alright, so that's a lot of simple math pretty fast.
87
One, maybe it's useful, maybe not to you.
88
One useful thing to call out is you can actually put the same input on the left side and the right side.
89
of a math block so if you're doing some sort of transformation on one line of a value
90
like scaling and you can say like, oh, okay, the integer that I currently have plus 10, and then store it in the same variable name.
91
There's really no good reason to do that, but technically it's still valid code.
92
So let's look at a real world scenario really quick where we combine a couple of these
93
and to create a Celsius to Fahrenheit or Fahrenheit to Celsius converter, right?
94
You can take a you know your initial value times nine and you can store that in...
95
my in one
96
And then you can take my int 1 as the output from there
97
and store it as the input from 2 and then say divide by 5.
98
Put that in my int 2.
99
And then you can add my int2. To 32.
100
I moved it.
101
I didn't copy it.
102
There we go.
103
And that obviously you can store in my int.
104
Three.
105
So let's go ahead and download that to the PLC.
106
I'm sure all those intermediates had values, but they'll get overwritten.
107
Oh, this is Celsius to Fahrenheit.
108
75 Celsius is quite hot.
109
30 Celsius.
110
Is 86 Fahrenheit.
111
Okay, that math checks out.
112
So we built a Celsius to Fahrenheit converter.
113
I put it in my notes backwards.
114
Let's actually go ahead real quick and do the same thing.
115
Let's do Fahrenheit to Celsius, see it in reverse.
116
Okay, and I went ahead and spared you the pain of having to watch me type it all out.
117
But here we can see Fahrenheit to Celsius is the same formula but in reverse.
118
It's taking, you know, some number subtracting 32 out.
119
and then multiplying by 5, dividing by 10.
120
So in this case, rather than 30, let's just see it in reverse.
121
If it's 86 degrees Fahrenheit, it's 30 Celsius.
122
This makes sense because we're seeing the same formula in reverse.
123
So let's see what our Fahrenheit to Celsius converter says.
124
If it's a brisk autumn day and it's 60 degrees, that's 15 celsius and you know the math should check out
125
because if we go and make this 15 we should get OK, 59.
126
But that's actually an interesting one because you're seeing the two different types of rounding going on by using exclusively integer values, because if these were all reals,
127
they would obviously be to the decimal precision the exact same number um
128
but that's actually cool you're seeing a symptom of using integers for your math
129
but this is still a functioning celsius to fahrenheit and fahrenheit to celsius converter However, you may be looking at this and saying this looks kind of stupid.
130
I need six integers to be able to do this math.
131
You know, I have to
132
output to an integer value that then goes
133
and becomes the input of another block on every one of these blocks
134
and no you don't that's actually where a far more useful
135
block for doing multi -step calculations like this comes in
136
and in Siemens it's called calculate in Allen Bradley Rockwell it's called compute so you type a CPT in
137
Pretty much every Allen Bradley instruction has like a three letter or four letter
138
abbreviation and CPT is the version of this that you use in Allen Bradley.
139
I actually think the compute block in Rockwell is a little bit more intuitive than the calculate block in Siemens
140
but They do functionally the same thing.
141
And what's cool about this is I can take that same input, my int 0, which is going to be our Celsius input,
142
and then I can store it to a new output that will be our secondary check.
143
So my int 4, if we do this calculation right, should be the same as my in three because we're going to attempt to multiply by nine divide by 5,
144
and add 32, all in this one block.
145
So we're going to try to multiply by nine, divide by 5, and then add 32.
146
all to my int zero.
147
by tap double clicking this output or whatever your PLC IDE version of editing this is.
148
And the output we reference those input variables in defining our output function.
149
So we just come in here and we say, input one times input two,
150
so multiply by nine, divided by input 3 divided by 5 and then plus input 4.
151
So add 32.
152
Okay?
153
And I'm quite confident this is going to work, but let's go ahead and do the reverse version of it too so you can
154
We can just get both of them knocked out at the same time.
155
So we'll use that my int 5 as the input.
156
And what's the next unused one?
157
We'll use my int 9 as the output for this one.
158
And then the only thing different here is we want to subtract by 32, multiply by 5, and divide by 9.
159
I'll just keep them in that order we want to use them here.
160
And this function is going to be...
161
little different it's gonna be input 1 minus input 2 Fortunately, compute blocks and calculate blocks respect PEMDAS.
162
It respects the order of operations, to put it more clearly.
163
So we're going to use those parentheses to say do the subtraction first, and then multiply by input 3 and divide by input 4.
164
Uh, that was, there we go.
165
I put a space in the wrong spot.
166
Okay, so this is saying, you know, the input minus 32 times 5 divided by 9.
167
Okay, so if we did our math correctly and I'm something of a math whiz, Let's go ahead and download.
168
So we did the kind of step show each step using each block one at a time
169
and we have 15 converts up to 59 and then we have 60 converts down to 15.
170
We see the same thing happening here.
171
So if we say Celsius 22 degrees.
172
71 degrees Fahrenheit well let's say if we have 72 degrees Fahrenheit it converts down to 22 degrees Celsius.
173
So 75, 23, yeah I guess I saw that coming.
174
19 would convert up to 66.
175
Okay, so this is a pretty solid basic introduction to math and simple Mathematical operations in ladder programming for Siemens.
176
And so we'll probably do an advanced math video at some point in the future, but those come up far less frequently than the ones we covered today.
177
Hopefully you found this useful.
178
Hopefully you've been enjoying the series.
179
If there's a specific concept you want to see covered in the video.
180
in a video, be sure to let me know about in the comments below.
181
As always, thank you for watching.
182
Don't forget to like the video, subscribe to the channel, and see you next time.
183
Thanks.
184
Bye.

App downloaden

Alles wat je nodig hebt om vloeiend te spreken

AI UitspraakScoor elke zin
IPA OefeningBeheers elk geluid
WoordenschatBouw je woordenschat op
WoordenspelLeren terwijl je speelt

Zelfde Kanaal

FOR YOU

Aanbevolen Video

Woordenschat en spreektips bij deze les

Deze spreekles op niveau C1 is gebaseerd op de video “PLC Programming Tutorial - Ladder Logic : Math and Calculations”. Deze woorden komen het vaakst terug: block, input, integer, celsius, value. Deze video bevat 184 zinnen en 2130 woorden om na te spreken. Het gesproken deel duurt 12:50. De spreker praat in een natuurlijk tempo van ongeveer 166 woorden per minuut, dicht bij een alledaags gesprek. Slechts 81% van de woorden hoort bij de 3.000 meest gebruikte Engelse woorden, dus de woordenschat is pittig.

Belangrijke woorden in deze video

De 15 moeilijkste woorden uit de video, met uitspraak en betekenis:

WoordUitspraakBetekenis
integer zelfstandig naamwoord/ˈɪn.tɪ.d͡ʒə(ɹ)/geheel getal
multiplication zelfstandig naamwoord/ˌmʌltɪplɪˈkeɪʃən/vermenigvuldiging
multiply werkwoord/ˈmʌltɪplaɪ/vermenigvuldigen
subtract werkwoord/səbˈtɹækt/aftrekken, in mindering brengen
minus/ˈmaɪ.nəs/min
subtraction zelfstandig naamwoord/səbˈtɹækʃən/aftrekken
calculate werkwoord/ˈkælkjʊleɪt/berekenen, uitwerken
remainder zelfstandig naamwoord/ɹəˈmeɪndɚ/rest, restant
ladder zelfstandig naamwoord/ˈlæd.ɚ/ladder
compute werkwoord/kəmˈpjuːt/uitrekenen, berekenen
decimal zelfstandig naamwoord/ˈdɛs.ɪ.məl/decimaalstelsel, tientallig talstelsel
tutorial zelfstandig naamwoord/ˌtjuːˈtɔːɹɪəl/snelcursus, tutorial
float werkwoord/fləʊt/drijven
mathematical bijvoeglijk naamwoord/ˌmæθ(.ə)ˈmæt.ɪ.kəl/wiskundig
litter zelfstandig naamwoord/ˈlɪt.ɚ/strooisel

Phrasal verbs die je zult horen

WoordBetekenis
check out werkwoordonderzoeken

Zinnen om te herhalen

Korte, volledige zinnen uit de video die je in alledaagse gesprekken kunt gebruiken:

  • Today, we're going to start from scratch.
  • One, maybe it's useful, maybe not to you.
  • Hopefully you've been enjoying the series.

Uitspraak om op te letten

De spreker gebruikt 55 samentrekkingen en verkorte vormen, zoals we'll, we're, you're. Spreek ze kort uit, zoals je ze hoort.

  • De “th”-klanken: mathematical /ˌmæθ(.ə)ˈmæt.ɪ.kəl/, parenthesis /pəˈɹɛn.θə.sɪs/
  • De klanken “sh” en “zh”: multiplication /ˌmʌltɪplɪˈkeɪʃən/, subtraction /səbˈtɹækʃən/, calculation /ˌkælkjuˈleɪʃn̩/, showcase /ˈʃoʊˌkeɪs/, abbreviation /əˌbɹi.viˈeɪ.ʃn̩/
  • Lange woorden — let op de klemtoon: multiplication /ˌmʌltɪplɪˈkeɪʃən/, mathematical /ˌmæθ(.ə)ˈmæt.ɪ.kəl/, abbreviation /əˌbɹi.viˈeɪ.ʃn̩/, parenthesis /pəˈɹɛn.θə.sɪs/, intuitive /ɪnˈtjuːɪtɪv/

Klanken die Nederlandstaligen lastig vinden:

  • Stemhebbende eindmedeklinker — /b/, /d/, /g/, /z/, /v/ niet verscherpen: subscribe /səbˈskɹaɪb/, operand /ˈɑpəˌɹænd/, intuitive /ɪnˈtjuːɪtɪv/, unused /ʌnˈjuzd/, backward /ˈbækwɚd/
  • /æ/ — opener dan de Nederlandse “e”: subtract /səbˈtɹækt/, subtraction /səbˈtɹækʃən/, calculate /ˈkælkjʊleɪt/, ladder /ˈlæd.ɚ/, mathematical /ˌmæθ(.ə)ˈmæt.ɪ.kəl/
  • /w/ — met ronde lippen: backward /ˈbækwɚd/, straightforward /ˌstɹeɪtˈfɔː(ɹ)wə(ɹ)d/

Zo oefen je met deze video

  1. Luister de hele video één keer zonder te spreken en noteer de woorden die je niet kent.
  2. Begin op 0,75× snelheid, spreek zin voor zin na en ga terug naar normale snelheid zodra het makkelijk gaat.
  3. Neem jezelf op en vergelijk met het origineel; let daarbij op woorden als integer, multiplication, multiply.

Wat is de Shadowing-techniek?

Shadowing is een wetenschappelijk onderbouwde taalleermethode die oorspronkelijk is ontwikkeld voor professionele tolkentraining en gepopulariseerd door polyglot Dr. Alexander Arguelles. De methode is eenvoudig maar krachtig: je luistert naar native Engelse audio en herhaalt het onmiddellijk hardop — als een schaduw die de spreker volgt met slechts 1–2 seconden vertraging. In tegenstelling tot passief luisteren of grammaticadrills, dwingt shadowing je hersenen en mondspieren om echte spraakpatronen tegelijkertijd te verwerken en te reproduceren. Onderzoek toont aan dat het de uitspraaknauwkeurigheid, intonatie, ritme, verbonden spraak, luisterbegrip en spreekvaardigheid aanzienlijk verbetert — waardoor het een van de meest effectieve methoden is voor IELTS Speaking-voorbereiding en echte Engelse communicatie.

Shadowing-techniek: lees de volledige stap-voor-stap-gids →