Tag Archives: plc programming tutorial

PLC programming tutorial – Shift and rotate


Basic PLC programming tutorial for Beginners how to work with Shift and rotate instructions in TIA V13 and how to work in TIA Portal V13/V14. Content: – Shift right (SHR) – Shift left (SHL)



[youtube=https://www.youtube.com/watch?v=dsK13nqiQuo&w=320&h=266]

Basic PLC programming tutorial for Beginners how to work with Shift and rotate instructions in TIA V13 and how to work in TIA Portal V13/V14. Content: – Rotate right (ROR) – Rotate left (ROL)


[youtube=https://www.youtube.com/watch?v=s_8XKxtXNT0&w=320&h=266]

PLC programming tutorial – Word logic operations


Basic PLC programming tutorial for Beginners how to work with word logic operations in TIA V13 and how to work in TIA Portal V13/V14. Content: – AND logic operation (AND) – OR logic operation (OR) – EXCLUSIVE OR logic operation (XOR) – Create ones complement (INVERT) – Decode (DECO)

[youtube=https://www.youtube.com/watch?v=7qvubojlQN8&w=320&h=266]


Basic PLC programming tutorial for Beginners how to work with word logic operations in TIA V13 and how to work in TIA Portal V13/V14. Content: – Encode (ENCO) – Select (SEL) – Multiplex (MUX) – Demultiplex (DEMUX)

[youtube=https://www.youtube.com/watch?v=nio6BJ5Buts&w=320&h=266]


PLC programming tutorial – Program control operations


Basic PLC programming tutotrial for Beginners how to work with program control operations in TIA V13 and ho to work in TIA Portal V13/V14. Content: – Jump if RLO = 1 (–(JMP)) – Jump if RLO = 0 (–(JMPN)) – Jump label (Label)

[youtube=https://www.youtube.com/watch?v=PS3cYlwtHyQ&w=320&h=266]



Basic PLC programming tutorial for Beginners how to work with program control operations in TIA V13 and how to work in TIA Portal V13/V14. Content: – Define jump list (JMP_LIST) – Jump distributor (SWITCH) – Return (–(RET))


[youtube=https://www.youtube.com/watch?v=_U_t30Szdm8&w=320&h=266]

PLC programming tutorial – Move operations


Basic PLC programming tutorial for Beginners how to work with move operations in TIA V13 and how to work in TIA Portal V13/V14. Content: – Move value (MOVE) – Deserialize – Serialize


[youtube=https://www.youtube.com/watch?v=bneq9NUk2Vs&w=320&h=266]

Basic PLC programming tutorial for Beginners how to work with move operations in TIA V13 and how to work in TIA Portal V13/V14. Content: – Move block (MOVE_BLK) – Move block (MOVE_BLK_VARIANT) – Move block uninterruptible (UMOVE_BLK)

[youtube=https://www.youtube.com/watch?v=GGyxZU9Xi6Y&w=320&h=266]
Basic PLC programming tutorial for Beginners how to work with move operation in TIA V13 and how to work in TIA Portal V13/V14.

Content: – Fill block (FILL_BLK)

– Fill block uninterruptible (UFILL_BLK)

– Swap (SWAP)



[youtube=https://www.youtube.com/watch?v=wDQYAxSmU5g&w=320&h=266]


PLC programming tutorial – Math operations


Basic PLC programming tutorial for Beginners how to work with math operations in TIA V13 and how to work in TIA Portal V13/V14. Content: – Calculate (CALCULATE) – Add (ADD) – Subtract (SUB) – Multiply (MUL) – Divide (DIV)

[youtube=https://www.youtube.com/watch?v=FyVvbvbTCUA&w=320&h=266]


Basic PLC programming tutorial for Beginners how to work with math operations in TIA V13 and how work in TIA Portal V13/V14. Content: – Return remainder of division(MOD) – Create twos complement (NEG) – Increment (INC) – Decrement (DEC) – Form absolute value(ABS) – Get minimum (MIN) – Get maximum (MAX) – Set limit value (LIMIT)

[youtube=https://www.youtube.com/watch?v=K-ZV62zLSU8&w=320&h=266]

Basic PLC programming tutorial for Beginners how to work with math operations in TIA V13 and how to work in TIA Portal V13/V14. Content: – Form square (SQR) – Form square root (SQRT) – Form natural logarithm (LN) – Form exponential value (EXP) – Form sine value (SIN) – Form cosine value (COS)

[youtube=https://www.youtube.com/watch?v=KxmM8N54mdE&w=320&h=266]

Basic PLC programming tutorial for Beginners how to work with math operations in TIA V13 and how to work in TIA Portal V13/V14. Content: – Form tangent value (TAN) – Form arcsine value (ASIN) – Form arccosine value (ACOS) – Form arctangent value (ATAN) – Return fraction (FRAC) – Exponentiate (EXPT)

[youtube=https://www.youtube.com/watch?v=aq17dMQsJtk&w=320&h=266]


PLC ladder programming principles and programming methods

(1) Input / output relay, internal auxiliary relays, timers, counters and other devices of the contact can be used repeatedly, without complex program structure to reduce the use of contacts. (2) Each line ladder left the bus started, the coil terminates at the right bus. Contacts are not on the right side of the coil, as shown below

(3) In addition to stepping procedure, any coils, timers, counters, and other advanced instruction can not be directly connected to the left bus bar.
(4) In the process, does not allow the same number twice coil output (dual coil output). The following ladder is not allowed.

(5) does not allow the bridge circuit.

(6)Shall be prepared by the sequential program from top to bottom, from left to right to prepare the way. To reduce the number of steps in the implementation of the program, the program should be to the left and right big small big small.

(7) as an input device with a normally open contact

(8) PLC programming experience commonly Design
In the traditional relay – contactor control diagram and typical PLC based control circuit, based on the experience accumulated translation, revised and improved to give final control procedures.

STEP 7 hardware configuration tool HW Config

Select the SIMATIC manager on the left side of the station, double-click the right window of the “hardware” icon, open the hardware configuration tool HW Config

(1) hardware directory


You can use the menu command to “view”, “directory” or the button on the toolbar to open or close the hardware directory window on the right. Select a hardware directory in a hardware object, the hardware directory below the small window to see its brief information, such as the main function of the order number and module, etc..
CP hardware directory is a communication processor, FM is a function module, IM is the interface module, PS is the power module, RACK is the rack or guide rail. SM is a signal module, in which the DO, AI respectively is the digital quantity input module and the digital quantity output module, AO, DI respectively is the analog quantity input module and the analog quantity output module.


(2) hardware configuration window


Figure 2-20 the upper left window is the hardware configuration window, the window is placed in the host frame and the expansion of the rack, and use the interface module to connect them. PROFIBUS-DP network can also be generated in the window, and placed DP from the station on the network.


(3) hardware information display window


Select the hardware configuration window in a rack or DP slave station, the following hardware information display window will display the detailed information of the selected object, such as module order numbers, CPU firmware version number and in the MPI Network station address, and I / O module address and annotations. The upper left corner of the window button is used to switch the rack or DP slave station in the hardware configuration window.

Omron PLC high-speed counter reset method

Omron PLC high-speed counting the number of reset mode, choose Z signal + software reset and soft reset in two ways.
 
       1. Z signal + software reset mode

 
       High-speed counter reset flag is ON state, Z-phase signal and reset input OFF → ON time by the high-speed counter current value is reset. The case of addition, since the reset flag is ON, 1 cycle 1, can be determined only in the common process, and therefore occur in the ladder program OFF → ON from the beginning of the next cycle Z-phase signal is active again.

 
       2. Soft reset mode

 
       When high-speed counter reset flag from OFF to ON, the high-speed counter current value is reset. In addition, the reset flag OFF to ON determination 1 cycle 1, carried out in the common process, the reset process is also the time. However, in the middle of a cycle period when ON to OFF change, reset flag is Dhamma track.

Omron PLC programming software to use the function block

Omron PLC programming software also increases the function block function block preparation software features to IEC61131-3
A function block call a ladder example
The main purpose is to promote good function block structured programming, function calls; allow complex programs to create less code, more manageable process.
A block from the block header and block body composition
Physique – to be used in the function block program data: as a variable input and output connections, the function block variables, parameters are defined locally within a block – parameters.
Blocks may contain instructions algorithm – this is the actual code for each function block execution. Call, the corresponding input and output variables corresponding to the actual variable substitution. Not all PLC function blocks can be created.
The function block can be established Omron PLC: CJ1M, CJ, CS, CP1H / L, etc;
The number of each type of PLC function blocks that can be created is different. You can define up to 64 function blocks in the PLC, up to 30,000 write statements.
Steps for creating and using function blocks
A, PLC must be a valid PLC type.
Second, the definition of the function block is created. Select the appropriate function block type: ladder or structured text; the new block is created, its name will default to ‘block’.
Third, it is to open the block for editing, including setting a variable using function blocks in the block header; block the use of written algorithms function block ladder structured editor or a text editor to write.
Fourth, created after the function block can be called in the main program using the ladder diagram editor.
If a specific function block already exists, from ‘FB list’ option. If not, the function block is created only need to enter a new name, select the appropriate ‘FB list’ definition. The function block is created automatically in the global symbol table selection (including the allocation of memory for each variable in the function block header is defined); calling function block will be displayed in the ladder.Executive function block calls can be connected to the function block EN input pin through execution conditions. When the execution condition is satisfied (equivalent to True), energy flow reaches the EN pin, the function block is executed. Function Block ENO output pin optional. It is optional; you can connect to perform coil or execution conditions, but the right-most elements must be terminated with a coil or instructions.
V. The function block input and output pins.
These pins must use the [ENTER] key or from [insert] [function block parameters] menu option to select the parameters of the connection; rather than using the contact or coil connection. Left function block input pin; the right side of the function block output pin. Input and output pins connected to the function block is entirely optional.
Sixth, after the setup is complete, CX -P program can compile, download and run.
Establish ways
Select the tree menu [block], right insertOr select the tree menu [block], and then from the drop-down menu [Insert], select the [block]
There are several forms to create
First, the direct import (suffix .CXF) existing function blocks from the file;Second, create your own: structural way to write text; or a ladder to write.
Called
Select the appropriate cell programming area, right call, or use the [Insert] menu [function block call] option.

Frequency measurement for Omron PLC high-speed counter

By PRV instruction, you can read the frequency of the input pulse, high-speed counter frequency measurement, frequency is measured in Hz, hexadecimal 8-bit output, and can be used only in high-speed counter 0. In addition, also during high-speed counter 0 comparison operation at the same time, measurement frequency. Even in the frequency measurement, nor will feature high-speed counter, pulse output function has been affected.

      1. High-speed counter frequency measurement step

      
(1) the use of high-speed counter settings without using the /: the PLC Setup High-speed counter [O / without] is set to “use.”

      (2) counter selection: Setting PLC Setup High-speed counter in the [] / [] pulse input mode.

      Sampling (3) Value range mode: select System Settings in the PLC high-speed counter [O] / [] mode range of values, the value range mode to ring mode, the selection PLC Setup High-speed counter 0 [ ] / [] ring counter maximum value.

      (4) Select the reset method of high-speed counter current value: Select PLC Setup High-speed counter [0] / [Reset] mode.

      Execution (5) PRV instruction: Operands N is the number of high-speed counter [high-speed counter input 0: # OO1O]; C is the frequency of the operand read is # 0003; operand D is a frequency to save channel.

Omron PLC equipment disassembly sequence and method

(1) downtime must be two or more people care operations;
 
(2) The front panel of the CPU mode selector switch from “Run” to “stop” position;

 
(3) off the main power supply of the PLC, and then close the other to die Sakamoto power supply;

 
(4) The power supply shelf connected to the power line wire number and remember clearly after connecting position, and then remove the screws power racks and cabinets connected to the power rack can be removed;

 
(5) CPU board and I / 0 board may, upon rotating the screw template underneath removed;

 
(6) When installing in reverse order.

Hardware interrupt (OB40) – Siemens S7-300PLC organization block OB

Response process from different modules (eg I / O modules, CP or FM module module) issued a warning or a hardware interrupt request signal.

OB 40 runs, the operating system does not receive the other hardware interrupt requests.
You can modify the parameters for analog or digital module with a programming tool which is set by the start signal OB 40. For CP and FM, the software must also provide supporting module settings. By calling SFC, also set online is interrupted by a hardware module in the program is running.

OB40 Application

When the system is configured analog input module, the user can set the allowable range of measured values, if the measured value exceeds this limit, OB40 is called. This feature is similar to the OB1 the comparison logic, but it is omitted in OB1 control program, saving the scan cycle time.

PLC programming elements timer

Timer is equivalent to relay time relay in the circuit may delay control in your program. FX2 series programmable controller has the following four types of timer.
100ms timer: T0~T199 200 timing ranges: 0.1~3276.7 s
T200~T245 46 10ms timer timing range: 0.01~327.67 s
1ms totalizer timers T246~T249 4 (interrupt) time range 0.001~32.767 s
100ms totalizer timer T250~T255 6 timer range 0.1~3276.7s
Timer programmable controller based on cumulative timing clock pulse, clock pulse 1ms, 10ms, 100ms in different specifications. (Process timer job is actually the clock pulse counts) because of work, outside of own numbered memory, timer, also played a set value registers (Word), a current values of registers (Word). Setting register (Word) store when programming timings set value of an assignment. Current values of registers recording timer to the current value. These registers as a 16-bit binary storage. The maximum value multiplied by the time timer value is the maximum timed range of timer values. The timer starts timing conditions are met, current values of registers is counted when the timer actions when the current value is equal to the set value, normally open contacts connected normally closed contacts disconnect, and procedures used to control the object, achieve the purpose of time control.
Figure 6 timer used in the ladder diagram. Figure 6 (a) as a normal non-totalizing timer. Figure 6 (b) integrating the timer. Figure 6 (a) in the X1 time condition, when X1 is switched on t-10 times of the timer begins. K20 as the set value. Decimal number 20 for the timer time unit values of multiples. T 10 to 100ms timer, when set value is K20, its time time of 2s. Y10 for timer objects in the picture. When time is up, timer t 10 normally open connecting, Y10 set to 1. T10 is the non-accumulation-type timer. At the beginning of its time and not when the set value is reached, disconnect timing conditions X1 or PLC power power failure, time to abort and the current values of registers reset (set to 0). Disconnect if X1 or PLC power power failure occurs in the timing process is complete and the contact of the timer action, contact action cannot be maintained.
T 10 timer replace timer T250 product formula, the situation is different. Plot formula of timer in timed conditions or PLC lost lose the power, the current values of registers contents and contact status can be maintained, cumulative timings. So called accumulation. Figure 6 (b) ladder diagram for timer t 250 product formula work. Timer product formula current values of registers and contact with memory function, you must join in a program dedicated to reset reset instructions. X2 is a reset condition. When X2 connected to perform RST T250 instruction, t 250 the current values of registers and contacts at the same time set to 0.

Figure 6 timer using
Timer you can use the number k as the set value at once, such as in Figure 3-5 K20 and K345, also can be used after the data content of the register as a set value. Set timer value is D10 and D10 content is 100, the timer value is 100. When using the data set timer value registers. General use has the power to keep the data register. Even so, if battery voltage decreases, the timer may malfunction.

Mitsubishi FX series PLC multiple output directives (MPS and the MRD, and MPP)


Precautions for use:
 
(1) the MPS order multiple circuit or circuits of electric shock can be stored up to back multiple branches out.
 
(2) the 1th MPS stack instruction before the branch, multiple branches using MRD stack before the branch instruction in the middle and last branch of multiple circuits using MPP out of the warehouse instruction.
 
(3) finally slip MPP instruction must be used, and MPS with MPP‘s use without much 11 times, and occur in pairs.

Mitsubishi FX series PLC instructions

1. take rising edge/falling edge of LDP/LDF——directive
Features: take a single normally open the rising edge/falling edge and bus (bus bar and branch bus left) connected when a rising edge when specifying operating units through to 1 scan cycle.
 
2. ANDP/ANDF—–with rising edge/falling edge command
Features: series a single normally open the rising edge/falling edge.
3. the ORP/ORF——–or rising edge/falling edge instructions
Features: series a single normally open the rising edge/falling edge.