Network
Data Transmission
The goal of this laboratory is to measure a temperature on one computer
and transmit it to another computer. Here are the details.
-
In the data server, modularize
the measurement process to include the following:
-
There should be two "nested"
loops. In the inner loop, measurements are taken and formatted, then
sent to the network connection.
-
In the outer loop, there
will be a TCP/IP listener that established a connection. That loop
should run as quickly as possible so that it checks as often as possible
for a client trying to make a connection.
-
The Fluke/Hydra should
be reset outside of the measurement loop. However, that will probably
be inside the loop where the TCP/IP listener is located.
-
To make the process
as fast as possible you can set the Hydra to measure voltage in a sub-vi
(A "Reset" sub-vi). The output of that sub-vi should be an error
signal. There are no inputs for this sub-vi.
-
The temperature measurement
should be modularized in a separate sub-vi inside the measurement/data
transmission loop. The input to that sub-vi should be an error signal
(from the reset sub-vi), and there is no output.
-
The outer loop should
"listen" for a connection, then move to an inner loop where the temperature
is measured, then transmitted. The temperature data format should
be determined by the following:
-
First measure the length
of the temperature data, and encode the size of the temperature data string
into two (2) bytes, padding the size string if necessary. (i.e.,
if there are nine bits in the measurement string, then you should send
two characters - a "0" and a "9".
-
Then transmit the size
of the temperature string as those two bytes.
-
Then transmit the temperature
data.
-
On the other end, you
need to build a data client that does the following:
-
Opens a connection with
the server.
-
Receives data from the
server. The first data will be the number of bytes in the data string,
and the number of bytes will in turn be encoded into two bytes. Then
you should receive the temperature string data.
-
The temperature string
should be converted to a numerical format and displayed on a thermometer
type of indicator.
-
As you receive data, the
received data should be stored in a data file. In the data file,
there should be two columns - time and temperature.
Click
here for some questions to answer for this laboratory.
*
TCPIP stands for "Transmission Control Protocol/Internet
Protocol". It is a protocol for transmissions
between computers, and it is an "open standard" so that anyone can create
an implementation if they want to. TCPIP runs on almost every hardware
platform. It's widely used. You will find ways to implement
TCPIP in LabView, C/C++, Visual Basic, etc. Our personal opinion
is that LabView is the easiest way to do it.