A Practical Applications of Virtual PLC using LabVIEW Software

: In this study thirteen different functions (VIs) are designed and tested .These include, single input single output, single input two outputs, latch outputs, timer, counter, logic function, less, greater and equal functions, XOR function, compound function and shift register. At the end of the study, for illustration purposes, the 7-day tea maker , electro-pneumatic drive system and their simulation were developed and tested. Results of experiment show complete coincidence between the PLC-based control and Virtual PLC-based program results.


INTRODUCTION
Today, traditional PLCs are still in use at most plants, but windows-based PCs using the LabVIEW software (Abuzalata et al., 2010;Alia et al., 2011) are increasingly becoming the preferred control mechanism for new installations.PLCs have become a favorite tool in the control industry because of their simplicity, robust I/O interface and reliable performance Bolton (2006Bolton ( , 1999)).Traditional PLC systems have proven to be information barriers to enterprise-wide data access.One may add that the inherent proprietary design of PLCs has limited data access for a number of reasons, such as the limited amount of memory, the nature of programming language (Relay Ladder Logic) and the data access, where data inside the PLC is stored in a data table and accessed by data table location.An important feature of PLCs is that a standard PLC executes only a single program at a time, while an industrial computer is capable of executing several programs or tasks simultaneously in any order.Another two important PLC drawbacks may be noted also: The first one is that PLC register access is performed at a surprisingly low level on most PLCs Morris (1982) and Travis and Kring (2006).The second one is that if the ladder logic and the host computer program both write to a PLC register, we have an obvious conflict.Instead, all registers should be one-way, that is, either the PLC writes to them or the host computer program does.In contrast to PLCs, PCs have virtually unlimited memory, compared to traditional PLCs.LabVIEW makes it easy to maintain good architecture in the applications because encapsulation and modularity are easy to implement through the use of sub.VIs.
Building on the above mentioned the aim of this study is to illustrate the design of different PLCs functions in order to be used as a practical applications using LabVIEW environment.

EQUIVALENT PLC/LABVIEW LADDER DIAGRAM
In Table 1, the ladder diagram rungs for PLC, Siemens (S7-200) software and their equivalents using LabVIEW from Single Input, Single Output (Relay) as in the example Thomas (2002).

THE 7-DAY TEA MAKER
Operation of The 7-day tea maker: The operation of the tea maker required the following sequences: The time switch closes at the appropriate time in the morning and initiates the cycle.Valve V1 is opened and water fills the kettle K until the float switch FS operates.This switches off valve V1 and switches on heating element E. Water in the kettle boils and operates thermostat TH.This switches off the element E and switches on valve V2.Hot water flows into the teapot and V2 must shut off when the teapot is full.An alarm bell rings to inform the user that the tea is made.
The system relies upon the user to replace the teapot, complete with tea, every day and to fill up the tank each week.The sequence listed is a 'program specification'.

Inputs and outputs:
LabVIEW is to be used instead of PLC to control this system, as it is known that the inputs and outputs for the PLC have to be identified prior to the design of a program.In the tea maker application, what is the input and outputs?

Output devices:
The diagram for the 7-day tea maker in Fig. 1 illustrates the operation of the system.Referring to the tea maker system to identify each element as input or an output device and give it a unique identification as shown in Table 2.
The 7-day tea maker program: Since LabVIEW is to be used instead of PLC to control this system and then design the program by the PLC, which is PLC Siemens (S7-200) software, then by LabVIEW software.requires the following steps: Initialize the operation by the external ON push button or the internal one in the software, the solenoid valve SV is works and moves the cylinder to forward direction.When the cylinder touches the limit switch LS, timer one T1 will be activated.After the time value of T1 is ended, the SV is returns to off state and the solenoid returns to the backward direction.This makes the timer two T2 to turn on, T1 off and the counter C1 increases by one.
After the time value of the T2 ends, the SV is activated and the cylinder moves to forward direction again.The sequence is continued until the counter reaches its value, then the operation will be off automatically.The user can switch off the operation at any time by the external off push button or the internal one in the software, also the user can switch on the operation from the external on push button.

Inputs and outputs of the pneumatic cylinder:
LabVIEW will be used instead of PLC to control this system.As known, the inputs and outputs for the PLC have to be identified prior to the design of a program.
Referring to the pneumatic cylinder system we can identify each element as input or output device and give it a unique identification as shown in Table 3.The pneumatic cylinder program: Since LabVIEW is to be used instead of PLC to control this system, then firstly design the program using the PLC, which is PLC Siemens (S7-200) software as shown in Fig. 5, then using LabVIEW software as shown in Fig. 6.
• PLC ladder diagram of the pneumatic cylinder: • LabVIEW ladder diagram of the pneumatic cylinder: Figure 6 shows the ladder diagram of the pneumatic cylinder system The pneumatic cylinder simulation using labVIEW: Figure 7 illustrates the simulation of the pneumatic cylinder application using LabVIEW software.
As shown in Fig. 9, the construction of the hardware circuit.The electrical circuit includes two parts; first part is the optocoupler, which isolates the DAQ board from the high currents of the solenoid coil.Digital Channel 5 in the DAQ board activates the optocoupler and its output activates the second part (power transistor).The aim of the second part is to give the suitable current to solenoid (Suitablesignal conditioning).The output of the power transistor activates the solenoid valve (Alia et al., 2011).

CONCLUSION
Using LabVIEW environment, thirteen different virtual rungs have been designed and tested.Applying the same approach it is possible to design a complete set of PLC functions in order to realize programmable PCbased virtual PLC.In this case the virtual PLC will gain the advantages of PC-Based control.
Fig. 1: Diagram of the 7-day tea maker

3 B•
The PLC ladder diagram: As shown in Fig. 2, the ladder diagram of the 7-day tea maker program using PLC Siemens (S7-200) software is shown in Fig. 2. • The LabVIEW ladder diagram: As shown in Fig. 3 the ladder diagram of the 7-day Tea maker program using is LabVIEW.• The 7-day tea maker simulation using Lab-VIEW: As shown in Fig. 4 the simulation of the 7day tea maker using LabVIEW software.

Fig. 5 :
Fig. 5: Siemens ladder diagram of the pneumatic cylinderPNEUMATIC CYLINDER SYSTEMOperation of the pneumatic cylinder: The operation of the pneumatic cylinder valveAlia et al. (2011) requires the following steps: Initialize the operation by the external ON push button or the internal one in the software, the solenoid valve SV is works and moves the cylinder to forward direction.When the cylinder touches the limit switch LS, timer one T1 will be activated.After the time value of T1 is ended, the SV is returns to off state and the solenoid returns to the backward direction.This makes the timer two T2 to turn on, T1 off and the counter C1 increases by one.After the time value of the T2 ends, the SV is activated and the cylinder moves to forward direction again.The sequence is continued until the counter reaches its value, then the operation will be off automatically.The user can switch off the operation at any time by the external off push button or the internal one in the software, also the user can switch on the operation from the external on push button.

Fig. 6 :
Fig. 6: LabVIEW ladder diagram of the pneumatic cylinder system

Fig. 9 :
Fig. 9: The hardware circuit of the pneumatic cylinder

Table 1 :
Functions for PLC and their equivalents using LabVIEW Legend PLC Siemens (S7-200) LabVIEW 1-Single Input, Single Output (Relay) • Inputs: They are signals/information from sensors, which inform the PLC (LabVIEW program) what happens to the system being controlled.Inputs tell the PLC (LabVIEW program) what is going on,