MBLogic for an open world in automation
This page provides a description of each instruction list (IL) instruction used in the Ck soft logic library. "Ck" is a soft logic library which is modeled closely on the Koyo "Click" PLC. The Ck library is not intended to provide an exact emulation of the "Click". Rather it is intended to provide an instruction set which is similar enough to the "Click" that someone who is already familiar with the "Click" will understand the "Ck" library fairly easily.
The most significant difference between the two systems is the Koyo "Click" does not have a documented IL instruction set. The IL instructions used below have been interpolated from a combination of the ladder instructions used by the "Click", and the IL instructions used in the Koyo DL-205.
This document is not intended as a primer in PLC programming in general or in IL programming. The reader is assumed to be already familiar with PLC programming concepts, conventions, and terminology.
Select (click on) a heading for details on any of the following instructions.
An explanation of the logic stack, and how it is used when executing boolean instructions.
Instruction | Instr Type | Description |
---|---|---|
// | Program Formatting | Comment line |
AND | Boolean input | AND bit with top of logic stack |
ANDE | Compare | AND if parm1 equals param2 |
ANDGE | Compare | AND if parm1 >= parm2 |
ANDGT | Compare | AND if parm1 > parm2 |
ANDLE | Compare | AND if parm1 <= parm2 |
ANDLT | Compare | AND if parm1 < parm2 |
ANDN | Boolean input | AND NOT bit with top of logic stack |
ANDND | Edge contact | AND negative differential |
ANDNE | Compare | AND if parm1 is not equal to parm2 |
ANDPD | Edge contact | AND positive differential |
ANDSTR | Boolean input | AND top two values on logic stack |
CALL | Program control | Call subroutine |
CNTD | Counter/Timer | Count down |
CNTU | Counter/Timer | Count up |
COPY | Copy | Copy a single value to a register |
CPYBLK | Copy | Copy a block of data |
END | Program control | Program end |
ENDC | Program control | Program end conditional |
FILL | Copy | Fill a block of data |
FINDEQ | Search | Search table for equal to |
FINDGE | Search | Search table for >= |
FINDGT | Search | Search table for > |
FINDIEQ | Search | Incremental search table for equal to |
FINDIGE | Search | Incremental search table for >= |
FINDIGT | Search | Incremental search table for > |
FINDILE | Search | Incremental search table for <= |
FINDILT | Search | Incremental search table for < |
FINDINE | Search | Incremental search table for not equal |
FINDLE | Search | Search table for <= |
FINDLT | Search | Search table for < |
FINDNE | Search | Search table for not equal |
FOR | Program control | For/next loop |
MATHDEC | Math | Decimal math |
MATHHEX | Math | Hexadecimal math |
NETWORK | Program Formatting | Network |
NEXT | Program control | Next in For/next loop |
OR | Boolean input | OR bit with top of logic stack |
ORE | Compare | OR if parm1 equals parm2 |
ORGE | Compare | OR if parm1 >= parm2 |
ORGT | Compare | OR if parm1 > parm2 |
ORLE | Compare | OR if parm1 <= parm2 |
ORLT | Compare | OR if parm1 < parm2 |
ORN | Boolean input | OR NOT bit with top of logic stack |
ORND | Edge contact | OR negative differential |
ORNE | Compare | OR if parm1 is not equal to parm2 |
ORPD | Edge contact | OR positive differential |
ORSTR | Boolean input | OR top two values on logic stack |
OUT | Boolean output | Output logic stack to bit |
OUT | Boolean output | Output logic stack to multiple bits |
PACK | Copy | Pack bits into a register |
PD | Boolean output | Output logic stack one shot to multiple bits |
PD | Boolean output | Output logic stack one shot |
RST | Boolean output | Reset multiple bits if logic stack true |
RST | Boolean output | Reset bit if logic stack true |
RT | Program control | Return from subroutine |
RTC | Program control | Return from subroutine conditional |
SBR | Program control | Define a subroutine |
SET | Boolean output | Set multiple bits if logic stack true |
SET | Boolean output | Set bit if logic stack true |
SHFRG | Shift register | Shift register move bits to right |
STR | Boolean input | Store bit onto logic stack |
STRE | Compare | STR if parm1 equals parm2 |
STRGE | Compare | STR if parm1 >= parm2 |
STRGT | Compare | STR if parm1 > parm2 |
STRLE | Compare | STR if parm1 <= parm2 |
STRLT | Compare | STR if parm1 < parm2 |
STRN | Boolean input | Store NOT bit onto logic stack |
STRND | Edge contact | STORE negative differential |
STRNE | Compare | STR if parm1 is not equal to parm2 |
STRPD | Edge contact | STORE positive differential |
SUM | Math | Sum a range of registers |
TMR | Counter/Timer | On delay timer |
TMRA | Counter/Timer | On delay accumulating timer |
TMROFF | Counter/Timer | Off delay timer |
UDC | Counter/Timer | Up/down counter |
UNPACK | Copy | Unpack bits from a register |