Lab 2: TCP /IP communication Southern Methodist University Bryan Rodriguez
Objective- To gain a better understanding of the basic communication from flow of TCP/IP using Labview. (Note: This will be how you will communicate with the CSE students) Southern Methodist University Bryan Rodriguez
Acquire Data From Wii remote Format/ Manipulate/ Organize the data Transmit To CSE Basic Data Flow Via Bluetooth connection Via TCP/IP connection Southern Methodist University Bryan Rodriguez
What is TCP? “The Transmission Control Protocol (TCP) is one of the core protocols of the Internet Protocol Suite. TCP is one of the two original components of the suite (the other being Internet Protocol, or IP), so the entire suite is commonly referred to as TCP/IP. Whereas IP handles lower-level transmissions from computer to computer as a message makes its way across the Internet, TCP operates at a higher level, concerned only with the two end systems, for example a Web browser and a Web server. In particular, TCP provides reliable, ordered delivery of a stream of bytes from a program on one computer to another program on another computer. Besides the Web, other common applications of TCP include and file transfer. Among its other management tasks, TCP controls segment size, the rate at which data is exchanged, and network traffic congestion. “ Internet Protocol SuiteInternet Protocol file transfer Southern Methodist University Bryan Rodriguez
Let’s start by looking at a simple communication setup. 1) Open a new blank project: From the main Labview window under “New Custom Lab” select “On my computer” and press the green arrow next to this section. 2) Open an example lab of a TCP/IP connection: In the toolbar at the top select the following- Help > Find Example In the new window open the “Networking Folder“ then open the “TCP & UDP” folder Southern Methodist University Bryan Rodriguez
This should be what you see at this point Open the following examples: “Simple Data Client” and “Simple Data Server” Southern Methodist University Bryan Rodriguez
Following the instructions provided in on each example establish a communication between the 2 windows to transmit data to one another. Look at the various components used for the user interfaces. Relating these examples to our project: EE students = Simple Server CSE students = Simple Data Client Southern Methodist University Bryan Rodriguez
Now let’s look at how everything is working, To do this look at the block diagram for each of the examples- Window > Show Block Diagram With use of the small “Context Help” window and the foot notes on each of the examples try to see if you can get a high level understanding of what is going on and how they are working. Southern Methodist University Bryan Rodriguez
Since this is how we will communicate with the CSE students we need to understand how this example works and what components we will need for our project. In particular make note of the following blocks and their necessary connections in the “Simple Data Server” example: TCP listen TCP Write TCP Close connection For a very detailed explanation of each of the blocks, or any others, right click the block and select Help. Southern Methodist University Bryan Rodriguez
Now you will need to build your own project that transmits a String via a similar connection. You will need to build the following in your own project. Remember to add components you can either do so manually by rick clicking and searching for them or you can copy and past components from other labs. Southern Methodist University Bryan Rodriguez
Once the lab sheet is made and there are no errors you will need to make a “pseudo” CSE student for testing the communication. You will need to download the file “Robot_Networking.jar” from the lab website and follow these instructions: Com. Test: 1.Save this file to the C drive. 2. Set the labview robot project to PORT 4000 (the java program tries to connect to that port) 3. Start running the labview robot project 4. Go to start >> run >> type "cmd“ 5. At the command prompt, type: java -jar "C:\Robot_Networking.jar" Southern Methodist University Bryan Rodriguez
If everything is working properly you should see your string being outputted on the command window. This signifies that you can now use this as a building block in your robot project to establish communication and transmit data to the CSE students. Make sure to save your project so that you can easily extract it or add onto it with future labs as you work towards creating your main robot project files. Southern Methodist University Bryan Rodriguez
Lab questions/discussion points for your report: 1)Briefly describe the 3 major blocks used in your data server project ( Hint: slide 9 ) 2) What data type are we using for the “TCP Write” block? What is the significance of this block and why does the data type matter? 3)What type of looping structure is used in your project and why? Southern Methodist University Bryan Rodriguez