http://bbs.csdn.net/topics/390977511? Page=1 # post - 398941257
Do with VB6 development and instrument communication, now reading parameter instrument display number less than 65535 can be read normal, as Long as more than 65535 the number of the instrument, communication back to the frame of data is 8000 h, converted to a decimal is 32768, write less than the number of 32767 when writing parameters can modify the data on the instrument properly, but writing is more than 32767 the number of the instrument is returned an error response code 03, can't change, also asked a lot of places, many say a type's definition, may have a problem what Integer to Long, it may not seem like this problem, can't see themselves under communication manuals, there was a place where translation feeling and I'm a little problem, the problem on the manual says a parameter is 16, so seems to be said more than 16 under how to read and write, but their translation is not very understand what to do, now sent to you to see whether help my problem under analysis and manual said this chapter, specific how should handle? Thank you very much!
7. CHAPTER 7 Modbus and EI Bisynch
The ADVANCED switchable viewer
7.1. The ACCESS TO the FULL RESOLUTION FLOATING POINT AND
TIMING DATA (MODBUS ONLY)
One of the main limitations of the Modbus is that only 16 bit integer representations of the data can
Normally be transferred. In most cases, this does not cause a problem, since appropriate
Scaling can be applied to the values without losing precision. Indeed all values displayable on
The 4 digit Series 2000 front panel may be transferred in this way. The clear this from the
Significant drawback that the scaling factor to be applied needs to be known at both ends of the
The communications link.
One further problem is that certain 'time' parameters, notably those 2 for the programmer
The function are always returned over the communications link in seconds. It is possible for long
16 bit durations to overflow the Modbus limit.
To overcome these problems, a sub protocol has had been defined, using the upper portion of the
The Modbus address space (8000 h and upwards), allowing full 32 bit resolution floating point
And The timer parameters. The upper area is known as The IEEE region.
This sub - protocol provides two consecutive Modbus addresses for all The parameters. The base
Address for any given parameter in the IEEE region can easily be calculated by taking its
Normal Modbus address, doubling it, and adding 8000 h. For example, the address in the
The IEEE region of the Target Setpoint (Modbus address 2) is simple
2 x 2 + 8000 h=8004 h=32772 decimal
This calculation applies to any parameter that has a Modbus address.
Access to the IEEE area is made via block reads (Functions provides 3 & amp; 4) and writes (16 Function
Attempts to use the "Write a Word" (6) the Function operation will be rejected with the an error
The response. Furthermore, the block reads and writes using the IEEE region should only be
Performed at even addresses, day no damage to the instrument will result in attempting
Access the at odd addresses. In general, the number of words' field, In the Modbus frame,
Should be set to 2 times what it he have had for the 'normal' Modbus.
The rules governing how The data in The two consecutive Modbus addresses are organised
Depending on the 'data type of the parameter.
CodePudding user response:
The passage says that general equipment he USES 16 bits of data to expressed, which is from 0 to 65535, then such as divided by 10 to figure out numericalIf need higher precision of data, from the Modbus address area of more than 8000 h to read, that USES the 32-bit floating-point
That you like in the original post
Need to send 02 03 81 42 00 02 XX XX (XX XX is check code, I'm too lazy to calculate]
CodePudding user response:
Oh, say write back to use function code 16, if written in 06 will return an errorCodePudding user response: