Journal of Software Engineering and Applications, 2011, 4, 172-180
doi:10.4236/jsea.2011.43019 Published Online March 2011 (http://www.SciRP.org/journal/jsea)
Copyright © 2011 SciRes. JSEA
Development of Equivalent Virtual Instruments
to PLC Functions and Networks
Mohammad A. K. Alia, Tariq M. Younes, Mohammad Abu Zalata
Mechatroncis Engineering Department, Faculty of Engineering Technology, Al-Balqa Applied University, Amman, Jordan.
Email: makalalia2000@yahoo.com, tariqmog@hotmail.com, abuzalata@yahoo.com
Received February 20
th
, 2011; revised March 5
th
, 2011; accepted March 10
th
, 2011.
ABSTRACT
This research is a continuation to our work which was published in [1]. Eight different timing VIs are designed and
tested. These include ON-Delay, OFF-Delay, Single Shot, Retriggerable Monostable, and Accumulative software-based
timers. Using hardware programmable counter/timer chip (DAQ-STC-24bit) and PCI MIO-16E-1 DAQ board, another
two precise timers are designed. At the end of the paper, for illustration purposes, an electro-pneumatic drive system
was developed and controlled utilizing designed on-delay timers VI functions. Results of experiment show complete
coincidence between the PLC-based control and Virtual PLC-based program results.
Keywords: PLC, Virtual PLC, LabVIEW, Programmable Timers
1. Introduction
In our work “Design of a virtual PLC using LabVIEW”
we have shown how it is possible to create LabVIEW
VIs which represent PLC functions and networks. We
compared between PC-based and PLC-based control
systems, and came to the fact that both systems are con-
tinuously developing in the same direction in order to ob-
tain better programmability, connectivity and communi-
cation interfacing. At the time being the PC-based DCSs
are suited for industrial applications. They are robust and
they easily work in an open architecture mode, while
PLCs are equipped with specific MMI software and
pseudo-standard commutation software also. We have
shown that in order to improve the programmability of
PACs, we practically brought the PLC to the computer
utilizing by that numerous advantages of computers such
as multitasking, unlimited memory, high speed and the
possibility of creating unlimited number of programma-
ble objects such as counters, timers, shift registers and
others. Because of the limited size of previous work, we
were not able to cover other important VIs which may be
used also as the analog of PLC functions. In this paper
we shall develop different types of programmable timers
using LabVIEW software [2] and NI DAQ board hard-
ware also. The LabVIEW basic functions that provide
timing on millisecond level are the “wait” and “wait for
Next ms Multiple” VIs. Both are based on the same un-
derlying mechanism. Most applications work comforta-
bly with available LabVIEW measurements that resolve
milliseconds, and many more operate with second reso-
lution [3-4]. A few applications demand sub-millisecond
resolution and response time, which is problematic due
primarily to operating system and not a LabVIEW limi-
tation [5]. If the application requires higher accuracy or
resolution than the built-in timing functions can supply,
then one will have to use some additional hardware, such
as NI-DAQ boards or an external clock [6]. NI-boards
have two 24bit counter chips and several on-board clocks
that can be counted to produce accurate timing (intervals).
With the DAQ counter-timer VIs, one can configure the
on-board versatile hardware for a variety of tasks includ-
ing the accurate generation of timed pulses, counting
events, and the measurement of periods and frequencies.
The counter output generates a pulse when a preprogram-
med terminal count (TC) is reached. The pulse may be
used for sequencing purposes.
Similar hardware-based timing may be performed us-
ing windows API function “Query performance counter”.
This function looks at a high resolution system hardware
counter that runs at approximately 1.2 MHz or 0.8 micro-
second count. The actual resolution, once we account for
the delay in calling the function, will be considerably less,
but still far better than one millisecond.
Concerning Real-Time operating systems (RTOS), they
are designed to run a single program with very precise