oracle+除法取商和余数,PLC里面怎么得到除法指令得到商与余数

Example

STL Explanation

L IW10 //Load the value of IW10 into ACCU 1-L.

L MW14 //Load the contents of ACCU 1-L into ACCU 2-L. Load the value of MW14 into ACCU 1-L.

/I  //Divide ACCU 2-L by ACCU 1-L; store the result in ACCU 1: ACCU 1-L: quotient, ACCU 1-H: remainder

T MD20 //The contents of ACCU 1 (result) are transferred to MD20.

Example: 13 divided by 4

Contents of ACCU 2-L before instruction (IW10):  "13"

Contents of ACCU 1-L before instruction (MW14): "4"

Instruction /I (ACCU 2-L / ACCU 1-L):   "13/4"

Contents of ACCU 1-L after instruction (quotient): "3"

Contents of ACCU 1-H after instruction (remainder): "1"

对于D:1.求商Example

STL Explanation

L ID10 //Load the value of ID10 into ACCU 1.

L MD14 //Load the contents of ACCU 1 into ACCU 2. Load the value of MD14 into ACCU 1.

/D  //Divide ACCU 2 by ACCU 1; store the result (quotient) in ACCU 1.

T MD20 //The contents of ACCU 1 (result) are transferred to MD20.

Example: 13 divided by 4

Contents of ACCU 2 before instruction (ID10):  "13"

Contents of ACCU 1 before instruction (MD14):  "4"

Instruction /D (ACCU 2 / ACCU 1):   "13/4"

Contents of ACCU 1 after instruction (quotient):  "3"

2.求余数 Explanation

L ID10 //Load the value of ID10 into ACCU 1.

L MD14 //Load the contents of ACCU 1 into ACCU 2. Load the value of MD14 into ACCU 1.

MOD  //Divide ACCU 2 by ACCU 1, store the result (remainder) in ACCU 1.

T MD20 //The contents of ACCU 1 (result) are transferred to MD20.

Example: 13 divided by 4

Contents of ACCU 2 before instruction (ID10):  "13"

Contents of ACCU 1 before instruction (MD14):  "4"

Instruction MOD (ACCU 2 / ACCU 1):   "13/4"

Contents of ACCU 1 after instruction (remainder): "1"

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值