Showing posts with label plc training in noida. Show all posts
Showing posts with label plc training in noida. Show all posts

Wednesday, 5 November 2014

Reliance Industries Use PLC Scada Technologies



Reliance Industries Ltd (RIL) had shared all the copies of its correspondence with the Supreme Court-appointed tribunal on the KG-D6 cost recovery issue to the Oil Ministry and the Directorate General of Hydrocarbons (DGH), according to sources.

Contrary to the impression being created, RIL had, subsequent to Supreme Court on April 29 appointing former Australian judge Michael Hudsom McHugh as third arbitrator to decide whether government was right in denying cost recovery of up to $2.3 billion for gas output from KG-D6 lagging targets, marked all correspondence-related mails with the tribunal to the ministry and the DGH, they said.

Mr McHugh had on May 20 declined to be part of the tribunal saying his consent was not taken, but subsequently agreed after lawyers for RIL and its partners BP Plc of the UK and Canada's Niko Resources contacted him on May 29.

Sources said RIL's advocates in an email on May 29 requested Mr McHugh to accept his appointment as the third/presiding arbitrator of the tribunal. A copy of Tom Sprange's (RIL's lawyer) email was marked to the Oil Ministry and its technical arm, Director General of Hydrocarbons (DGH).

Government lawyers Swarup & Associates, who have now told the ministry that appointment of a foreigner as the presiding arbiter would be "undesirable" in the absence of any such contractual provision and difficulty in ascertaining the person's "independence and impartiality", was not marked on the email as it was not known at that time who would act for the government of India, they said.
Thereafter emails and correspondence were exchanged between the RIL and the Tribunal with respect to the fixing of fee for the arbitrators. By this time, government lawyers were intimated and they were marked on those emails but they chose not to reply, sources said.

On June 18, RIL's lawyers sent a letter to government's advocate stating copies of all the correspondence between the arbitrators and the parties will be provided to them.

Mr McHugh on June 26 sent an email to all the parties on behalf of all arbitrators enclosing a working draft procedural timetable but a week later on July 2 government advocates sent emails asking the tribunal not to proceed with the matter till a detailed response is issued by them and asked the tribunal to send copies of all the documents correspondence exchanged.

Sources said the government felt Mr McHugh appointment stood terminated the moment he declined to accept the appointment and thereafter he cannot reappoint himself.

Mr McHugh withdrew from the tribunal and RIL filed a fresh plea before the Supreme Court for appointment of a third arbitrator to decide on the case.

Sofcon India Pvt Ltd

Sofcon is group of companies since 1995. We are affiliate & funded by NSDC and Sofcon provide PLC Training in Noida and PLC Training in Delhi.



Source:-http://profit.ndtv.com/news/corporates/article-reliance-industries-shared-all-correspondence-with-oil-ministry-technical-arm-report-619675

Monday, 27 October 2014

PLC Numerical Systems

Numerical systems

 INTRODUCTION
 D.1 Decimal numerical system
 D.2 Binary numerical system
 D.3 Hexadecimal numerical system

People were always difficult to except the fact that something is different from themselves or their way of thinking. It is probably one of the reasons why numerical systems other than decimal are hard to understand. Still, whether we like it or not, reality is quite different. Decimal system used in everyday life is by far less used than binary code, which is the working basis for millions of computers across the world.

Each numerical system rests upon its basis. With decimal numerical system, this basis is 10, with binary it is 2, while with hexadecimal it equals 16. Value of each digit depends on it’s position in the number, represented in certain numerical system. Sum of values of each digit is the value of the number. Binary and hexadecimal systems are especially interesting for this course. Besides these two, decimal system will be detailed, too, for the sake of comparison. Although there is nothing new to tell about decimal system, we will give it a look for its relations with other numerical systems.
Decimal numerical system is defined with its basis 10 and decimal positioning from right to left, and it consists of digits 0,1,2,3,4,5,6,7,8,9. This means that the rightmost digit is multiplied by 1 in total sum, next digit to it is multiplied by 10, next one by 100, etc.

Example:
Operations of addition, subtraction, division and multiplication in decimal numerical system are well known, so we will not detail these.
 
D.2 Binary numerical system
Binary numerical system is quite different from the decimal that we got used to in common life. Its basis is 2 and each digit can have one of two values, “1” or “0”. Binary numerical system is used for computers and microcontrollers, because it is much easier for processing than decimal. Usually, binary number consists of 8, 16 or 32 binary digits. Origins of this division are irrelevant for this course, so we will just take it for granted.

Example:
10011011 - binary number with 8 digits

To understand the logic of binary numbers, let us have an example. Let’s assume that we have a cabinet with four drawers and that we should tell someone to bring us something from one of these. Nothing simpler, we could say “in the lower row on the left” and it would be quite sufficient. However, if it must be done without this kind of orientation, left, right, up, down and the likes, then we have a problem. There is a plenty of solutions for the situation, but we should look for the best and the most efficient! Let us mark the columns with A and rows with B. If A=1, we assume the upper row of drawers, and if A=0 we assume the lower. Similar with columns, B=1 is the left column and B=0 is the right column (following picture). Now, it is easier to explain which drawer we think of, just use one of the four combinations 00, 01, 10 or 11. This “naming” of each drawer is nothing more than binary nomenclature of numbers, that is, converting decimal numbers into binary system. In short, labels “first, second, third and fourth” are substituted with “00, 01, 10 and 11”.
We still need to understand the logic of binary numerical system, i.e. how to get the decimal value of a number out of the sequence consisting of ones and zeros. This procedure is called conversion of binary number to decimal value.
As it can be seen, conversion of binary number to decimal value is done by totaling the sum on the right. Depending on the position in the binary number, digits carry different “weight” multiplied by themselves, and totaling them all gives us an understandable decimal number.
Let’s further assume that there are marbles in each of the drawers, 2 in the first, 4 in the second, 7 in the third and 3 in the fourth. Let the person opening the drawers also use the binary system. Under these conditions, question would be “How many marbles are there in 01?”, and the answer would be “There are 100 marbles in 01!” Notice that both question and answer are clear, although we did not use common terminology. Further, notice that two digits are sufficient for decimal numbers from 0 to 3, and that all values greater than 3 require additional binary digits. Thus, for 0 ~ 7 range, three digits are sufficient, four digits cover the range 0 ~ 15, etc. Simply put, the greatest decimal number that can be represented with n binary digits is 2 raised to power n, decreased by one.
Example:
24-1 = 16 - 1 = 15

So, 4 binary digits cover decimal values from 0 to 15, including the values “0” and “15”, which is 16 different values. 
Arithmetical operations that exist in decimal numerical system also apply in binary system. In this chapter, we will cover only addition and subtraction, for simplicity sake.

Basic rules that apply to binary addition are:
Addition works similar to decimal numerical system - we add the digits of the same weight. If both digits added are zero, the result remains zero, while “0” and “1” total “1”. Two ones give zero, but one is carried to the left position.
We can do the check by converting these numbers to decimal system and adding them. Value of the first number is 10, value of the second is 9 and 19 as result, which means that operation was done correctly. Problem occurs when the result is greater than can be represented with given number of binary digits. There are various solutions, one of them being expanding the number of binary digits like in the example below.
 
Subtraction works on the same principles as addition does. Two zeros give zero in result, as do two ones, while subtraction of one from zero requires borrowing one from the higher position in binary number. Example:
Conversion of numbers to decimal system gives as values 10 and 9, with the result of subtraction of 1, which is correct.

Hexadecimal numerical system has number 16 for basis. Therefore, there are 16 different digits used in this system. These are “0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F”. Letters A, B, C, D, E and F represent values 10, 11, 12, 13, 14, 15 and are used for the sake of easier notation. As with binary numerical system, we can apply the same formula here for determining the greatest decimal number that can be represented with a given number of hexadecimal digits.


Example:
162 - 1 = 256 - 1 = 255

Usually, hexadecimal numbers have prefix “$” or “0x” to emphasize the fact that hexadecimal system is used. Thus, number A37E should be represented with $A37E or 0xA37E. No calculations are needed for converting the hexadecimal number to binary system - it is simple substituting of hexadecimal digits with binary ones. Since maximum value of hexadecimal digit is 15, 4 binary digits are required per one hexadecimal.
 
Example:
Check, i.e. converting both numbers to decimal system, gives us value 228 which is correct.

In order to calculate decimal equivalent of hexadecimal number, each digit of number should be multiplied by 16 raised to power equal to the position in the number and then added altogether.
Addition works similar to two previous numerical systems.
Example:
It is required to add the appropriate digits of a number, and if their sum equals 16, that position takes value “0”. Values exceeding 16 should be added to the sum of digits on higher position. First number converted equals 14891, while other is 43457. Their sum is 58348, that is $E3EC converted to decimal numerical system. Subtraction works identically to previously mentioned systems.

Example:
Conversion gives us numbers 11590 and 5970, and the result of subtractions is 5620, that is $15F4 converted to decimal numerical system.
Conclusion
Binary numerical system remains the most commonly used, decimal system the most intelligible, while hexadecimal is somewhere in between. It’s simple conversion to binary system makes it, besides binary and decimal, the most important numerical system to us.

PLC Diagnostics

PLC diagnostics
 INTRODUCTION
 C.1 Diagnostic functions of PLC
 C.2 Non-fatal errors
 C.3 Fatal errors
 C.4 User defined errors
 C.5 Failure alarm - FAL(06)
 C.6 Severe Failure alarm - FALS(07)
 C.7 MESSAGE - MSG(46)
 C.8 Syntax errors
 C.9 Algorithm for finding errors in the program

Introduction
The whole work of PLC controller can be represented with a diagram shown on the following page. After turning on the power, PLC is first initialized (clearing IR, SR i AR areas, presetting system timers and checking I/O lines), and if no errors were detected, monitoring process, program execution, calling the I/O lines and serving the peripheral devices starts to occur in cycles.
C.1 Diagnostic functions of PLC
PLC controller features additional functions that make locating errors easier. Errors can be divided into two categories according to severity :

1. Fatal errors are severe and they prevent PLC controller from operating until their cause is located and solved.
2. Non-fatal errors are those that do not prevent PLC controller from operating. After detecting one or more non-fatal errors, program execution will continue. Nevertheless, it is necessary to correct these errors as soon as possible.
C.2 Non-fatal errors
When one of these errors takes place, indicators POWER and RUN will be on, and the indicator ERR/ALM will blink. Upon locating non-fatal error, manual for the given PLC controller should be consulted and the flags checked in order to understand the cause of a problem and correct the error.
C.3 Fatal erros
When any of the fatal errors take place, PLC controller stops operating and all outputs are shut down. PLC controller cannot be put back to work until the controller is turned off and then turned back on, or until it is switched to PROGRAM mode via peripheral device and the fatal error corrected. With these errors, indicators ERR/ALM are on, while the RUN indicator remains off. It is necessary to check the error flag in the manual of the given PLC in order to locate the cause of the problem and to correct the error.
There are three instructions for user to define his own errors or messages. FAL(06) causes non-fatal error, FAL(07) causes fatal error, while MSG(46) sends a message to program console or to the host computer connected to the PLC controller.
 
C.5 Failure alarm - FAL(06)
Instruction FAL(06) generates the code of non-fatal error that took place to provide the information on the possible cause of the problem for the programmer. Upon execution of the instruction FAL(06) following events take place:

1. Indicator ERR/ALM will blink, while PLC continues to work.
2. Two-digits BCD number of instruction FAL (01 do 99) is written from SR253000 to SR25307.

Same number must not be assigned to both FAL and FALS instructions. To delete the code of an error, error should be corrected and FAL 00 instruction executed.
C.6 Severe failure alarm - FALS(07)
Instruction FALS(07) generates the code of fatal error that took place. In this case the following happens:

1. Program stops and all outputs are shut down.
2. Indicator ERR/ALM is turned on.
3. Two-digit BCD number (01 do 99) of instruction FALS is written from SR 253000 to SR25307.
4. If memory card with RTC is used, part of the memory where the presence of error is recorded will also contain numbers of FALS instruction and exact time when error took place.

Numbers of FALS instruction can be assigned to certain states. Same number must not be assigned to both FAL and FALS instructions. To delete FALS error, PLC controller must be in PROGRAM mode, cause of error solved and then error code deleted.
C.7 Message - MSG (46)
MSG(46) is used for printing messages on program console display. Message cannot exceed 16 characters, and it appears when specified condition is fulfilled.
C.8 Syntax errors
During the program check with operation Program Check, syntax errors are detected. There are three levels of program check at user’s disposal. By selecting the level, types of errors to be checked for are selected. The following table shows types of errors, corresponding messages that appear on display and explains all of syntax errors. Zero level check searches for errors of A, B and C type. First level check searches for errors of A and B type, while the second searches only for errors of type A.

TypeMessageMeaning and the appropriate action
A?????Program is damaged by creating non-existing function in the code. Re-enter your program.
CIRCUIT ERRNumber of logical blocks doesn't match the instructions of logical blocks. Check the program.
OPERAND ERREntered constant is not in allowed range. Change the constant so that it fits in the proper range.
NO END INSTRProgram is missing the instruction END(01). Add END(01) to the last address of the program.
LOCN ERRInstruction is in the wrong place of the program. Check what the instruction demands and correct the mistake.
JME UNDEFDInstruction JME(04) is missing the instruction JMP(05). Correct the number of jump and add the correct JME(04) instruction.
DUPLSame number of jump or subroutine is used twice in the program. Correct the program so that each number is used only once. 
SBN UNDEFDInstruction SBS(091) is programmed for non-existing subroutine. Correct the number of subroutine or create the missing one.
STEP ERRSTEP(08) with the number of section and STEP(08) without the number of section are used illegally. Check the demands of instruction STEP(08) and correct the mistake. 
BIL-ILC-ERRIL(02) and ILC(03) are not used in pair. Check if every instruction IL(02) has its corresponding ILC(03). This message will also appear in case that multiple IL(02) instructions were used with single ILC(03) instruction. Check if that's exactly what you wanted...
JMP=JME ERRJMP(04) and JME(05) are not used in pair. Before proceeding, check if the program is written exactly the way you wanted.
SEN-RET ERRIf the address of instruction SBN(92) is displayed, there are two different subroutines with the same number. Change one of the numbers or delete one of the subroutines in question. If the address of instruction RET(93) is displayed, RET(93) wasn't used appropriately. Check the demands of this instruction and correct the mistake.
CCOIL DUPLSame bit is controlled by more than one instruction (for example, OUT, OUT NOT, DIFU(13), KEEP(11), SFT(10)...). Although certain instructions allow this, you should check the demands of specific instructions, make sure that the program is correct or rearrange the program so that each bit is controlled by single instruction.
JMP UNDEFDJME(05) is used without JMP(04) with the same number of jump. Add the instruction JMP(04) with the same number or delete JME(05) that is not used.
SBS UNDEFDThere is a subroutine that is not called by SBS(91). Add subroutine call to an appropriate place in the program or delete the subroutine.
C.9 Algorithm for finding errors in the program


Saturday, 25 October 2014

PLC Expanding the number of input/output lines

APPENDIX A   Expanding the number of input/output lines
 INTRODUCTION
 A.1 Differences and similarities
 A.2 Marking the PLC controller
 A.3 Specific case

Introduction

This appendix is an answer to the question “What if more input or output lines are needed ?”. Model detailed in the book carries the mark CPM1A-10CDR-A and is taken as an optimal for it’s price and features. Alternative models with greater number of lines include CPM1A-20CDR-A, CPM1A-30CDR-A or CPM1A-40CDR-A. The last two can be expanded with three additional modules with 20 extra I/O lines each, totaling 100 I/O lines as a maximum (if this is still insufficient, maybe it is time for you to start using some of more powerful PLC controllers).
If not even the most powerful model of CPM1A family satisfies your needs, then extra modules with 20 I/O lines are added. This form of connection reaches 100 input/outputs, which is a significant number in industrial proportions.

A.1. Differences and similarities

Taking the other model of PLC controller from CPM1A class basically doesn’t change a thing! Everything said for one model also applies to the other. Only thing that changes is the number of screw terminal and the number of bits in IR area connected to that screw terminal. If model with 10 I/O lines (model described in the book) has 6 inputs on addresses IR0000 - IR0005, then the 20 I/O lines model will have 12 inputs on addresses IR0000 - IR0011. Expanding itself should not be a problem. After taking off the cover on the right side, there is a connector which is then connected to the expansion module via flat cable. Still, it requires skill when assigning inputs and outputs because expansion increases the cost of the project. All the models and expansions of CPM1A class carry additional marks defining them more precisely.

Description      
Input points
Output points
Power Supply
Model Number
10 I/O points      
6 points
4 point Relay Output
100 to240 VAC, 50/60 Hz
CPM1A-10CDR-A

24 VDC
CPM1A-10CDR-D
Transistor NPN
24 VDC
CPM1A-l0CDT-D
Transistor PNP
24 VDC
CPM1A-10CDT1-D
20 I/O points

12 points
8 points
100 to 240 VAC, 50/60 Hz
CPMlA-20CDR-A
24 VDC
CPM1A-20CDR-D
Transistor NPN
24 VDC
CPM1A-20CDT-D
Transistor PNP
24 VDC
CPMlA-20CDT1-D
30 I/O points
18 points               
12 points
100 to 240 VAC, 50/60 Hz
CPM1A-30CDR-A
24 VDC
CPM1A-30CDR-D
Transistor NPN
24 VDC
CPM1A-30CDT-D
Transistor PNP
24 VDC
CPM1A-30CDT1-D
40 I/O points

24 points               
16 points
100 to 240 VAC, 50/60 Hz
CPM1A-40CDR-A
24 VDC
CPM1A-40CDR-D
Transistor NPN
24 VDC
CPM1A-40CDT-D
Transistor PNP
24 VDC
CPM1A-40CDT1-D

Notice that PLC controllers with 10 and 20 I/O lines do not have an expansion port. Generally speaking, if there is the slightest possibility for expansion in the project, PLC controller with 30 or 40 I/O lines should be used.

A.2. Marking the PLC controller

Marking the controller and the expansion module undergoes three criteria. The first is voltage, the second is the type of input/output and the third is number of I/O lines. The picture below is self-explanatory.

A.3. Specific case
If two 20 I/O lines expansion modules and one analog module are added to 30 I/O lines model, assigned inputs/outputs will have the addresses from the following table.

UnitAssigned input bitsAssigned output bits
1Central processing unit (CPM2A-30CDX-X)IR 00000-IR 00011 and IR 00100-IR 00105IR 01000-IR 01007 and IR 01100-IR 01103
2Unit for I/O expansion (CPM1A-20EDxxx)IR 00200-IR 02011IR 01200-IR 01207
3Analog I/O unit (CPM1A-MAD01)IR 00300-IR 03015 and IR 00400-IR 00415IR 01300-IR 01315
4Unit for I/O expansion (CPM1A-EDxxx)IR 00500-IR 00511IR 01400-IR 01415

Friday, 24 October 2014

CHAPTER 7 EXAMPLES

   

CHAPTER 7  EXAMPLES

Introduction

7.1 Self-maintenance
7.2 Making large time intervals
7.3 Delays of ON and OFF status 
7.4 Counter over 9999
7.5 Alternate ON-OFF output
7.6 Automation of parking garage 
7.7 Operating a charge and discharge process
7.8 Automation of product packaging
7.9 Automation of storage door


Introduction

Programming only related examples make up the first group of examples. They are given as separate small programs that can later be incorporated into larger ones. Second group consists of examples which can be applied to some real problems. 


7.1 Self-maintenance

Program allows input to remain at ON status even when the condition that brought it to that status stops. Example in picture below illustrates how use of a key connected to the input IR000.00 changes IR010.01 output status to ON. By letting the key go, output IR010.01 is not reset. This is because IR010.01 output keeps itself at status ON through OR circuit (having IR000.00), and it stays in this status until key at input IR000.01 is pressed. Input IR000.01 is in I connection with the output pin IR010.01 which cancels out a condition, and resets an IR010.01 bit. Example of self-maintenance is quite frequent in specific applications. If a user was connected to IR010.01 output, START and STOP functions could be realized from two keys (without the use of switches). Specifically, input IR000.00 would be a START key, and IR000.01 would be a STOP key.
7.2 Making large time intervals

If it's necessary to make a bigger time interval of 999.9 seconds (9999x0.1s) two linked timers, or a timer and a counter can be used as in this example. Counter is set to count to 2000, and timer is set to 5 seconds which gives a time interval of 10.000 seconds or 2.77 hours. By executing a condition at IR000.00 input, timer begins to count. When it reaches the limit, it sets a flag TIM001 which interrupts the link and simultaneously resets a timer. Once 5 seconds have run out, flag TIM001 changes its status to ON and executes a condition at the counter input CNT002. When a counter numbers 2000 such changes in timer flag status, TIM001 sets its flag CNT002 which in turn executes a condition for IR010.00 to change status to ON. Time that has elapsed from the change of IR000.00 input status to ON and a change of IR010.00 input status to ON comes to 10.000 seconds.

Ladder Diagram:

7.3 Delays of ON and OFF status

Example shows how to make output (IR010.00) delay as opposed to ?(in relation to ?? unclear meaning) input (IR000.00). By executing a condition at IR000.00 input, timer TIM000 begins counting a set value 10 in steps of 0.1 seconds each. After one second has elapsed, it set its flag TIM000 which is a condition in changing output status IR010.00 to ON. Thus we accomplish a delay of one second between ON status of IR000.00 input and ON status IR010.00 input. By changing IR010.00 output status to ON, half of the condition for activation of the second timer is executed. Second half of the timer is executed when IR000.00 input changes status to OFF (normally closed contact). Timer TIM001 sets its flag TIM001 after one second, and interrupts a condition for keeping an output in ON status.

 

Ladder Diagram:

7.4 Counter over 9999

If you need to count over 9999 (maximum value for a counter), you can use two connected timers. First counter counts up to certain value, and the other one counts flag status changes of the first counter. Thus you get the possibility of counting up to a value which is a result of set values of the first and second counter. In an example at the bottom, first counter counts up to 1000, and second up to 20 which allows you to count to 20000. By executing a condition at IR000.00 input (line whose changes are followed is brought to it), first counter decreases its value by one. This is repeated until counter arrives at zero when it sets its flag CNT001 and simultaneously resets itself (is made ready for a new cycle of counting from 1000 to 0). Each setting of CNT001 influences the other counter which sets its flag after twenty settings of the first counter's flag. By setting CNT002 flag of the second counter, a condition is executed for an IR010.00 output to be activated and to stay in that status through self-maintenance.

Ladder Diagram:


Same effect can be achieved with a modified program below. First change is that there is a "switch" for the whole program, and this is IR000.00 input (program can accomplish its function only while this switch is active). Second change is that the line whose status is followed is brought to IR000.01 input. The rest is the same as in the previous version of the program. Counter CNT002 counts status changes of the CNT001 counter flag. When it numbers them, it changes the status of its flag CNT002 which executes the condition for status change of IR010.00 output. This changes IR010.00 output status after 20000 changes of input IR000.01.

Ladder Diagram:

 

7.5 Alternate ON-OFF output

Example makes a certain number of impulses of desired duration at PLC controller IR010.00 output. Number of impulses is given in instruction of the counter (here it is a constant #0010 or ten impulses) impulse duration in two timer instructions. First timer defines duration of ON status, and second one duration of OFF status of IR010.00 output bit. In the example these two durations are the same, but through assigning them different parameters they can differ so that duration of ON status can be different from duration of OFF status.


Program starts executing a condition at IR000.00 bit. Since a normally closed contact which refers to counter flag (that isn't set ) is linked with this IR000.00 bit in "I" circuit, this status of IR200.00 bit will change to ON. Bit IR200.00 keeps its status through self-maintenance until counter flag is not set and a condition interrupted.

When an IR200.00 bit is set, timers TIM001 and TIM002 start counting a set interval number at 0.1 s ( in the example, this number is 10 for the first timer, or 20 for the second timer, and this sets the period of one or two seconds). With both timers, a normally closed contact which refers to TIM002 timer flag is connected with IR200.00 bit. When this flag is set which happens every two seconds, both timers are reset. Timer TIM002 resets timer TIM001 and itself, and this starts a new cycle. 

At the start of a program, IR010.00 output bit changes status to ON and stays in this status until TIM001 flag changes status to ON (after one second). By changing TIM001 flag status to ON, condition is broken (because it is represented as normally closed contact) and IR010.00 bit changes status to OFF. 

IR010.00 output status changes to ON again when time has run out on TIM002 timer. This resets TIM001 timer and its flag which in turn executes a condition for status change of the IR010.00 output. Cycle is thus repeated until a counter numbers 10 changes of TIM001 flag status. With the change of status of CNT000 counter flag, a condition for an assisting bit IR200.00 is broken, and program stops working. 

Ladder Diagram:
 

CHAPTER 6 SYSWIN program for programming a PLC controller

   

CHAPTER 6  SYSWIN program for programming a PLC controller

Introduction
6.1 Connecting a PLC controller with a PC computer
6.2 SYSWIN program installation
6.3 Writing your first program
6.4 Saving a project
6.5 Program transfer to PLC controller
6.6 Testing program function
6.7 Interpretation of "Tools" icons
6.8 PLC controller working modes
6.9 Run mode
6.10 Monitor mode
6.11 Program-Stop mode
6.12 Program execution and monitoring
6.13 Impact on the program during monitoring
6.14 Graphic representation of dimension changes in a program

Introduction

SYSWIN is a software designed for OMRON programmable controllers class C and CV. It is designed for creating and maintaining a program, as well as for testing PLC controller function, in off-line and controller's operational regime. 
Necessary conditions for starting SYSWIN are Microsoft Windows environment on a standard IBM or 386/486 compatible or Pentium computer, with 8MB RAM at least, and 10MB free disc space. 

6.1 Connecting a PLC controller with a PC computer

PLC controller is linked with a PC computer through an RS-232 cable. One end of the cable is connected to a serial PC port (9-pin or 25-pin connector), while the other end is connected to an RS-232C connector on RS232 module of a CPM1A controller. In order to establish a connection with a PC, DIP switch on the connector must be set in "Host" position. 
 
 

6.2 SYSWIN program installation

Instruction package for CPM1A is covered by three SYSWIN installation diskettes. It can be installed in Windows 3.1, 3.11, 95, 98 or NT 4.0. In order to start the installation you need to select RUN option from a START menu.

 
A window will come up like the one below where you need to write in the file command "setup.exe". Mentioned file can be found in the installation directory of Syswin program. Following a brief installation procedure you will get a program group Syswin 3.4.
Double-click on Syswin icon starts a Syswin program which opens as in the following picture. 
 
 

6.3 Writing your first program

Writing a program begins with New Project option from a File menu. In a message window that appears you need to select options as in picture below.
 

Select a PLC controller by clicking on OK, and a program is ready to be used. It is recommended when you begin working that you write in a header a title of a program, author's name and inputs/outputs used. This may seem as a waste of time, but really isn't because this habit of writing comments will pay off in the future. 

Program written here is just a basic program made for learning Syswin. Program can detect when a key has been pressed and can activate a relay at the PLC controller output. As long as the key is pressed down, a relay is active. Operation of a relay and a key can be followed via LED diodes on PLC controller housing. Writing a program begins with a click on the first icon to the left, recognized by two vertical lines. Icon beneath this one is similar to the first but for a slash. These two icons correspond with concepts normally open and normally closed contact which all instruction lines start with. You can select an option with an open contact by clicking on the first icon. When you click on the black rectangle to the right, a small window will appear where you need to write in the address of a bit a contact relates to. 

It is very important to use addresses in a regular way when programming with SYSWIN. Addresses can have two parts, first refers to the word address, and the second to bit address in that word (both numbers must be separated by a period). For example, if address 200 is used, SYSWIN will interpret this as 2.00, and a zero bit whose word address is 2 will be called for. If you wish to access word 200 or its zero bit, you must use a call 20000, or better even 200.00. In this example address 000.00 is assigned for input address (key). This address represents a zero bit for word 000 from memory region IR. Simply said, it is an input screw terminal designated as 00 input. By connecting a key to it, and to one of the COMM terminal screws, a needed connection between PLC controller and keys is established.
 

Address dialogue box for a bit that contact refers to
When you have written in 000.00, select OK, and first segment of the program will come up. Bit address will appear above the symbol with two vertical lines which refers to this bit, and a black rectangle will move one space to the right.
 

First element of a program myprog.swp

First instructions up to the bus bar are called conditions because their execution activates instructions found to the right of the condition instructions. When a condition is entered, you also need to enter a corresponding instruction that is set off by an execution of the condition. In this example it is a relay controlled by a 00 bit in a word 010 of memory region IR. Output instructions are represented by a circle, or a circle and a line if we are dealing with a normally closed contact. By clicking on the icon with a circle, you select an output option with normally open contacts. Click on a black rectangle, and a contact window will come up where you need to write in the address for the output bit 010.00. Output of the IR region is found at address IR010, and first four bits of this word represent a relay within a PLC controller (if we are talking about a model CPM1A with relay outputs). Program done so far looks as in picture below.
     
Second element of myprog.swp program 
 
The basic functional entirety of some program is Network. Program consists of several networks found one below the other. Operations with these are found in Block option of the menu. Of all options, two basic ones, Insert network and Delete network are used the most. Other makers for PLC controllers use different concepts such as Rung instead of the term Network. Simply said, we are talking about a PLC program sequence which has one or more executing instructions, and along with END instruction can make up one correct PLC program. As the first network in a program is already in use, the next one has to be added. Adding a Network is done with Insert network command from a Block menu. 
 
 

When selecting this option, a small window appears where you need to select whether a new network will appear above or below the existing one.

 
In our case you should choose the second option and click on OK. Following this, a new network appears as in picture below.
 

Last network in every program must contain END instruction. Since this is a simple example, second network is also the last. End instruction is found among the functions. In order to come to it, you need to click on FUN icon following which a window as in picture below will come up.
 

Selecting a function by clicking on FUN icon.

END instruction can be obtained either by writing in "END" in newly obtained window or by clicking on Select which gives all PLC controller instructions sorted by the regions as in the following picture.


Selecting END instruction from a set of instructions sorted in regions.

By entering the END instruction your writing of a program is finished. Finished program looks as in the following picture.

 

Finished myprog.swp program


6.4 Saving a project

Since you've finished writing a program, you need to save a project. Select Save Project option from a File menu, and write in the file name in a message window (myprog.swp in this case). After you click on OK, project will be saved. You can access SYSWIN file contents only from SYSWIN; file type is identified by extension:

Project.swp - SYSWIN program

Project.swl- SYSWIN library

Project.swt - SYSWIN pattern

Project.swb - SYSWIN back-up file

Project.prg - PMD program


6.5 Program transfer to PLC controller

First you need to check whether PLC is connected with a PC correctly, and you'll do this by checking physical connection through a serial cable. Following this you need to select a Communication option from Project menu in order to set parameters for serial communication. Of all the parameters, the most important one to be selected is a serial port of a computer that PLC is connected to. Default settings for CPM1A are: COM1, 9600 Baud, Unit 00, protocol ASCII 7 bit Even Parity 2 stop and they need to be left so. To check how communication functions, you can click on Test PLC to test link with a PLC controller.
 

When a connection has been established, program transfer begins with a click on download from Online menu. Select expansion function or memory allocation. Before you program a PLC, it's good to erase program's memory contents. Finally, after a successful program transfer to a PLC, a message window will come up to inform us of this.


6.6 Testing program function 

Program check option from a Project menu allows testing of program function. Message that appears following a command has several options that can be selected before you run a test. Once these options have been selected, click on Execute, and a report on testing and errors will be displayed. You can further check for errors, and there is also a 'Go to Network' command which transfers you to a segment where the error was found. 

SYSWIN has classic editorial capabilities, such as Edit/Find or Edit/Replace commands. Searching through a program for assigned values or symbols is quick and offers a large number of optional filters. We can search through an entire program or its segments, and this is defined with option call. Also, there are possibilities for defining a search path, as well as for different actions when looking for a desired element.

Beside this, SYSWIN provides various advantages in situations where we need permanent archiving of user program. It is especially important to periodically print projects that are made quick and easy by SYSWIN. Projects can be printed in many different formats, and printing can include specific sections of a project. 

6.7 Meaning of "Tools" icons

SYSWIN has several types of editors among whom a relay diagram also known as relay editor, or first editor that awaits us upon starting a SYSWIN program is the most frequently used editor. 

First we need to explain tools palette (Drawing Tools) and the meaning of each icon. Aside through the usual mouse click, you can access the specific elements of this palette from a keyboard. You'll find a corresponding key of the keyboard by each icon, and you can accomplish the same action with it as you would using a mouse.

 


By clicking on the icon, we have selected a desired tool, and with a click on network section this symbol will be stored in a program. Explanation for each of the icons is given as follows:
 
Open contact icon. By clicking on this icon (or using a key '"') we enter an open contact into Network. We need to position the element we have entered at a specified place (black space). Following this, a message window where data can be entered (open contact address-number of words, bit position) is activated automatically. 
 
Closed contact icon. By clicking on this icon (or '/' on keyboard) we enter a closed contact or inverted condition into network. 
 
Horizontal line. By clicking on this icon (or using '-' on a keyboard), horizontal line is lengthened out from left to right. SYSWIN, however, retains a right to make drawn lines optimal in terms of length, or to point out possible errors. This option is used when you need to add another condition before an instruction contingent upon this condition, or when something simply can not fit. 
 
Vertical line. With a click on this icon, or use of '?', we draw vertical lines from top to bottom. This option is necessary to realize parallel connections between contacts.
 
Output instruction. This represents an instruction that is executed if condition instruction preceding it is executed. With the help of this instruction we advance a result of logical expression with output variables (bits). We can arrive to this instruction with the help of keyboard ('O' key). 
 
Inverted output instruction (shortcut-key 'Q'). Similarly to the previous case, with this executing instruction we advance a result of logical expression to an output bit, and the only difference is that this bit is turned on if a condition is not executed and vice versa. 
 
PLC functions (shortcut-key 'F'). Click on this icon accomplishes possibility of installment of complex PLC instructions into a program. Window that appears following a click on the icon contains all instructions sorted by sections. Some of these instructions are given separately as icons, and some can be accessed only through this option. One such instruction is END instruction which is used in each program. Window that comes up is displayed in the following picture.
 

When this window pops up, select an instruction and click on OK. 
 
Click on this icon (or using 'T' key) will give you an option to enter a timer into the program. Using a mouse, click on the bright area of the monitor, and a message window comes up where you can enter needed information relating to a timer (timer designation and duration in milliseconds). This way, we get a classic timer or timer with a delay when turned on. If some other version of a timer is needed, preceding FUN icon should be used, and option Timers and counters (see picture above) selected. 
 
Counter icon. Click on this icon (or 'C' key), and this will install a classic counter into a PLC program. Prior to this we enter needed information in message window: designation of the counter (CNT001 for instance) and counter value. Change of counter status (decrementing by 1) is done when an input signal (CP) changes from OFF to ON status. 
 
With this icon we can invert previously entered contact, output or input. Inversion is done so that we first click on this icon, and then on a variable whose inversion we wish to perform. 
 
Erase icon. Click on this icon and a shaded area of network erases the shaded part of the program. 

Mouse plays an important part in the SYSWIN program. Each double-click on any PLC instruction results in a corresponding editor where necessary changes can be entered. This principle is accordingly installed into SYSWIN, so double-click on block or network heading (BLOCK HEADER BAR or NETWORK HEADER BAR) gives the same results. 

6.8 PLC controller working modes

There are several ways to find out the present working mode, for example from an Online Mode menu or its display in a Toolbar. This option is accessible if communication was successfully established with a PLC controller.

If we choose a mode that differs from a present one, change of mode will be momentary. In order to avoid an accidental change of PLC controller mode, there is an option that obliges a computer to ask a question before each mode change, whether that is the option a user really wants (this option is included as default). PLC controller has three modes in class C, MONITOR, RUN and PROGRAM/STOP mode. 

6.9 RUN MODE

This PLC mode enables program to be executed as basic operation. It is used in final testing, after a program has been tested in detail, and errors have been eliminated. SYSWIN can not change memory contents of PLC controller in this mode, neither is the change of a program being executed possible. Of course, when program is finished and tested, PLC begins its new life in command closet, being first set to RUN mode. 

6.10 Monitor mode

In this mode, program execution is possible, as well as editing and monitoring during operation. This is the most frequently used mode in program development. When this mode has been selected, controller has an obligation to supply a PC with information which relates to program itself, or more precisely to status of variables in the program. If we additionally confirm Monitoring option from an Online menu, we can follow current values of variables on the monitor itself, in real time.

All changes in inputs and outputs can be viewed on the monitor, and status of variables and program locations used in the program are registered and memorized. 

6.11 Program-Stop mode

Choosing this mode simply stops a PLC controller if PLC was in RUN or MONITOR mode. It is used for data and program transfer to PLC controller. 

6.12 Program execution and monitoring

Program transferred from a PC to a PLC starts executing at the moment when you move from a Stop/Program mode to a Monitor or Run mode. When Monitoring function starts executing, some sections of the monitor will be shaded (see picture above), and this way you can follow program execution. Monitoring is active during editing of some program segment, and is stopped at the moment when a changed section of the program is transferred into a PLC controller. 

6.13 Impact on the program during monitoring

During monitoring, you can use the right button on the mouse to call up a menu of some elements of ladder diagram. Menu that appears when we click on location where address of some bit is positioned, contains the following elements:

Force Set - used for permanent forced set up of bit status to ON
Force Reset - used for permanent forced set up of bit status to OFF
Cancel - cancels out the forced status
Set (1) - used for a brief change of bit status from OFF to ON status
Reset (0) - used for a brief change of bit status from ON to OFF status
Cancel All - cancels out forced status of all bits

With the help of these options, status of bits can be changed, word contents in controller memory can also be changed, and all or some of the earlier forced settings can be cancelled out. The concept of forcing entails forced set up of some input/output to ON or OFF status for program reevaluation. At the moment when PLC leaves monitoring regime, data on forced bits and words is lost. Simultaneous forcing and evaluation of contents of a greater number of dimensions, and Data Set Bar is used for this, usually found at the bottom of the monitor (see previous picture). Editing as well as defining an area in Data Set Bar is accomplished with a double click following which a corresponding message window appears, and we write here address for the bit whose status we are following.

6.14 Graphic representation of dimension changes in a program

SYSWIN allows graphic representation of dimensions with time as abscissa. When a monitoring mode is in use, monitor display changes through time, showing changes in values of monitored dimensions. Monitor refreshment is done after a reception of each sample where sample intervals are 0,1-65.5 seconds. Graphics saved in this way can be stored for later analysis as a file, or read in an already saved file.

Procedure for starting graphic monitoring is following:

- from Editors menu select Time chart monitoring option
- from a new tools palette select Trace Configure (pictured as a key).
- Fill out message box Configure Time Chart Monitor (see next picture)
- From Online menu choose Tracing.

With Trace/Configure command adjust parameters for monitoring. Necessary parameters are Trigger or an event where saving will begin, sampling period and bits and/or words whose values we are monitoring. Mapping of a time diagram for dimensions previously specified begins after the last command.

Quitting is done with a click on a black square icon, and restarting is performed by clicking on an a red circle icon. Return to the editor with a ladder diagram by clicking on Editors menu and Program editor submenu.