FIRST Robotics Competition Documents

Showing results for 
Search instead for 
Did you mean: 

Archived: Print Custom Status on the Driver Station LCD from LabVIEW and C++.

This document does not apply to the current FRC season and is provided for reference only. It has been archived and is no longer being updated by National Instruments.

The latest update to the Driver Station provides teams with two screens: the Main Screen that you are familiar with and a new User Screen.  On the Main Screen, the last line (Line 6) is now available to users to print their own status summary.  The User Screen has a one line status summary on the top line with all the critical information drivers need to know about the state of the robot.  The other 5 lines are available for users to print anything they like.  To switch between these screens, simply press (or hold) the Select button.


This article has two examples of printing to the Driver Station LCD, one written in LabVIEW and one written in C++.  The examples include the API needed to access the LCD as well as a simple application that uses the API.  For teams wanting to print to the LCD, it is recommended to copy the API into the team project and include it in the project the same way that the example application does.


The APIs are very similar between the two languages, but I'll explain each of them in detail.


The LabVIEW API consists of 2 VIs.  The Set LCD Line Text VI stores the text that you pass in into a local buffer on the cRIO.  This VI can be called any time and different things printed to different parts of each line.  If the string is longer than the length left on the line, the output will be truncated.  You can start your string on any column on the display.  There are 21 columns on the LCD.  The Starting Column is a 1-based parameter.  This VI takes a string, but The Format To String VI can be used to print numbers in a specific format.  This was intentionally left out of the API so that the power of the Format To String VI would be exposed to the user directly.  The Update LCD VI is used to send the strings written to the local buffer to the Driver Station.  It should be called in a loop that is synchronized with the Network Communication updates, but it is not strictly necessary.


The C++ API consists of a class called DriverStationLCD.  It is a singleton object that can be accessed from anywhere in a team's project.  Call DriverStationLCD::GetInstance() to get a pointer to the singleton.  With the pointer to the DriverStationLCD, you can call the 2 primary entry points.  The Printf() method works just like you expect printf to work.  Before the format string, the line and starting column to print to must be specified.  Call UpdateLCD() to send the locally buffered text to the driver station.


For these examples to work, you must have Driver Station image 2009-01-22c1 or newer and cRIO image v11 (included with update 3) or newer.


EDIT: Updated the LabVIEW Example.  The wrong project directory was posted previously.

Todd S.
NI Employee (retired)

Thanks for posting!  Could you please add a screen shot or two to get an idea of what your code looks like?

Todd S.
LabVIEW Community Manager
National Instruments