AN DB41.DBX 0.1
JNB a1
L DB42.DBD 92
L MD 28 //前馈系数
*R
L 3.330000e+000
/R
L -1.000000e+000
*R
T DB41.DBD 60
JU a2
a1: L 0.000000e+000
T DB41.DBD 60
JU a2
a2: AN(
L MD 60
L 0.000000e+000
<=R
)
JNB a3
JU a4
a3: L 0.000000e+000
T MD 60
L W#16#0
T PQW 256
JU end
a4: L DB41.DBW 76
T PQW 256
JU end
最佳答案
AN DB41.DBX 0.1
JNB a1 // 如果RLO=0跳转到a1
L DB42.DBD 92 //装载双字DBD92
L MD 28 //前馈系数
*R //DBD92 *MD28
L 3.330000e+000
/R //DBD92*MD28/3.33
L -1.000000e+000
*R //DBD92*MD28/(3.33*-1)
T DB41.DBD 60 // 保存到DB41.DBD60
JU a2 //跳转到a2
a1: L 0.000000e+000 //
T DB41.DBD 60 //装载0到DB41.DBD60
JU a2 //跳转到a2
a2: AN(
L MD 60
L 0.000000e+000
<=R
) //MD60中值与0进行实数比较。若RLO结果为0,跳转到a3,若为1
JNB a3 //则跳转到a4
JU a4 //
a3: L 0.000000e+000 //装载0到MD60
T MD 60
L W#16#0 //装载十六进制0到PQW256
T PQW 256
JU end //跳转至end
a4: L DB41.DBW 76 //装载DB41.DBW 76数据到PQW256
T PQW 256
JU end //跳转到end
提问者对于答案的评价:
谢谢
原创文章,作者:more0621,如若转载,请注明出处:https://www.zhaoplc.com/plc248651.html