Neither the serial number nor the PLM revision number is useful in determining PLM memory size. Smarthome came up with an algorithm that works. It is somewhat roundabout but is now being used by the UDI ISY product to make that determination with success. The premise of this technique is that the memory model in the PLM wraps the memory address if outside the valid range.
Step 1 – retrieve the current data from locations 0FFF, 1FFF and 3FFF using Set MSB Peek commands and save the values.
Step 2 – write an 01 into 0FFF, an 02 into 1FFF and 03 into 3FFF using Set MSB Peek Poke commands.
Step 3 – read the current values from locations 0FFF, 1FFF and 3FFF, using Set MSB Peek commands.
If the data returned is 01 02 03 then all three addresses were valid and the PLM has large memory. The first link record address is 3FF8.
If the data returned is 03 03 03 then 1FFF and 3FFF do not exist and the PLM has small memory. The first link record address is 0FF8.
Step 4 – restore the saved values from step 1 using Set MSB Peek Poke, restoring in the same sequence as the data was retrieved.
The sequence of data addresses read and written is important.
If this is a Broadcast message being sent because one of the relays changed state there is no way to determine from the message which relay state change generated the Broadcast message. By Querying the relay states in the beginning and comparing the last saved state bit pattern to the new state bit pattern is the only way to know which relay was changed.
Yes, you can turn on/off a specific relay without affecting the state of the other relays. Output On 0x45 turns On the relay number specified in cmd2 field. The cmd2 relay number value ranges from 0-7 for relays 1-8. Output Off 0x46 turns Off the relay number specified in cmd2. The cmd2 relay number ranges from 0-7 for relays 1-8. Cmd2 for these commands is NOT a bit mask but the actual relay number relative to zero. The cmd2 value in the ACK response is a bit map of the current relays which are On.