User Tools

Site Tools


kb:bestpractices:codingconventions:errorhandling

04 Error Handling

The HSE Error Code Helper is a Quick Drop Plugin that helps with selecting (reusing) existing error codes as well as creating constant VIs for new error codes.

The HSE Logger allows the logging of errors when running the application.

Error Codes

  • Use the range reserved for user-defined errors (500000 – 599999)

For Loops

Deciding between shift registers or indexing tunnel for error wire can be tricky. Some thoughts to have in mind:

If an error in one iteration should prevent the execution of the following iterations, you can use a shift register for the error wire. In general, use indexing tunnels.

If a for loop is executed zero times, because the array on the auto index input tunnel is empty, all output tunnels of the for loop will output the default values. Double check not to lose information e.g. errors occurred before the for loop or references, data, etc which should be passed through the for loop. This can be solved by using a shift register, or explicitly pass the data around the loop.

Timed Loops and Sequences

Always wire the error out of Timed Loops or Timed Sequence Structures as it can happen that those structures don't execute at all, for example if an invalid clock source was selected:

kb/bestpractices/codingconventions/errorhandling.txt · Last modified: 2023/04/28 10:13 by joerg.hampel