×

Our Future . . .

When I initially created this site in 2014, it was to serve two primary purposes.

  1. To document the tips, tricks, and other higher level development practices that make programming for FRC in LabVIEW easier.
  2. Provide a common place for LabVIEW teams to find resources.

At first, this meant documenting the architectural and similar tools that I had learned on my way to becoming a Certified LabVIEW Developer, that had been put to use by the team I was currently mentoring (#3937, Breakaway). (This had the added bonus of helping the senior programmer that had been soaking all this up document it for his successor.)

Since then, this site has had a few additions and updates (mostly by me).

While I have often invited other teams (I am no longer in the AR area and have pretty much lost contact with Breakaway) on CD and at the regionals I've been at to write tutorials for specific topics that they had solved, I was rarely met with a response (specifically once - shout out to the Huskie Robotics 3061 for actually following through, but they were the only ones).

 

In recent years, I have found myself going through some family changes and needing to dial back my commitment to other activities.

This leaves this site both:

  1. Looking for a new champion/curator, that is willing to:
    • maintain the back end,
    • make sure material that becomes obsolete is either updated, or moved to the archives section of the menu,
    • and either write content or get other teams to write content to help this site remain relevant.
  2. Looking for a new source of funding/hosting. (I have been personall providing the $36/yr that it costs to maintain it using Google Domains for the domain name - and email - and Hosting24 for the hosting; I have thought about using some sort of a Donate button, but have not been able to find a platform that allows for *only* raising the target amount).

 

If you have any interest in seeing the continuation of this site, please let me know.

FRC LabVIEW Tutorials - TypeDef

Table of Contents

You are actually already using these whether you realize it or not - you'll be able to recognize them in some of the standard code once we are through.

A Type Def is a custom control that has all the instances linked so that one can change the original and immediately have the changes reflected throughout the project. (NI Documentation here)

For this example, we will be creating and modifying a Type Def for a state machine

Initialization

Just a formality, but we will open several devices in Begin.vi

Initialization

Teleop

Due to the constructs of this data structure, it can be implemented in Periodic Tasks or in Teleop, because our state machine tutorial already shows a similar one in Periodic Tasks.vi, we will implement this one in Teleop.

To start, create a enum control on the front panel, and right click on it. From the menu, select "Make Type Def."

create the Type Def.

Right click again and select "Open Type Def"

Open the typedef

Once the Type Def is open, we can set the items of the enum. For this example the Up, Down, and Initialize, have been entered.

The initial configuration of a couple of modes

Back in Teleop.vi, we will use a feedback node to keep track of the current state.

initial setup conditions

Here we realize that a mistake was made - we want to have a state for getting the user input.

If we right click on the constant that was made from our original control, we can reopen the typedef.

Re-opening the typedef

And we just add the get user input case to the values,

Adding another option

We also need to tell LabVIEW to apply the changes

Applying the change

Back in teleop, notice that both instances of the Type Def have updated.

it updated inside Teleo too.

And we finish out (most of this is implemented in our State Machines tutorial, so for details on that, click here)

finishing up

This tutorial is meant to be suggestive of how one might use a Type Def in the FIRST Robotics Competition. It will likely need to be modified to fit your specific application.

While this is a short example, the power of the Type Def grows exponentially. This last year our team had to add a case to a state machine that already had eleven (or so) cases, in the past, that would have meant deleting all the next case constants, modifying the case structure to take the new one, . . . Fortunately we had implemented a Type Def for our possible modes, and adding that case became as simple as the above example.

If this tutorial inadvertently leaves some details out, please tell us about it and we will update it.

Google Form to request details