详细的问题描述和源代码见这个帖子rnhttp://bbs.csdn.net/topics/390977511?page=1#post-398941257rnrn用VB6做开发和仪表通讯，现在读参数时仪表显示小于65535的数可以正常<em>读取</em>，只要仪表上大于65535这个数，通讯返回的帧<em>数据</em>就是8000h，转成十进制就都是32768。在写参数时写小于32767的数可以正常修改仪表上的<em>数据</em>，但写大于32767的数仪表就返回一个03的错误响应码，无法修改。也问了好多地方了，很多人都说类型定义可能有问题，什么Integer改Long，好像不是这个问题，没办法自己看了下通讯手册，其中有一处地方翻译过来感觉和我这个问题有点问题，手册上说一个参数是16位，所以下段好像是说超过16位的<em>怎么</em>读写的办法，但是自己翻译了一下也不是很理解到底要<em>怎么</em>办，现在发出来大家看下帮忙分析下我的问题是否和手册这章节说的有关，具体要<em>怎么</em>处理？十分感谢！rnrn7. CHAPTER 7 Modbus and EI BisynchrnADVANCED TOPICSrn7.1. ACCESS TO FULL RESOLUTION FLOATING POINT ANDrnTIMING DATA (MODBUS ONLY)rnrnOne of the main limitations of Modbus is that only 16 bit integer representations of data canrnnormally be transferred. In most cases, this does not cause a problem, since appropriaternscaling can be applied to the values without losing precision. Indeed all values displayable onrnthe 4 digit Series 2000 front panel may be transferred in this way. However this has thernsignificant drawback that the scaling factor to be applied needs to be known at both ends ofrnthe communications link.rnrnOne further problem is that certain ‘time’ parameters, notably those used for the programmerrnfunction are always returned over the communications link in seconds. It is possible for longrndurations to overflow the 16 bit Modbus limit.rnTo overcome these problems, a sub protocol has been defined, using the upper portion of thernModbus address space (8000h and upwards), allowing full 32 bit resolution floating pointrnand timer parameters. The upper area is known as the IEEE region.rnThis sub-protocol provides two consecutive Modbus addresses for all parameters. The basernaddress for any given parameter in the IEEE region can easily be calculated by taking itsrnnormal Modbus address, doubling it, and adding 8000h. For example, the address in thernIEEE region of the Target Setpoint (Modbus address 2) is simplyrn2 x 2 + 8000h = 8004h = 32772 decimalrnThis calculation applies to any parameter that has a Modbus address.rnAccess to the IEEE area is made via block reads (Functions 3 & 4) and writes (Function 16rnAttempts to use the ‘Write a Word’ (Function 6) operation will be rejected with an errorrnresponse. Furthermore, block reads and writes using the IEEE region should only bernperformed at even addresses, although no damage to the instrument will result in attemptingrnaccess at odd addresses. In general, the ‘number of words’ field, in the Modbus frame,rnshould be set to 2 times what it would have been for ‘normal’ Modbus.rnThe rules governing how the data in the two consecutive Modbus addresses are organisedrndepending on the ‘data type’ of the parameter.