The access to the data memory is different to each PLC. There are many marks and models of PLC. Some popular marks are Allen Bradley, Siemens, schneider-electric, Omron, Automation Direct among other. It is very difficult to talk about to access the processor memory in general way, so, a specific processor was chosen. The choice is a popular mark, that also it has free programming software and emulator. The result was Micrologix 1100 of Allen Bradley. In the future it will talk about others marks of PLC.
The micrologix 1100 has included I/O and also supports till 4 expansion modules. In total it can handle up to 144 digital I/O. It has RS-232/485 port, Ethernet port, 4k program memory, 4k data memory and LCD screen through which it can monitor and modify controller data. More details can be seen in the user manual.
Addressing data memory of the PLC
The PLC data memory is divided in files. Each file is of a specific data type. Nine default data files are created. These are:
- File 0, outputs (O0)
- File 1, inputs (I1)
- File 2, status (S2)
- File 3, binaries (B3)
- File 4, timers (T4)
- File 5, counters (C5)
- File 6, control registers (R6)
- File 7, de integers (N7)
- File 8, point floats (F8)
This memory distribution can be seen in RSLogixMicro.
Input and output address
The size of de output file is depending of the quantity of output modules in the PLC. For address of outputs, the format is as follows:
O:#output_module/#bit
Where #output_module is 0 for outputs on the base and 1, 2, 3 and 4 for output modules in the position 1, 2, 3 and 4 respectively, So, the address of the first output is O:0/0 and the address of the output 5 in the module on the position 3 is O:3/5.
The address of the input is very similar, just the “O” is changed for “I”. So, the address of the first input in the base is I:0/0 and the address of the input 6 in the module on the position 1 is I:1/6.
Binary and integer address.
Binaries and Integers are grouped in elements of 16 bits. The following format is used to address a bit: B3:#element/#bit or also B3/#bit, where the #element is omitted. In this sense, the address B3:1/1 and the address B3/17 are same, for example, like the next figure shows, in the position with the red x.
Integers are of 16 bits, so, an integer can represent numbers in the range of -32.768 a 32.767. The address of the integers have the follows format: N:#elemento, so, a valid address for a integer is N7:1, referring to second integer of the file N7. Also it can access a particular bit of an integer, for example to access the last bit of the N7:1 the next address is used N7:1/15.
Timers and counter address
The address to access the timers, counters, control register, floating point and states will be explained later, when appropriate.
Instruction set of the PLC
The Micrologix 1100 controller is programming with ladder diagram. Instruction set of the processor is divided en group of instructions, such as: binary, timers and counters, arithmetic, logical, compare, program control among others.
Input and output instructions
Instructions that write on the data memory are called output instruction and are put in the last position on the rung. The rest of instructions are called input instructions.
Bit instruction group
The most basic instruction group is the binary and which we will explain below, within this group include the following instructions:
- Normally open contact (-] [-, XIC), input instruction. In this instruction is assigned a binary address, for example, an input (I), an output (O) or a bit (B) and its behavior is as a relay whose coil is the associated address. If the address state is 0 (false), then the contact is open and there is no logical continuity, in other words, the instruction is false. If the address state is 1 (true), then the contact will close and there is logical continuity between its ends, in other words, the instruction is true.
- Normally closed contact (-]/[-, XIO), input instruction. In this instruction is assigned a binary address, for example, an input (I), an output (O) or a bit (B) and its behavior is as a relay whose coil is the associated address. If the address state is 0 (false), then the contact is closed and there is logical continuity, in other words, the instruction is true. If the address state is 1 (true), then the contact will open and there is no logical continuity between its ends, in other words, the instruction is false.
- One shot (-[ONS]-, ONS), input instruction. In this instruction is assigned a bit (B) and always has, at least, one instruction before it. The ONS instruction checks the state of instructions before it. When the state changes from false to true (rising edge), the ONS instruction is true during the time of one scan cycle. The instruction is false the rest of time.
- Output coil (–( )–, OTE), output instruction. In this instruction is assigned a binary address, for example, an output (O) or a bit (B). When the rung is false, the OTE instruction writes 0 in the corresponding address and when the rung is true, the OTE instruction writes 1 in the corresponding address.
- Output latch (–(L)–, OTL), output instruction. In this instruction is assigned a binary address, for example, an output (O) or a bit (B). When the rung is false, the OTL instruction does not do anything and when the rung is true, the OTL instruction writes 1 in the corresponding address.
- Output unlatch (–(U)–, OTU), output instruction. In this instruction is assigned a binary address, for example, an output (O) or a bit (B). When the rung is false, the OTL instruction does not do anything and when the rung is true, the OTL instruction writes 0 in the corresponding address.
The complete instruction set of the PLC can be found here. The next figure shows the ladder diagram for a typical motor start developed with RSLogixMicro. A start button is connected in the input I:0/0, a stop button is connected in the input I:0/1, the auxiliary contact is connected in the input I:0/2 and the starter coil is connected in the output O:0/0. When the start button is pressed the rung is true till output instruction, then the starter is activated, the auxiliary contact is activated and the motor starts even if the start button is released. If stop button is pressed, the output instruction is false and the motor is stopped. The program can download to RSEmulate using RSLinx and then be tested.
Pingback: » PLC: mis primeros pasosControl Real