This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.
In this project, the software development of PLC programming is demonstrated by using Microsoft Visual C#. The main objective of this project is to develop a software that enables the programming of ladder diagram and its simulation by ladder logic. The Soft-PLC software allows user to design the PLC circuit on the workspace. The software provided the basic function for the PLC circuit such as contact, coil, one shot, counter, timer and etc. Here are also other advanced functions included in this software which are Comparison Function and Arithmetic Function.
For the workspace of the Soft-PLC software, the ladder is currently can be edited up to 1000 rungs and each rung can fixed with 12 elements. It is found that Microsoft Visual C# Data Grid View can be used as ladder diagram editor. For example, pictures will show in the respective cell/grid once the user has selected the component that required and placed at the location selected; address and other information (such as counter variable, timer variable, and etc.) in array form will be assigned to the component that has been positioned. Then, the program is ready for simulation if there is no an incomplete rung.
Another objective of the project is to run the simulation for the ladder logic that has been constructed. Iteration (for loop in this case) is used heavily to test the logic. This is the basic programming in control to run the logic. The advantage is relatively easy to use, however much more difficult to debug when facing bug during simulation. To represent the state of the element during the simulation, the program changes the color of the element; blue color represent logic 0 and red color represent logic 1. From the testing, it is found that the method is running correctly so far.
For the simulation on counter, the counter counts the number of rising edge of the input to the counter. The method used to build the counter is relatively simple which is to test the input to the counter and the counter variable increased or decreased by 1 when the input changes from low to high. For the timer, Microsoft Visual C# provided a timer which allows the user to specify a recurring interval at which the elapsed event is raised in the application. In this software, 2 timers are used during the simulation. One of the timers is used to run the simulation function. The rate of simulation is set at 5Hz. Another timer is used to build the timer in the PLC circuit. For the timer provided by Microsoft Visual C#, it is estimated 1 interval equivalent to 1 millisecond.
The Comparison Function and Arithmetic Function in this software currently only can work with the counter. The simulation on the Comparison Function is built by searching the target counter and compares the variable of the counter to the variable in the comparison operator with the rule of the operator. The software search and record the address of the counter when the user edits the name of target counter. The method of building the Arithmetic Function is almost the same with the Comparison Function but the arithmetic operator produce a result to the destination counter with the given expression.
The second objective is to design a user friendly graphical interface for PLC programming software. The user interface has been designed to be simple and easy to use. All the function can be selected directly from the tool strip on the top of the software. However, the drag and drop function is not included in this software and the software facing the difficulty for insert parallel line.
In conclusion, the software is able to run the simulation. In simulation part, the function in this software can be performed well. However, here are bugs existing in the software and more time is needed to debug the software.
The software is currently facing some limitation. The first limitation of the software is the Comparison Function and Arithmetic Function. The operator can only work with the counter. The Comparison Function and Arithmetic Function are currently unavailable to work with other elements such as timer. Besides that, the rate of simulation can reach to only 5Hz due to the simulation function is very long. If increase the rate to 100Hz, the software will very busy to run the simulation function and cannot detect and response to the change of input in the PLC circuit such as when the user click the contact, the software is unable to change the state of the contact. Another limitation is the difficult to insert a parallel line. The method of insert a parallel line must be improved.
5.3 Future Development
For future improvement, the simulation rate must be increased without affect the detection of input from the user. This problem must be solved because with a low simulation rate, the user can see the delay in electric signal transfer when the PLC circuit goes complicated. The recommended simulation rate is at least 1000Hz.
Next improvement is more function can be added to this software. The improvement in the compare operation and arithmetic operation to support using other element as the operands can be added to this software. Besides that, the instruction to reset the timer and counter must be added to this software. The reset instruction is used to reset the RTO timers and CTU/CTC counters which are not reset automatically. The timer should improve to provide more connection such as TT.
A large improvement can be done in making the software more user friendly, the method of inserting a parallel line must be improve and software must be identify where the user going to insert the parallel line. Drag and drop function can be added to this software, so that the user can drag the element on the workspace to any location on the workspace.
The software can be improved so that it has the ability to save the program on the workspace and load back when the user needs it. The conversion of ladder diagram to the PLC protocol and the networking to communicate with the PLCs must be added to this software so that the PLC can read the program in the workspace and the software can communicate with the PLC.