Is there a best practices for logging in LabVIEW?
The robot is a very busy system, and as we add more functionality (PID, State machines, State machines reacting to other state machines, etc) the complexity of debugging increases dramatically.
Ideally, I’d like to be able to turn the robot on, operate it for a while, turn it off - and then be able to read from some file that can “tell a story” about what happened:
TimeStamp1 - Autonomous Invoked
TimeStamp2 - Entering Autonomous_RaiseArm
TimeStamp3 - Arm Target changed to HighMiddlePeg
TimeStamp4 - Arm raised to target height (HighMiddlePeg)
TimeStamp5 - Entering Autonomous_DriveForward
TimeStamp6 …
Is there already a framework in LabVIEW I can use to do this? Have other teams implemented something similar?
I don’t think so, not at least in that simple form. I think(i am not completly sure) if you keep the block diagram open and hit the little run arrow then you will get feedback information(i have not tried this i have just heard you can do this).
Right - when you run it from your computer, you get really rich debugging information, but I’m talking more about the situation you get during a Regional.
The robot goes on the field, does its thing, and I’d like a way to know (at least to some degree) what the internal state of the robot was during the match. The robot also gets powered off at the end of every match, so the information can’t reside in RAM.
so you want a live diagnostic?
You can see an example of recording and saving a timestamp to a file with the autoflex code i posted a few threads back. You might want to save it to an XML file like i did in v1.0 (a few more threads back) so that it is easily readable.
I’m not sure how siggy did it, but you do have the ability to write text files using the CRIO. We were utilizing this earlier this year to store pictures from the camera for calibration (drive practice match taking pictures at required intervals, etc). We’ve since removed it because vision this year with the retro-reflective tape is fairly unreliable. But the ability is there.
Create variables (strings or otherwise) that you want stored and tie-in a timestamp from a ms counter in robot main that gets fed into your different loops. I’d save the values in an array and then write 1 time per every couple seconds - no reason to be writing every loop.
PS to FIRST - GIVE US LIT VISION TARGETS BACK.
I disagree. If you use a light source of appropriate brightness and color, the target detection is spot on.