An Introduction to Data Servers |
Introduction
Data servers are much like
the servers that serve up web pages. Let's look at some examples.
Let's say that you have
recently purchased 200 shares of XYZ corp, and you want to check the current
price of your stock. (And, just for the record, we tried to get a price fo
XYZ - stock symbol - and they couldn't find any record of such a symbol for
a company. Remember, it's just an example.) Anyhow, you log on to a web
page, and you get the price of the stock. Even better, without you doing
anything (like hitting the refresh button), the price gets updated on a
regular basis.
Let's say that you are a fan
of a baseball team. (It might be the Toledo Mudhens, but they are in the
minor leagues and we don't know if this service is available for them.) You
log on to a page that displays the score of today's game, and the score is
updated after every batter.
Both of these examples are
examples of data servers.
What happens in a data
server is the following.
The server "listens" for a
connection. In other words, the server must determine when a request has
come from a possible client. That address has to be sent to the correct IP
address (the IP address of the server) and the correct port on the server
computer.
When the server receives a
request, a connection is established. The phraseology is that a connection
is "opened".
After the connection is
opened, the server needs to prepare the data for transmission in the
agreed-upon format.
Then the server needs to send
the data.
When everything is complete,
the server closes the connection.
There are numerous
applications where this kind of operation can be used.
You might want to monitor a
temperature remotely - or more likely, you might want to monitor several
variables remotely (like temperature, flow rate, pH, etc. on a stream) - and
you might want to monitor variables at several locations - not just one
place.
You might want to transmit
results or operations (say for example, performance of a control system) and
log the data into a file for analysis. You might even want to do the
analysis real time.
And so on. . .
In order to do put data on
the network and acquire it remotely, you need to examine some particular ways of
implementation. In this lesson, we examine a simple data server and a simple
data client implemented in LabVIEW.
The Data Server
Here is a block diagram for
a simple temperature server.
We will examine the flow
of information/actions in this vi to see how the server operates.
We have encapsulated the GPIB
reset function as a sub-vi. That may be overkill since there is only one
GPIB Write in the sub-vi.
We have encapsulated the
temperature function as a sub-vi. This sub-vi has numerous functions
including:
Setting the measurement (DCV),
and the scale.
Taking the measurement.
Bringing the
measurement from the Hydra to the computer. Note that the data coming
from the measurement arrives as a string.
|