跟讀練習: How to Scale Analog Values in PLC Programming! - 通過影片學習英語口語
選擇練習模式
每種模式都會開啟全屏練習室。
152 句
如果句子過短或過長,請點選 Edit 進行調整。
1
Hello and welcome back to the channel.
2
And today we're going to take a look at PLC programming, continuing our PLC programming tutorials, and today zeroing in on how to scale analog inputs.
3
So we've done quite a lot of work so far on the channel with Booleans or binary digital inputs and digital outputs, which are on, off, zero, or one.
4
Today we're going to take a look at the other kind of input, which is analog inputs and outputs.
5
And these are things like temperatures, pressures, flows, the speed of a variable frequency drive, things that are not zero or one.
6
They have a range of control, a range of feedback input or control output.
7
And to understand the scaling that we need to do in the PLC, you need to understand briefly how these work.
8
signal.
9
The most common ones are 0 to 10 volts DC and 4 to 20 milliamps analog input.
10
So the thing that I want to go, you know, put my credibility at stake
11
and say is more common is 4 to 20 milliamps
12
because you get this nice benefit of 0 milliamps also telling you that there's a problem with the device.
13
So 4 milliamps acts as your baseline of a zero reading where that's zero pressure
14
or flow or your low level or whatever, but, or four milliamps tells you that, but zero milliamps tells you,
15
hey, I've lost communication with this device and I've gotten some benefit.
16
You don't always have that necessarily if you have zero to 10 volts, unless you add in some sort of like broken line connection.
17
Now it's important to note that every PLC manufacturer and every analog input card can be a little bit different.
18
So you need to check the specs for what the raw input signal is for your card.
19
Some Alan Bradley cards will use zero to 32 ,000.
20
They'll basically max out what a double integer can hold, a double integer value variable.
21
But Siemens, the more common one is basically zero to 27 ,648,
22
where anything below zero will be seen as under current and anything above 27 ,648 will be seen as over current.
23
I have the Siemens PLC programming software and a PLC hooked up.
24
But the concepts we're about to cover are universal for any PLC.
25
So let's actually get into what scaling an analog input looks like, and let's just make a new function called analog scaling.
26
you could create this in any plc platform now the exact
27
name of the next two blocks i'm going to show do vary across plc platforms
28
so the two steps we want to do are basically take a raw electrical
29
input which will be giving us a value of 0 to 27 648
30
and we want to normalize it to basically 0 to
31
And then we want to scale it according to our engineering units.
32
Okay, so this is what scaling an analog input means.
33
What that 0 to 27 ,648 means to the actual real world is meaningless unless we scale it because a flow meter,
34
a pressure sensor and a temperature sensor and a level sensor could amps,
35
but that tank might be telling you 0 to 10 feet of liquid, that flow meter might be telling you 0 to 50 GPM of flow,
36
you know that temperature could be 32 to 200 degrees Fahrenheit, or you might want that temperature sensor reading in Celsius.
37
that is where the scaling comes in.
38
So the first thing we want to do is we want to normalize that raw value.
39
Siemens has a block called norm underscore X.
40
You could do this in Allen Bradley with a compute or calculate block.
41
You can do it in Siemens with a calculate block, but this is already built for you where you basically say, what is my raw electrical minimum?
42
It's going to And then we'll define this raw input as a input to be passed into this function.
43
OK, so we're creating a function that will let us scale all of our analog inputs.
44
So we'll make this reusable.
45
So we'll make it what's called a local in, meaning it needs to get passed into this function when we call it.
46
And we'll make it a double integer.
47
That's the proper proper format for this.
48
function called normalized.
49
So we'll just go ahead and define it.
50
We'll make it a real because this is going to give us zero to one, but we don't want an integer that will only ever read zero or one.
51
We want it that normalized zero to 100 percent.
52
So we want it to be a real.
53
Okay, now we'll have this normalized bit that will and actually did I call it local temp?
54
Okay, good.
55
So this will basically tell us zero to one as a function of scale, like where in the four 20 milliamps span our devices.
56
But that's still not useful because those aren't the units we're looking for.
57
What we're looking for is something that has been scaled to the appropriate output.
58
Okay, so we'll take that normalized and we'll say we have zero to 100.
59
It can be really tempting to just take that value and multiply it times your max span.
60
So if you were looking at a level sensor
61
with saying like well now I'll just multiply it by a hundred
62
and it'll tell me the percent full of the tank
63
but that's tricky because four milliamps does not always equal zero sometimes like with the temperature sensor
64
and in the US you know we're using Fahrenheit zero is
65
not a temperature you're going to see from a temperature sensor very regularly
66
if you're measuring the temperature of a liquid a lot of these are scaled to like 32
67
or or you know there'll be 32 to 200 but you want temperature sensor that goes 50 to 300.
68
So again, to make this reusable, what we want to do is we want to make some new variables and call them EU min and EU max.
69
You can call these something else that makes more sense to you.
70
EU means engineering units, right?
71
This means the basically like the actual what you want your scaled output to display as.
72
And we'll make these reels as well, even though they are most commonly going to be integers.
73
That's OK.
74
We'll keep them all reels.
75
not be local temp that should be another local in okay we want
76
when you're calling can i move that okay we want
77
that to be a local in because we want this to be something that you pass in per input
78
the whole thing about making an analog scaling function that's reusable
79
means you need to be able to change these parameters per sensor
80
that you hook up so we'll make engineering units minimum I know I just said output,
81
that'll be our scaled input.
82
But if you think about what this function is doing, it's taking a raw electrical signal from an analog input,
83
and it's turning it into a useful scaled engineering units, whether that's GPM for flow, or, you know, inches of H2O for,
84
for, for, for a level sensor or something like that.
85
So we'll make that a local out, and we'll go ahead and define that.
86
Just this little normalize plus scale is all it's going to take to give us a reusable function
87
that will let us scale inputs.
88
So let's go take a look at what actually using this thing looks like and we'll show an example of it working.
89
So let's go ahead and define like raw.
90
Temp one, okay, we'll make a raw temperature sensor
91
and to not worry about wiring or physical hookup We'll make it a memory tag for now, but obviously I This would be the tag you hook up to your global analog input channel.
92
We'll go ahead and define it and we'll say the engineering units minimum for this will be 32 and 200, right?
93
So it's measuring the temperature of water.
94
There's no reason to think it's going to measure below 32.
95
Super important point about EU min and EU max.
96
This is not something you as the programmer should be picking what makes sense to you.
97
This should be from the manual of the device that you hooked up.
98
span for four and 20 milliamps.
99
So I am obviously picking values for the demonstration.
100
But these are things that should be coming from a manual.
101
Now let's go ahead and define the scaled output.
102
Okay, so this is going to be now a temperature sensor doesn't need the pound sign.
103
There we go.
104
This is going to show us a temperature sensor.
105
Let's go ahead and download it.
106
This will show us a temperature sensor that is going to read a raw electrical signal of zero to 27 ,648.
107
But our function that we just wrote should scale
108
that down to a zero to one percent of span
109
and then multiply it times 32 to 200 to figure out where we are in that span.
110
Okay, so we're sitting there at zero 32 is a good sign.
111
Let's go ahead and throw 13 ,000 in here and look at what about middle span looks like, And it gives us, hey,
112
okay, you're getting this electrical reading on your card of 13 ,000.
113
That correlates to 110 .99 degrees Fahrenheit.
114
Nobody in the UK panic.
115
And then let's say, let's go get pretty close to max span, okay, 25 ,000.
116
All right, it's 183 degrees.
117
So you can see this is kind of cool and kind of useful.
118
But let's take a look at where it gets really useful.
119
level in here as well
120
and the level is going to show us from three inches of water up to 240 inches of water.
121
Okay, it's a it's I don't know, ultrasonic level sensor to pick your poison.
122
But basically, let's just make up that we have some level sensor here
123
and we are going to have a scaled level one here and we'll make that a global memory as well.
124
And like making all these global memories is not exactly good programmers etiquette.
125
I'm just trying to go fast for the sake of a tutorial.
126
And then we'll throw one more in here.
127
and we'll define a little global flow meter tag here.
128
That shouldn't have been a reel, that's okay, it doesn't matter.
129
And let's say that the flow meter is zero to 100 GPM and we'll make scaled flow one tag as well.
130
Okay, define tag, global memory.
131
There we go.
132
All right, let's go ahead and download this, play around with it and talk through what we're seeing a little bit.
133
All righty, so we'll leave scaled temp alone as is.
134
But what's cool is we've written that scaling function once.
135
And this raw to, you know,
136
10 ,000, a little less than half span, it gives us, hey, okay, the level is 88 inches of water.
137
And I go to my flow, and I say, this is a little over half span.
138
And it says, all right, you're getting 54 GPM.
139
So one very simple analog scaling function that takes a raw input, normalizes it, and then scales it according to our engineering units,
140
is able to take every 4 to 20 convert it to engineering units that we'd want to see.
141
We'd want to put these on an HMI, add them to a historian tool, and view trends over time.
142
So this is really a simple, basic crash course to analog scaling.
143
No need, I think, to overcomplicate it.
144
I'm sure in the future we'll need to do a tutorial on the actual wiring of analog inputs
145
and the setup loop checking process for analog inputs, how you actually make sure they're working correctly.
146
But for the scaling in the PLC, I think this is a great tutorial and good place to stop.
147
So I'll go ahead and call it there on this lesson.
148
If you have any questions, be sure to let me know about in the comments below.
149
Please consider leaving a like on the video, subscribing to the channel, that helps me out a ton.
150
And let me know in the comments as well what you'd like to see next on the channel.
151
Thanks so much for watching and see you next time.
152
Thanks, bye.
同頻道
FOR YOU
推薦影片
上下文與背景
在本影片中,講述者深入探討了可程式設計邏輯控制器(PLC)程式設計中的模擬輸入值縮放方法。通過強調模擬輸入與數字輸入的區別,他介紹瞭如何處理溫度、壓力和流量等非二進位制的訊號。為了幫助學習者更好地理解這些技術概念,講述者還提到了一些常見的電氣訊號範圍,如0到10伏和4到20毫安。掌握這些基礎知識,能夠幫助英語學習者在相關技術領域內更自信地溝通與交流。
日常交流中的五個常用短語
- “Hello and welcome back to the channel.”(你好,歡迎回到頻道。)
- “Today we're going to take a look at...”(今天我們將檢視...)
- “It's important to note that...”(需要注意的是...)
- “Let's actually get into...”(讓我們深入瞭解...)
- “What that means to the actual real world is meaningless unless we scale it.”(在實際生活中,這意味著無意義,除非我們進行縮放。)
上述短語可幫助您在技術交流中更流暢地表達。在練習時,嘗試shadowspeak 技巧,逐字模仿發音,以提高您的英語發音和表達能力。利用 看YouTube學英語 的機會,增強您對技術英語的理解。
逐步跟讀指南
要有效地跟隨這個影片的內容並克服學習中的艱難點,您可以參考以下步驟:
- 認真聆聽:反覆播放影片,儘量捕捉每個單詞和短語。
- 分段練習:把影片內容分成小段,每段學習後進行重複練習,幫助記憶。
- 模仿發音:使用shadowspeaks方法,準備適量的時間以專注於每一句話的發音和語調。
- 記錄並反饋:使用錄音功能記錄自己的跟讀和表達,便於後續進行自我點評。
- 應用於實際:嘗試將所學內容應用於日常對話中,提高聽說能力。
通過這樣的練習,您不僅能夠掌握相關技術術語,還能在與他人交流時變得更加自信。採取shadow speak 的方法,助你在英語學習的旅程中不斷進步!
影片中的語法
說話人最常用的結構,並附上影片中的原話:
| 結構 | 影片中的用法 |
|---|---|
| 被動語態 be + 過去分詞 — 強調發生了什麼,而不是誰做的 | will be seen · is already built · be passed |
| 現在完成時 have/has + 過去分詞 — 過去發生但與現在仍有關聯的事 | we've done · I've lost · has been scaled |
| 定語從句 who / which + 從句 — 補充說明人或事物 | outputs, which are · input, which is · input which will |
什麼是跟讀法?
跟讀法 (Shadowing) 是一種有科學依據的語言學習技巧,最初開發用於專業口譯員的培訓,並由多語言者Alexander Arguelles博士普及。這個方法簡單而強大:您在聽英語母語原聲的同時立即大聲重複——就像是一個延遲1-2秒緊跟說話者的影子。與被動聽力或語法練習不同,跟讀法強迫您的大腦和口腔肌肉同時處理並模模擬實的講話模式。研究表明它能顯著提高發音準確性,語調,節奏,連讀,聽力理解和口語流利度——使其成為雅思口語備考和真實英語交流最有效的方法之一。






















