If you're looking at this example https://decibel.ni.com/content/docs/DOC-18893
you might want to replace Demo.vi with the version attached here. It makes the error handling a bit cleaner.