Log in

View Full Version : Labview on PC using udp C++ on cRIO need udp server solution


PaulDavis1968
17-03-2012, 09:27
My team has labview getting correct distances on the DS. We just can't get them to the driver station. Desperately needing help.

DominickC
17-03-2012, 09:32
Do you mean you are having trouble sending data from the cRIO to the Dashboard? If so, you'd flatten your data to a string and send it via Set User Data High.vi.

PaulDavis1968
17-03-2012, 09:35
No I need to receive the data on the robot. I do not have a viable solution at the moment. How would I schedule a udp server that runs threaded on the robot. I am out of my depth on that. Networktables I can not get to work.

Greg McKaskle
17-03-2012, 09:54
There are other threads on this with more deails, but generally, I'd suggest using UDP. An example of this is in the dashboard already, where the Kinect info is read from the DS. Change the read to a write, and change the port and the LV side should be done. I don't know that I can point you to a UDP example for C++, but I suspect you can google and find some.

Greg McKaskle

PaulDavis1968
17-03-2012, 10:44
I have found some. I just wanted to know how to fork off a process so that it was running in background after starting robot.

Greg McKaskle
17-03-2012, 10:59
I think WPILib includes a task class that will wrap the posix thread APIs. That should make it pretty easy to do.

Greg McKaskle

PaulDavis1968
17-03-2012, 11:54
Thanks I will try that. Write now we are messing with your networkable you made in LV. Will the robot c++ code work with that combo? Are they combatable is basically what I am asking. Will find out in the next 30 minutes.

Next year all Lab view this is not fun trying to glue all these dissimilar things together.

Greg McKaskle
17-03-2012, 13:12
Hopefully the LV and C++ network tables are compatable. I've tried Java and LV in simple cases and I put it into beta to see what worked. Please let me know.

Greg McKaskle