uPLC Functional description

The uPLC program is scanned every 6milliseconds. With this sampling, 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 6ms with respect to the physical event. If the microprocessor is overloaded with work (the operating mode is active, there are frequent serial requests and the PLC program is long), it may take more than 6 milliseconds to scan the entire PLC program.

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

The LD (LDN) instruction loads the bit defined as the operant on the stack with all the other logical instructions work 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 A	bit B	result
1
1
1	1	1
OR logical operation
bit A	bit B	result
1	1
1	1
1	1	1

The respective negative operations ANDN and ORN follow the same logic except that the negated value of the bit specified will be used.

They are always set to 0 when the converter is powered on.

The pico­PLC includes 9 constants for arithmetic operations. These can be the constants most used by normal applications. 17 more word parameters are reserved, in partuclar from 8683 to 8700, which can be stored and used as PLC parameters. These parameter will be set to zero at every PLC starts.

When the arithmetic operations (ADD, SUB, MUL, DIV) are used, the operators are assumed to be words and are signed. In the mathematical operations on double words, 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, the bit 2 of 8671 is set to 0 if the result is positive and set to 1 if it is negative. In the same waythe bit 3 of 8671 is set to 1 if the result is 0 and set to 0 if it is not 0. These settings remain active until the next arithmetic operation is executed.

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