课程中心
HOME
课程中心
正文内容
plc编程say指令 PLC基本知识 -- 33 基本指令 (顺便学英文)
发布时间 : 2024-11-24
作者 : 小编
访问数量 : 23
扫码分享至微信

PLC基本知识 -- 33 基本指令 (顺便学英文)

Basic Instructions / 基本指令

Now let's examine some of the basic instructions is greater detail to see more about what each one does.

现在让我们看一些基本的指令,更详细地了解每个指令的功能。

Load / Load指令

The load (LD) instruction is a normally open contact. It is sometimes also called examine if ON (XIO) (as in examine the input to see if its physically ON). The symbol for a load instruction is shown below.

load (LD)指令是一个常开触点。有时也称为检查是否打开(XIO)(就像在检查输入点以查看其在物理意义上是否闭合),load指令的符号如下所示:

A Load (contact) symbol / Load(常开)符号

This is used when an input signal is needed to be present for the symbol to turn ON. When the physical input is ON we can say that the instruction is True. We examine the input for an ON signal. If the input is physically ON then the symbol is ON. An ON condition is also referred to as a logic 1 state.

当需要一个输入信号才能使这个符号闭合(ON)时,就使用这种方法。当物理输入闭合(ON)时,我们可以说指令是“真”。我们检查输入点的闭合(ON)信号,如果输入点在物理上是闭合(ON)的,那么这个符号就是闭合(ON)的。一个闭合(ON)状态也称为逻辑1状态。

This symbol normally can be used for internal inputs, external inputs and external output contacts. Remember that internal relays don't physically exist. They are simulated (software) relays.

此符号通常可用于内部输入、外部输入和外部输出触点。记住,内部继电器在物理上并不存在,它们是模拟(软件)继电器。

LoadBar / LoadBar指令

The LoadBar instruction is a normally closed contact. It is sometimes also called LoadNot or examine if closed. (XIC) (as in examine the input to see if its physically closed) The symbol for a loadbar instruction is shown below.

LoadBar指令是一个常闭触点。有时也称为LoadNot或(XIC)(就像在检查输入点看其在物理意义上是否关闭)。loadBar指令的符号如下所示:

A LoadNot (normally closed contact) symbol / LoadNot(常闭)符号

This is used when an input signal does not need to be present for the symbol to turn ON. When the physical input is OFF we can say that the instruction is True. We examine the input for an OFF signal. If the input is physically OFF then the symbol is ON. An OFF condition is also referred to as a logic 0 state.

当不需要一个输入信号就可以使这个符号闭合(ON)时,就使用这种方法。当物理输入打开(OFF)时,我们可以说指令是“真”。我们检查输入点的打开(OFF)信号,如果输入点在物理上是打开(OFF)的,那么这个符号就是闭合(ON)的。一个打开(OFF)状态也称为逻辑0状态。

This symbol normally can be used for internal inputs, external inputs and sometimes, external output contacts. Remember again that internal relays don't physically exist. They are simulated (software) relays. It is the exact opposite of the Load instruction.

此符号通常可用于内部输入、外部输入,有时也可用于外部输出触点。请再次记住,内部继电器在物理上并不存在。它们是模拟(软件)继电器。LoadBar指令与Load指令完全相反。

*NOTE - With most PLCs this instruction (Load or Loadbar) MUST be the first symbol on the left of the ladder. / *注意:对于大多数PLC,这个指令(Load或Loadbar)必须是梯形图左边的第一个符号。

Out / Out指令

The Out instruction is sometimes also called an OutputEnergize instruction. The output instruction is like a relay coil. Its symbol looks as shown below.

OUT指令有时也称为OutputEnergize指令。输出指令类似于一个继电器线圈,它的符号如下所示:

An OUT (coil) symbol / OUT(线圈)符号

When there is a path of True instructions preceding this on the ladder rung, it will also be True. When the instruction is True it is physically ON. We can think of this instruction as a normally open output. This instruction can be used for internal coils and external outputs.

在梯形图的某一横档上,当这个符号前面的路径上的其他指令都是“真”时,这个符号也将是“真”,“真”表示是物理意义上的“ON”。通常情况下我们把这个符号看作一个常开输出,该符号既可用于内部线圈也可用于外部输出。

OutBar / OutBar指令

The OutBar instruction is sometimes also called an OutNot instruction. Some vendors don't have this instruction. The OutBar instruction is like a normally closed relay coil. Its symbol looks like that shown below.

OutBar指令有时也称为OutNot指令。有些品牌的PLC没有这个说明。OutBar指令就像一个常闭的继电器线圈,它的符号如下所示:

An OUTBar (normally closed coil) symbol / OUTBar(常闭)符号

When there is a path of False instructions preceding this on the ladder rung, it will be True. When the instruction is True it is physically On. We can think of this instruction as a normally closed output. This instruction can be used for internal coils and external outputs. It is the exact opposite of the Out instruction.

在梯形图的某一横档上,当这个符号前面的路径上的其他指令都是“假”时,这个符号将是“真”,“真”表示是物理意义上的“ON”。通常情况下我们把这个符号看作一个常闭输出,该符号既可用于内部线圈也可用于外部输出。它与OUT指令完全相反。

PLC基本知识 -- 51 运算指令 (顺便学英文)

Math Instructions / 运算指令

Let's now look at using some basic math functions on our data. Many times in our applications we must execute some type of mathematical formula on our data. It's a rare occurrence when our data is actually exactly what we needed.

现在让我们看看如何在数据上使用一些基本的数学函数。很多时候,在我们的应用程序中,我们必须对数据执行某种类型的数学公式;但当我们的数据确实是我们所需要的类型的时候,我们也不一定要用到运算指令。

As an example, let's say we are manufacturing widgets. We don't want to display the total number we've made today, but rather we want to display how many more we need to make today to meet our quota. Lets say our quota for today is 1000 pieces. We'll say X is our current production. Therefore, we can figure that 1000-X=widgets left to make. To implement this formula we obviously need some math capability.

举个例子,假设我们在生产小部件,我们不想显示我们今天完成的总数,但是我们想显示我们今天需要完成多少才能达到我们的配额。假设我们今天的配额是1000件,我们当前的产量是X,那么,我们可以计算出我们还需要完成多少才能达到我们的配额,即还需要完成的小部件数量是1000-X。显然,为了实现这个公式,我们需要一些数学运算能力。

In general, PLCs almost always include these math functions:

一般来说,PLC通常包括以下这些数学运算功能:

Addition - The capability to add one piece of data to another. It is commonly called ADD.加法 - 将一段数据与另一段数据相加的功能,它通常被称为ADD。Subtraction - The capability to subtract one piece of data from another. It is commonly called SUB.减法 - 从一个数据中减去另一个数据的能力,它通常被称为SUB。Multiplication - The capability to multiply one piece of data by another. It is commonly called MUL.乘法 - 将一段数据乘以另一段数据的能力,它通常被称为MUL。Division - The capability to divide one piece of data from another. It is commonly called DIV.除法 - 将一个数据与另一个数据进行相除的能力,它通常被称为DIV。

As we saw with the MOV instruction there are generally two common methods used by the majority of plc makers. The first method includes a single instruction that asks us for a few key pieces of information. This method typically requires:

正如我们在MOV指令中讲到的,大多数PLC制造商通常使用两种常用的方法。第一个方法 包含一条指令,它要求我们提供一些关键信息。这种方法通常需要:

Source A - This is the address of the first piece of data we will use in our formula. In other words it's the location in memory of where the first "number" is that we use in the formula.源A - 这是我们将在我们的公式中使用的第一数据块的地址。换句话说,它是我们在公式中使用的第一个“数字”在内存中的位置。Source B - This is the address of the second piece of data we will use in our formula. In other words it's the location in memory of where the second "number" is that we use in the formula. -NOTE: typically we can only work with 2 pieces of data at a time. In other words we can't work directly with a formula like 1+2+3. We would have to break it up into pieces. Like 1+2=X then X+3= our result.源B - 这是我们将在公式中使用的第二数据块的地址。换句话说,它是我们在公式中使用的第二个“数字”在内存中的位置。注意:通常我们一次只能处理2个数据。换句话说,我们不能直接用1+2+3这样的公式,我们得把它拆成碎片,比如1+2=X,然后X+3=结果。Destination - This is the address where the result of our formula will be put. For example, if 1+2=3, (I hope it still does!), the 3 would automatically be put into this destination memory location.结果 - 这是我们的计算公式的结果将被存放的地址。例如,如果1+2=3,3将自动放入这个目标内存位置。

ADD symbol / ADD指令符号

The instructions above typically have a symbol that looks like that shown above. Of course, the word ADD would be replaced by SUB, MUL, DIV, etc. In this symbol, The source A is DM100, the source B is DM101 and the destination is DM102. Therefore, the formula is simply whatever value is in DM100 + whatever value is in DM101. The result is automatically stored into DM102.

上面的指令通常有一个类似于上面所示的符号。当然,ADD这个指令会被替换为SUB、MUL、DIV等。在这个符号中,源A的地址是DM100,源B的地址是DM101,计算结果的地址是DM102。因此,公式就是DM100中的任何值+ DM101中的任何值,计算结果自动存储到DM102中。

Shown above is how to use math functions on a ladder diagram. Please note that once again we are using a one-shot instruction. As we've seen before, this is because if we didn't use it we would execute the formula on every scan. Odds are good that we'd only want to execute the function one time when input 0000 becomes true. If we had previously put the number 100 into DM100 and 200 into DM101, the number 300 would be stored in DM102.(i.e. 100+200=300, right??)

上图显示的是如何在梯形图上使用数学运算函数。请注意,我们再次使用上升沿指令DIFU。正如我们之前看到的,这是因为如果我们不使用它,程序每次扫描时都会执行一次这个公式。当输入0000为“真”(True)时,我们只希望执行一次这个运算函数,这种功能是很常用的。如果我们预先将数字100放入地址DM100,将数字200放入地址DM101,那么数字300将被存储在地址DM102中。(100+200=300,对吧?)

ADD symbol (dual method) / ADD指令符(用于双指令方式)

The dual instruction method would use a symbol similar to that shown above. In this method, we give this symbol only the Source B location. The Source A location is given by the LDA instruction. The Destination would be included in the STA instruction.

双指令方法将使用类似于上图所示的符号。在这个方法中,ADD指令只给出这个符号的源B地址DM101,源A的地置DM100由LDA指令给出,结果的地址DM102将包括在STA指令中。

Shown above is a ladder diagram showing what we mean.

上图是双指令方法的梯形图。

The results are the same as the single instruction method shown above.

其计算结果和上面所讲单指令的计算结果是一样的。

In the example above, data memory 102 (DM102) initially holds the constant (number) 0000. Each time the operator pushes button 0000 the difu instruction will turn on (become true) FOR ONE SCAN. When this happens we load the value(number) in DM100(100) and add it to the value(number) in DM101(200). The result, 300 in this example (100+200=300) is then stored in DM102(300).

在上面的示例中,数据内存102 (DM102)最初保存的常量(数字)是0。每次操作员按下0000按钮,DIFU指令就会打开(变为“真”)一个扫描周期,当发生这种情况时,我们加载DM100中的值(数字)100并将其与DM101中的值(数字)200相加。其结果,本例中的300(100+200=300)存储到DM102中去。

What would happen if we had a result that was greater than the value that could be stored in a memory location?

如果计算结果大于存储器可以存储的最大值,会发生什么情况呢?

Typically the memory locations are 16-bit locations. (more about number types in a later chapter) In plain words this means that if the number is greater than 65535 (2^16=65536) it is too big to fit. Then we get what's called an overflow. Typically the plc turns on an internal relay that tells us an overflow has happened. Depending on the plc, we would have different data in the destination location. (DM102 from example) Most PLCs put the remainder here.

通常,内存地址是16位的地址(关于数字类型的更多内容将在后面的章节中介绍)。简单地说,这意味着如果数字大于65535(2^16=65536),那么它就太大了,寄存器无法容纳。然后我们得到了所谓的溢出。通常,这时候PLC会打开内部继电器,告诉我们发生了溢出。根据PLC的不同,我们在目标地址(比如DM102)会有不同的数据,大多数PLC将其余数放在这里。

Some use 32-bit math which solves the problem. (except for really big numbers!) If we're doing division, for example, and we divide by zero (illegal) the overflow bit typically turns on as well. Suffice it to say, check the overflow bit in your ladder and if its true, plan appropriately.

一些使用32位的运算来解决这个问题(除非是非常大的数字!)。例如,如果我们在做除法,然后除以0(非法),溢出位通常也会打开。我只想说,检查一下你的梯形图上是否有溢出的部分,如果是的话,适当地规划一下,可以设计成报警输出。

Many PLCs also include other math capabilities. Some of these functions could include:

许多PLC还包括其他一些数学运算功能。其中一些功能可能包括:

Square roots / 平方根ScalingAbsolute value / 绝对值Sine / 正弦Cosine / 余弦Tangent / 正切Natural logarithm / 自然对数Base 10 logarithm / 以10为底的对数X^Y (X to the power of Y) / X的Y次方Arcsine (tan, cos) / 反正弦and more....check with the manufacturer to be sure. / 还有其他的请查询用户手册

Some PLCs can use floating point math as well. Floating point math is simply using decimal points. In other words, we could say that 10 divided by 3 is 3.333333 (floating point). Or we could say that 10 divided by 3 is 3 with a remainder of 1(long division). Many micro/mini PLCs don't include floating point math. Most larger systems typically do.

一些PLC也可以使用浮点数。浮点数学就是简单地使用小数点,换句话说,我们可以说10除以3等于3.333333(浮点数)或者我们可以说10除以3等于3余数是1(长除法),许多迷你PLC不包括浮点运算,但大多数大型系统通常都会有浮点运算功能。

Understand the theory and we can always learn how our manufacturer of choice does it.

理解这个理论,我们就可以知道如何选择我们所需类型的PLC。

相关问答

PLC与伺服电机连接?

plc控制伺服电机,一般日系伺服驱动器支持脉冲输入和模拟量输入控制,而欧系多支持模拟量输入控制,如果采用日系伺服,可以有多种品牌支持脉冲输出的PLC,一般是集...

请问,plc是如何对伺服进行三轴控制的?

plc控制伺服电机,一般日系伺服驱动器支持脉冲输入和模拟量输入控制,而欧系多支持模拟量输入控制,如果采用日系伺服,可以有多种品牌支持脉冲输出的PLC,一般是集...

ram存储器的特点是?

ram存储器的特点:1、访问速度快:最大的优点就是用户在读取或者写入数据时的速度是最快的,在目前所有的访问设备中,随机储存器几乎是最快的,一些访问设备在...

按一下开启按钮,灯亮10s,暗5s,重复3次后停止工作,求梯形图-ZO...

采用台达PLC编程。与三菱PLC一样。有用(0)回复编写一个方波,计算一下方波的次数即可不知道你用的是哪种品牌的PLC呢有用(0)回复展开查看全部5条讨论...

像waybackintolove、longlongwaytogo、aplcaenear

tolove男女对唱的有myboolaundromateverlastinglovei'llbemissingyouI.O.U(new)thesaltwaterroom(o...

民宿酒店设计民宿酒店设计注意事项?民宿酒店设计装修技巧是什...

[回答]businesscommunication英[ˈbizniskəˌmju:niˈkeiʃən]美[ˈbɪznɪskəˌmjunɪˈkeʃən][词典]商业通信;[网络]商务沟通;商务交际;商务交流;[...

 利奥雷诺  山鼓声声 
王经理: 180-0000-0000(微信同号)
10086@qq.com
北京海淀区西三旗街道国际大厦08A座
©2024  上海羊羽卓进出口贸易有限公司  版权所有.All Rights Reserved.  |  程序由Z-BlogPHP强力驱动
网站首页
电话咨询
微信号

QQ

在线咨询真诚为您提供专业解答服务

热线

188-0000-0000
专属服务热线

微信

二维码扫一扫微信交流
顶部