On team 3419, we've done what 414cnewq is suggesting (talk via a custom socket between the roboRIO and a program running on the laptop). Unless you're an experienced networking programmer, it can be a quite a bit tricky. That being said, if you want to learn about the low level details of how computers communicate with each other in the "real world", this is a great educational exercise. It's also a good approach if you need to do something very with very low-latency, like having a USB camera on the roboRIO and processing the images on the laptop.
If you want a simpler approach, you can use the NetworkTables. This is how the roboRIO and SmartDashboard talk to each other, and you can write code that acts like the SmartDashboard to read the data. Here's a java example:
-Import NetworkTables.jar (the location changes from year to year. last year it was C:\Users\<USERNAME>\wpilib\java\current\lib). You may also need to include SmartDashboard.jar but I don't think so.
-Create a NetworkTable member variable:
private NetworkTable mNetworkTable;
-Initialize it at startup. I forget if the first two lines here are necessary. I think they are in general, but might not be if you are running in the context of the smartdashboard (like a custom widget)
NetworkTable.setIPAddress("roborio-3419-frc.local");
NetworkTable.setClientMode();
mNetworkTable = NetworkTable.getTable("SmartDashboard");
-To read data out of it, use a line like this:
mNetworkTable.getNumber("SomeVariableThatYouSetOnT heRIO", aDefaultInCaseItHasntBeenSet);
There is also a .NET implementation of NetworkTables (
https://github.com/robotdotnet/NetworkTablesDotNet ). The similar lines of code in C# are:
Declare it:
private NetworkTables.NetworkTable mSmartDashboardTable;
Initialize it:
NetworkTable.SetIPAddress("roborio-3419-frc.local");
//Set Client Mode
NetworkTable.SetClientMode();
//Initialize the client
NetworkTable.Initialize();
mSmartDashboardTable = NetworkTable.GetTable("SmartDashboard");
Use it:
mSmartDashboardTable.GetNumber("SomeVariable", theDefault);
I think there is a C++ implementation as well.
Hope this helps.