The following commands make use of a RelayNumber parameter, which are always 16-bit values.  The RelayNumber is a the number of the relay you would like to control.  This RelayNumber variable is converted into LSB and MSB values, which is subsequently communicated to the controller.

RelayNumber = The Relay Number you would like to control.

LSB = ((RelayNumber) And 255)
MSB = (((RelayNumber) And 65280) / 255)

Since most users will be working with less than 256 relays, the following substitutions can be made to help simplify this process:

LSB = Relay Number (0 to 255)
MSB = 0

Should you need to speak to more than 256 relays, changing the MSB to 1 will only speak to relays above 256.  The following values will only talk to relays 256 to 511:

LSB = Relay Number (0 to 255)
MSB = 1 (This will send the LSB above to relays 256 through 512)

Commands Below are in Hex Format using API Mode. TX = Bytes Sent to the Controller RX = Bytes Received from the Controller.  Note Bytes Received May be Different for Some Commands.

TX:234LSBMSBCKSFunctionRX:234
AA04FE2C0000D8Read the Status of Relay 1AA0100AB
AA04FE2CFF00D7Read the Status of Relay 256AA0100AB
AA04FE2C0001D9Read the Status of Relay 257AA0100AB
AA04FE2E0000DATurn Off All Relays then Activate Relay 1AA015500
AA04FE2EFF00D9Turn Off All Relays then Activate Relay 256AA015500
AA04FE2E0001DBTurn Off All Relays then Activate Relay 257AA015500
AA04FE2F0000DBTurn Off Relay 1AA015500
AA04FE2FFF00DATurn Off Relay 256AA015500
AA04FE2F0001DCTurn Off Relay 257AA015500
AA04FE300000DCTurn On Relay 1AA015500
AA04FE30FF00DBTurn On Relay 256AA015500
AA04FE300001DDTurn On Relay 257AA015500