Log in

View Full Version : Connecting two java programs with a Ethernet cord


279 EMPIE
06-12-2012, 13:13
I was wondering if anyone has made any code that will send information in a Java Program on a laptop through a Ethernet cord to the Program in the cRIO.

I'm sure it is do able its just i haven't found much sample code to learn off of. I have no experiance with programming IP/TCP, Ports, or anything else that has to do with this subject.

I was just wondering if someone could help me out. :D

F22Rapture
06-12-2012, 16:53
I was wondering if anyone has made any code that will send information in a Java Program on a laptop through a Ethernet cord to the Program in the cRIO.

I'm sure it is do able its just i haven't found much sample code to learn off of. I have no experiance with programming IP/TCP, Ports, or anything else that has to do with this subject.

I was just wondering if someone could help me out. :D

I'd recommend making a SmartDashboard plugin to serve your needs, and use Networktables/Networktables2 to pass the data. That way you really don't even need to bother with handling TCP/UDP directly.

What are you doing with the data at either end?

279 EMPIE
07-12-2012, 14:04
What are you doing with the data at either end?

Well i would most likely be transferring Variables and Numbers from the Laptop to the cRIO.

joelg236
07-12-2012, 15:10
Well i would most likely be transferring Variables and Numbers from the Laptop to the cRIO.

I would definitely recommend saving yourself a lot of trouble and use the SmartDashboard. It can do that without a problem.

F22Rapture
07-12-2012, 18:15
Well i would most likely be transferring Variables and Numbers from the Laptop to the cRIO.

I would definitely recommend saving yourself a lot of trouble and use the SmartDashboard. It can do that without a problem.

Exactly. You don't even need to use a plugin since networktables has that functionality built in.

279 EMPIE
10-12-2012, 13:40
Thank You,

I have never used SmartDashboard before so i will look into that and see what i can do.

279 EMPIE
11-12-2012, 12:21
Does SmartDashboard have a API??

BigJ
11-12-2012, 12:28
Does SmartDashboard have a API??

http://www.wbrobotics.com/javadoc/edu/wpi/first/wpilibj/smartdashboard/SmartDashboard.html

279 EMPIE
11-12-2012, 13:13
http://www.wbrobotics.com/javadoc/edu/wpi/first/wpilibj/smartdashboard/SmartDashboard.html

TY

connor.worley
11-12-2012, 13:52
Note: SmartDasboard 2/NetworkTables 2 will be coming out for the 2013 season. Make sure to upgrade when it arrives!

F22Rapture
11-12-2012, 17:36
Note: SmartDasboard 2/NetworkTables 2 will be coming out for the 2013 season. Make sure to upgrade when it arrives!

Actually, it's SmartDashboard 3 :P

Has anybody managed to figure out how NT2 works, exactly? I'm sure it's much more efficient than NT1 but it also seems a whole lot more complicated. We don't have a robot to test on atm so I really couldn't mess with it much even if I wanted to.