0

I was wondering how to make it so the rest of the program runs when one component fails to (and therefor the rest of the path that relied on this component is incapacitated as well). In other languages, this is equivalent to "catching an exception," but the added issue here is that I'm afraid that even if such a feature existed (cant find if it does), then the rest of the program would still try to run... Any advice would be very much appreciated. Thanks in advance!

CharlesB
  • 86,532
  • 28
  • 194
  • 218
Cenoc
  • 11,172
  • 21
  • 58
  • 92

1 Answers1

2

LabVIEW doesn't have exception handling, but handles error in a different way: (nearly) all VIs accept an error cluster as input (and so should yours); if it is positive (an error occurred), the VI will return immediately, passing error as output, and next will get it as input, etc. This is called error.

As all these VIs transmit this cluster between each others you will get it in your top-level VI, so if error occurs you just have to cleanup stuff correctly it and exit.

CharlesB
  • 86,532
  • 28
  • 194
  • 218
  • 1
    But how do you suppress the error output? (there is a modal pop-up that comes up) – Cenoc Apr 27 '12 at 20:25
  • the modal error dialog pops up if you don't handle an error cluster, ie if you leave it unwired at some place of your code – CharlesB Apr 27 '12 at 22:50
  • 1
    Just for completeness: the modal error dialog pops up if you leave an error output unwired *and* automatic error handling is enabled in the VI's properties. Disable automatic error handling and unwired errors will be ignored. It's enabled by default for new VIs but you can turn this off in LabVIEW's preferences. – nekomatic Jan 07 '14 at 08:46