CycleEncoder:
PROC = {
Truth Table
Pulse: TYPE = [0..10);
-- Inputs --
lD0: ARRAY Pulse OF Ports.Level ← [X, L, X, X, X, X, X, X, X, H];
lD1: ARRAY Pulse OF Ports.Level ← [X, L, X, X, X, X, X, X, H, L];
lD2: ARRAY Pulse OF Ports.Level ← [X, L, X, X, X, X, X, H, L, L];
lD3: ARRAY Pulse OF Ports.Level ← [X, L, X, X, X, X, H, L, L, L];
lD4: ARRAY Pulse OF Ports.Level ← [X, L, X, X, X, H, L, L, L, L];
lD5: ARRAY Pulse OF Ports.Level ← [X, L, X, X, H, L, L, L, L, L];
lD6: ARRAY Pulse OF Ports.Level ← [X, L, X, H, L, L, L, L, L, L];
lD7: ARRAY Pulse OF Ports.Level ← [X, H, L, L, L, L, L, L, L, L];
lEin: ARRAY Pulse OF Ports.Level ← [L, H, H, H, H, H, H, H, H, H];
-- Outputs --
lO0: ARRAY Pulse OF Ports.Level ← [L, L, H, L, H, L, H, L, H, L];
lO1: ARRAY Pulse OF Ports.Level ← [L, L, H, H, L, L, H, H, L, L];
lO2: ARRAY Pulse OF Ports.Level ← [L, L, H, H, H, H, L, L, L, L];
lGS: ARRAY Pulse OF Ports.Level ← [L, L, H, H, H, H, H, H, H, H];
lEout: ARRAY Pulse OF Ports.Level ← [L, H, L, L, L, L, L, L, L, L];
FOR pulse: Pulse
IN Pulse
DO
p[D0].l ← lD0[pulse];
p[D1].l ← lD1[pulse];
p[D2].l ← lD2[pulse];
p[D3].l ← lD3[pulse];
p[D4].l ← lD4[pulse];
p[D5].l ← lD5[pulse];
p[D6].l ← lD6[pulse];
p[D7].l ← lD7[pulse];
p[Ein].l ← lEin[pulse];
p[O0].l ← lO0[pulse];
p[O1].l ← lO1[pulse];
p[O2].l ← lO2[pulse];
p[GS].l ← lGS[pulse];
p[Eout].l ← lEout[pulse];
Eval[];
ENDLOOP;
}; --CycleEncoder