![]() |
Communicating With A PC
I am stuck here guys and I need some help, I am not going to use a serial port since out laptop does not have a serial port. I was thinking either communicate with an ethernet on the 2nd port or the existing connection with the dashboard. The problem is I do not know how to do that, there is no socket class, or anything similar to it. I am currently looking at the DataOutputStream and the Driverstation class, but I am not sure if thats the one that communicate through the ethernet. I have an idea on what they do, but I have no idea from the client side to get that data being sent. Should I use sockets? If I do use sockets, whats the port and IP of the robot? I know I sound like a total noob, but its been a long day, I woke up at 5:30 and lifted for an hour and now I am school trying to figure this out...
|
Re: Communicating With A PC
1. You could use the DashBoard data stream to feed data one-way to the PC, then setup the Classmate to feed to an external dashboard (it will do this), on your computer. I do not know what port this uses, but the IP is 10.xx.yy.2 where xx.yy is your team number (For me it would be 10.0.33.2). Dashboard will only send data to port 1, directly to the Classmate, which then relays the data to your program.
2. You could use sockets. In LabVIEW (after not using the front panel controls and Dashboard) I would go to sockets. Nothing wrong with them, you just need to know what you are doing. 3. If you do not understand the Dashboard, you should probably not go into sockets. 4. Read through some of the LabVIEW dashboard code to get a feel for how the Dashboard operates client-side. There are two VI's of significance: There is one (I forgot it's name), that gives you your data. It gives you two strings: High and Low (priority). You then take the binary string and get a structure of data. You do not have to do it that way, but you get two strings whatever way you do it. Look inside this VI. It will tell you exactly how the Dashboard is getting its data. It uses a UDP socket and waits for new data (in it's own thread). You should *probably* create a new thread to run it in, so your other code dosen't have to wait for new data (and hang when there is no data coming in). The other VI is Get Image from Controller. It does just that, it gets the latest camera image from the crio. Feed it the IP (which you know) and it will get it for you. Inside, it has a TCP or UDP socket (I think it's TCP but I am not quite sure) that gets a string, which it then converts to an image. I do not know the encoding on it, but it uses the LabVIEW image to string function to create it. |
Re: Communicating With A PC
Quote:
--Ryan |
Re: Communicating With A PC
Quote:
|
Re: Communicating With A PC
You're using C++, right? It depends on what information you're trying to communicate to/from the PC. If you don't use the dashboard interface, then you'll want to use sockets. Lookup how to use sockets, its mostly the same interface as every other OS.
If you use sockets, you get to pick the port that you use. We have a webserver running on our robot that we use to communicate with it. The code for it uses the portable boost::asio asynchronous I/O library to abstract all the socket crap away. But, asynchronous I/O is inherently tricky, so user beware. http://code.google.com/p/webdma/ |
Re: Communicating With A PC
what are you trying to transfer? If you just want to get feedback or basic debug info, you could just use my ZomB Dashboard: http://firstforge.wpi.edu/sf/projects/zombdashboard
it (currently) uses the dashboard packets to send ints, floats, and strings, and also supports the video stream. You can also configure the DS to send data (minus video) to a remote computer (its in a draft manual on the site) It uses the Dashboard class and works with Java and C++ If you need help, pm me. |
Re: Communicating With A PC
Quote:
Quote:
Thanks for your help, if you have not noticed, I like to do a lot of things from scratch, LOL |
Re: Communicating With A PC
Quote:
|
Re: Communicating With A PC
Quote:
|
Re: Communicating With A PC
Quote:
|
Re: Communicating With A PC
Quote:
And the C++ libraries should already be in place on your computer if you installed the build tools from the DVD. As far as I know the imaging tool just changes a few config files to load the correct environment |
| All times are GMT -5. The time now is 03:26. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi