5
« on: December 10, 2015, 06:11:48 AM »
Can anyone suggest a more efficient way to write this statement.
It is used 5 times in the program with D=0 thur 4
The way it is currently written uses up way to much memory.
IF D=0 AND DM[2] = DM[41] AND DM[647]=1 'PROD1 BAY1 SELECTED
DM[20]=A 'BAY1 HSC SET POINT
DM[430]=1
ELSEIF D=0 AND DM[2]= DM[41] AND DM[647]=2 'PROD1 BAY2 SELECTED
DM[20]=F 'BAY2 HSC SET POINT
DM[430]=2
ELSEIF D=0 AND DM[2]= DM[41] AND DM[647]=3 'PROD1 BAY3 SELECTED
DM[20]=B 'BAY3 HSC SET POINT
DM[430]=3
ELSEIF D=0 AND DM[2]= DM[41] AND DM[647]=4 'PROD1 BAY4 SELECTED
DM[20]=G 'BAY4 HSC SET POINT
DM[430]=4
ELSEIF D=0 AND DM[2]= DM[41] AND DM[647]=5 'PROD1 BAY5 SELECTED
DM[20]=C 'BAY5 HSC SET POINT
DM[430]=5
ELSEIF D=0 AND DM[2]= DM[41] AND DM[647]=6 'PROD1 BAY6 SELECTED
DM[20]=E 'BAY6 HSC SET POINT
DM[430]=6
ELSEIF D=0 AND DM[2]= DM[41] AND DM[647]=7 'PROD1 BAY7 SELECTED
DM[20]=H 'BAY7 HSC SET POINT
DM[430]=7
ELSEIF D=0 AND DM[2]= DM[41] AND DM[647]=8 'PROD1 BAY8 SELECTED
DM[20]=I 'BAY8 HSC SET POINT
DM[430]=8
ELSE DM[430]=0
DM32[375]=0
ENDIF
IF D=0 AND DM[22] = DM[42] AND DM[487]=1 'PROD2 BAY1 SELECTED
DM[20]=A 'BAY1 HSC SET POINT
DM[431]=1
ELSEIF D=0 AND DM[22]= DM[42] AND DM[487]=2 'PROD2 BAY2 SELECTED
DM[20]=F 'BAY2 HSC SET POINT
DM[431]=2
ELSEIF D=0 AND DM[22]= DM[42] AND DM[487]=3 'PROD2 BAY3 SELECTED
DM[20]=B 'BAY3 HSC SET POINT
DM[431]=3
ELSEIF D=0 AND DM[22]= DM[42] AND DM[487]=4 'PROD2 BAY4 SELECTED
DM[20]=G 'BAY4 HSC SET POINT
DM[431]=4
ELSEIF D=0 AND DM[22]= DM[42] AND DM[487]=5 'PROD2 BAY5 SELECTED
DM[20]=C 'BAY5 HSC SET POINT
DM[431]=5
ELSEIF D=0 AND DM[22]= DM[42] AND DM[487]=6 'PROD2 BAY6 SELECTED
DM[20]=E 'BAY6 HSC SET POINT
DM[431]=6
ELSEIF D=0 AND DM[22]= DM[42] AND DM[487]=7 'PROD2 BAY7 SELECTED
DM[20]=H 'BAY7 HSC SET POINT
DM[431]=7
ELSEIF D=0 AND DM[22]= DM[42] AND DM[487]=8 'PROD2 BAY8 SELECTED
DM[20]=I 'BAY8 HSC SET POINT
DM[431]=8
ELSE DM[431]=0
ENDIF
It continues on for a total of 13 Products