From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case Structure - Case Specific Error

Solved!
Go to solution

I am entering my Case Structure (T/F) with a single error line...but, when I exit the Case Structure, I want to go the direction that the Case sends me.  For example, if my Case is True, I want to carry-on my merry way, so the Error Line just runs straight through.  For the False, I want to go a different direction...can I add a second Outbound Error Line Tunnel?

 

Capture.PNG

 

 

0 Kudos
Message 1 of 6
(4,199 Views)

Just wire the error wires to the same terminal on the edge of the case structure...

 

It seems like you need some basic training in the functionality of LabVIEW and programming practices.

"Give me six hours to chop down a tree and I will spend the first four sharpening the axe."  - Abraham Lincoln

Here are some free training tools primarily focused on LabVIEW and NI hardware to help get started.

NI Learning Center

NI Getting Started

-Hardware Basics

-MyRIO Project Essentials Guide (lots of good simple circuits with links to youtube demonstrations)

-LabVEW Basics

-DAQ Application Tutorials

-cRIO Developer's Guide

Learn NI Training Resource Videos

3 Hour LabVIEW Introduction

6 Hour LabVIEW Introduction
Self Paced training for students
Self Paced training beginner to advanced, SSP Required
LabVIEW Wiki on Training

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 6
(4,196 Views)
Solution
Accepted by topic author ajsdwilson

I reommend to ponder the sanity of your ideas. Do you really need two error outputs for the same case structure?

 

In any case, there are plenty of solutions:

 

  • You could brach the error wire to both output tunnels for cases that only have one error source.
  • You can use "use default if unwired" tunnels.
  • You could use "merge errors" to combine multiple error wires into one.
  • etc. etc.

 

It is difficult to say much more without seeing the rest of the code? What is in the other cases? How do you guaranteed that the while loop does not go on forever?

0 Kudos
Message 3 of 6
(4,190 Views)

I guess I should explain myself...this is my first Labview project and some days I make great progress and everything is clear, other days not-so-much...today is the latter.  The True Case will ultimately send me to a new state, the False Case will send me along the rest of the process.  I am still only marginally comfortable with the Error Lines...I'll wire both cases to the same terminal.  Thanks for everyone's help!  I did take the Labview 1 and 2, but real life examples are more daunting.

0 Kudos
Message 4 of 6
(4,174 Views)

@ajsdwilson wrote:

... and everything is clear, other days not-so-much...today is the latter. 


Now you know how I feel when looking at text based code again 😄 😮

 

Feel free to share your code so we can give you more specific feedback. Good luck!

0 Kudos
Message 5 of 6
(4,162 Views)

Error handling is one of the things that a lot of LabVIEW developers hate to do, but is very important to cut down on debugging time. Wiring the error clusters through is one thing, but making sure you get notified properly (without freezing your application) is another. Usually you don't want two separate error clusters like you have because one could get lost, so you use a Merge Errors node. There are exceptions to this guideline: parallel processes, multiple device types, error-ignoring processes, etc.

 

Most developers I've met get better and better at their error handling and create their own system to do it. Commonly (and this is what I do), an application will have a parallel consumer loop that just waits for errors to be sent to it from elsewhere via a queue. This parallel process can alert the user, or do other things, while everything else in the application continues to function.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 6 of 6
(4,152 Views)