FIRST Robotics Competition Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

FRC LabVIEW/cRIO specifications/stats

Hi guys,

After taking a closer look at the Robot Mode VI, it looks like while we do read the Control bit that would signal the end of a round, we never pass the value Finish out. So, you are right, we never stop the loop and run the Finish VI unless someone presses the Finish button on the front panel. Sorry for the confusion and the developers are looking into why we did this.

With that being said, outside the context of FRc, we would still like to teach students the programming practice:

Open, Read/Write, Close.

While it seems we're breaking this practice at the moment, this concept is valuable. Let's take for example, you're writing to a file. You'll create a reference to a file and then write to it. If you don't close the reference at the end, this reference will remain in memory even after the VI finishes running. If you run the VI again, it'll create another reference to the same VI. If you do this over and over again, you should see your memory usage go up in. To check this, open WindowsTask Manager and go to the Processes tab. You should see the memory usage of LabVIEW.exe go up as you run the VI below which simulates opening multiple references without closing them.

Open_ref.png

0 Kudos
Message 11 of 14
(991 Views)

Just wanted to say that I'm still following this discussion, especially after I came back to it to print some responses out. Thanks O54E, your last post pretty much sums up the finish VI debate. But I clearly agree with you that in general, closing references is the correct practice. I still teach my fellow programmers about it.

"and the developers are looking into why we did this."

Have the developers figured out the answer to this? It would be interesting to know. It's probably not a high priority issue, though, so it's ok if that hasn't made it's way around yet.

0 Kudos
Message 12 of 14
(991 Views)

Hi LabViewEnthusiast,

I talked to the developers some more since the last time I posted. During a competition, the sequence of states would be Begin»Autonomous»Teleop»Finish. However, if you're testing your code, you'd be running the Autonomous or Teleop VI over and over again. If we exit the main loop and go the Finish VI after a practice round, you'll have to either restart your cRIO or redeploy to start the loop back up again. Instead, after a practice round we go to the state where Autonomous and Teleop are disabled and wait for the next time a practice round is enabled. Therefore, the only time we run the Finish VI is when the user clicks on the Finish button to stop the program.

Cheers,

Olivia

0 Kudos
Message 13 of 14
(991 Views)

Ok thanks, that helps!

0 Kudos
Message 14 of 14
(991 Views)