您的位置:首页 > 其它

Modbus软件开发实战指南 之 开发自己的Modbus Poll工具 - 4

2017-03-15 09:58 603 查看
说到mobus,其寄存器的结构非常特殊,16位的,

这种情况下,有很多初学者犯憷,不知道如何处理了。

特别是对于float,double等类型的,

发送数据,接收数据都很难办。 怎么学习modbus开发呢?除了前面推荐的清华出版的书籍之外,

现在推荐一个非常好用的工具:
http://www.binaryconvert.com/
提供各种数据类型的16进制和十进制之间的转换:

Online Binary-Decimal Converter
 
This converter allows you to convert numbers from decimal format to binary format and from binary format to decimal format. It supports the
main variable data types used in most programming languages. It also floating point numbers (single and double precision) according to the standard IEEE754. Supported types are shown in the following table:
 
  
 
TYPEBITSMINIMUMMAXIMUMDECIMAL FORMAT 
        
 

Unsigned char80255Integer 
        
 

Signed char8-128127Integer 
        
 

Unsigned short16065535Integer 
        
 

Signed short16-3276832767Integer 
        
 

Unsigned int3204294967295Integer 
        
 

Signed int32-21474836482147483647Integer 
        
 

Float (IEEE754)32-3.4028E+383.4028E+38Real number 
        
 

Double (IEEE754)64-1.7977E+3081.7977E+308Real number 
 
   
 
How to convert from decimal to binary?
 

Enter the number in decimal form in the corresponding field. For floating-point numbers, the following formats are valid:

128001.5766

1.280015766E5
 
    

The result is shown on the next page both in hexadecimal and in binary. Each bits is represented by a square (green = 1, gray = 0). The closest decimal value that
can be represented by this binary expression is also shown in the field "Most accurate representation".
 
 
How to convert from binary to decimal?
 

Enter the number in hexadecimal form or in binary form in the corresponding field. 
    

A bit can be toggled by clicking on the corresponding square. 
    

The decimal value is shown. For display purpose, the number of figures is limited to 30. However, all computations are performed with full precision without any
rounding.
 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐