Question about errror data in the default program

In the default code this year, in begin.vi, the error line is bundled into an array like this:

http://files.myopera.com/DocWu/albums/1939471/ErrorArrayCapture.JPG

As I add other devices, should I expand the array and add those errors?

Is whatever is handling errors able to expect errors from additional devices, or do I need to modify something else to anticipate them?

Are these errors that are going to be displayed in the Driver Station?

What’s the best practice here?

Thanks!

As I add other devices, should I expand the array and add those errors?

yes, as you open more devices, you can expand the error array and feed the error out, to the error array.

Is whatever is handling errors able to expect errors from additional devices, or do I need to modify something else to anticipate them?

If by whatever you mean the watchdog, then that works for you. The watchdog in simple terms makes sure your code runs smoothly and controls any mishaps.

Are these errors that are going to be displayed in the Driver Station?

yes, any errors that you come across will be displayed in the Error message box in the diagnostics tab on the driver’s station.

Hope this helps!

Actually, the error handling in Begin is different from the rest of the project. Neither is wrong, and as with any language, error handling can be done in many ways and the selection is probably more style than conscious choice.

In this case, the Begin VI outputs an error which is wired to the other elements in Robot Main to make sure they don’t start until Begin completes. In reality, there is no reason that the dependency has to be accomplished with the error wire, but this is a common pattern. The next thought is that if there is an error wire people may probe it as they debug. If Begin produces errors but doesn’t propagate the error, this may lead to confusion. So Begin builds the array and propagates the errors whereas most of the rest of the template code relies on the auto error reporting and the console in the diagnostics screen.

To answer the original question, if you won’t confuse yourself or others on your team, it is fine to eliminate the extra wires and build arrays. Or your group of programmers can decide that the info is useful and to build the array to pass out. The most important thing is to be consistent and avoid confusion.

Greg McKaskle