PrintF to Driver Station

Hey all!

I’ve been reading through the documentation to use the Driverstation class, but, I still havn’t figured out how the data actually goes across the network into eth2.

Does anyone know what port I can listen into to get data when using the printf function?


include a printf in your code, run it, then in WR target connections, right click the cRIO connection>Target Tools>Target Console:OK

Well, is there any way to pull the data off without using the WR tools?

The data that you print will also go out the cRIO console on the serial port.

There is some setup that you need to do (a dip switch setting I think) and a somewhat custom serial cable to construct, but you can get the console printfs via the serial port without having Wind River involved.

I think I’m trying to do something similar.
Instead of getting the output in an ugly console, I’m trying to redirect the sdout stream to a C# gui that I’ll create. Does anyone have any idea how to redirect the sdout stream to a process on the laptop?

Oh, and to get the cout’s (or printf’s or whatever) to appear in the Wind River Target Console, you need to flip the dip switch labeled “Console Out” on the cRIO to the left (if the bulk of the cRIO is to your right)

I tried that, it worked a few times, then it stopped working for me

Anyone know how to pull off dashboard values from the control system packets?

Based on the default dashboard project in labview, the packet comes in on UDP port 1165 of the 10.XX.YY.6 address. There’s a bunch of decoding that gets done in “Receive DS” that you can try to decipher if you’re trying to roll your own.

We took the default project, stipped off the right side of the diagram and plugged in our own front panel elements. Once you get it up and running, it proves to be extremely useful…much more so than a console of streaming numbers :slight_smile:

I have to say, if you’re doing a laptop based dashboard that at this point in time this is a fast and easy way to get something up quickly. One thing that burned me a few times is having data in the input cluster out of order. To fix this you can right click on the cluster itself and select the reorder controls option.

You’re right, the LabView Dashboard looks like it can be really useful.
How do I set the constant on the left to match with the dashboard data format I define in the code? Also, how do I get the custom data to appear on the LabView dashboad?

If using Windriver you can just create one of the sample projects to demo the dashboard class.

It is extremely useful to download/install the WPI Lib sources…

Specifically, driverstation.cpp and dashboard.cpp

It is clear that dashboard.cpp is a packer class that encodes the data in a way for Labview to unpack…

One does not need to use this particular way of packing data if one is to write their own dashboard (e.g. using c#, java, etc…). All that is needed is a sample upd server code to read port 1165 as noted earlier in this tread… One can then come up with their own way of encoding data in the packets…

The robot essentially sends the 984 or so bytes every 20ms… it is all there in the code in driverstation.cpp (senddata function)

These bytes then go to the driverstation (address 10.x.x.5) which then sends them to the 10.x.x.6 address. This is hardwired somewhere… The laptop that has 10.x.x.6 address then receives the information via udp from the driver station…

I’m working on a custom dashboard also. This thread is very helpful.