FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview Question

Greetings,

Is there a way to extract the size (dimansion) of an enum (enumeration)?  Looking for number of entries in the enum.

Also, can the label within an enum individual record also be extracted as a character string?

Thanks

0 Kudos
Message 1 of 3
(4,579 Views)

Yes.  You can take the first element in the enumeration, subtract 1, and you'll get the maximum value of the enumeration.  Convert that to an integer and add one, and you have the number of items in the enumeration.  You can convert an individual enumeration element to a string by using "Format Into String" with the format string set to %s.

Is this question related to code for the FIRST Robotics Competition?  If not, please post future questions in the appropriate forum at http://forums.ni.com.

0 Kudos
Message 2 of 3
(2,761 Views)

Thanks, this is for LabView FRC.  I want to use this with some other code prior to the Autonomous period when we can send some IO to the robot.  By the way,  What is the order of execution when connected to the field.  In 2009 it was:  BEGIN--TELEOP--AUTON--TELEOP.  SO we put similar code in teleop so that we could send data to the auton just prior to the match starting.

Thanks Again

0 Kudos
Message 3 of 3
(2,761 Views)