{"id":23047,"date":"2026-06-29T11:53:27","date_gmt":"2026-06-29T09:53:27","guid":{"rendered":"https:\/\/gpower.io\/error-handling-in-labview-24\/"},"modified":"2026-06-29T13:25:54","modified_gmt":"2026-06-29T11:25:54","slug":"error-handling-in-labview-24","status":"publish","type":"post","link":"https:\/\/gpower.io\/en\/error-handling-in-labview-24\/","title":{"rendered":"Error handling in LabVIEW [2:4]"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"23047\" class=\"elementor elementor-23047 elementor-23038\" data-elementor-post-type=\"post\">\n\t\t\t\t<div data-particle_enable=\"false\" data-particle-mobile-disabled=\"false\" class=\"elementor-element elementor-element-3089f21 e-flex e-con-boxed e-con e-parent\" data-id=\"3089f21\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-e8371bc elementor-widget elementor-widget-heading\" data-id=\"e8371bc\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">This post [2:4] is part of a series by GPower's software developer, Jesper Kj\u00e6r S\u00f8rensen, on building robust software and test systems. <\/h2>\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div data-particle_enable=\"false\" data-particle-mobile-disabled=\"false\" class=\"elementor-element elementor-element-b79cf37 e-flex e-con-boxed e-con e-parent\" data-id=\"b79cf37\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-49af1a1 elementor-widget elementor-widget-heading\" data-id=\"49af1a1\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Do you know the feeling...?<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-96451b0 elementor-widget elementor-widget-text-editor\" data-id=\"96451b0\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>\u201cBut it worked on my machine!\u201d That&#8217;s the mantra of every programmer who hasn&#8217;t mastered error handling. Of course, you would never say that \ud83d\ude0a. But perhaps you have a colleague who does\u2014and after reading this article, you might consider sending it to them.  <\/p><p>As I mentioned in <a class=\"bbqIFANxjrJIYSkuWsXikfbXdUvSLAtXTGIA \" tabindex=\"0\" href=\"https:\/\/gpower.io\/en\/lack-of-error-handling-the-invisible-time-thief\/\" target=\"_self\" data-test-app-aware-link=\"\">my last article<\/a>, it is important that you identify which errors can occur in your code. In this article, you will get tips and tricks for: <\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b9aefba elementor-align-start elementor-icon-list--layout-traditional elementor-list-item-link-full_width elementor-widget elementor-widget-icon-list\" data-id=\"b9aefba\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"icon-list.default\">\n\t\t\t\t\t\t\t<ul class=\"elementor-icon-list-items\">\n\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-fas-check\" viewBox=\"0 0 512 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"><\/path><\/svg>\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text\">Handling errors and communicating to future developers (and perhaps yourself... \ud83d\ude0a)<\/span>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-fas-check\" viewBox=\"0 0 512 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"><\/path><\/svg>\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text\">Ways to repeat a process that fails<\/span>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t\t\t<li class=\"elementor-icon-list-item\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-icon\">\n\t\t\t\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-fas-check\" viewBox=\"0 0 512 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"><\/path><\/svg>\t\t\t\t\t\t<\/span>\n\t\t\t\t\t\t\t\t\t\t<span class=\"elementor-icon-list-text\">Better programming techniques for error handling<\/span>\n\t\t\t\t\t\t\t\t\t<\/li>\n\t\t\t\t\t\t<\/ul>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6dafe52 elementor-widget elementor-widget-heading\" data-id=\"6dafe52\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Handling all errors from a function\n<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5c77a91 elementor-widget elementor-widget-text-editor\" data-id=\"5c77a91\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p id=\"ember76\" class=\"ember-view reader-text-block__paragraph\">Error handling is a fundamental part of programming. If you, as the developer, choose to suppress errors from a function, it is important that you communicate this to the next person who will be working with the code. That could be you in six months.  <\/p><p class=\"ember-view reader-text-block__paragraph\">At GPower, we have solved this by creating our own library to handle and improve exactly this communication. I will spare you the details of all our new functions, and instead simply highlight what we do when we specifically suppress errors from a function in the code. <\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0eee44d elementor-widget elementor-widget-heading\" data-id=\"0eee44d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">1: Ignore Error: When you want to ignore an error<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7f3c509 elementor-widget elementor-widget-text-editor\" data-id=\"7f3c509\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p id=\"ember78\" class=\"ember-view reader-text-block__paragraph\">Our \u201cIgnore Error\u201d function is designed to show that the programmer has decided that errors from this function are ignored. It may seem silly to a dedicated software developer like yourself, and you may be thinking that you can simply leave the error wire from this function unconnected, and you will get the same result. <\/p><p id=\"ember79\" class=\"ember-view reader-text-block__paragraph\">That is partly true, but this communicates directly to the reader that it is a deliberate action. In addition, an advantage is that you can use standard LabVIEW search functions to search for all the places where errors are deliberately ignored. Likewise, \u201cIgnore Error\u201d gives the reader a visual cue that these errors are being ignored on purpose, and not just because the developer was busy and forgot to wire them. Another advantage is that if you use <a class=\"bbqIFANxjrJIYSkuWsXikfbXdUvSLAtXTGIA \" tabindex=\"0\" href=\"https:\/\/labviewwiki.org\/wiki\/VI_Analyzer\" target=\"_blank\" rel=\"noopener\" data-test-app-aware-link=\"\">VI Analyzer<\/a>, it can be used to suppress warnings about errors that are not handled (Figure 1).   <\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-f944b61 elementor-widget elementor-widget-image\" data-id=\"f944b61\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t<figure class=\"wp-caption\">\n\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"510\" height=\"210\" src=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/06\/Billede-1-GPowers-Ignore-Error-funktion-i-brug.webp\" class=\"attachment-large size-large wp-image-23048\" alt=\"Figure 1: GPower\u2019s Ignore Error function in use\" srcset=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/06\/Billede-1-GPowers-Ignore-Error-funktion-i-brug.webp 510w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/06\/Billede-1-GPowers-Ignore-Error-funktion-i-brug-300x124.webp 300w\" sizes=\"auto, (max-width: 510px) 100vw, 510px\" \/>\t\t\t\t\t\t\t\t\t\t\t<figcaption class=\"widget-image-caption wp-caption-text\">Figure 1: GPower\u2019s Ignore Error function in use<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e22b740 elementor-widget elementor-widget-text-editor\" data-id=\"e22b740\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p id=\"ember81\" class=\"ember-view reader-text-block__paragraph\">There is a difference between trying to suppress all errors from a function and focusing on a specific error with a given error code. This is where you, as a developer, need to be careful: The function you develop can only be held accountable for the error codes it can generate. Therefore, it is important that you do not remove any error you have received as input via the \u201cError In\u201d control. In the example below in Figure 2, you can see that only the error from the validation function is removed, whereas all other external errors with code 9 are reported onwards (Figure 2).   <\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-fdec6a5 elementor-widget elementor-widget-image\" data-id=\"fdec6a5\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t<figure class=\"wp-caption\">\n\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"708\" height=\"181\" src=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/06\/Billede-2-En-funktion-maa-kun-fjerne-sine-egne-fejl-og-ikke-udefrakommende.webp\" class=\"attachment-large size-large wp-image-23049\" alt=\"\" srcset=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/06\/Billede-2-En-funktion-maa-kun-fjerne-sine-egne-fejl-og-ikke-udefrakommende.webp 708w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/06\/Billede-2-En-funktion-maa-kun-fjerne-sine-egne-fejl-og-ikke-udefrakommende-300x77.webp 300w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/06\/Billede-2-En-funktion-maa-kun-fjerne-sine-egne-fejl-og-ikke-udefrakommende-600x153.webp 600w\" sizes=\"auto, (max-width: 708px) 100vw, 708px\" \/>\t\t\t\t\t\t\t\t\t\t\t<figcaption class=\"widget-image-caption wp-caption-text\">Figure 2: A function may only remove its own errors, not external ones<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9f6779f elementor-widget elementor-widget-heading\" data-id=\"9f6779f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">2: Repeating the failing action<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-b0fa990 elementor-widget elementor-widget-text-editor\" data-id=\"b0fa990\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p id=\"ember85\" class=\"ember-view reader-text-block__paragraph\">Sometimes it can be practical to repeat what fails\u2014for example when you are dealing with hardware or networks. Something may have happened out in the \u201creal world\u201d that the code is not aware of. It could be that the network has been restarted by IT, or that the server is busy handling another request. In cases like these, it can be a good idea to build in a retry strategy, and it is easy in LabVIEW! Here are two examples of strategies:     <\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-766d321 elementor-widget elementor-widget-image\" data-id=\"766d321\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t<figure class=\"wp-caption\">\n\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"584\" height=\"284\" src=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/06\/Billede-3-Uendelig-gentagelse-ved-fejlende-netvaerksforbindelse.webp\" class=\"attachment-large size-large wp-image-23050\" alt=\"\" srcset=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/06\/Billede-3-Uendelig-gentagelse-ved-fejlende-netvaerksforbindelse.webp 584w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/06\/Billede-3-Uendelig-gentagelse-ved-fejlende-netvaerksforbindelse-300x146.webp 300w\" sizes=\"auto, (max-width: 584px) 100vw, 584px\" \/>\t\t\t\t\t\t\t\t\t\t\t<figcaption class=\"widget-image-caption wp-caption-text\">Figure 3: Infinite retry on failed network connection<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-802c125 elementor-widget elementor-widget-text-editor\" data-id=\"802c125\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p id=\"ember85\" class=\"ember-view reader-text-block__paragraph\">The example above (Figure 3) tries to establish a network connection and keeps trying to connect as long as it fails. As a developer, you must also be mindful to build in handling for shutting down the program\u2014e.g., by removing errors during shutdown\u2014so that the program can close if the user wants it to. This can be addressed with the other strategy: having a limited number of connection attempts, as shown in the figure below (Figure 4):    <\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4b022b1 elementor-widget elementor-widget-image\" data-id=\"4b022b1\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t<figure class=\"wp-caption\">\n\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"191\" src=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/06\/Billede-4-Begraenset-antal-gentagelser-for-at-forbinde-til-netvaerk.png\" class=\"attachment-large size-large wp-image-23063\" alt=\"Figure 4: Limited number of retries to connect to the network\" srcset=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/06\/Billede-4-Begraenset-antal-gentagelser-for-at-forbinde-til-netvaerk.png 400w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/06\/Billede-4-Begraenset-antal-gentagelser-for-at-forbinde-til-netvaerk-300x143.webp 300w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/>\t\t\t\t\t\t\t\t\t\t\t<figcaption class=\"widget-image-caption wp-caption-text\">Figure 4: Limited number of retries to connect to the network<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-81f3241 elementor-widget elementor-widget-text-editor\" data-id=\"81f3241\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p id=\"ember89\" class=\"ember-view reader-text-block__paragraph\">By limiting the number of attempts, the program will try to connect three times and then wait for user interaction. This can be a more user-friendly scenario, where the user is then asked to start the operation again to take three new attempts. <\/p><p id=\"ember90\" class=\"ember-view reader-text-block__paragraph\">Note here that in both strategies, shift registers have deliberately not been used to store the error from the previous run, as that would break the entire functionality of the retry function. In addition, a case structure is used here to shield against external errors, which would also break the retry function. There are many more methods for implementing a retry function <a class=\"bbqIFANxjrJIYSkuWsXikfbXdUvSLAtXTGIA \" tabindex=\"0\" href=\"https:\/\/kortlink.dk\/2syrq\" target=\"_blank\" rel=\"noopener\" data-test-app-aware-link=\"\">here<\/a>.  <\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5d098c0 elementor-widget elementor-widget-heading\" data-id=\"5d098c0\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">3: Programming techniques for error handling<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e86141c elementor-widget elementor-widget-text-editor\" data-id=\"e86141c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>In the example of repeating the failing process, I used a case structure to shield against external errors. That made sense in this specific example, but in most LabVIEW primitives and functions, what in English is called \u201cStandard Error Behavior\u201d is used. This can roughly be translated as normal error behavior. As an example: If there is an external error on the error wire into a function or primitive, it does not perform its action, but simply lets the error pass through. This can be seen as the general behavior in the event of an error.    <\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5a4510f elementor-widget elementor-widget-image\" data-id=\"5a4510f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t<figure class=\"wp-caption\">\n\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"141\" src=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/06\/Billede-5-Unoedvendige-casestrukturer-der-omslutter-code-eller-funktionalitet.webp\" class=\"attachment-large size-large wp-image-23064\" alt=\"Figure 5: Unnecessary case structures wrapping code or functionality\" srcset=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/06\/Billede-5-Unoedvendige-casestrukturer-der-omslutter-code-eller-funktionalitet.webp 974w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/06\/Billede-5-Unoedvendige-casestrukturer-der-omslutter-code-eller-funktionalitet-300x53.webp 300w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/06\/Billede-5-Unoedvendige-casestrukturer-der-omslutter-code-eller-funktionalitet-768x136.webp 768w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/06\/Billede-5-Unoedvendige-casestrukturer-der-omslutter-code-eller-funktionalitet-600x106.webp 600w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t\t\t\t<figcaption class=\"widget-image-caption wp-caption-text\">Figure 5: Unnecessary case structures wrapping code or functionality<\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-9e0806f elementor-widget elementor-widget-text-editor\" data-id=\"9e0806f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>Many LabVIEW developers implement a case structure in all their VIs, as can be seen in Figure 5 in the left diagram above. This method is not recommended, as it prevents the compiler from optimizing the code. The code should run 99.9% of its lifetime in the state where there is no error, and it is built from functions that already implement the desired behavior.  <\/p><p>Therefore, you should write the code as in the diagram above on the right. To be fair, there are also some functions and primitives that perform their function despite errors, e.g., the \u201cClose Reference\u201d function. For these, the error wire is used to synchronize when the function is executed. It is most often stated in the documentation for the individual function how it behaves in the event of an error.    <\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-123fa77 elementor-widget elementor-widget-heading\" data-id=\"123fa77\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">4: Avoid using Warnings\u2014they are just noise<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-39ed78b elementor-widget elementor-widget-text-editor\" data-id=\"39ed78b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p id=\"ember96\" class=\"ember-view reader-text-block__paragraph\">The next example I want to highlight is from the <a class=\"bbqIFANxjrJIYSkuWsXikfbXdUvSLAtXTGIA \" tabindex=\"0\" href=\"https:\/\/github.com\/NISystemsEngineering\/LabVIEW-Modbus-API\/blob\/master\/Network%20Protocol\/Network%20Slave\/TCP\/check%20unsalvageable%20connection.vi\" target=\"_blank\" rel=\"noopener\" data-test-app-aware-link=\"\">NI Modbus TCP driver<\/a>, where almost all errors are downgraded to warnings. The downgrade is done to ensure that very few errors can stop the driver from continuing to run. In Figure 6, I have modified the code so you can see all states of the case structure at the same time.  <\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2eb26a9 elementor-widget elementor-widget-image\" data-id=\"2eb26a9\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t<figure class=\"wp-caption\">\n\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"800\" height=\"283\" src=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/06\/Billede-6-NI-Modbus-fejlhaandtering-ved-at-nedgradere-en-fejl-til-en-warning.webp\" class=\"attachment-large size-large wp-image-23065\" alt=\"Figure 6: NI Modbus error handling by downgrading an error to a warning\" srcset=\"https:\/\/gpower.io\/wp-content\/uploads\/2026\/06\/Billede-6-NI-Modbus-fejlhaandtering-ved-at-nedgradere-en-fejl-til-en-warning.webp 974w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/06\/Billede-6-NI-Modbus-fejlhaandtering-ved-at-nedgradere-en-fejl-til-en-warning-300x106.webp 300w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/06\/Billede-6-NI-Modbus-fejlhaandtering-ved-at-nedgradere-en-fejl-til-en-warning-768x271.webp 768w, https:\/\/gpower.io\/wp-content\/uploads\/2026\/06\/Billede-6-NI-Modbus-fejlhaandtering-ved-at-nedgradere-en-fejl-til-en-warning-600x212.webp 600w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/>\t\t\t\t\t\t\t\t\t\t\t<figcaption class=\"widget-image-caption wp-caption-text\">Figure 6: NI Modbus error handling by downgrading an error to a warning <\/figcaption>\n\t\t\t\t\t\t\t\t\t\t<\/figure>\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-35e47e3 elementor-widget elementor-widget-text-editor\" data-id=\"35e47e3\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>In Figure 6 above, you can see that the case structure only lets through the error numbers that occur when the connection cannot be maintained, while all other error numbers are downgraded to a warning. Since this VI is part of a state machine that stops if an error occurs, the programmer has assessed that it was necessary to downgrade all other errors. <\/p><p>The side effect is simply that all warnings, without filtering, are reported to the user due to the use of \u201cConnection Reference\u201d. It is therefore up to the user to handle these themselves. For example, it may take too long before the TCP client writes to the TCP server, and therefore the driver responds with error 56 &#8220;Connection Timeout&#8221;, which is downgraded to warning 56 &#8220;Connection Timeout&#8221;. In this way, it is up to the person implementing the driver to handle whether it has any impact on the given application.   <\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7512fd0 elementor-widget elementor-widget-heading\" data-id=\"7512fd0\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">A concluding remark<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6f40f5f elementor-widget elementor-widget-text-editor\" data-id=\"6f40f5f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p id=\"ember101\" class=\"ember-view reader-text-block__paragraph\">This article has covered many topics within error handling, and I hope you have been inspired to use some of it in your own work. The idea behind the article is precisely to demystify error handling\u2014to make it easier to identify what you can do, and what you, in my opinion, should do during the development process. There are no fixed rules within error handling, but the tools and techniques described have certainly been worth their weight in gold for me.   <\/p><p id=\"ember102\" class=\"ember-view reader-text-block__paragraph\">The next article will be about GPower\u2019s concept of Custom Errors, and why we think it is a good idea. <\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t<div data-particle_enable=\"false\" data-particle-mobile-disabled=\"false\" class=\"elementor-element elementor-element-0e276ac e-flex e-con-boxed e-con e-parent\" data-id=\"0e276ac\" data-element_type=\"container\" data-e-type=\"container\" data-settings=\"{&quot;background_background&quot;:&quot;classic&quot;}\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t<div data-particle_enable=\"false\" data-particle-mobile-disabled=\"false\" class=\"elementor-element elementor-element-5f8a95e e-con-full e-flex e-con e-child\" data-id=\"5f8a95e\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t<div class=\"elementor-element elementor-element-7875b98 elementor-widget elementor-widget-image\" data-id=\"7875b98\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img loading=\"lazy\" decoding=\"async\" width=\"286\" height=\"222\" src=\"https:\/\/gpower.io\/wp-content\/uploads\/2025\/09\/Quote.png\" class=\"attachment-full size-full wp-image-21498\" alt=\"\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-929671c elementor-widget elementor-widget-text-editor\" data-id=\"929671c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p><em>If you want to keep your night\u2019s sleep and save money, it is time to get started with error handling. <\/em><\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-60d5745 elementor-widget elementor-widget-text-editor\" data-id=\"60d5745\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t\t\t\t\t\t<p>\u2013 LabVIEW Champion, Jesper Kj\u00e6r S\u00f8rensen, GPower<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3233d10 elementor-shape-circle elementor-grid-0 e-grid-align-center elementor-widget elementor-widget-social-icons\" data-id=\"3233d10\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"social-icons.default\">\n\t\t\t\t\t\t\t<div class=\"elementor-social-icons-wrapper elementor-grid\">\n\t\t\t\t\t\t\t<span class=\"elementor-grid-item\">\n\t\t\t\t\t<a class=\"elementor-icon elementor-social-icon elementor-social-icon-linkedin elementor-repeater-item-ccb2421\" href=\"https:\/\/www.linkedin.com\/pulse\/manglende-fejlh%C3%A5ndtering-den-usynlige-tidsr%C3%B8ver-s%C3%B8rensen-nntrf\/\" target=\"_blank\" rel=\"noopener\">\n\t\t\t\t\t\t<span class=\"elementor-screen-only\">Linkedin<\/span>\n\t\t\t\t\t\t<svg aria-hidden=\"true\" class=\"e-font-icon-svg e-fab-linkedin\" viewBox=\"0 0 448 512\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\"><path d=\"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z\"><\/path><\/svg>\t\t\t\t\t<\/a>\n\t\t\t\t<\/span>\n\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>This post [2:4] is part of a series by GPower&#8217;s software developer, Jesper Kj\u00e6r S\u00f8rensen, on building robust software and test systems. Do you know the feeling&#8230;? \u201cBut it worked on my machine!\u201d That&#8217;s the mantra of every programmer who hasn&#8217;t mastered error handling. Of course, you would never say that \ud83d\ude0a. But perhaps you [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":23051,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[82],"tags":[109],"class_list":["post-23047","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-articles","tag-insights"],"_links":{"self":[{"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/posts\/23047","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/comments?post=23047"}],"version-history":[{"count":4,"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/posts\/23047\/revisions"}],"predecessor-version":[{"id":23068,"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/posts\/23047\/revisions\/23068"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/media\/23051"}],"wp:attachment":[{"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/media?parent=23047"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/categories?post=23047"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gpower.io\/en\/wp-json\/wp\/v2\/tags?post=23047"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}