meta data for this page
  •  

uPLC Functional description

The uPLC program is scanned every 6 milliseconds. In each scan, the input is first read, the two timers are updated, the user program is scanned, and the output is updated. For this reason, reading the input and setting the output can vary by up to 6 ms relative to the physical event. If the microprocessor is overloaded (the operating mode is active, there are frequent serial requests, and the PLC program is long), it may take more than 6 ms to scan the entire program.

All pico-PLC instructions, with the exception of the arithmetic instructions, are single-bit instructions. The stack has a depth of only one bit.

The LD (LDN) instruction loads the bit defined as the operand onto the stack, while all the other logical instructions operate on the stack itself. The arithmetic instructions are executed only if the stack bit is set to 1.

The truth table for the logical operations is given below for the convenience of the user.

AND logical operation
bit Abit Bresult
000
010
100
111
OR logical operation
bit Abit Bresult
000
011
101
111

The negated operations ANDN and ORN follow the same logic, except that the negated value of the specified bit is used. They are always set to 0 when the converter is powered on.

The pico-PLC includes 9 constants for arithmetic operations. These are the constants most often used by typical applications. In addition, 17 word parameters are reserved — in particular from 8683 to 8700 — which can be stored and used as PLC parameters. These parameters are set to zero at every PLC start.

When the arithmetic operations (ADD, SUB, MUL, DIV) are used, the operands are treated as signed words. For double-word operations, the operands and the result are defined as follows: the parameter of the operand defines the least significant part, while the most significant part is represented by the next word.

After every arithmetic operation, bit 2 of 8671 is set to 0 if the result is positive and to 1 if it is negative. In the same way, bit 3 of 8671 is set to 1 if the result is 0 and to 0 if it is not 0. These settings remain active until the next arithmetic operation is executed.

A mathematical operation is executed by placing the result in one of the free parameters (Parameter 8674…8682).