// fill the writeBuffer with LED vars WriteB[0]:=$FF; WriteB[1]:=$FF; WriteB[2]:=$FF; WriteB[3]:=$FF; (* // only Code request PKeyB := Get_TCPKey; *) if Init_TCP(c_nr) = (VersionID + c_nr )then begin // c_nr is Controller index PKeyB := TCPTransfer(@WriteB); if PKeyB^.KeyResult then begin // process the key events in Buffer[3], Buffer[4] if PKeyB^.Buffer[4] >= 1 then begin bKeyCode := PKeyB^.Buffer[3]; // Matrix KeyCode end; // process switches bSwitch0 := PKeyB^.Buffer[5]; // Input-Port0 bSwitch1 := PKeyB^.Buffer[6]; // Input-Port1 bSwitch2 := PKeyB^.Buffer[7]; // Input-Port2 bSwitch3 := PKeyB^.Buffer[8]; // Input-Port3 end; end else begin // transfer error end; // the Module can be leaved open for loops, but close it on program end Close_TCP;