sdg.marinusvz
2020-10-16 08:45
First of all, you cannot multidrop if you connect through the internal GPRS modem.
Secondly, if you communicate through the RS485, you can multidrop.
However, the multidrop address is worked out implicitly from the meter serial number, and you cannot set it.
The system will automatically work out what the DLMS HDLC multidrop address is, and communicate to the meter using that addresss.
The formula we use is as follows:
long left = Long.parseLong(meter.substring(meter.length()-8, meter.length()-4))+16;
left = left << 1;
long l1 = (left & 0xFF00);
l1 = l1 << 1;
left = (left & 0x00FF) | l1;
long right = Long.parseLong(meter.substring(meter.length()-4))+16;
right = right << 1;
long r1 = (right & 0xFF00);
r1 = r1 << 1;
right = (right & 0x00FF) | r1;
// put them together into what we expect to see in the HDLC...
long all = (left << 16) | right;
all = ((all&0xFF) >> 1)
| ((all&0xFF00) >> 2)
| ((all&0xFF0000) >> 3)
| ((all&0xFF000000) >> 4);
serverAddr = (int)all;