欧姆龙PLC技术问答


1、问:浮点运算有什么样的好处,在运算的结果中他的小点位也是不可以进位的?浮点运算与双精浮点运算有什么样的区别?

答:浮点运算支持带小数点的运算,这就是它的好处,浮点运算每个参与运算的数占了2个通道而双精度浮点运算则占4个通道。

2、CP1H系列中,BCD除得的结果是带有小数点的,如何把小数进位呢。例如/BL(435) #1499664 #1000 D70
使D70中得到的数值是1500。如何进位呢


答: 可以使用比较余数实现。/BL除法得到的余数存放在D72,D73通道,使用比较指令CMP进行判别,如果需要进位,在D70通道加#1。

3、浮点数的乘法所得的结果是BCD码吗 


答:浮点数指令的运算结果是专用的浮点数格式,可以使用FIX指令把浮点数转化成十六进制,再使用BCD指令把十六进制转换成BCD形式。

4、有符号的二进制运算与无符号的二进制运算有什么区别?符号指的是负号吗?包括小数点吗?


答:带符号的二进制运算中,计算后得到的结果中最高位15位是符号位,如果是1:代表是负数,0:代表是正数
无符号的二进制数据范围是0000-ffff (4位16进制)
0~65535(10进制数)
有符号的二进制数据负数范围:8000~ffff(4位16进制)
0~-32768 (10进制数)正数范围:0000~7fff(4位16进制)
0~32768(10进制数)

Write a comment

Comments: 2
  • #1

    Berneice Vantrease (Thursday, 02 February 2017 04:24)


    Good day! I know this is kinda off topic but I'd figured I'd ask. Would you be interested in trading links or maybe guest authoring a blog post or vice-versa? My blog goes over a lot of the same topics as yours and I feel we could greatly benefit from each other. If you might be interested feel free to send me an e-mail. I look forward to hearing from you! Great blog by the way!

  • #2

    Carissa Tollett (Friday, 03 February 2017 01:50)


    Have you ever considered about adding a little bit more than just your articles? I mean, what you say is fundamental and all. However just imagine if you added some great images or videos to give your posts more, "pop"! Your content is excellent but with images and clips, this blog could undeniably be one of the greatest in its field. Amazing blog!