Modbus protocol, HVAC system control

J

Thread Starter

JD

Hello all, Hope someone reads this thread and can possibly offer some insight.

I have a question about the difference in protocol of return strings, sent from a modbus simulation software application, and an actual HCAV system harware return string.

I'm sending a poll request for 1 zone, 1 holding register,(temp value). I'm looking at the bitwize vlau information, of byte 5, and everything is working perfectly, and as it should when connected to the simulation software application, however when the same poll reqeust is send connected to an HVAC system hardware,( should be same protocol, I'm getting an incorrect value form the holding register.

Can anyone offer and information, or insight to this? please?

Thanks,
 
J

Jerry Miille

You are probably reading the "wrong" register. There are two addressing methods commonly found in Modbus implementations. Some are "1" based and some are "0" based. Your simulator adheres to one method and the HVAC system the other.

Try reading one register number higher or lower and see if you can match up the data.

We sell protocol converter modules and always instruct a potential user to test by reading a known value and if the value returned is not correct then try an address one higher or one lower. It is a very common problem and we have a configuration switch to compensate for this in our products.

Jerry Miille
 
The register number could be off by a one, depending on whether the registers are numbered from zero or one. Offsetting your register value by one might pull the correct data.

You could be reading the wrong pair of floating point registers, with the wrong byte order, for instance exponent 1 mantissa 2

mantissa 1
exponent 1
mantissa 2
exponent 2

Carl
 
It is not unusual to have byte reversal issues. One of the devices, Host or Slave, should have a Data Byte Reversal Configuration field. An example of byte reversing 12345 is 0x3039 and 0x3930. It gets more complicated with IEEE Floating Point dual registers which may also be at play. For example 12345.0 (0x46 40 e4 00) as a Floating point can come at you as:

0x46 40 e4 00 or
0x40 46 00 e4 or
0xe4 00 46 40 or
0x00 e4 40 46
 
Hi,

I do not see enough information to determine exactly what is wrong. One thing I do see is you say 1 byte. A holding register is 2 bytes.

The exact message request and response would get you a more definitive answer.

Good luck,

Mark
http://www.peakhmi.com/

 
You haven't really given us enough information to go on. The most common problem that people have with Modbus isn't the protocol, it's the vendor documentation. A lot of vendors will write their documentation according to how things would map into the data table of a particular model of PLC, rather than according to what the actual Modbus protocol standard says. That's very nice and "helpful" if you are using that particular PLC, but it just confuses everyone who is using anything else.

I have a brief explanation of the Modbus protocol at the following URL:

http://mblogic.sourceforge.net/mbapps/ModbusBasics-en.html

You may wish to pay particular attention to the section titled: "Some Common Misconceptions about Modbus Addresses".

If you would like to give us some more details about what you are doing, we may be able to provide a more direct response.
 
Top