heypauly2002
Member
Hello PLC group,
Hope you all had a wonderful Father's Day.
Has anyone seen CASE used like this.
CASE DcupLD_Step OF
1: _IO_EM_DO_11 := TRUE; (* turn on output to drive Z down, go to next step *)
DcupLD_Step := 2;
2: IF _IO_EM_DI_12 THEN (* Z down LS on, time to turn on vacuum to pick part *)
_IO_EM_DO_12 := TRUE; (* turn on vacuum *)
DcupLD_Step := 3;
END_IF;
3: IF _IO_EM_DI_17 THEN (* DcupLoad_VacuumOn is TRUE, part is on pick up tool *)
_IO_EM_DO_11 := FALSE; (* send Z up with part *)
DcupLD_Step := 4;
END_IF;
4: IF _IO_EM_DI_11 AND NOT _IO_EM_DI_15 THEN (* DcupLoad_Z_Up AND part removed from singulator *)
_IO_EM_DO_10 := TRUE; (* send Y out with part on tool *)
DcupLD_Step := 5;
END_IF;
5: IF _IO_EM_DI_14 THEN (* Y is out, Y out LS is ON, and ready to send Z down *)
_IO_EM_DO_11 := TRUE; (* send Z down with part on tool into the nest *)
DcupLD_Step := 6;
END_IF;
6: IF _IO_EM_DI_12 AND _IO_EM_DI_16 THEN (* Z is down and part is in the nesting *)
_IO_EM_DO_12 := FALSE; (* turn off the vacuum, drop off the part *)
DcupLD_Step := 7;
END_IF;
7: IF NOT _IO_EM_DI_17 THEN (* no vacuum, part is released, time to send Z up *)
_IO_EM_DO_11 := FALSE; (* send Z up without part *)
DcupLD_Step := 8;
END_IF;
8: IF _IO_EM_DI_12 AND _IO_EM_DI_16 THEN (* Z is up and part is in the nesting, released from tool *)
_IO_EM_DO_10 := FALSE; (* send Y back to home position *)
DcupLD_Step := 9;
END_IF;
9: IF _IO_EM_DI_13 THEN (* Y is at home position, ready for next cycle *)
DcupLD_Step := 0;
END_IF;
END_CASE;
??? I was trying to compact my decision making step/sequence logic IF THEN with my output section. The outputs would normally be a part of CASE. CASE SubStation_Step OF...
Hope you all had a wonderful Father's Day.
Has anyone seen CASE used like this.
CASE DcupLD_Step OF
1: _IO_EM_DO_11 := TRUE; (* turn on output to drive Z down, go to next step *)
DcupLD_Step := 2;
2: IF _IO_EM_DI_12 THEN (* Z down LS on, time to turn on vacuum to pick part *)
_IO_EM_DO_12 := TRUE; (* turn on vacuum *)
DcupLD_Step := 3;
END_IF;
3: IF _IO_EM_DI_17 THEN (* DcupLoad_VacuumOn is TRUE, part is on pick up tool *)
_IO_EM_DO_11 := FALSE; (* send Z up with part *)
DcupLD_Step := 4;
END_IF;
4: IF _IO_EM_DI_11 AND NOT _IO_EM_DI_15 THEN (* DcupLoad_Z_Up AND part removed from singulator *)
_IO_EM_DO_10 := TRUE; (* send Y out with part on tool *)
DcupLD_Step := 5;
END_IF;
5: IF _IO_EM_DI_14 THEN (* Y is out, Y out LS is ON, and ready to send Z down *)
_IO_EM_DO_11 := TRUE; (* send Z down with part on tool into the nest *)
DcupLD_Step := 6;
END_IF;
6: IF _IO_EM_DI_12 AND _IO_EM_DI_16 THEN (* Z is down and part is in the nesting *)
_IO_EM_DO_12 := FALSE; (* turn off the vacuum, drop off the part *)
DcupLD_Step := 7;
END_IF;
7: IF NOT _IO_EM_DI_17 THEN (* no vacuum, part is released, time to send Z up *)
_IO_EM_DO_11 := FALSE; (* send Z up without part *)
DcupLD_Step := 8;
END_IF;
8: IF _IO_EM_DI_12 AND _IO_EM_DI_16 THEN (* Z is up and part is in the nesting, released from tool *)
_IO_EM_DO_10 := FALSE; (* send Y back to home position *)
DcupLD_Step := 9;
END_IF;
9: IF _IO_EM_DI_13 THEN (* Y is at home position, ready for next cycle *)
DcupLD_Step := 0;
END_IF;
END_CASE;
??? I was trying to compact my decision making step/sequence logic IF THEN with my output section. The outputs would normally be a part of CASE. CASE SubStation_Step OF...