Error In address


Recommended Posts

Actually it is there, but its 0000. You can't put h8000 into the address field as the h will stop conversion of the string to a number and result in 0, thus what you are seeing. The h in your docs probably means hex, which means you need to convert it into decimal before using. 8000 hex is 32768 in decimal. The problem is that this is the same as 2769 in standard modbus notation, so you need to create an extra tag that reads address 50,000 even if you don't have a value there. You only have to read it once, though with QuickMod Pro you'll probably just leave it.

The reason for this is that Modbus actually has two addressing schemes. There is the 40,000 scheme, where addresses are between 0-9999 for coils, 10,001 - 19,999 for input status, 30,001 - 39,999 for input registers, and 40,001 and 49,999 for holding registrers. The thing is, these numbers are not actually in the Modbus protocol frame. When you say you want register 40,001, the frame actually contains address 0. The "4" says its a holding register and so command "3" is used (I don't know why its backwards, since input registers "3" result in command "4"). DAQFactory, however, simply throws this number away, and subtracts one. You have to tell it which command you want. This is because of the many different numeric formats.

So, many devices use this 40,000 notation, but many others use the addressing used in the frame and simply specify the command. So, they start at 0. This is especially true in devices that have more than 10,000 registers. The modbus frame, technically can support 65536 different addresses provided you use this notation and not the 40,000 notation (which is limited to 9,999).

DAQFactory tries to automatically detect which notation you are using based on the values. As long as you only specify addresses below 30,000, it assumes you are using 0 based notation (the second type I described). If you read an address between 30,000 and 50,000 it switches over to 40,000 based notation (the first type I described). The problem is that, like in your case, you have an address that is in 0 based notation, but is really big and so falls in the 30,000 to 50,000 range. To keep DAQFactory from switching to the 40,000 notation mode, you have to read a value above 50,000 which locks DAQFactory into 0 index mode for that device.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.