We are getting ready for competition at Milwaukee next week and I just have a few things to clear up. (We are using LabVIEW, by the way)
I know that we can receive things back from the cRIO (one way) and we are allowed to see it on our computers during competition. We have been able to successfully put our code onto the cRIO (we kept it behind as our 40 lbs) and play around with some left over globe motors.
My question is how we get this information. With the normal deploy it runs right from the VI—but with it saved on the flash memory as the start up we don’t deploy it, correct? Do we need to create a dashboard project (I was under the assumption that was only for C code).
I have been looking around, but I haven’t been able to find a specific answer to my question.
Not exactly sure what I’m answering…
You have to set the cRIO to send back the information you want, and you need to use a dashboard project to retrieve the sent data. You can either edit the dashboard datatype.ctl, which seems to be common, or you can use your own structure by using the “set user data.vi”. A good example on how to pack the information for user data can be found in 1629’s code at http://beta.gearsinc.org/beta_2008-10-29/. Essentially, it takes something in, turns it into a string, turns the string into a byte array, and you’re good to go. Unpacking should be the exact reverse.
You can run the dashboard at the same time as having code for the robot deployed from your computer, but I suggest build/deploy (set as startup) if you have a stable version right now.
Edit: Once you have your robot code running, just open your dashboard project and deploy. It should deploy to your computer, so it shouldn’t mess with the running robot code. All it does is read udp packets and process them as far as I know
Well, if you’re running off of a front panel deploy, you should already be able to see everything, but you can’t run off a front panel deploy at competition, I believe, but the dashboard will work regardless.
2. The place where they do the packing is located in the vi called “GaCo_SendToDriverStation.vi” It says robot status cause it’s an older version, but it’s the same thing
If I can get to the LV laptop before I can’t edit this anymore, I’ll post an example
EDIT: what do you want to display? The default dashboard lists all the ins/outs and battery voltage and the like. If you want processed stuff like “is the camera finding something” you’re going to have to change something
That depends on whether you are satisfied with the default dashboard data. If you want to send your own specific information in addition to the defaults, you’ll need to put it in the user bytes of the dashboard stream and modify the dashboard program to read and display them.
Okay–I am starting to understand. Is this about right?
We are using a PID and encoders to control slipping. If I wanted to send the difference between the actual speed and the requested speed, would I take the number, convert it into a string, put in into a cluster, flatten the cluster into binary, and the put it into “Robot Status”?
Then on the dashboard I would take that, unflatten it, and then extract it from the cluster?
Not quite…put the number into the cluster, flatten the cluster into a string, and convert the string to a byte array. I still have to work out a couple quirks in my own dashboard xD. Earlier, I actually tried taking the 32 bit Uint and breaking it into a binary array and converting 8 bits to a ubyte int and putting them into an array. (Doesn’t work very well…or really at all. Probably did something wrong).
So packing goes
value -> cluster ->binary string ->byte array
byte array ->binary string->cluster->value