I am trying to figure out how to get this background logic program to work right. Right now when i have DI 197, 198, 201 or 202 ON all 3 of my flags go on. I realized that is because the OR statement is not working how i thought. I am trying to clean my program up by using these flags so its not so convoluted. Basically i want any of the 197 198 201 202 DI ON and look for other DI to be ON or OFF to make that flag ON.
Any thoughts or help is appreciated.
Background program
6: F[4:Unload OP20]=(DI[197:UnloadOP20T1Chk1] OR DI[198:UnloadOP20T1Chk2] OR DI[201:UnloadOP20T2Chk1] OR DI[202:UnloadOP20T2Chk2] AND DI[204:UnloadOP20forGage]=OFF AND DI[224:OP20 SPC Cycle]=OFF AND DI[131:Start Task]=ON) ;
7: ;
10: F[7:UnloadOP20forGage]=(DI[197:UnloadOP20T1Chk1] OR DI[198:UnloadOP20T1Chk2] OR DI[201:UnloadOP20T2Chk1] OR DI[202:UnloadOP20T2Chk2] AND DI[204:UnloadOP20forGage]=ON) ;
11: ;
12: F[8:Unload OP20 SPC]=(DI[197:UnloadOP20T1Chk1] OR DI[198:UnloadOP20T1Chk2] OR DI[201:UnloadOP20T2Chk1] OR DI[202:UnloadOP20T2Chk2] AND DI[224:OP20 SPC Cycle]=ON AND DI[131:Start Task]=ON) ;
13: ;
/END