शैडोइंग अभ्यास: PLC Programming Tutorial - Ladder Logic #3: Math and Calculations - YouTube के साथ अंग्रेजी बोलना सीखें

C1
⏸ रुका हुआ
Hello and welcome back to Lemaster Tech
184 वाक्य
यदि वाक्य बहुत छोटे या लंबे हों, तो समायोजित करने के लिए Edit पर क्लिक करें।
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.

ऐप डाउनलोड करें

Everything you need to speak fluently

AI PronunciationScore every sentence
IPA PracticeMaster every sound
VocabularyBuild your word bank
Vocab GameLearn while playing
QR स्कैन करें
QR स्कैन करें

इस वीडियो के साथ बोलने का अभ्यास क्यों करें?

इस वीडियो में पीएलसी प्रोग्रामिंग की मूल बातें दी गई हैं, विशेष रूप से सीढ़ी के तार्किक भाषा में गणितीय संचालन जैसे कि जोड़, घटाव, गुणा और भाग। ऐसे ट्यूटोरियल्स अंग्रेजी बोलने का अभ्यास करने का एक बेहतरीन अवसर प्रदान करते हैं। जब आप वीडियो का अनुसरण करते हैं, तो आप महत्वपूर्ण तकनीकी शब्दावली सीखते हैं जो आपके पेशेवर अभ्यास को बढ़ा सकता है। इस वीडियो को देखकर, आप न केवल अंग्रेजी में प्रवीणता प्राप्त कर सकते हैं बल्कि वास्तविक समय पर बातचीत की स्थिति में भी खुद को स्थापित कर सकते हैं। अंग्रेजी शैडोइंग तकनीक का उपयोग करते हुए, आप बोलने की क्षमता को विकसित कर सकते हैं और तकनीकी विषयों पर चर्चा करने में अपना आत्मविश्वास बढ़ा सकते हैं।

विधि और संदर्भ में अभ्यास

वीडियो में कई महत्वपूर्ण भाषाई संरचनाएं देखी जा सकती हैं:

  • सक्रिय क्रियाविधि: जैसे "Let’s go ahead and make" और "we will talk about"।
  • निर्देशात्मक वाक्य: जैसे "Let’s go ahead and set all of these up"। यह शैली इंगित करती है कि आप आगे बढ़ते समय क्या करने जा रहे हैं।
  • विभाजित वाक्य: जैसे "you could enter another variable in here too"। यहाँ पर विकल्पों की बात की जा रही है, जिससे आप अधिक संवादात्मक तरीके से विचार व्यक्त कर सकते हैं।
  • परिभाषा: वीडियो में तकनीकी शब्दावली जैसे "input", "output", "addition", "multiplication" का उपयोग करके उदाहरण दिए गए हैं।

सामान्य उच्चारण जाल

इस वीडियो में कुछ शब्द और उच्चारण जाल हो सकते हैं, जो सीखने वालों के लिए चुनौतीपूर्ण हो सकते हैं:

  • "Addition" और "Multiplication": इन शब्दों में शब्द के वजन को समझना आवश्यक है।
  • "Output": यह शब्द अक्सर तेज गति से बोला जाता है, जिसे सही उच्चारण करना आवश्यक है।
  • "Variable": इसकी उच्चारण विविधता हो सकती है, इसलिए इसे सही तरीके से अभ्यास करना महत्वपूर्ण है।

इन उच्चारणों और वाक्य संरचनाओं का अभ्यास करके, आप अंग्रेजी बोलने का अभ्यास बेहतर तरीके से कर सकते हैं और shadowspeak तकनीक का उपयोग कर सकते हैं, जो आपकी अभिव्यक्ति की क्षमता को बढ़ाने में मददगार है।

शैडोइंग तकनीक क्या है?

शैडोइंग (Shadowing) एक विज्ञान-समर्थित भाषा सीखने की तकनीक है जो मूल रूप से पेशेवर दुभाषिया प्रशिक्षण के लिए विकसित की गई थी। विधि सरल लेकिन शक्तिशाली है: आप मूल अंग्रेज़ी ऑडियो सुनते हैं और तुरंत इसे ज़ोर से दोहराते हैं — जैसे वक्ता की छाया 1-2 सेकंड की देरी से। शोध से पता चलता है कि यह उच्चारण सटीकता, स्वर, लय, जुड़ी हुई ध्वनियाँ, सुनने की समझ और बोलने की प्रवाहशीलता में काफ़ी सुधार करता है।