TRY IT THIS WAY AND SEE IF IT WORKS
IF DM[1] < DM[2] THEN
SETBIT RELAY[1],5
'CLRBIT RELAY[1],5
ENDIF
RELAY 5 ON BANK ONE THE RELAYS GO FROM 0 TO 15 PER BANKS SO IF YOU WANT TO TURN ON RELAY 18 THEN YOU GO SETBITRELAY [2],1 THE SAME TO CLEAR CLRBIT RELAY[2],1
EXAMPLE:
B1 = 0 TO 15; B2 = 16 TO 31 BUT PROGRAMICALLY WILL BE 0 TO 15 TOO WHAT MAKE THE DIFFERENCE IS THE BANK NUMBER 1,2,3,4 AND SO ON. SETBIT RELAY[B2],1 = TURN ON RELAY 18 REMEBER WE START FROM 0 SO RELAY 16 IN REAL TERM IS 17 + 1 = #18 ON BANK 2
USE THE SETBIT TO ENERGIZE USE CLRBIT TO DE-ENERGIZE
I HOPE YOU GET IT...