Home
programmable logic controller programming software user manual
Contents
1. It is possible to toggle the state of an output by double clicking the mouse in the state column If the state is OFF then a command will be sent to the PLC to turn the output on Once the output has turned on the state will change to ON Note that you cannot toggle the state of an input or system value PROCON ELECTRONICS 19 Prosoft 7 2 View Memory in Debug Mode If you click the mouse pointer on the PLC gt View Mem menu item a box will open which shows a list of the memory registers in the PLC You can use the scroll bar to move up or down the list The list does not have pre defined values as with the I O box The reason for this is to give you flexibility in what you view on the screen at any one time For instance you might want to view the current value of timer 1 which might be in memory address 12 refer to the memory map of your PLC to get the correct address Type 12 into the first column and you will see the current value automatically change in the value column If you now want to view a value your program has in memory address 98 you would enter the number 98 into the second row first column and the corresponding value will be shown in the value column If you want to alter the value of a memory location then all you have to do is double click the mouse in the value column This action will bring up another box which allows you to enter a new value from the keyboard Clicking the mouse pointer on the Update button will write the
2. ladder circuit runs before the DOWN ladder circuit so the UP motor always turns on first To solve this we need to remember which direction we were traveling in when we stopped the motor This is done by adding another internal relay R3 which we call U D_L or UP Down latch When the door goes UP we set this relay on When the door goes down we reset this relay to off If we now add the contact from this relay to be in series with the BUTTON for each of the motor controls then if the motor was going up the U D_L normally closed contact will be open This prevents the motor from going up again after a stop and so the down circuit can be operated FiGiet A DOWN TOP_L Ii R3 12 RS D2 01 sal BUTTON UD LA Top L STOP DOWN Up 01 R3 4 d Up UD L 11 R3 13 R5 01 D2 ae HH BUTTON UD LA bor L STOP UP DOWN 02 R3 6 o DOWN UD LA Now try adding a timer so that a LIGHT on output 3 comes on for 10 seconds each time the button is pressed The BUTTON sets the LIGHT on This starts the timer When the timer reaches the set point 100 X 0 15 10Sec the timer contact closes which resets the LIGHT to off and on the next scan the timer is stopped T1 6 10 o Timer 1 LIGHT PROCON ELECTRONICS 66 ProSoft 9 3 Up Down Counter Example It is required to generate an up down counter which has 2 up inputs and 2 down inputs The counter must switch on a light when a maximum count of 1500 has been reached e The standard counter function blo
3. new value to the PLC memory Try changing the value in memory address 98 to 1234 it D WORFACA pictestisample1 pce PL401 File Ladder DLC About RpZ0500 Mew Memory Simulation Mode Memory Location 12 Simulate Mode PLE Running 7 3 Start Stop PLC in Debug Mode When you are in debug mode it is possible to stop the PLC and then start the PLC again by clicking the mouse pointer on the PLC gt Start PLC or PLC gt Stop PLC menu items You can still view all the memory addresses and l O statuses when the PLC has been stopped PROCON ELECTRONICS 20 ProSoft 8 LADDER LOGIC This section explains the layout of the memory the layout of a ladder program and each of the elements that can be used in a ladder program 8 1 PLC Operation When the PLC is running a program it runs in a continuous loop Each pass around the loop is called a CPU SCAN The scan time consists of the time taken to read the inputs run the ladder program write the outputs and to do housekeeping work such as updating the timers handling the communications and any other PLC specific tasks The diagram below shows a typical PLC scan cycle ye y SELF TEST READ INPUTS RUN LADDER PROGRAM WRITE OUTPUTS COMMUNICATIONS ETC t ae The PLC reads the inputs from the physical hardware and copies their values to memory The PLC ladder program uses the information from memory This makes the PLC faster and avoids cases where an input changes
4. program The arrows coming together show the line being deleted and the program being shifted to close the gap T 4 1 16 Insert Line aL The insert line toolbar is used to insert an empty line on the ladder program The arrows facing apart show the ladder program being shifted apart to make space for the new line 4 1 17 CopyLines LI The copy line toolbar is used to copy one or more lines from a part of the ladder program to another part This is useful to save time re entering repetitive lines of ladder program 4 1 18 Move Lines NM The move line toolbar is used to move one or more lines from a part of the ladder program to another part This is useful if it is necessary to re order the sequence of the ladder program and saves you from having to re enter the program 4 1 19 Shift Element Right The shift element right toolbar is used to move the selected element one position to the right This task will only be performed if the position on the right is not already occupied 4 1 20 Shift Element Left The shift element left toolbar is used to move the selected element one position to the left This task will only be performed if the position on the left is not already occupied PROCON ELECTRONICS 15 ProSoft 4 2 CREATING A SAMPLE PROGRAM The following example takes you through the steps of creating a simple ladder program You may need to refer back to the previous chapters for some of the actions 4 2 1 Step 1 C
5. 4 1 8 NO O e a 14 4 1 9 vendedoras 14 AS E RA KI EE 14 CDN RE RES RE tati 14 Ski SUNOS OUPO roto lille 14 ANN Colmiients sona elite 15 AA Delete le mentores callado adi 15 ALO Delete AAG station 15 A STAGE EE 15 AMM e Et 15 e eege 15 AMO AM E ao 15 AZO STO Ee E EE 15 4 2 CREATING A SAMPLE PROGRAM 16 4 2 1 A beetebuerg 16 4 2 2 Eden 16 4 2 3 EE sect O EE 16 ye A cose EE 17 0 PROGRAMMING THE PLC roca 18 Te DEBUGOIN THE PEE odia ataco 19 7 1 View TO status a Debio Mode ardid 19 dez NIE Memory 10 Debus Mode dadas 20 7 3 Stary stop PEC mm Debus Moderada a 20 8 2 ERT EE E 21 8 1 PEC OD onda dolia 21 8 2 PIA MEMON td 22 8 3 Basie Rime Conf ura ONS EE 24 6 Ladder Ereegnes 26 8 5 Ladder Eeer illo dias 21 8 5 1 Ladder Inputs Normally Open Closed Contact 21 8 5 2 Ladder Inputs Positive Negative Edge Contact 21 8 5 3 Ladder Inputs Function Cont Itea a r a ewe alias 28 833 1 Function Contact Mem Mea dass 28 8 5 3 2 Function Contact Mem Const aenea a AN 29 8 5 3 3 Function Contact Mem Mem 29 8 5 3 4 Function Contact Mem Constt 29 PROCON ELECTRONICS 3 ProSoft 8 5 3 5 Function Contact Mem gt Mem 30 8 5 3 6 Function Contact Mem gt onst 30 8 5 3 7 Function Contact Mem Mem 30 8 5 3 8 Function Contact Mem lt Const cooocccncnnccnnonoccnnonocononaconnnnanoncnnacononnocnnnnncccnnnnicinons 31 8 5 4 Ladder Outputs Normal Inverted
6. 4 2 6 E a J 10 11 12 13 Rp 0520 PROCON ELECTRONICS 24 ProSoft e Input contacts can be put in parallel This is known as an or function For example in the diagram below Input 1 OR Input 2 must be on for the Output 1 to go on COL 1 E 2 4 Rp 50 al 6 E E E 10 11 Le 13 RLYL e Arowcan be split so that outputs can also be put in parallel This is used when the same condition is used to switch more than one output For example in the diagram below Input 1 will turn on Output 1 AND OUTPUT 2 COL 1 E S d o rf 11 Poco 1 ERT 5 6 El 10 LL 12 15 e tis also possible to put input contacts in the split For example in the diagram below Input 1 will turn on Output 1 Input 1 AND Input 2 will turn on OUTPUT 2 COL 1 E a d Ii i ep e ie n O IP1 IFz 5 6 Z 5 9 10 1i 12 15 ol RLYL Oe RLYT2 The series and parallel ladder circuits can be combined into a single rung For example in the diagram below the Output 1 will turn on if either Inout 1 AND Input 2 is on OR Input 3 AND Input 4 is on COL 1 2 5 4 5 R E 11 12 E EJ i 4 1P1 IP 13 14 a 2 1P3 1P4 PROCON ELECTRONICS 25 10 11 12 13 ol RLYL ProSoft 8 4 Ladder Program Processing When the PLC runs the ladder program it steps through each of the elements starting at the top left and ending at the bottom right When the PLC gets to the END of
7. Output 31 8 5 5 Ladder Outputs Sey Reset Oolpll Vsicindi ti as 31 8 5 6 Ladder Outputs Standard Funcpons 33 8 5 6 1 Function Output Timer 0 1Sec amp TmerO lSech 33 8 5 6 2 Function Output TimerA 0 1Sec and TimerA OOlSaech 34 S055 Funcion Gutput COUNTER aa 35 8 5 6 4 Function Output Cntr Up Down Type IA 35 S00 Funcor Output NOP EE 36 52 00 Runcion Output ACE NID aaa e 36 8 5 6 7 Function Output LD Load Accumulator oooooooooooooaoooonncnncnnnnnnnnnnnonononanannnnnnnos 36 3 000 unci n Output OUT ia ida 37 83 07 Punci onr Output AND dias 38 8 5 6 10 Function Output AOR ha lio 39 8 5 6 11 Functor Output gt EN TEE 40 8 5 6 12 Function oumu CMP ala lol land 41 8 5 6 13 EE EE ADD EE 41 8 5 6 14 Funcion EE EE SUD dass 42 8 5 6 15 teo O MUL EE 42 8 5 6 16 Funcion ouput DI ias 43 8 5 6 17 Funcion CAP E D EE 43 8 5 6 18 Function Output DECI a E N 43 8 5 6 19 Function Output INV a 44 8 30 20 Function Output MOYA 44 8 5 6 21 Function Output SHL ere ia 44 8X022 Funcion Output SHR EE 45 8 30 23 Function Output CALI a 46 8 5 6 24 Function Output SUBR lacio 46 8 5 6 25 Punction Output NEE 46 8 5 6 26 Purnction Output RAND a EEN 47 8 5 7 Ladder Outputs Advanced Funcpong a 48 8 5 7 1 Function Output LDD Load Double 48 8 5 7 2 Function Output OUTD Out Double 49 So Funchonr Ouiput ECH RR AE 49 e ER EE ge ER Ouiput ORD EE 5
8. PLC where values are Address to be written to or read from depending on the function See the Memory map of the PLC in the manual for the PLC that you are using to get the correct address for these registers 4 Range This is the number of registers to be read or written Slave This is the address of the memory in the slave unit where Memory values are to be read from or written to You will need to refer Address to the memory map of these registers in the manual for the slave unit Timeout This is the time that the communications driver will wait for a response from the slave device before a timeout error occurs The time is a multiple of 10 milliseconds 7 Function This is the Modbus function that determines if the poll is a read or a write The following functions are supported 1 Read a range of bits 3 Read a range of registers 15 Write a range of bits 16 Write a range of registers This parameter must always be the last parameter called as it also starts the communications transmission There are two system bits that are associated with the communications port These are the CommReady bit and the CommError bit The CommReady bit is normally off and will indicate that the communications port is ready for anew message As soon as the new message has started transmitting this bit is set to on This bit is used in the ladder logic program to prevent a second message from being sent out before the previous m
9. and memory M44 has the value 0000 0000 0000 0110 and memory M45 has the value 0000 0000 0001 1000 the result in the accumulator 0000 0000 0000 1000 0000 0000 0000 0010 Rp 5E20 Miz PROCON ELECTRONICS 49 ProSoft 8 5 7 4 Function Output ORD This function logically OR s the 32 bit accumulator with memory M and memory M 1 or with a constant K The result is placed in the accumulator If the accumulator has the value 0000 0000 0000 1100 0000 0000 0000 0011 and memory M44 has the value 0000 0000 0000 0110 and memory M45 has the value 0000 0000 0001 1000 the result in the accumulator 0000 0000 0001 1100 0000 0000 0000 0111 POCO Miz ORD Mad 8 5 7 5 Function Output XORD This function logically Exclusive OR s the 32 bit accumulator with memory M and memory M 1 or with a constant K The result is placed in the accumulator If the accumulator has the value 0000 0000 0000 1100 0000 0000 0000 0011 and memory M44 has the value 0000 0000 0000 0110 and memory M45 has the value 0000 0000 0001 1000 the result in the accumulator 0000 0000 0001 0100 0000 0000 0000 O101 Rpg A M12 omy Mdd PROCON ELECTRONICS 50 ProSoft 8 5 7 6 Function Output CMPD This function Compares the 32 bit accumulator with memory M and M 1 or with a constant K If the value in the accumulator is less than the value in memory constant then system bit S6 is turned on If the value in the accumulator is
10. binary ae pad A PROCON ELECTRONICS 45 ProSoft 8 5 6 23 Function Output CALL This function is used to call a subroutine The constant k is the label of the subroutine 8 5 6 24 Function Output SUBR This function is the start of a subroutine The constant k is the label of the subroutine which is called by the call function 8 5 6 25 Function Output RET This function must be placed at the last line of a subroutine The function can also be used in the subroutine for a conditional return The example below calls a subroutine number 1 when input 1 is on The subroutine SUBR ladder diagram is placed after the END function and labels the start of the subroutine The RET function is used to tell the PLC that this is the end of the subroutine and to jump back to the main program A maximum of 20 subroutines can be used in a ladder program PROCON ELECTRONICS 46 ProSoft 8 5 6 26 Function Output RAND This function places a random number from 0 to 100 in the accumulator HDZ A PROCON ELECTRONICS 47 ProSoft 8 5 7 Ladder Outputs Advanced Functions The advanced function outputs are function blocks which perform advanced tasks You must check the manual for your PLC to see which of these functions are available in your PLC 8 5 7 1 Function Output LDD Load Double The accumulator is a 32 bit working register which is used for all mathematical operations The accumulator must first be l
11. click on the Close button to exit this box 3 8 EDIT gt Comms Settings Now click on the menu item Edit and then Comms Settings If this option is available on the PLC you are using then a box will appear on the screen which is labeled Setup PLC RS485 Comms Port If this feature is not available on your PLC then this option will not be available and you should go onto the next section i D WORKACA plctest tmp pce PL401 File Edit Ladder Compile Program About 4H se aie ate H l l lA TI Ex i Tc im CoOL 1 Z a 4 5 6 T E H 10 11 1 13 El R R U a N wW G 1 Setup PLE R5485 Comm Port Network ID R 19200 Baud Rate Z Parity none D 3 Stop Bits i Select A S 6 Setup PLE Comme Parameters The parameters which are setup in this box are not for the programming port on the PLC but the second port which is used for RS485 Modbus Communications The Network ID is default to 1 and this is suitable for Modbus Master communications If the PLC is to be a Modbus slave then this ID must be changed so that the PLC has a unique ID on the RS485 network Valid addresses are from 1 to 253 PROCON ELECTRONICS 12 ProSoft The baud rate parity and stop bits must be setup to match the parameters of the RS485 network Default values are baud rate 19200 8 data bits no parity and 1 stop bit Once the values have been selected with the pull down bars the data can be entered into the project by clicking on the Select butt
12. constant then system bit S6 is turned on If the value in the accumulator is equal to the value in memory constant then system bit S7 is turned on If the value in the accumulator is greater than the value in memory constant then system bit S8 is turned on The value in the accumulator is left unchanged If the memory M12 has the value 123 and the memory M44 has the value 125 then the system bit S6 will be on and the system bits S7 and S8 will be off COL 1 z a 4 7 6 T o g a0 1l 1 13 H R I e LO N Wy G l i Miz CMP d M44 e y a d CMP MEM K di T o CMP gt MEME Hr 8 5 6 13 Function Output ADD This function Adds the memory M or constant K to the accumulator The result is stored in the accumulator ACC ACC M K LOL 1 E E 4 z 6 E D El 10 1i LE 15 Rp Pi E E E M44 PROCON ELECTRONICS 41 ProSoft 8 5 6 14 Function Output SUB This function subtracts the memory M or constant K from the accumulator The result is stored in the accumulator ACC ACC M K Rp 50 0 M44 8 5 6 15 Function Output MUL This function multiplies the accumulator with the memory M or constant K The result is stored in the accumulator The result can be a value up to 32 bits ACC ACC X M K ae o A M44 PROCON ELECTRONICS 42 ProSoft 8 5 6 16 Function Output DIV This function divides the 32 bit accumulator by the 16 bit memory M or constant K The result is stored in th
13. equal to the value in memory constant then system bit S7 is turned on If the value in the accumulator is greater than the value in memory constant then system bit S8 is turned on The value in the accumulator is left unchanged If the memory M12 has the value 123 and the memory M44 has the value 125 then the system bit S6 will be on and the system bits S7 and S8 will be off BeQ2c Ai CMP gt BEM K RLS 8 5 7 7 Function Output ADDD This function Adds the memory M and M 1 or constant K to the 32 bit accumulator The result is stored in the accumulator ACC ACC M 1 M or ACC ACC K 8 5 7 8 Function Output SUBD This function Subtracts the memory M and M 1 or constant K from the 32 bit accumulator The result is stored in the accumulator ACC ACC M 1 M or ACC ACC K PROCON ELECTRONICS 91 ProSoft 8 5 7 9 Function Output MULD This function Multiplies the memory M and M 1 or constant K with the 32 bit accumulator The result is stored in the accumulator ACC ACC X M 1 M or ACC ACCX K 8 5 7 10 Function Output DIVD This function divides the 32 bit accumulator by the memory M and M 1 or constant K The result is stored in the accumulator ACC ACC M 1 M or ACC ACC K 8 5 7 11 Function Output INCD This function increments the memory M and M 1 directly and does not use the accumulator M 1 M M 1 M 1 8 5 7 12 Function Output DECD This fun
14. feedback signals which use the Reset input in an identical manner to the emergency stop circuit above PROCON ELECTRONICS 63 ProSoft 9 2 Garage Door Example It is required to design a ladder logic program to operate a garage door e There is a single pushbutton which is used to open or close the door If the door is down then the button will start it opening If the door is up then the button will start it closing If the door is opening or closing then the door will stop and if the button is pressed again then the door must change direction e There is a limit switch at the top and bottom of the door to indicate when the door is up or down The limit switch is closed when the door is in contact with it e The door motor requires two relays one to make it go up and the other to make it go down The I O used will be as follows Digital Inout 1 BUTTON Manual Push Button Normally open and non latching Digital Input 2 TOP_L Top limit switch Digital Input 3 BOT_L Bottom limit switch Digital Output 1 UP Motor run UP Digital Output 2 DOWN Motor run DOWN Control Logic There are many ways of solving this program depending on the ladder elements chosen and on your personal style of programming This example shows one of these solutions and gives an idea how a application problem can be solved step by step We start by programming a motor control circuit to operate the UP motor When the BUTTON input is pressed the UP motor
15. from the start to the end of the program e The PLC steps through the ladder program one rung at a time The program reads the inputs from memory and after performing the programmed tasks the output memory is updated with the output information e When the program is complete the physical outputs are updated from the output memory The scan time is the time to go once through all of these steps The part of the scan cycle that is within the control of the programmer is the ladder program A short ladder program will result in fast scan times whilst more complicated programs which make use of many mathematical functions will take longer It is up to the programmer to be aware of the response required for the system and to design the program accordingly PROCON ELECTRONICS 21 Prosoft 8 2 PLC Memory The PLC has a block of memory which is used to store the statuses of inputs outputs timers counters internal relays system relays and variables The size of the memory depends on the PLC that is being used You will need to refer to the manual on your PLC to get the exact details Each element is identified by a Symbol and an Address A XXX Element SYMBOL Element ADDRESS There are three types of elements 1 Relay elements These operate in a similar way to a relay and their state is either ON or OFF 2 Memory elements These are 16 bit memory registers and are represented as numbers 0 65535 3 Combination elements These inc
16. must turn on and stay latched on The motor must turn off when the door hits the TOP limit switch or if there is a fault and the DOWN motor is on The same idea is applied to the DOWN motor The motor will run until the door hits the BOTTOM limit switch COL 1 Z EI d 5 6 E Si J 10 11 12 la ii i gl 11 Iz GE al a Es BUTTON TOP _L Do fy LIP al Z LIP 11 I5 ol OZ 2 3 E BUTTON BOT L LIP C hy Oz P DON PROCON ELECTRONICS 64 ProSoft The next step is to add the stop facility We add a circuit that uses internal relay R5 as the STOP contact The BUTTON can only be used to STOP the motor if the motor is already going up OR down We also change the BUTTON contacts to a one shot when the BUTTON is pressed This prevents the circuit from generating a race condition if the button is held on The STOP contact R5 is added to the UP and DOWN motor control circuits Hie A 11 12 R5 J BUTTON TOP_L STOP o1 Up 11 13 R5 J BUTTON BOT_L STOP a2 DOWN GE OL Dow hy UP al Oe LIP Do why The next thing we have to take care of is that the BUTTON must only operate the STOP relay if the motor has moved off the limit switch In the circuit we add the two limit switch contacts in series with the UP and DOWN contacts ePOa2c Ai PROCON ELECTRONICS 65 ProSoft The final problem to be solved is that when we stop the door mid travel and then push the BUTTON to change direction the door always UP The reason for this is because the UP
17. or a write Some of the parameters are initialized to default values on power up of the PLC If you do not need to change these parameters then you do not need to include them in the ladder logic program Other parameters are kept after the first communications poll has been completed so if the value does not change then it is not necessary to reload them each time The parameters are listed below TCP IP and UDP Communications Parameters Parameter Name Description PLC Memory This is the address of the memory in the PLC where values are Address to be written to or read from depending on the function See the Memory map of the PLC in the manual for the PLC that you are using to get the correct address for these registers Mxxx This is the Modbus address of the memory in the slave unit where values are to be read from or written to You will need to Address refer to the memory map of these registers in the manual for the slave unit ie Modbus 40003 3 Function This is the Modbus function that determines if the poll is a read or a write The following functions are supported 1 Read a range of bits 3 Read a range of registers 15 Write a range of bits 16 Write a range of registers Mode 0 TCP IP 1 UDP This parameter must always be the last parameter called as it also starts the communications transmission There are two system bits that are associated with the communications port These are the TComReady bit and
18. screen will tell you when the compile process is complete The compile process is used to firstly check the program for errors and secondly to convert the program into a format that the PLC understands If the ladder program has an incomplete circuit then the compiler will give an error message and jump to the place on the program where the error is PROCON ELECTRONICS 17 ProSoft 6 PROGRAMMING THE PLC Once the ladder program has been successfully compiled the PLC can be programmed with the ladder program This is done by clicking the on the Program menu item Before the PLC can be programmed you must make sure that the PLC has been switched on and the Programming Port of the PLC has been connected to the RS232 COM port of the PC using the special programming cable from Procon PROGRAMMABLE LOGIC CONTROLLER OUTPUT 4 OUTPUT OUTPUT 2 jl CC NO C NO MD NAO PROCON d LC Ise ww wg we SS P E ES DUDO II When you start programming the PLC the software checks that the PLC type is the same as the type you selected for your project If the types are not the same an error message will be displayed and programming will be aborted As soon as the programming is complete the PLC will start running automatically If you switch on the START input you will see that the FAN1 output stays latched on If you switch on The STOP input you will see the FAN1 output switch off This action can also be monitore
19. the TComError bit Timeout This is the time that the communications driver will wait for a response from the slave device before a timeout error occurs The time is a multiple of 10 milliseconds The TComReady bit is normally off and will indicate that the communications port is ready for anew message As soon as the new message has started transmitting this bit is set to on This bit is used in the ladder logic program to prevent a second message from being sent out before the previous message is complete The example shows how it is used The bit is cleared to off when the reply has been received from the slave If no reply comes back then the timeout will expire and the bit will be cleared off The TComError bit will be set on to indicate an error PROCON ELECTRONICS 59 ProSoft COL 1 2 a 4 J 6 E D E 10 1l 12 15 som The first Poll will read a range of registers from a Modbus TCP IP slave to PLO memory LDIF Load the IP address of the slave device 169 254 111 113 1 TCOOM O default port number 502 is used TCOME1 default protocol Modbus is Used TCOM 2 Slave ID 1 TOMES PLC memory address to save data 200 TCOM 4 Range number of registers to be read 5 TCOM S Starting address in slave fram where to read registers 2 40002 TCOM 6 Use default timeout QC e TCOM Function 3 Read registers TCOM S Mode 0 TCP IP The system contact with a 0 1 second period is used to start th
20. the program it starts from the beginning again The example below shows the typical sequence of processing a program Start of Rung EN 4 5 6 7 8 E 10 11 12 13 O OT O k 2 18 Ii 5 G E 1 Ip IPS IP1 End of Rung Sa Is From left to Right and top 2 to bottom AE GI ON L Step 1 Load Input 1 Step 2 Input 1 AND Input 2 Step 3 Input 1 AND Input 2 OR Input 3 Step 4 Input 1 AND Input 2 OR Input 3 AND NOT Input 8 Step 5 OUT Output 1 Step 6 Load Input 6 Step 7 OUT Output 2 Step 8 OUT Output 3 etc y PROCON ELECTRONICS 26 ProSoft 8 5 Ladder Programming Elements This section gives a detailed explanation of the elements that you can use to create your ladder program 8 5 1 Ladder Inputs Normally Open Closed Contact The normally open contact is equivalent to a relay contact or switch contact It can either be in the on or off state and can be a physical input or output or a point in memory The normally closed contact is simply the inverse of a normally open contact In the following example when input 11 is on the output O71 will go on Sais E J 4 5 6 E a J i LA Le 15 Kit A ER Hr In the following example when input 11 is off the output O1 will go on COL 1 E S 4 S 6 E 5 El 10 11 12 13 Rp tc 0 8 5 2 Ladder Inputs Positive Negative Edge Contact The positive edge contact is a normally open contact which closes for a single PLC scan wh
21. 0 LILI Pinchon Output CXORD EE 50 30 10 Finchin Output CMPD siones 51 S57 Finchin Output ADD asnos sierras 51 3010 Puncnom Output SUBD hiato i 51 E ER Dee RE EIER RE 52 5 0210 Funcion Output DVD ET 52 8 5 7 11 F nchom Output ING ass EEGEN 52 8 5 7 12 Function Output DECO EE 52 8 5 8 Ladder Outputs Float PUNCUONS its EE EES 53 8 5 8 1 Function Output LDF Load Fioar 53 8 5 8 2 Function Output OUTF Out Filoat 53 8 5 8 3 Function Output CMPF Compare Float e eeeessesssssssssseeererssssssssssssssseerrressssssss 53 8 5 8 4 Function Output ADDEB ccc eccccsseccecceceeeeeeaeaeeesseeeeeccceeeeeeeeeaaaaaeasssseeeeeeeeess 54 5303 Function Output SUBE Ls A e 54 8 5 8 6 Function Output MULEB ccccccccnnconononononnccnonenocccinonnoncanonanncannnanncocacononninnnccaiannns 54 0 07 Jhunchom Output DIV ee 54 30 00 e PUNCO OUMU AB TOE aie 54 3002 Euicion Outputes CP TOB id da 54 8 5 8 10 EUncuonOutput TEN REI dal 55 8 5 9 Ladder Outputs Trigonometric Functions csa a a a 55 207 Emcion oume ACOS la 55 S92 Funcion Output ASINE it ia 55 PROCON ELECTRONICS 4 ProSoft 8 5 9 3 Function Output ATANE acid da 55 8 5 9 4 Function Output COSE WEE 55 Soo FINECTO OUP SINE liada 55 S570 Function Output LAND aldea 56 SI Function Output SORT sa dias 56 5375 Function Output RADE ua 56 S599 Functor Output DEG Partaloa 56 8 5 9 10 Function
22. 0 Function Output OR This function logically OR s the lower 16 bits of the accumulator with memory M or with a constant K The result is placed in the accumulator If the memory M12 has the value 0000 0000 0000 0011 and the memory M44 has the value 0000 0000 0000 0110 the result copied to memory M44 will be 0000 0000 0000 0111 Memory M12 sule O eee ella HEHHE HHEN ES jojojofojojojofojofofofo 1 tpof OUT Memory M44 BRR HA MI DS ES ES jofojojofofojojo Ea Rp 50 M44 PROCON ELECTRONICS 39 Prosoft 8 5 6 11 Function Output XOR This function logically Exclusive OR s the lower 16 bits of the accumulator with memory M or with a constant K The result is placed in the accumulator If the memory M12 has the value 0000 0000 0000 0011 and the memory M44 has the value 0000 0000 0000 0110 the result copied to memory M44 will be 0000 0000 0000 0101 Memory M12 ella O eee jopojofojojojofojojo E ella HEHHE HHEN ES jojojofojojojofojofofofo 1 tpof Accumulator Upper Accumulator Lower RHHRRHRHRRHHRRDIDEE DEE HERRRMRNKNRR ES OI jofojojojofojojojofo 1 0 1 OUT Memory M44 HB HA MB DS ES olif jofojojofofojojo 1 0 1 a rp e n M44 PROCON ELECTRONICS 40 Prosoft 8 5 6 12 Function Output CMP This function Compares the accumulator lower 16 bits with memory M or with a constant K If the value in the accumulator is less than the value in memory
23. ATING A NEW PROJECT To create a new project click on the file menu item with the mouse A drop down sub menu will appear on the screen Click on new and a box will appear on the screen which asks you to select the PLC type It is important that you select the correct type according to the hardware you want to program This is because the auto configuration will initialize the I O and memory according to the type of PLC you have and this configuration is very likely to be different with other PLC types Once the PLC type has been selected click on select to continue A new box will now open on the screen which asks for the file name of the project you want to create You must also select a suitable working directory for your projects at this point After typing in the project name no extension is required click on save and you will now have created a project You will notice that at the top left of the screen the project name and path is displayed along with the PLC type 3 3 SETUP PC COMMUNICATIONS Click on the file menu item again and this time click on Setup gt PC Comms This action will open a box on the screen which allows you to enter the programming port address ID of the PLC and also set the Comm Port of the PC All PLC s are initially configured for an ID of 1 so there is no need to alter this parameter at the moment The PC Comm port must be changed according to the RS232 port that the PLC is to be connected to PROCON ELECTR
24. F This function performs the Arc Tangent of the 32 bit float accumulator The result is stored in the float accumulator FACC ATAN FACC 8 5 9 4 Function Output COSF This function performs the Cosine of the 32 bit float accumulator The result is stored in the float accumulator FACC COS FACC 8 5 9 5 Function Output SINF This function performs the Sine of the 32 bit float accumulator The result is stored in the float accumulator PROCON ELECTRONICS 55 ProSoft FACC SIN FACC 8 5 9 6 Function Output TANF This function performs the Tangent of the 32 bit float accumulator The result is stored in the float accumulator FACC TAN FACC 8 5 9 7 Function Output SQRTF This function performs the square root of the 32 bit float accumulator The result is stored in the float accumulator FACC SQRT FACC 8 5 9 8 Function Output RADF This function converts the degree value of the 32 bit float accumulator to the radian The result is stored in the float accumulator FACC RAD FACC 8 5 9 9 Function Output DEGF This function converts the radian value of the 32 bit float accumulator to degrees The result is stored in the float accumulator FACC DEG FACC 8 5 9 10 Function Output LOGF This function performs the logarithmic function on the value in the 32 bit float accumulator The result is stored in the float accumulator FACC LOG FACC 8 5 9 11 Funct
25. F EEE ee oT T oT T T f oT T f EME T T f o T f oT T T f pps II i E C d f O PROCON ELECTRONICS 23 ProSoft 8 3 Basic Rung Configurations The program is made up with input elements in columns 1 to 12 and output elements in the final column 13 A complete circuit may use only one or may use many rows This circuit is called a rung Some basic configurations of rungs are shown below e The example below shows a simple rung with a single Input and Output ELL 2 E 4 2 6 fi D El 10 IL 12 la e Itis not always necessary for a rung to have an input contact If the program is used to always switch an output on then the rung would look like this It is essential that each rung has at least one output relay or an output function otherwise the circuit would do nothing COL L E E 4 z D D 5 J 10 11 12 15 EDAD a r ea ie m RE e tis not always necessary to have an END output function at the end of a program except if the program uses subroutines Subroutines are placed after the end function and are only run if called by the ladder program You can also use an END in the middle of a program if you only want to test a portion of the program Any rungs after the END will be ignored GOL 1 Z S d D E 5 E 10 11 12 15 Poca Input contacts can be put in series This is known as an and function For example in the diagram below Input 1 AND Input 2 must be on for the Output 1 to go on MOL 1 Z El
26. Inverted Output The inverted output is the same as the normal output except that if the ladder rung is off then the output will be on 4 1 10 Set Output f The set output represents a physical output or could be an internal relay in memory in the PLC which is turned on when the ladder rung goes from off to on If the rung goes from on to off then the output will remain latched on 4 1 11 Reset Output The reset output represents a physical output or could be an internal relay in memory in the PLC which is turned off when the ladder rung goes from off to on If the rung goes from on to off then the output will remain off unlatched 4 1 12 Function Output Ky The function output represents a function block which may contain a timer counter or other mathematical function This function will only be executed if the rung is on PROCON ELECTRONICS 14 ProSoft 4 1 13 Comment T The comment toolbar enables you to enter a text comment onto the ladder program Comments are normally used to describe the operation of the following ladder circuit and are very useful for explaining to a third party the operation of a circuit 4 1 14 Delete Element x lt When the delete element toolbar is firstly selected from the toolbar and then any element on the ladder program can be deleted by clicking the mouse pointer over that element 4 1 15 Delete Line T The delete line toolbar is used to delete all the elements on a complete line on the ladder
27. ONICS 8 ProSoft 3 4 File gt Get Prog Info When you click on the File menu item and then the Get Prog Info button a box will open on the screen which reads the program name from the PLC date created and the date downloaded This can be used to inform the user at a later date which program has been downloaded into the PLC Initially when the PLC is new and there is no program loaded this data will not be available Click on the Close button to close the box D AWORK C pIctest tmp pce PL401 BEAR File Edit Ladder Compie Program About 4H se aie ate RAI ll TY AE Tc im COL 1 2 3 4 5 6 7 E o 10 11 12 13 El R R U o H d G Get Program Into from PLE File Mame PL401 1_pce Date Created 30 June 2004 Date Downloaded 1 July 2004 Close Setup PLC Comms Parameters 3 5 ENTER LADDER EDIT MODE Click on the ladder menu item to go into the ladder edit mode This will enable other menu items and the toolbar for selecting programming items will also become active You will notice a yellow box appear on the screen This box indicates the cell in the screen which was last edited 3 6 EDIT gt TAGS Now that the software is in Ladder Edit mode the first step is to edit the description of the I O tags that are going to be used in the program This step is not mandatory but will help you better identify the inputs and outputs if you give them a meaningful name and description Click on the menu item Edit and t
28. ProSoft PROGRAMMABLE LOGIC CONTROLLER PROGRAMMING SOFTWARE 12 Miz S4 3 4 HHH IP2 Kap 15 USER MANUAL pa gt PROCON ELECTRONICS 27 07 2005 V3 0 P O Box 24 STANFIELD 3613 SOUTH AFRICA Tel Fax Email Web 27 031 7028033 27 031 7028041 proconel proconel com www proconel com Procon Electronics makes no representations or warranties with respect to the contents hereof In addition information contained herein are subject to change without notice Every precaution has been taken in the preparation of this manual Nevertheless Procon Electronics assumes no responsibility express or implied for errors or omissions or any damages resulting from the use of the information contained in this publication All trademarks belong to their respective owners PROCON ELECTRONICS 2 ProSoft TABLE OF CONTENTS 1 AN OVERVIEW OF THE ProSoft PLC PROGRAMMING SOFTWARE PACKAGE 6 Ze ANSTALLING Pro Sissi loteo 6 DE CMO POSO ola tia E EE ico 8 3 1 A O 8 32 ORBATING ANEW GE E EE 8 3 3 SETUP PE COMMUNICATION Squad lacado 8 SE gt E tee 9 39 ENTER LADDER EDIT MODE ieten a S 9 30 EE 9 Saf BEDI EE 11 3 8 EDEESCOMMS SE ti tenney areee 12 Ay ADDER PROGRAMMING iii A A ii T 13 4 1 LADDER TOOLBAR ELEMENTS ada 13 4 1 1 Honza Wie E 13 4 1 2 A E 13 4 1 3 INomma NEE 13 4 1 4 Normally Closed COMO EE 13 4 1 5 PO E EONI a ao o o N ieee 14 4 1 6 Negative Edoo E 14 4 1 7 Ster Ee EE 14
29. a good idea to save the project at this point by clicking the mouse on the file gt save menu item PROCON ELECTRONICS 10 ProSoft 3 7 EDIT gt Communications Now click on the menu item Edit and then Communications lf this option is available on the PLC you are using then a box will appear on the screen which is labeled Edit Modbus Communications If this feature is not available on your PLC then this option will not be available and you should go onto the next section il D WORKACA plictest tmp pce PL401 File Edit Ladder Compile Program About 4H se aie ate A l ES dl wd KC AE Ad ellen COL 1 2 3 4 5 6 Z S g 10 11 iz 13 EJ CSC ZUA Edit Modbus Communications Function A Read Registers v Modbus Master Function 16 Write Registers Poll Block Remote Local Remote Number ID Function Address Range Address 2 f o o o o 3 Edit Modbus Communications When the Edit Modbus Communications box appears on the screen the Modbus Master select box will not be selected This means that the PLC will be a Modbus slave If you want the PLC to be a modbus slave or you will not be using this communications option then leave this box unselected and click on the Close button to exit the box When you select the Modbus master box the setup table will become active This box allows you to configure up to 20 modbus poll blocks This means that the PLC will be a Modbus Master and will be able to read or write mod
30. a wire jumper in an electric circuit 4 1 3 Normally Open Contact The normally open contact is equivalent to a relay contact or switch contact In the PLC the normally open contacts may be inputs outputs timers counters internal relays in memory or system statuses The contact represents a single binary bit which is either off 0 or on 1 4 1 4 Normally Closed Contact f The normally closed contact is equivalent to a relay contact or switch contact except that the status is inverted If an input is on then the normally closed contact will be off PROCON ELECTRONICS 13 ProSoft 4 1 5 Positive Edge Contact wll e The positive edge contact is a normally open contact which closes for a single PLC scan when the normally open contact goes from open to close This contact is often called a one shot 4 1 6 Negative Edge Contact Al The negative edge contact is a normally open contact which closes for a single PLC scan when the normally open contact goes from close to open This contact is often called a one shot 4 1 7 Function Contact HH The function contact enables the ladder program to do complex functions which have a Boolean result 4 1 8 Normal Output ke The normal output represents a physical output or could be an internal relay in memory in the PLC The output is turned off if the result of the ladder rung connected to the output is off or turned on if the result of the ladder rung is on 4 1 9
31. bus registers with up to 20 other Modbus slave devices These devices could be other PLC s Mod MUX I O modules or operator interface s etc The first column in the table is the Modbus Address ID of the slave that the PLC is going to communicate with This value can range from 1 to 253 and will depend on the addressing capability of the slave unit The second column is the modbus function Enter a 3 if you want to read registers from a remote slave unit or 16 if you want to write to registers in a remote slave unit Note that digital I O must be read or written as 16 bit modbus registers The third column is the local address This is the address of the memory in the PLC where values are to be written to function 3 or read from function 16 depending on the function PROCON ELECTRONICS 11 Prosoft See the Memory map of the PLC in the manual for the PLC that you are using to get the correct address for these registers The forth column is the range of the registers This is the number of registers to be read or written The fifth column is the remote address This is the address of the memory in the slave unit where values are to be read from function 3 or written to function 16 You will need to refer to the memory map of these registers in the manual for the slave unit Once you have completed entering the data into the table you must click on the Submit button to enter them into the project Finally when you are complete you can
32. ck cannot be used as this only has 1 input for up and 1 input for down so we must use another technique The I O used will be as follows Digital Input 1 UP1 Manual Push Button Digital Input 2 UP2 Manual Push Button Digital Input 3 DOWN1 Manual Push Button Digital Input 4 DOWN2 Manual Push Button Digital Output 1 LIGHT Control Logic As it is not possible to use the built in counter function we need to make our own counter Use memory M45 to store the counter value Check that this memory is available on your PLC If it is not then choose another memory address To implement the UP count we can use the INCREMENT INC function and to do the DOWN count we can use the DECREMENT DEC function As we only want to count once every time the inputs go on we need to use the positive edge contact one shot COL 1 2 d 4 z 6 f D El 10 11 1z POCO PROCON ELECTRONICS 67 ProSoft Now to switch on the light when the count reaches 1500 we can use the compare function as follows Whenever the count goes over 1500 the light will come on and when the count goes back below 1500 then the light will go off COL 1 E 4 5 6 Z 5 J 10 IL 1 15 H R INZ UO Mo W IL a HJ d 23 UR M45 INZ UPZ M45 PROCON ELECTRONICS 68 ProSoft PROCON ELECTRONICS 69 ProSoft
33. ction decrements the memory M and M 1 directly and does not use the accumulator M 1 M M 1 M 1 PROCON ELECTRONICS 92 ProSoft 8 5 8 Ladder Outputs Float Functions The float functions are function blocks which perform mathematical tasks using the IEEE 754 floating point notation These functions use two memory locations and are 32 bit functions The range of the values extend from 1 18E 38 to 3 39E 38 The 32 bit floating point format is as follows 31 30 23 22 0 The value of the number is Ay n Exponent 127 4 Mantissa Float Constants can be written with or without the exponential For example 123 4 can also be written as 1 234E2 You must check the manual for your PLC to see which of these functions are available in your PLC 8 5 8 1 Function Output LDF Load Float The floating point functions use a separate accumulator which must first be loaded with a value before any of the floating point mathematical functions are used The LDF function loads the 32 bit float accumulator from memory M or with a constant F As memory is only 16 bit registers the LDF function loads the lower 16 bits of the accumulator from the memory location M and the upper 16 bits from the memory location M 1 8 5 8 2 Function Output OUTF Out Float The OUTF function copies the 32 bit float accumulator to memory M As memory is only 16 bit registers the OUTF function copies the lower 16 bits of the accu
34. d on the PC if you now go into DEBUG mode PROCON ELECTRONICS 18 ProSoft 7 DEBUGGING THE PLC To enter Debug mode click the mouse pointer on the Debug menu item If you switch on the START input you will see that the circuit is complete from left to right across the ladder program and this is shown by a red line on the screen Any part of the circuit that is on will be in red Any part that is off will not have the red line If you now switch off the START input you will see that the circuit is being latched on by the FAN1 contact The diagram below shows the red line where the circuit is complete To go back to edit the ladder program click the mouse pointer on the Ladder menu item and this will stop the debug mode it D WORFACA pictestisample1 pce PL401 File Ladder DLC About Filet A View O Simulation Mode IO Number Description Simulate Mode PLE Running 7 1 View I O status in Debug Mode If you click the mouse pointer on the PLC gt View I O menu item a box will open which shows a list of the digital I O in the PLC You can use the scroll bar to move up or down the list When a digital input output is OFF it is in red and when it is ON it is in green The purpose of this box is to show you the status of any of the digital inputs whilst the PLC is running This is a very useful tool for fault finding you ladder program Try switching the START input on and off slowly and you will see the status change on the screen
35. ds the accumulator with the value in memory address 12 Note that if the function is joined directly to the left hand side of the rung that the function will be called every PLC scan Memory M12 ella TU eee Accumulator Upper Accumulator Lower RHHRRHHRH HRH HEH DDHEE BENRRMRKRNKK EA jojojojof1 1jofpof 1 pof Rp 050 Miz PROCON ELECTRONICS 36 ProSoft 8 5 6 8 Function Output OUT The lower 16 bits of the value in the accumulator is copied to memory M In the example the value in the accumulator is copied to memory address 44 Memory M12 9 8N7 6 5 4f3 2 1 0OJ J Bit Accumulator Upper Accumulator Lower AB ABBA BAH AREA DEE HAM MA A Wi OF O Of Of OF 1 1 Of OF 1 14 1 Memory M44 HB BE MAI MID ES OF O O Of OF 1 4 Of OF 1 14 4 ol PoC M44 PROCON ELECTRONICS 37 ProSoft 8 5 6 9 Function Output AND This function logically AND s the lower 16 bits of the accumulator with memory M or with a constant K The result is placed in the accumulator If the memory M12 has the value 0000 0000 0000 0011 and the memory M44 has the value 0000 0000 0000 0110 the result copied to memory M44 will be 0000 0000 0000 0010 Memory M12 sule O eee jopojofojojojofojojo E ella HEHHE HHEN ES jojojofojojojofojofofofo 1 tpof OUT Memory M44 HB HE HEHHE DS jofojojofofojojo Ol 1 of PoC M44 PROCON ELECTRONICS 38 ProSoft 8 5 6 1
36. e UE Ee LE dido 56 8 5 9 11 Functor Re ER E E 56 8 5 10 Ladder Outputs Communications Funcpons 57 8 5 10 1 Function Output Serial Communications COMM 57 8 5 10 2 Function Output TCP IP Communications CICOM 59 Y LADDERPROGRAVMESAMPLES EE 62 9 1 Motor Control Example spare aid 62 9 2 dl ale Door Example aaa A ETAN AE EE 64 9 3 Up Dowa Counter Example aaa la lila 67 PROCON ELECTRONICS 5 ProSoft 1 AN OVERVIEW OF THE ProSoft PLC PROGRAMMING SOFTWARE PACKAGE The ProSoft PC software package is used to configure and program PLC products manufactured by Procon Electronics The software runs on a Windows XP operating system and has been written to be very user friendly and quick to learn Most of the programming can be performed with only mouse operations ProSoft has built in intelligence to auto configure itself according to the type of PLC being used This includes selecting the correct amount of I O memory and variable memory depending on the capabilities of the PLC The PLC program being designed is written in the well Known ladder logic language and saved as a project file This project file holds the program all the auto parameters for the PLC type chosen and the tag names the user has given to the I O The software combines ladder logic with function blocks to allow the use of mathematical functions and manipulation of analog variables ProSoft has a modbus master configuration section which allow
37. e accumulator ACC ACC M K PoC M44 8 5 6 17 Function Output INC This function increments the memory M directly and does not use the accumulator Mem Mem 1 Rp E 8 5 6 18 Function Output DEC This function decrements the memory M directly and does not use the accumulator Mem Mem 1 Poca PROCON ELECTRONICS 43 ProSoft 8 5 6 19 Function Output INV This function inverts the bits in the accumulator ACC ACC ee pd A 8 5 6 20 Function Output MOV This function moves a variable in a memory location to a new location The accumulator must already contain the address of the memory location to be moved M44 M43 RED M44 8 5 6 21 Function Output SHL The bits in the accumulator are shifted left by the value in memory M or constant K The lower bits are filled with zeros In the example below the accumulator is loaded with the value 5 or 0000 0000 0000 0101 binary The accumulator is then shifted left 3 times to give the result 40 or 0000 0000 0010 1000 binary BeQ2c Ai PROCON ELECTRONICS 44 ProSoft 8 5 6 22 Function Output SHR The bits in the accumulator are shifted right by the value in memory M or constant K The upper bits are filled with zeros In the example below the accumulator is loaded with the value 5 or 0000 0000 0000 0101 binary The accumulator is then shifted right twice to give the result 1 or 0000 0000 0000 0001
38. e communications If there are no others comms busy then the TComl Ready contact will be closed and this can run 3 Relay Lis an interlock to alternate between the two messages inthis example 3a S16 CN HI 1 4 ij 0D 1Sec Tomi Ready Relay 1 5 6 H R LU a N wm E F S J 10 1i PROCON ELECTRONICS 60 ProSoft COL i 2 a 4 2 6 D D a i 11 L 15 The second Poll will write a range of registers fram PLO memory to a Modbus UDP slave LOIP Load the IP address of the slave device 169 254 111 120 13 TOCOM O default port number 502 is used TCOME1 default protocol Modbus is used TCOM 2 Slave ID 1 TCOMES PLE memory address to get data 1 TOOM 4 Range number of registers to be read 1 TOOM S Starting address in slave from where to write registers 2 40002 TCOM 6 Use default timeout TCOME Function 16 Write registers TCOM 8 Mode 1 UDP CSC 00 14 HI ER 16 Ri 2 15 H 4 0 1Sec TComi Ready Relay 1 16 SD o E m Lz Ke KA Y C o En Paras Ee H Y mo a Parad QC sc C o Parad ZU ec C o Fara el ki Y C o Parad fe PROCON ELECTRONICS 61 ProSoft 9 LADDER PROGRAM EXAMPLES This section describes some practical applications and how they can be implemented using the PLC The purpose is to show you how ladder programs can be constructed and to see how the various elements are used 9 1 Motor Con
39. e off otherwise it will be on In the example below the timer T1 will start timing when the input 11 is turned on When the timer value is greater or equal to 40 4 seconds the timer output will turn on When the input 11 turns off after 6 seconds the timer T1 will stop and the timer value will be reset to zero COL i 2 3 4 5 e F 5 0 10 11 12 13 R R T1 e 22 0 15 G ii 1P1 Kat Ti Ol 7 3 Timer 1 RLY1 Il Tl Timer Value 0 10 20 30 40 50 0 10 x0 1Sec PROCON ELECTRONICS 33 ProSoft 8 5 6 2 Function Output TimerA 0 1Sec and TimerA 0 01Sec The TimerA 0 1Sec is an Accumulating timer with 0 1 Second time base and the TimerA 0 01Sec has a 0 01Second time base The functionality of these timers is the same There a number of timers available numbered from 1 upwards to the maximum depending on the PLC being used The timer will run as long as the input is on and stops when the input is removed The timer will continue when the input is on again The timer will be reset to zero when the reset input is on The timer also has a built in compare function The compare function compares the timer value with a value in memory or a constant If the timer value is less than the memory value or constant then the timer output will be off otherwise it will be on In the example below the timer T1 will start timing when the input I1 is turned on If input I1 is turned off then the timer will stop The timer will continue when the input is tur
40. en the normally open contact goes from off to on The negative edge contact closes for a single PLC scan when the normally open contact goes from on to off In the following example each time input l1 goes from off to on the output O1 will go on for one scan ed pt Eden ER RIEL In the following example each time input l1 goes from on to off the output O1 will go on for one scan Rp e m PROCON ELECTRONICS 27 ProSoft 8 5 3 Ladder Inputs Function Contact The function contacts are function blocks which produce an ON or OFF result and can be treated as a ladder input 8 5 3 1 Function Contact Mem Mem The function compares the contents of two memory locations If they are the same then the result will be on otherwise the result will be off In the following example when the value in memory M12 is equal to the value in memory M13 the output O1 will turn on GOL 1 Ea d 4 J 6 D 5 El 10 a1 12 13 WI RE PROCON ELECTRONICS 28 ProSoft 8 5 3 2 Function Contact Mem Const The function compares the contents of a memory location with a constant number If they are the same then the result will be on otherwise the result will be off In the following example when the value in memory M12 is equal to 10 the output O1 will turn on Rp A k10 RLYL 8 5 3 3 Function Contact Mem Mem The function compares the contents of two memory locations If they are not the same then the result wil
41. essage is complete The example shows how it is used The bit is cleared to off when the reply has been received from the slave If no reply comes back then the timeout will expire and the bit will be cleared off The CommError bit will be set on to indicate an error PROCON ELECTRONICS 57 ProSoft COL 1 z e 4 5 6 T a El 10 11 12 13 H R Uo The first Poll will write a register from Memory Address 1 inthe PLO to Memory Address 1 inthe Slave with a Range of 1 E o Function 16 is used to write a range of registers 1 Note how the CommiReady bit is used to ensure that the program only runs the functions when the Comm Portis ready Ka pa Gel 314 HI L 2 J 1Sec Commi Ready Relay 1 gi COMM Faraz 3 Ki COMM Paras 4 KI COMM Parad 5 KI COMM Paras 6 KI H RE Uu o COMM de w Para d K16 The second Poll will read a register from Memory Address 1 inthe Slave to Memory Address 100 in the PLC with a Range ol Function 3 is used to read a range of registers 5 514 HI R1 2 g Commi Ready Relay 1 10 11 12 R R U Oo N e CG 13 14 15 3 Camm Error RLY PROCON ELECTRONICS 98 ProSoft 8 5 10 2 Function Output TCP IP Communications TCOM The Ethernet communications port can controlled directly from the ladder logic program to send Modbus TCP IP or UDP messages to remote slave devices The communications function TCOM is used to setup the parameters and to initiate a communications poll which could be a read
42. he menu item File gt Save to save the project PROCON ELECTRONICS 16 ProSoft it D WORKAC plictestisample1 pce PL401 File Edit Compile Program Debug About e ate a Ell 2 9 T X n C m COL 1 Z 3 4 5 6 T 5 D 10 11 12 13 El H o LL Iz ol RpZ0500 1 o START STOP FANI al FAMIL Selected Toolbar Button Normal Output The operation of the ladder program works as follows The initial condition at power up is that the START input is open the FAN1 output is off and the STOP input is closed as itis a normally closed input When the START input is closed the rung is complete along Row from the left to the right This results in the output FAN1 coming on The FAN1 contact now closes and keeps the FAN1 switched on even when the START input is off When the STOP input is operated the circuit is broken and the FAN1 output switches off This causes the FAN1 contact to open so when the STOP input is removed the FAN1 output stays off The example1 is a typical example of a start stop circuit that would normally be implemented with relays The circuit shown is called a rung When a new circuit is programmed below the first circuit a new rung will be created Although these rungs form part of the same ladder program they are treated as independent circuits 5 COMPILING The ladder program can now be compiled by clicking the mouse pointer on the Compile menu item The text status line at the bottom of the
43. hen Tags to open the box which displays the I O tags The I O tags are divided into categories These categories are Inputs Outputs Timers Counters PROCON ELECTRONICS 9 ProSoft Relays and System The first pull down select box is used to choose the category you want to edit The default is always the Inputs i D WORKACA plctest tmp pce PL401 File Edit Ladder Compile Program About 4H ae ate ate H l l ll TI KC AE Ad ellen CUL 1 2 3 4 5 6 T 5 a 10 11 12 La El ROR Woo NW G Edit Element TYPE Inputs DESCRIPTION This is the Start Button Input ADDRESS I MAME 3 START M Delete Close Edit Tags The next pull down box allows you to select which of the Inputs you want to edit In ProSoft digital Inputs are called labeled as with the number of the input so Input 8 is 18 Once you have selected the Input you want to edit click on the name box with the mouse not the pull down arrow and type in a new name For example change Input 1 IP1 to read START lt is now possible to give this input a description by entering text in the description box Once you have completed a TAG you must click on the Add button to ensure the data you have entered is added to the project This must be done before you start editing the next tag or the data you have just entered will be lost Once you have completed edit the tag names and descriptions you must click on Close to exit this box It would be
44. ion Output EXPF This function performs the exponential function on the value in the 32 bit float accumulator The result is stored in the float accumulator FACC EXP FACC PROCON ELECTRONICS 96 ProSoft 8 5 10 Ladder Outputs Communications Functions 8 5 10 1 Function Output Serial Communications COMM The RS485 communications port can controlled directly from the ladder logic program instead of using the Modbus Poll Blocks as previously described The Modbus Master tick box must not be selected This puts the RS485 communications port in Modbus Slave mode until the COMM function is called The communications function COMM is used to setup the parameters and to initiate a communications poll which could be a read or a write Some of the parameters are initialized to default values on power up of the PLC If you do not need to change these parameters then you do not need to include them in the ladder logic program Other parameters are kept after the first communications poll has been completed so if the value does not change then it is not necessary to reload them each time The parameters are listed below Serial Communications Parameters Parameter Name gt gt gt Description 0 PortNumber Selectthe RS485Port Default 1 1 Protocol Modbus 0 Memory 1 Default 0 2 SIs 1D The network address of the slave E PLC Memory This is the address of the memory in the
45. l be on otherwise the result will be off In the following example when the value in memory M12 is not equal to the value in memory M13 the output O1 will turn on M13 RITA 8 5 3 4 Function Contact Mem Const The function compares the contents of a memory location with a constant number lf they are not the same then the result will be on otherwise the result will be off In the following example when the value in memory M12 is not equal to 10 the output O1 will turn on E10 Hr PROCON ELECTRONICS 29 ProSoft 8 5 3 5 Function Contact Mem gt Mem The function compares the contents of two memory locations If the value in the first memory is greater than or equal to the value in the second memory the result will be on otherwise the result will be off In the following example when the value in memory M12 is greater or equal to the value in memory M13 the output O71 will turn on COL E E a 4 sl 6 E 5 J i 11 Le 15 Mis RLY 8 5 3 6 Function Contact Mem gt Const The function compares the contents of a memory location with a constant number If the value in memory is greater than or equal to the constant then the result will be on otherwise the result will be off In the following example when the value in memory M12 is greater or equal to 10 the output O1 will turn on CLA El d 4 2 6 E D Es 10 Ll 12 13 Rp 0580 8 5 3 7 Function Contact Mem lt Mem The function compares
46. lude Counters and Timers which have both relay and memory elements PLC Memory Map Type Inputs 1 max Inputs Used as a contact in the ladder program ls connected to the physical inputs on the PLC Outputs 1 max Outputs Used as a contact or relay in the MD jem ladder program Is connected to the physical outputs on the PLC Timers T 1 max Timers Uses Memory for the Current Value and Preset Value Uses contacts for the compare output Counters C 1 max Counters Uses Memory for the Count Value and Preset Value Uses contacts for the compare output Relays 1 max Relays May be used as temporary contacts or it relays Does not have any physical connection to inputs or outputs System S 1 max System These are contacts which are generated by the PLC such as 1sec pulse contact etc Refer to manual on PLC Memory M 0 max Mem Memory is used to store temporary variables for calculations using the output function element Constant 0 65535 Decimal Constant PROCON ELECTRONICS 22 ProSoft A typical memory map of a PLC would look like to following example AE GH E fac Address Type EE T ee We A e e 3 M eee IO IE O R12 R1 R0 Ro f R8 R7 Re R5 R4 R3 R2 R1 S16 S15 St4 S KE oT T E es ee es ft AA E i ENG oT T o T T E T p ASA o T T oT T EA T er a ae T T oT T ma if counters M15 7 oT T T f oT T EME T f oT T o T T
47. lue is greater or equal to the preset value In the example below the counter C1 will increment on each off to on transition of the input 11 The counter C1 will decrement on each off to on transition of the input 12 When the counter value is greater or equal to 5 the counter output will turn on When the input I3 turns on the counter C1 will stop and the counter value will be reset to zero COL 1 ES E 4 z D E D El 10 dd LE SO I1 enza TPL L IFz PS K5 EL Counter 1 RLY1 PROCON ELECTRONICS 35 ProSoft 8 5 6 5 Function Output NOP This function performs no operation lt can be inserted for debugging purposes when you want the result of a rung to do nothing In the example below the Input 11 will do nothing COL 1 2 E 4 a 6 El D El 10 11 12 15 PoC 8 5 6 6 Function Output END Placing this output function in the ladder program will indicate the end of the program Any ladder program after this function will not be run 8 5 6 7 Function Output LD Load Accumulator The accumulator is a 32 bit working register which is used for all mathematical operations The accumulator must first be loaded with a value before any of the mathematical functions are used The LD function loads the accumulator from memory M or with a constant K As memory and constants are only 16 bits they are loaded into the lower 16 bits of the accumulator The upper 16 bits are set to zero The example loa
48. mulator to the memory location M and the upper 16 bits to the memory location M 1 8 5 8 3 Function Output CMPF Compare Float This function Compares the 32 bit float accumulator with memory M and M 1 or with a constant K If the value in the accumulator is less than the value in memory constant then system bit S6 is turned on If the value in the accumulator is equal to the value in memory constant then system bit S7 is turned on If the value in the accumulator is greater than the value in memory constant then system bit S8 is turned on The value in the accumulator is left unchanged PROCON ELECTRONICS 99 Prosoft 8 5 8 4 Function Output ADDF This function Adds the memory M and M 1 or constant F to the 32 bit float accumulator The result is stored in the float accumulator FACC FACC M 1 M or FACC FACC F 8 5 8 5 Function Output SUBF This function Subtracts the memory M and M 1 or constant F from the 32 bit float accumulator The result is stored in the float accumulator FACC FACC M 1 M_ or FACC FACC F 8 5 8 6 Function Output MULF This function Multiplies the memory M and M 1 or constant F with the 32 bit float accumulator The result is stored in the float accumulator FACC FACC X M 1 M or FACC FACC X F 8 5 8 7 Function Output DIVF This function divides the 32 bit float accumulator by the memory M and M 1 or constant F The result is stored in the floa
49. ned on again When the timer value is greater or equal to 40 4 seconds the timer output will turn on When the input 12 turns on after 6 seconds the timer T1 will stop and the timer value will be reset to zero COL i 2 3 4 5 6 7 a g 10 li D P gv Sech u z ii IFA 12 2 IP Ti i 2 3 Timer 1 RLY1L 11 Tl I2 Timer Value 0 10 20 30 40 50 0 10 x0 1Sec PROCON ELECTRONICS 34 ProSoft 8 5 6 3 Function Output Counter Up counter with reset input The counter will count up when the count input goes from off to on The counter will be reset to zero when the reset input is on The counter output will go on when the count value is greater or equal to the preset value The counter is addressed as the counter number from 1 to max Counters depending on the PLC being used In the example below the counter C1 will increment on each off to on transition of the input 11 When the counter value is greater or equal to 4 the counter output will turn on When the input 12 turns on the counter C1 will stop and the counter value will be reset to zero COL 1 ra z 4 6 T D J 10 11 Le 15 Rp ED 8 5 6 4 Function Output Cntr Up Down Type 1 Up Down counter with reset input The counter will count up when the Up count input goes from off to on The counter will count down when the Down count input goes from off to on The counter will be reset to zero when the reset input is on The counter output will go on when the count va
50. oaded with a value before any of the mathematical functions are used The LDD function loads the 32 bit accumulator from memory M or with a constant K As memory is only 16 bit registers the LDD function loads the lower 16 bits of the accumulator from the memory location M and the upper 16 bits from the memory location M 1 The example loads the lower 16 bits of the accumulator with the value in memory address 12 and the upper 16 bits of the accumulator wit the value in memory address 13 Note that if the function is joined directly to the left hand side of the rung that the function will be called every PLC scan Memory M13 Memory M12 Pec GN MINI MIDI d HAHN MEN MENN au Aaa UCHU CULE OO ESEE UAE Accumulator Upper Accumulator Lower 1 1 OF 0 0 0 root 1 1 0 of 0 0 is A PROCON ELECTRONICS 48 ProSoft 8 5 7 2 Function Output OUTD Out Double The lower 16 bits of the accumulator are copied to the memory M and the upper 16 bits of the value in the accumulator are copied to memory M 1 In the example the lower 16 bits of the accumulator are copied to memory address M44 and the upper 16 bits to memory M45 COL 1 Z a d S 6 E 5 E 10 11 La Kit A 8 5 7 3 Function Output ANDD This function logically AND s the accumulator with memory M and memory M 1 or with a constant K The result is placed in the accumulator If the accumulator has the value 0000 0000 0000 1100 0000 0000 0000 0011
51. on 4 LADDER PROGRAMMING 4 1 LADDER TOOLBAR ELEMENTS The toolbar on the screen contains a collection of elements which may be chosen for generating the ladder diagram The element must first be selected by clicking on it with the mouse If you position the mouse pointer over the element a text description will pop up on the screen and if you click the mouse button over the element the text status bar at the bottom of the screen will show the element that has been chosen To add the element to the program you must move the mouse to the desired position on the ladder diagram area and click the mouse button The element will be added to the ladder program H there are options for this element then another box will open up on the screen for you to make further selections A brief description of the elements are given below A more detailed description can be found further in the manual 4 1 1 Horizontal Wire lt lt The horizontal wire is used to connect elements of the ladder diagram together from left to right and makes a series AND connection It is the same as using a wire jumper in an electric circuit For a circuit to be complete there must be a continuous connection from the left hand side of the ladder diagram to the right hand side of the ladder diagram 4 1 2 Vertical Wire The vertical wire is used to connect elements of the ladder diagram together from top to bottom and makes a parallel OR connection It is the same as using
52. or could be an internal relay in memory in the PLC which is turned on when the ladder rung goes from off to on If the rung goes from on to off then the output will remain latched on The reset output is simply the opposite and is turned off when the ladder rung goes from off to on In the following example when input l1 goes on the output O1 will be set on When input l1 is off the output O1 will stay on COL 1 2 3 4 D Bl a J 10 1i Le 15 PC PROCON ELECTRONICS 31 Prosoft In the following example when input l1 goes on the output O1 will be reset off When input 11 is off the output O1 will stay off Rp A PROCON ELECTRONICS 32 ProSoft 8 5 6 Ladder Outputs Standard Functions The function outputs are function blocks which perform a set task if the result of the rung is on 8 5 6 1 Function Output Timer 0 1Sec Timer 0 01Sec The Timer 0 1Sec is a single input timer with 0 1 Second time base and the Timer 0 01Sec has a 0 01Second time base The functionality of these timers is the same There a number of timers available numbered from 1 upwards to the maximum depending on the PLC being used The timer will run as long as the input is on The timer will be reset to zero when the input is off The timer also has a built in compare function The compare function compares the timer value with a value in memory or a constant If the timer value is less than the memory value or constant then the timer output will b
53. reate a new project called sample1 Click the mouse pointer on File gt New on the menu and after selecting the PLC type you are using type in the name sample 4 2 2 Step 2 Edit some tag names to make them more descriptive Click on Edit gt Tags on the menu and select Input 1 Change the name to START and click the ADD button Select Input 2 and change the name to STOP and click the ADD button Finally select Output 1 and change the name to FAN1 and click the ADD button Click Close to exit Click on File gt Save to save the project 4 2 3 Step 3 In this step you will enter a ladder program using the element toolbar e Click on the normally open contact toolbar Now click on the ladder program Row1 Column1 Select the START input from the box e Click on the horizontal wire toolbar Now click on the ladder program Row1 Column2 e Click on the normally closed contact toolbar Now click on the ladder program Row1 Columns Select the STOP input trom the box e Click on the normally open contact toolbar Now click on the ladder program Row2 Column1 Select the FAN1 output from the box Click on the vertical wire toolbar Now click on the ladder program Row2 Column2 Click on the horizontal wire toolbar Now click on the ladder program Row1 Column4 to Row1 Column12 e Finally click on the normal output xz toolbar Now click on the ladder program Row1 Column13 Select the FAN1 output from the box e Click on t
54. s easy setting up of the PLC for communications This feature is only enabled if the PLC supports this function 2 INSTALLING ProSoft Step 1 Insert the CD ROM into the CD Drive The software installer should start without assistance If the software installer does not start browse to setup exe in the root directory of the CD and double click on it then click on OK to start the setup Prosoft Setup 2 To start ProSoft Setup click OK To quit without installing click Cancel Cancel PROCON ELECTRONICS 6 ProSoft Step 2 Select the Installation Folder if required It is recommended that the suggested folder is used for the installation i ProSoft Select Installation Folder The installer will install ProSoft to the following folder To install in this folder click Mest To install to a different folder enter it below or click Browse Folder C Program Files Procons Fros ott Install ProSoft for yourself or for anyone who uses this computer O Just me Step 3 Finally confirm the setup and complete the setup procedure You will notice that a shortcut has been added to the user Desktop Remove the CD ROM from the CD Drive PROCON ELECTRONICS 7 ProSoft 3 Setting Up ProSoft 3 1 STARTUP To launch the ProSoft Application Program click on the shortcut on the Desktop called ProSoft This will load the startup screen which is blank until a project has been created or opened 3 2 CRE
55. t accumulator FACC FACC M 1 M_ or FACC FACC F 8 5 8 8 Function Output BTOF This function copies the 32 bit accumulator to the 32 bit float accumulator A type conversion is carried out from a 32 bit integer to a 32 bit floating point value FACC ACC 8 5 8 9 Function Output FTOB This function copies the 32 bit floating point accumulator to the 32 bit accumulator A type conversion is carried out from a 32 bit floating point value to a 32 bit integer ACC FACC PROCON ELECTRONICS 94 ProSoft 8 5 8 10 Function Output PWRF This function raises the 32 bit float accumulator by the power of the value in memory M and M 1 or constant K The result is stored in the float accumulator FACC FACC or FACC FACC 8 5 9 Ladder Outputs Trigonometric Functions The trig functions are function blocks which perform mathematical tasks using the IEEE 754 floating point notation The unit for the functions is in RAD s You must check the manual for your PLC to see which of these functions are available in your PLC 8 5 9 1 Function Output ACOSF This function performs the Arc Cosine of the 32 bit float accumulator The result is stored in the float accumulator FACC ACOS FACC 8 5 9 2 Function Output ASINF This function performs the Arc Sine of the 32 bit float accumulator The result is stored in the float accumulator FACC ASIN FACC 8 5 9 3 Function Output ATAN
56. the contents of two memory locations If the value in the first memory is less than the value in the second memory the result will be on otherwise the result will be off In the following example when the value in memory M12 is less than the value in memory M13 the output O1 will turn on COL 1 E S 4 z D Fi a a 10 11 12 15 WI Hr PROCON ELECTRONICS 30 ProSoft 8 5 3 8 Function Contact Mem lt Const The function compares the contents of a memory location with a constant number If the value in memory is less than the constant then the result will be on otherwise the result will be off In the following example when the value in memory M12 is less than 10 the output O1 will turn on ZOL 1 E E 4 2 6 Z 5 El 10 dal Le 15 k10 RLYL 8 5 4 Ladder Outputs Normal Inverted Output The normal output represents a physical output or could be an internal relay in memory in the PLC The output is turned off if the result of the ladder rung connected to the output is off or turned on if the result of the ladder rung is on The inverted output is simply the inverse of a normal output In the following example when input l1 is on the output O1 will go on CUL 1 2 E 4 2 6 Z 5 El 10 11 Le 15 KG A IF1 RL In the following example when input 11 is on the output O1 will be off COL 1 E J 4 2 6 Z 5 Y 10 11 12 13 ed t Eden 8 5 5 Ladder Outputs Set Reset Output The set output represents a physical output
57. trol Example This example can be used for most applications for the control of motors via a PLC including pumps conveyors mixers etc The START input must be held on for 5 seconds before the motor starts The STOP input stops the motor The Emergency Stop will stop the motor and stay latched until the Reset input is pressed The I O used will be as follows Digital Input 1 START Manual Start Push Button Digital Input 2 STOP Manual Stop Push Button Digital Input 3 ESTOP Emergency Stop aux contact from emergency stop circuit Digital Input 4 RESET Alarm reset Push Button Digital Output 1 MOTOR Motor run relay Control Logic The first step is to do the detecting and latching of the emergency stop alarm The alarm will only be cleared when the alarm condition is cleared and the operator resets the alarm We use the internal relay R1 as the emergency stop alarm relay COL 1 E E 4 D T O J 10 11 12 15 U d f IK Ri a 0 EST QP ES_ AL HI 14 ES_4L RESET Next a timer with a limit of 5 seconds 50 X 0 1sec is connected to the Start input The timer output will switch on when the START input is pressed for longer than 5 seconds T1 11 0 13 2 3 START KOO PROCON ELECTRONICS 62 ProSoft Finally we do the program which drives the output to the motor having considered all the input signals TL Iz Ri Ol 3 4 0 Timer 1 STUP ES AL MOTOR It is possible to add other alarm circuits for motor tripped and motor running
Download Pdf Manuals
Related Search
Related Contents
Ma machine - Nespresso Programmer`s Guide Carton d`invitation Philips D2051MMX Télécharger Accoppiatori di bus DP/PA-Link e Y-Link - Service, Support Bulletin Manual 04/2013 Copyright © All rights reserved.
Failed to retrieve file