View Single Post
  #2   Spotlight this post!  
Unread 14-12-2012, 22:49
MAldridge's Avatar
MAldridge MAldridge is offline
Lead Programmer
AKA: Rube #1
FRC #0418 (LASA Robotics)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Austin
Posts: 117
MAldridge will become famous soon enoughMAldridge will become famous soon enough
Re: Error in/ Error out?

they do exactly what the name implies: they carry errors.

In the event that your program throws an error, you can have other functions fail and exit on error so that they don't try operating with invalid inputs. This is especially important for files. Imagine that I open a file that doesn't exist, the system will catch this and generate an error, but the write/read operations don't know about this error, to tell them about it, you carry the error cluster to the read/write vi's that you would use, and then your file access code could tell that it had no file, and it could then take the appropriate actions or exit.

Its also useful if you want to auto reconnect on error. I set up my team's camera to continuously try to establish a connection, but if you want to do this beware, the WPILib is bugged and the error cluster is not carried internally in one of the read VI's.
__________________
'Why are you a programer?' --Team Captain
'Because the robot isn't complicated enough!' --Me
Reply With Quote