Professional Documents
Culture Documents
Lvi Ii 05
Lvi Ii 05
TOPICS
A. TCP/IP Overview
B. Implementing the Client/Server Model
ni.com/training
A. TCP/IP Overview
• Link two Ethernet devices together using a
crossover cable
• Link many devices together using a hub
• Communicate using IP address
PC 128.1.0.0
X.X.X.X
Ethernet Device N N N
ni.com/training
The Client/Server Model
Server Client
ni.com/training
Client Model Overview
NO
Open Execute
Connection Command Done?
To Server on Server
YES
Close
Connection
To Server
ni.com/training
Server Model Overview (Handles one client)
Initialize Wait for a
Server Connection
Wait for a
Command
NO
Return Execute
Done?
Results Command
YES
Close
Connection
ni.com/training
Exercise 5-1: Simple Data Client VI and
Simple Data Server VI
Concept
Open and examine two of the TCP/IP example VIs that
GOAL
ni.com/training
B. Implementing the Client/Server Model
NO
Open Execute
Connection Command Done?
To Server on Server
YES
Close
Connection
To Server
ni.com/training
Server Model VIs
Initialize Wait for a
Server Connection
Wait for a
Command
NO
Return Execute
Done?
Command Command
YES
Close
Connection
ni.com/training
Server Model VIs
ni.com/training
Server Model (Handles multiple clients)
ni.com/training
Client/Server VIs
Read Modes:
Execute
Command • Standard (default): Returns bytes
Client or Server requested or more; timeout error if
less than requested are received
• Buffered: Returns bytes requested
or none; timeout error if less than
requested are received
• CRLF: Returns bytes read up to
and including carriage return and
line feed; timeout error if not found
• Immediate: Returns any bytes
ni.com/training
Client/Server VIs
Close
Connection
ni.com/training
Exercise 5-2: TCP File Transfer
Concept
Create a file transfer program using TCP
GOAL
ni.com/training
Summary
ni.com/training