Posts

Showing posts from October, 2018

What is timer and counter in PLC?

Timer and Counter
The timer in the PLC counts the time, and the counter counts the events.

The timer does count only the time, and the counter has a certain period of time because the PLC has a scan period, and the timing can be implemented with the timer or the corresponding logic.

Similarities and differences between timers and counters of Mitsubishi PLC

1, function is different, one timing, one counting
2, code is different, one is T and one is C
3,The trigger mode is different, the timer should be always on, and the counter only needs one pulse.
4, Once the timer reaches the set value, it will not be counted again, and the counter can reach the set value and can count up in the past.
5, When the counter and timer are written, the format is almost the same as the code before the set value is after
6, Both can be triggered by time delay

plc counter ladder example

plc timer examples

Time control programming example implemented by Mitsubishi PLC with timer and counter

Image
Time control programming example
The timer of the Mitsubishi plc FX series is a power-on delay timer. Its working principle is that after the timer coil is energized, the delay starts, the time is up, the contact action; when the timer coil is powered off, the timer The contact is instantly reset.

However, in practical applications, we often encounter control requirements such as power-off delay, time-limited control, and long delay, which can be achieved through programming.

1, power-on delay control

The delay on control program is shown in Figure 3-27. The control function it realizes is that after X1 is turned on 5, Y0 has output.

The working principle is analyzed as follows:

When X1 is in the 0N state, the coil of the auxiliary relay M0 is turned on, and its normally open contact is closed and self-locking, so that the coil of the timer T0 can be kept in the power state.

After the coil of T0 is turned on for 5 s, the current value of T0 is equal to the set valu…

touchwin op320a user manual

touchwin op320a user manual
touchwin op320a

xinje touchwin software

xinje touchwin software



OP320 manual
Software OP20v6.5y
Software OP20v8.0q
Example
Connect s7200 plc
https://lolletteshop.wordpress.com/2018/08/24/op320-a-software-download/

https://www.xueplc.com/

How to write a general mode parallel link communication program?

Image
Write a general mode parallel link communication program
Two FX2N series PLCs exchange data through a 1:1 parallel link communication network, designing one

General mode communication program. The communication operation requirements are as follows.


(1) The ON/OFF status of the master station XOOO to X007 is output to the slave station through M800 to M807.

YOOO—Y007.


(2) When the calculation result of the master station (DO+D2) ≤ 100, the YOIO of the slave station changes to ON.


(3) The ON/OFF status of the MO to M7 in the slave station is output to the master station through MOOO to M007.

YOOO~Y007.


(4) The value of the slave D10 is used to set the timer (TO) value of the master station.


Solution: Set the program of the master station and the slave station according to the requirements of the topic, as shown in Figure 6-25. Figure 6-25 (a)

Set as the master station, complete the XO ~ X7 state input, (DO + D2) operation, status output, and

Timer operation settings. Figure 6-25 (b) i…

How to program the master station setting program for N:N network parameters?

Image
N:N network parameters
Setting requirements: Set the PIC as the master station, set the number of slave stations to 2, and use the mode 1 brush.

New, the number of communication retries is set to 3, and the communication timeout is set to 40ms.


Solution: Set according to the setting requirements, and get the program ladder diagram. M8038

After the action, five M()V instructions are executed, D8176 is O, which is set as the master station; D8177 is 2,

The number of slaves is set to 2; the value of D8178 is 1, and it is refreshed by mode l; the value of D8179 is 3, and the setting is

The number of retries is 3; the value of D8180 is 4, and the communication timeout is set to 40ms.





The requirements for the initialization setting procedure of the parallel network are as follows.

(l) Refresh range: 32-bit component and 4-word component (mode 1).

(2) Number of retries: 3 times.

(3) Communication timeout: 50ms.

What is the execution order of the PLC program?

Image
PLC program execution order (1) The ladder diagram should be programmed with the left bus as the starting point and the right bus as the end point, from left to right, written line by line.


The beginning of each line is the starting condition, consisting of normally open, normally closed contacts or a combination thereof. The rightmost coil is the output. After one line is written, one line is written from top to bottom. Do not write contacts on the right side of the coil



(2) The contacts should be drawn on the horizontal line and cannot be drawn on the vertical branch line.

As shown in the figure, the contact X005 is drawn on the vertical line, which makes it difficult to correctly identify the relationship with other contacts, and the circuit should be rearranged.



(3) When several series circuits are connected in parallel, the branch with the most contacts should be placed at the top of the ladder diagram.



For the case where several parallel circuits are connected in series, the pa…

How to set up the Siemens s7-400 plc configuration

Image
Configuring the S7-400 master station
(1) Right click in the right area and select "SIMATIC 400 STATION" in the pop-up shortcut menu Order, insert 400 sites, the corresponding S7-400 station will be displayed in the right window of the screen.



(2) Double-click the "Hardware" icon to configure the rack, PS and CPU modules and insert the CPU414-3DP

When selecting a module, select the same PROFIBUS network as the slave and set the station address parameters, in this example

The PROFIBUS address of the CPU 414-3DP is 2. After the configuration is completed, click the "OK" button to confirm the appearance.

PROFIBUS network



(3) Select "PROFIBUS DP" on the right side of the HW configuration configuration interface of S7-400.

Select "CPU315x" in "Configured Stations" and drag it to the PROFIBUS bus on the left.



(4) "DP slave" that appears

In the properties dialog, it appears

Two slave stations configured



(5) Select one of …

how to sets real-time clock S7-200 PLC

Image
S7-200 PLC sets real-time clock command: TODW (Set Real-time Clock)

When the enable input EN is active, the instruction loads the contents of the 8-byte buffer (start address is T) containing the time and date into the clock. The set value range is the same as the TODR command. Corresponding ladder diagram






The addressing range of T: VB, IB, QB, MB, SMB, SB, LB, *VD, *AC, *LD.

Instruction format: TODW T



Enable error condition for stream output ENO disconnect: 0006 (indirect addressing); 0007 (TOD data error); 000C (no clock present); SM4.3 (run time).



The S7-200 PLC does not perform checks and verifies that the date is accurate. Invalid dates (such as February 30) can be accepted, so you must ensure the accuracy of the input data.



Do not use the TODR/TODW instruction in both the main program and the interrupt program. Otherwise a fatal error will result.

Connect S7 300 to a PC Station via ethernet

WINCC Ethernet connects with S7-300
The usual S7-300 only needs the MPI port and no Ethernet port. The MPI Ethernet converter can change the MPI port of the S7-300 to Ethernet and connect with the host computer, and the cost is much cheaper than the price of the CP5611 card.

The driver selected on WINCC is TCP/IP (AUTO). The driver selected on the configuration network is S7-300 series TCP. It is completely the same as Siemens CP343-1 in other monitoring software.

Due to the external characteristics of ETH-MPI on its Ethernet side, it is exactly the same as Siemens CP343. Using the Siemens RPOFINET protocol, it is able to connect to the high-level software of today's mainstream, without the need for additional drivers.

The S7-300 TCP protocol is now integrated in these softwares.

Physical specification table for single mode fiber and multimode fiber

Image
Physical specification for single mode fiber and multimode fiber



Optical fibers are divided into multimode and singlemode fibers according to the mode field. Multimode is divided into 62.5/125μm, 50/125μm and 100/140μm. Commonly used are 62.5/125μm and 50/125μm multimode fiber;

Single-mode fiber requires only one specification, that is, 9/125μm single-mode fiber.

Types of Timers in Programmable Logic controllers

Image
Mitsubishi PLC timer type
The timer in the PLC is a device inside the PLC. Its function is equivalent to the time relay in the relay system. There are several hundred timers inside. The timer is based on the accumulated timing of the clock pulse. There are three kinds of clock pulses: 1ms, 10ms, and 100ms. When the measured time reaches the set value, the output contact operates.

The integrated timer has the function of counting accumulation. If the power is turned off or the timer coil is OFF during the timing, the calculation is calculated.

The current device will maintain the current count value (current value), and continue to accumulate after power-on or the timer coil is ON, that is, its current value has a hold function, and the current value becomes 0 only when the integrated timer is reset.




(1) The 1ms integration timer (T246 to T249) is a total of 4 points, which is the cumulative counting of 1ms clock pulses. The timing time range is 0.001 to 32.767s.

(2) The 100ms integ…

What is the function of a PLC timers

Image
PLC timers
PLC timers is a function that we often use when programming with PLC. In programming applications, we can often use timer to realize delay start function and alarm protection function. Moreover, the use of the timer is similar to the time relay in the relay control circuit, so it is easy to use, but is such a simple application, can you use it well?


Let's take a look at a program. This is a program sent to me by a student. He did a marquee program while practicing programming. He chose a 10ms timer to do it, but found that the marquee program does not execute. Ask me what is the reason? The program is as follows:



This is a very simple program, but it is such a simple program. When the ROL_B instruction is not executed at the time of execution, then where does the problem occur? Can you see what is the reason? What should I do? .


In fact, this situation is mainly due to the use of the timer, the understanding of the timer refresh mode is unclear, the S7-200 series PLC has t…

The difference between programmable controller and relay control

Programmable Controller and Relay control
In the PLC programming language, the ladder diagram is the most widely used language. The ladder diagram is converted into a PLC-acceptable program by the PLC's command system, and is entered into the PLC user memory area by the programmer. The ladder diagram is very similar to the relay control schematic. The main reason is that the invention of the PLC ladder diagram is roughly along the component symbol of the user relay control circuit, which is only slightly different.

The main differences between PLC and relay control are as follows:

(1) Different device components

The relay control circuit is made up of many real hardware relays. The PLC is composed of many "soft relays". These "relays" are actually triggers in the memory and can be set to "0" or "1".

(2) The number of contacts is different

Hard relays have a limited number of contacts, typically only 4 to 8 pairs; and "soft relays" have…

How to collect analog input in Delta plc

Delta plc analog input

In addition to the host, you must also have an delta plc analog AD module. According to the manual, make the corresponding settings for the module (TO command). Use the FROM command to read the digital signal after analog-to-digital conversion of the AD module

Example: Input 0-20MA module conversion number is -2000 to +2000 Module model is 06XA-EH The following is the setting of 4 analog inputs.

LD M1002

TO K0 K1 HF000 K1

TO K0 K18 K0 K4

TO K0 K24 K1000 K4

How to program Delta's plc programming time relay

Image
Delta plc programming time relay programming method
The Delta PLC timer is a time unit of 1ms, 10ms, 100ms. The timing mode is counted. When the current value of the timer = set value, the output coil is turned on. The set value is the decimal K value. The available data register D is used as the set value.

The actual set time of the timer = the time unit * set value.

Programming can be distinguished according to its nature:

1. General timer:

Generally, the timer is used to count once when the END instruction is running. When the TMR instruction is running, if the timing is reached, the output coil is turned on.


The ladder diagram of the programming looks at the following figure:




Programming Examples:
When X0=On, the current value of the timer T0 is counted at 100ms, and when the timer current value = set value K100, the output coil T0=On.

When X0=Off or power failure, the current value of timer T0 is cleared to 0, and output coil T0 becomes Off.

2. Integrated timer

The integrated timer counts…

What is floating point in plc

Image
Floating Point
Real numbers are integers, and floating point numbers are decimals. Floating point arithmetic is the operation of the decimal point.

PLC: A programmable logic controller that uses a type of programmable memory for its internal memory program, performing user-oriented instructions such as logic operations, sequence control, timing, counting, and arithmetic operations, and input through digital or analog / Output controls various types of machinery or production processes.





For example, a PLC that supports floating point numbers has a result of dividing by 3 and a result of 1.5, and a result of not supporting floating point numbers is 1.

It's as simple as floating point numbers are just a representation of decimals in scientific applications.

Because PLC is the same as PC, it is a binary operation, so the representation of pure decimals can not be applied on the circuit, so a scientific notation (floating point number) is implemented.

Floating point numbers are a way …

plc transistor output vs relay output

Image
Plc Transistor output vs Relay output

1. Different load voltage and current types

Load type: The transistor can only have a DC load, and the relay can be used with both AC and DC loads.
Current: Transistor current 0.2A-0.3A, relay 2A.
Voltage: The transistor can be connected to DC 24V (generally the maximum is about 30V DC, the relay can be connected to DC 24V or AC 220V.
2. Different load capacity
The ability of a transistor to carry a load is less than the ability of a relay to carry a load. When using a transistor, sometimes something else is added to drive a large load (such as a relay, a solid state relay, etc.).
3. Transistor overload capability is less than relay overload capability
Generally speaking, when there is a large inrush current (such as a bulb, an inductive load, etc.), the transistor has a small overload capability and needs to be derated more.
4. Transistor response speed is faster than relay
The principle of the relay output type is that the CPU drives the relay …

How is the Siemens PLCs7-200 connected to the encoder for measuring position?

Image
Defining a high-speed counter is nothing more than the following steps:

1. Create an initialization program, controlled by SM0.1;

2. Initialize the high-speed counter in the initialization program

2.1 Set the control register (HSC0 is SMB37), different counters correspond to different DI points, HSC0 is I0.0, HSC3 is I0.1, HSC4 is I0.2, HSC5 is I0.3 (222 does not support HSC1 and HSC2)

2.2 Execute the HDEF command, you can use mode 0

2.3 Set the initial value of the counter (HSC0 is SMD38), if it is started from zero, set it to zero.

2.4 Set the preset value (HSC0 is SMD42). When the counter counts this value, an interrupt can be generated. Generally, the interrupt is used to call the corresponding interrupt program to reset the current value (SMD38). Otherwise, the counter will not count until the end. Of course you You can also set a large value and clear the current value (SMD38) in other programs to ensure that you can never get to the head.

2.5 Specify the interrupt program (ATC…

Delta plc and encoder connection

Image
Delta's EH series PLC has a set of high-speed counter inputs, X0, X1, X2, X3.

Use C251 two-phase two inputs X1=A, X2=B,
At C252, X0=A, X1=B, X2=R
X253=A, X1=B, X2=R, X3=S at C253
A=A phase, B=B phase, R=reset, S=start
Just connect the line and write the counter program directly.









X10 is reset and X11 is active. (X0, X1 need not be connected after the encoder is connected, the program does not need to write these two components)

K5 is the set value. If you need dynamic setting, use register D-- instead, set D-- on the touch screen to modify or add a program to change D--value in PLC.

If you want to set the actual speed, distance, number of turns, etc., use the arithmetic program to change the D value.

For example, if the C251 value is 100 when the machine is turned one turn, you need to set the rotation of 20 turns to drive the Y0 output. Then add an arithmetic program:
LD M1000 "System Operation Instructions"


MUL K100 D200 D210 "Multiplication"


LDP X12 "Upgrade bu…

Mitsubishi FX series PLC counter application ladder diagram example

Image
Counter Plc ladder Diagram
Note: X3 resets the counter C0, C0 counts the pulse input to X4, the number of input pulses reaches 6, the normally open contact of counter C0 is closed, and Y0 is energized. When X3 is active, C0 is reset and Y0 is de-energized.

top cnc controller topcnc brand

Image
TOP CNC Controller 1,TC55H TOPCNC CNC controller
TC55H manual 1. Product Introduction TC55H is an upgrading version of TC55. It can control 4 feeding axis, 1 analog spindle. It is equipped with 16  input port and 8 output port, supporting importing G code files from USB stick.  Support saving the current coordinates after power off. 
2. Technical Specifications  Minimum data unit 0.001 mm Maximum data size ± 99999.999mm Maximum Speed: 24m/min (pulse is 0.001mm) Maximum pulse output frequency 400KHz Axis 1-4 (X,Y, Z,C) X,Y,Z,C axis can conduct linear interpolation, X,Y can do circular interpolation.  Electric Gear: numerator :1-99999 denominator: 1-99999  USB: Importing program and boot picture(You can load your own logo) Isolated I/O port Maximum Program Line:1000 Maximum Program: 99 RAM: 128M External Manual Operation: motor clockwise and counter clockwise spinning, start, pause, alert and stop  G code and M code One panel MPG(Registered Patent) 3.5 inch color LCD, pixel 320*240  Ana…

SMC5-5-N-N DSP CNC Controller 5 Axis

Image
DSP controller SMC5-5-N-N CNC for milling machine. Contents of delivery:
DSP controller SMC5-5-N-N -1 pcs
Specifications
High-performance, high-speed 32-bit ARM processor, high-performance FPGA seven-inch LCD display (resolution: 800 × 480) 16 opto isolated inputs (10mA), 8 optically isolated outputs 500mA Output frequency 500 kHz (all five axes are simultaneously 500 kHz) Controls 5 axes (X, Y, Z, A, B). Support MPG encoder. convenient user interface like man-machine, external USB port and built-in 8GTF memory card, Built-in memory can expand up to 32 GB Operating voltage 12-24 volts.

GX Developer timer command

Image
Timer T is the timer symbol, 0 is the number, K is the constant, it is decimal, that is, it is one second when it is set to K10.


The value oh D212 acts as the K value. Typically done when you want to allow a timer to be changed without accessing the program (from a numerical input on a HMI for example)


What is the command of Mitsubishi PLC [DDRVI K99999 K8000 Y0 Y03]

Image
DDRVI instruction DRVI is a relative positioning instruction (DRVI is 16 bits, DDRVI is 32 bits), and the current data in the current value register is used as a starting point to increase or decrease. It is a command to perform single speed position control in relative drive mode.

DDRVI K99999 K8000 Y0 Y03





Output pulse number Output pulse frequency Pulse output start address (only Y0 and Y1 are specified), rotation direction signal output

The scan cycle of the PLC, what is the scan cycle of the PLC?

Image
When the PLC is in the RUN mode, the time required to perform a scan operation is called the scan period, and its typical value is about 1 to 100 ms.

The plc scan cycle has a lot to do with the length of the user program, the type of instructions, and the speed at which the CPU executes the instructions.

When the user program is long, the instruction execution time accounts for a considerable proportion of the scan cycle.

Some programming software or programmers can provide the current value of the scan cycle, and some can also provide the maximum and minimum scan cycles.

High-speed counter (HSC) of Mitsubishi FX series PLC

Image
1. High speed counter
The 21-point high-speed counters C235 to C255 share the eight high-speed counter input terminals X0 to X7 of the PLC, and one input terminal can only be used for one high-speed counter at the same time. These 21 counters are all 32-bit up/down counters (see Table 3–7). Different types of high-speed counters can be used simultaneously, but their high-speed counter inputs cannot conflict.

The operation of the high-speed counter is based on the interrupt, which means that the triggering of the event is independent of the scan time. When counting external high-speed pulses, the coil of the high-speed counter in the ladder diagram should always be energized to indicate that the input point associated with it has been used, and the processing of other high-speed counters cannot conflict with it. The coil of the high-speed counter can be driven by the normally open contact of the M8000, which is always ON at runtime.


When X14 is ON, the high-speed counter C235 is selec…

Mitsubishi PLC step ladder diagram and SFC

Image
When programming with a stepping instruction, first design the state transition diagram and then convert it into a step ladder or instruction list according to the state transition diagram.




The action process is when the step contact S20 is closed, the output relay Y1 coil is turned on. When the X0 closed new state is set (turned on), the step contact S21 is also closed. At this time, the original step contact S20 is automatically reset (opened), which is equivalent to shifting the state of S20 to S21, which is the step conversion effect. State transition process between other state relays, and so on

It can be seen that the state transition diagram is a graph for describing the control process of the sequential control system, which consists of steps, transition conditions, and directed lines. Each state (step) represents an operation that works in sequence and requires a specific action to be completed. The transition (step) of the state is satisfied. Compared with ordinary instruction…

Difference between FB and FC's Siemens PLC

Image
Siemens PLC Difference between FB and FC's

characteristicFCFBCan be called as a subroutineYes YesCan assign parameters to Input/Output/InOutYes YesTemporary variables can be used YesYesCan use static variables (can be kept)NoYesRequires instance data block (per call)NoYesParameters passed as addresses to internal useYes NoParameters are passed to the internal use via the instance data blockNoYesCan call FB or FCYesYesCan be called by FB or FCYesYesCan use FB as multiple background callsNoYesCan not write all parameters when calledNoYes
Articles 7 and 8 in the above table are very important.
FB has memory (except Temp variable), FC has no memory (cannot remember the result of the last scan cycle),


To emphasize that the FC parameter is passed to the block to pass the address, remembering the address instead of a data.


FB parameter input and output block is the data, remember that the data is not the address, FB has a private storage space, the parameter access block is transferred t…