33
Real-Time Control Issues
oce PC. Often, a system based on a PLC
with 115VAC control I/O is much more
appropriate for real-time applications
(Figure 1). PLC processors are designed
to operate with deterministic control
loops, and the 115VAC control signals are
inherently immune to noisy industrial
environments.
If the required response time is long
enough, and there are other reasons
to use one of the familiar Windows
operating systems, keep in mind that
special steps are needed to improve its
data polling methodology. In a polled
system, the PC checks many devices to
see if they’re ready to send or receive
data. In the context of data acquisition
from an Ethernet-based IR camera, this
typically involves reading values from
a data stream. In a Windows-based
PC, the time between polled readings
is scheduled by Windows, so it’s non-
deterministic. In other words, the time at
which Windows will initiate an operation
cannot be known precisely. Its operation
depends on any number of system
factors, such as computer speed, the OS,
programming languages, and application
code optimization.
Polling can be appropriate with slower,
less time-sensitive operations. In contrast,
event-driven programming schemes are
less dependent on OS timing and tend
to reduce latency problems. They can
be used to create more deterministic
systems that collect discrete data values
that are closely related to the physical
phenomena being represented.
Creating such a system within a
Windows OS environment generally
requires writing program code using
Visual C/C++ , Visual Basic, etc. Using
these tools, a programmer can take
advantage of Windows events and
messaging functionality to create a
more deterministic application that
runs relatively fast and provides tight
control. Rather than constantly polling to
determine if data is ready for collection,
such programs can use the PC’s CPU
for additional tasks, such as database
or network access, until interrupted
by the automation system hardware.
As discussed in Chapter 4, there are
software developer kits that take some
of the work out of these tasks, and third
party software packages can eliminate
or minimize the need to write program
code. An example is illustrated in Figure 2.
Figure 2. Third party software provides
powerful control and analytic tools for IR
machine vision systems without writing
program code.
Data Communication Latencies
Hardware and data communications
have signicant eects on system
response time. The Ethernet interfaces on
many IR cameras allow communication
distances of 4000 feet or more. Wireless
and beroptic adapters and hubs can
extend the scope of the network even
more. Networked systems require the