Showing posts with label PLC. Show all posts
Showing posts with label PLC. Show all posts

Sunday, August 19, 2012

How To create S120 drive control/status word read write by one block

Answer:
Create a  FB block for getting this advantage

In                   Data type     Address           Initial Value                   Comment
Drive Run                Bool                0.0                     False                             OFF1
Flt ACK                  Bool                0.1                    False                             Fault Reset
F_Jog                      Bool                0.2                     False                          
R_Jog                      Bool                0.3                     False                          
Main_N_Set            Int                    2.0                      0                                Speed Set Point
Pos_Torque             Int                    4.0                      0                              Positive torque Limit
Neg_Torque            Int                     6.0                     0                               Negative Torque Limit
IO_address              Int                     8.0                     0                               Device Address

Out              Data type     Address                  Initial Value                   Comment


RTS              Bool               10.0                         False                                 Ready to Start
Rdy_op         Bool               10.1                         False                             Ready to Operation
IOP               Bool              10.2                         False                              In Operation
Fault              Bool               10.3                        False                            Fault Presen 
Jogging           Bool               10.4                       False                              Jogging With Jog Speed
Mtr_Speed   Int                 12.0                          0                               Speed of mtr in RPM
Mtr_Torq        Int                 14.0                          0                                      Mtr torque
Mtr_I              Int                  16.0                         0                                  Mtr Current
Mtr_Kw          Int                  18.0                         0                                    Mtr Kw
CommErr         Int                  20.0                        0                                  Comm Err

State                   Data type     Address           Initial Value                   Comment
Control word
B08_Inch0              Bool                   22.0                   False                                 .....
B09_Inch1              Bool                   22.1                   False                                 ......
B10_Plc_Contl        Bool                   22.2                    True                                 ......
B11_F_Enable        Bool                    22.3                    True                                Jog Forwad
B12_R_Enable        Bool                    22.4                    True                               Jog Reverse
B13_Mop_Up         Bool                    22.5                      False                               ...........
B14_Mop_Dn        Bool                     22.6                     False                                ....
B15_Ex_Flt            Bool                    22.7                    Fase                                    ..........
B00_On                 Bool                    23.0                    False                             OFF1
B01_NO_Coast       Bool                    23.1                   True                              OFF2
B02_NO_Qstop      Bool                     23.2                  True                              OFF3
B03_Enable            Bool                     23.3                  True                              
B04_RFG_Enable   Bool                     23.4                  True                            
B05_RFG_SRT     Bool                      23.5                  True                               ...........
B06_SP_Enable     Bool                       23.6                 True                                 ....
B07_Flt_ACK        Bool                       23.7                  False                              Fault Reset
W_2                     Int                         24.0                     0                                     spare
Speed_Set             Int                         26.0                     0                                  Main N Set
Torq_Pos              Int                          28.0                    0                                Torque positive
Torq_Neg             Int                          30.0                     0                                Torque Negative
STATUS WORD
Out0                   Byte                 32.0                         B#16#0                            spare
B00_RTS              Bool               33.0                         False                                 Ready to Start
B01_Rdy_op         Bool               33.1                         False                             Ready to Operation
B02_IOP               Bool              33.2                         False                                   In Operation
B03_Fault             Bool               33.3                          False                                 Fault Present
B04_OFF2           Bool               33.4                          False                                 Coast
B05_OFF3           Bool               33.5                          False                                 Q_Stop
B06_Inhibit           Bool               33.6                          False                               .......
B07_Warning        Bool               33.7                         False                                 ..............
W2                     Int                  34.0                          0                                   Spare
W3_Mtr_Speed     Int                  36.0                          0                              Speed of mtr in RPM
W4_Mtr_Torq            Int                  38.0                         0                             Mtr torque
W5_Mtr_I                  Int                  40.0                          0                            Mtr Current
W6_Mtr_Kw              Int                  42.0                          0                              Mtr Kw
CommErr            Int                  44.0                          0                                Comm Err

TEMP                          Data type                Address            Initial Value                 
Address_W                       WORD                               0.0                        
Ret_Val0                          Int                               2.0
Ret_Val1                           Int                              4.0

Block: FB100

Network: 1

L   #IO_adss
T   #Adress_W
NOP 0

Network: 2
A   #Drive Run
=   #B00_ON
A   #Flt ACK
=    #B07_Flt_ACK
A    #F_JoG
=    #B011_F_Jog
A    #R_Jog
=    #B12_R_Jog
Network: 03
L   # Main _N_Set
T   #Speed Set
L   #Pos_Torque
T   #Torq_pos
L   #Neg_Torque
T   # Torq_Neg
L    #IO_Address
T    # Address_W

Network:  04 (DATA SEND TO DRIVE)
Call    "DPWR_DAT"                            SFC15
   LADDR     :=Adress_w
   RECORD  :=P#DB100.DBX22.0 BYTE 10
   RET_VAL :=Ret_Val0

Network: 05

L   #Ret_Val0
T   # CommErr
NOP 0



Network: 06(DATA RECEIVE FROM DRIVE)

Call    "DPRD_DAT"                            SFC14
   LADDR     :=Adress_w
   RECORD  :=P#DB100.DBX32.0 BYTE 14
   RET_VAL :=Ret_Val1

Network: 07

L   #Ret_Val1
T   # CommErr
NOP 0

Network: 08
A   #B00_RTS
=   #RTS
A   #B01_Rdy_OP
=   #Rdy_op
A   #B02_IOP
=   #IOP
A   #B03_Fault
=    #Fault

Network:  09
L  #W3_Mtr_Speed
T  #Mtr_Speed
L   #W4_Mtr_Torq
T   #Mtr_Torq
L   # W5_Mtr_I
T   #Mtr_I  
L   #W6_Mtr_Kw
T   #Mtr_Kw





NOTE: Create DB100  block as Instant data block of FB100
CONTROL/Status word can be changed by your setting in STARTER/SCOUT







!--RELATED-POSTS-STARTS-->

Thursday, June 28, 2012

Status word description

The status word can be seen by displaying the STATUS column while monitoring in STL view.  The RLO (bit 1) and the STA (bit 2) are also displayed in the RLO and STA column.


BR        Binary Result Bit (Status Word, Bit 8)

The BR bit is bit 8 of the status word.
The BR bit transfers the results obtained from processing Statement List (STL) instructions on to the next instructions to be processed.

The Binary Result transfers the result of the operations
onto the next instruction for reference.  When the BR bit is 1 it enables the output
of the block (ENO) to be TRUE and thus allow other blocks after it to be
processed.  The SAVE, JCB and JNB instructions set the BR bit.

· If an error occurred during execution, the BR bit is ‘’0”.

· If the function was executed with no error, the BR bit is ‘’1”.


CC 1, CC 0        Condition Codes (Status Word, Bits 6 and 7)

The Condition Code bits provide results for comparison and math instructions.
Comparison Instructions
CC 1
CC 0
Meaning
0
0
ACCU 2 = ACCU 1
0
1
ACCU 2 < ACCU 1
1
0
ACCU 2 > ACCU 1
1
1
Unordered (floating point comparison only)
Math Instructions, without Overflow
CC 1
CC 0
Meaning
0
0
Result = 0
0
1
Result < 0
1
0
Result > 0
Integer Math Instructions, with Overflow
CC 1
CC 0
Meaning
0
0
Negative range overflow in ADD_I and ADD_DI
0
1
Negative range overflow in MUL_I and MUL_DI
1
0
Negative range overflow in ADD_I, ADD_DI, SUB_I, and SUB_DI
1
1
Division by 0 in DIV_I, DIV_DI, and MOD_DI
Floating Point Math Instructions, with Overflow
CC 1
CC 0
Meaning
0
0
Gradual underflow
0
1
Negative range overflow
1
0
Positive range overflow
1
1
Not a valid floating-point number
Shift and Rotate Instructions
CC 1
CC 0
Meaning
0
0
Bit shifted out = 0
1
0
Bit shifted out = 1
Word Logic Instructions
CC 1
CC 0
Meaning
0
0
Result = 0
1
0
Result <> 0


OV        Overflow (Status Word, Bit 5)

The OV bit displays errors for math instructions or comparison instructions with floating point numbers.

The OV bit is bit 5 of the status word.

It is set by a math instruction with floating point numbers after a fault has occurred (overflow, illegal operation, comparison unordered). The OV bit is reset when the fault is eliminated.




OS        Overflow Stored (Status Word, Bit 4)

The OS bit stores the OV bit if an error occurs during math instructions or comparison instructions with floating point numbers.

The OS bit is bit 4 of the status word.

The OS bit is set, together with the OV (Overflow) bit, in the event of a fault. It remains set after the fault has been eliminated. It thus stores the OV bit status and indicates whether or not a fault has occurred in one of the previously executed instructions.

The following commands reset the OS bit:

· JOS (Jump if OS=1)

· Block call instructions

· Block end instructions


OR        (Status Word, Bit 3)

The OR bit is used for combining AND functions before OR functions.

The OR bit is status word bit 3.

The OR bit is set if the RLO of the AND logic operation is 1. This anticipates the result of the OR logic operation. Every other bit-processing instruction resets the OR bit.


STA        Status Bit (Status Word, Bit 2)

The STA bit stores the value of an addressed bit.

The STA bit is bit 2 of the status word.

The status of a bit logic instruction that performs a read access to memory (A, AN, O, ON, X, or XN) is always the same as the value of the addressed bit. The status of a logic instruction that may perform a write access to the memory (R, S, or =) is the same as the value of the written bit or, if writing is not performed, the same as the value of the addressed bit. The status bit has no significance for bit instructions that do not access the memory. These instructions set STA to 1. The status bit is not read by instructions, it is interpreted for you when viewing the online status of program variables.


RLO        Result of Logic Operation (Status Word, Bit 1)

The RLO bit stores the result of a logic operation string or comparison instruction.

The RLO bit is status word bit 1.

The first instruction in a segment checks the contact signal state. The RLO is set to ‘’1’’ if the check is executed. The second instruction also checks the contact signal state. This check result is now combined with the value stored in the RLO bit according to the Boolean algebra rules and stored in the RLO bit. This logic string ends after an assignment or a conditional jump. Depending on the RLO bit value, an assignment or a conditional jump is executed.


/FC        First Check Bit (Status Word, Bit 0)

The /FC bit signal state controls a logic operation string.

The /FC bit is status word bit 0.

Each logic operation queries the /FC bit signal state and the addressed contact.

· If the /FC bit signal state equals ‘’1,’’ an instruction logically combines the result of its signal state check on its addressed contact with the RLO generated since the first check and stores the result in the RLO bit.

· If the /FC bit signal state equals ‘’0,’’ the logic string begins with a first check.

The logic string ends and the /FC bit is set to ‘’0’’ with the assignment of a value (S,R,=) or with a RLO-dependent jump instruction.




!--RELATED-POSTS-STARTS-->

Statu Word


Status word bits are read and written by the CPU and directly by your program statements.

As each of your instructions is processed, CPU status word bits are used according to the function of each instruction. Status word bits are used to link your instructions together and to provide immediate results and error information. Your program statements can then read status word bits and take action, if necessary.

Status Word

BR CC 1 CC 0 OV OS OR STA RLO   /FC

Notation for an instruction’s effect upon the status word:
- No read or write
* Read
x May write "1" or "0"
0 Reset to "0"
1 Set to "1"

Status Word in STL Monitor
See also:
CPU Resister !--RELATED-POSTS-STARTS-->

Types of PLC Programing Language

PLC user program is under the control system designer process control requirements, through the establishment of PLC programming language design. Developed by the International Electrotechnical Commission standard industrial control programming language (IE PLC user program is under the control system designer process control requirements, through the establishment of PLC programming language design.
The five languages in the IEC Standard 61131-3 are:

Instruction List (IL): A low-level language very similar to assembly language. The code is compact and suitable for small projects. It not very powerful. The other languages are easier to use and document. It has been years since I have used it and do not miss it.
Structured Text (ST): A high level language structured like Pascal. Users trained in high level text languages would be comfortable with ST.
Ladder Diagrams (LD): Also commonly known as Ladder Logic. Modeled after the electrical wiring of contacts and relays used to create logic. It made the transition from Relay logic (using actually electrical relays) to the PLC easier. It falls short when tasks become complex. Not the best for modular PLC programming. This language will look very familiar to Electricians.
Function Block Diagram (FBD): The blocks contain procedures or functions to act on the input "wires" and output the result. It lends itself readily to standardizing, modulating, and maintaining programs. I prefer this over LD, and many are coming to realize its advantages. Ladder Diagrams will die a slow death.
Sequential Function Chart (SFC): This graphic language is great for concurrent parallel sequential operations. It is self documenting. It very useful pulling together in a flow chart form the other PLC programming elements such as function blocks (FB) or structured text (ST). Its format shows overall program flow very well making it faster and easier to understand what the program is doing. Easy to identify the section of interest for troubleshooting and program improvement.
By the way...a common belief is that you would be able to quickly convert between the above languages. This is false. Although they have common elements they also have differences that preclude the possibility.




Ref:http://www.plcedge.com !--RELATED-POSTS-STARTS-->

Monday, June 25, 2012

What is PLC & how it work



PLCs are often defined as miniature industrial computers that contain hardware and software that is used to perform control functions. A PLC consists of two basic sections: the central processing unit (CPU) and the input/output interface system. The CPU, which controls all PLC activity, can further be broken down into the processor and memory system. The input/output system is physically connected to field devices (e.g., switches, sensors, etc.) and provides the interface between the CPU and the information providers (inputs) and controllable devices (outputs).
To operate, the CPU "reads" input data from connected field devices through the use of its input interfaces, and then "executes", or performs the control program that has been stored in its memory system. Programs are typically created in ladder logic, a language that closely resembles a relay-based wiring schematic, and are entered into the CPU's memory prior to operation. Finally, based on the program, the PLC "writes", or updates output devices via the output interfaces. This process, also known as scanning, continues in the same sequence without interruption, and changes only when a change is made to the control program.

A brief history
The first PLC can be traced back to 1968 when Bedford Associates, a company in Bedford, MA, developed a device called a Modular Digital Controller for General Motors (GM). The MODICON, as it was known, was developed to help GM eliminate traditional relay-based machine control systems. Because relays are mechanical devices, they have limited lifetimes. They are also cumbersome, especially in large applications where thousands of them may exist. With so many relays to work with, wiring and troubleshooting could be quite complicated.
Since the MODICON was an electronic device, not a mechanical one, it was perfect for GM's requirements, as well as for many other manufacturers and users of control equipment. With less wiring, simpler troubleshooting, and easy programming, PLC technology caught on quickly.

Today's PLC
As PLC technology has advanced, so have programming languages and communications capabilities, along with many other important features. Today's PLCs offer faster scan times, space efficient high-density input/output systems, and special interfaces to allow non-traditional devices to be attached directly to the PLC. Not only can they communicate with other control systems, they can also perform reporting functions and diagnose their own failures, as well as the failure of a machine or process.
Size is typically used to categorize today's PLC, and is often an indication of the features and types of applications it will accommodate. Small, non-modular PLCs (also known as fixed I/O PLCs) generally have less memory and accommodate a small number of inputs and outputs in fixed configurations. Modular PLCs have bases or racks that allow installation of multiple I/O modules, and will accommodate more complex applications.
When you consider all of the advances PLCs have made and all the benefits they offer, it's easy to see how they've become a standard in the industry, and why they will most likely continue their success in the future.

Which one is right for you?
So you've learned a little bit about PLCs and have decided that a PLC-based control system is the right choice for you. Now what?

The next step is to select the right system. But how do you do that? Where do you begin when there are so many manufacturers and so many different PLC models?
A drawing of the machine or process is a good start. This can help identify field devices and physical requirements for hardware locations. From the drawing, you can determine how many analog and/or discrete devices you will have. Discrete devices are those that operate in only two states: on and off. Examples of discrete devices include pushbuttons and switches. Analog devices, such as thermocouples, process transducers, and display meters, will supply or accept signals within a specified range, typically 0-10 volts or 4-20 mA.
Once the field device requirements and hardware locations are defined, you can begin the process of choosing a PLC that will meet your requirements. The worksheet on the following page is a basic summary of considerations for determining the type of PLC you will need, regardless of which manufacturers you are evaluating. Armed with this information, the next steps will be selecting, designing, programming, and installing your system.
When choosing a PLC, there are many factors to consider that, if not properly planned for, may affect your system's performance after installation. With proper planning, the selection of a PLC system can be done with relative ease.

!--RELATED-POSTS-STARTS-->