Monitering C++ Code With A LabVEIW Dashboard

I’ve made much progress in my programming since my last post and am well on my way to getting this summer bot off the ground (not literally of course.)

A mentor from my team has asked me to look into something, I’ve researched for a while and can not find anything to suggest it is possible so I figured I’d ask you at the CD community.

My mentors want my code to be monitored through a Dashboard, not console outputs like I have now. As far as I’m aware this is not possible unless I use LabVIEW to program the entire robot, which I don’t want to do.

Any input would be appreciated!

The LabVIEW Dashboard application just needs to receive the appropriate data from the robot. There is an example program that shows how to send that data using C++. I apologize for not having better details for you, but we chose LabVIEW for our robot programming and I’m not familiar enough with the C++ environment to help you more.

As Alan stated, the LV dashboard displays information it receives from the driver station/robot via the UDP connection. This means that the LV dashboard really doesn’t even know what language the robot code is running. The tricky part for the robot code is what is called marshaling. This is taking arbitrary data and flattening it into a byte buffer, then unflattening it on the other side and reconstructing the original data. To make this easier, the example introduces some classes for doing this.

In summary, it is certainly possible, give it a try and ask for help if you get stuck.

Greg McKaskle

its relatively simple… as long as you know how to broadcast UDP packets in c++ (shouldnt be too bad)

basically you create a data structure that holds the data you want to send over, then you typecast it into a character array ( senddata = (char *)data ) or something like that.

once its sent, you can build an identical data structure in labview (make sure you pack it correctly in c++), unflatten it from a string (see the documentation on that vi), and shazam you now have a data structure filled with data.

im sure there may also be libraries in c++ to do complete communications with labView, allowing real time updates too, but thats basically the reverse of the process described above.

Look into the Dashboard class provided in WPILib. There’s a good demo there that should get you off the ground. It interfaces nicely with the Labview Dashboard example as well. Once you figure out how it’s working, it’s easy to modify it to suit your needs.

I’ve also created a library that allows you to monitor and modify variables in C++ via an embedded webserver on the bot:

Then you don’t need LabVIEW either, just a web browser. :slight_smile:

Thanks guys I’ll give this a try, my code has also run into another brick wall, so I’ll be asking this in a few minutes!