UF3300 Modbus
If the register to be updated is read, then the value that was written to it
will often be returned despite the operation failing. An example of this
are the damping registers. The update of the unit is triggered by a low
to high transition and not simply by setting the bit high. Since the value
has already been set in the register, and providing it has not been
overwritten, all that is required to try again is to clear then set the
update bit once more. Leave a few hundred milliseconds between
these operations.
13.6
Some Examples
13.6.1
Unpacking Time and Date
The following pseudocode may be useful in unpacking time and date.
uint32 timeNdate; // allocate a 32-bit holding value.
uint16 year, month, day, hour, minute, second;
// Read the time and date starting at register offset 8.
timeNdate = Read2HoldingRegisters(8);
// Extract elements
second = timeNdate mod 2^6;
timeNdate = timeNdate div 2^6;
minute = timeNdate mod 2^6;
timeNdate = timeNdate div 2^6;
hour = timeNdate mod 2^5;
timeNdate = timeNdate div 2^5;
Day = timeNdate mod 2^5;
Page 28