tailieunhanh - Microprocessor Interfacing Techniques Lab VIEW Tutorial Part 6

Microprocessor Interfacing Techniques Lab VIEW Tutorial Part 6 | PHY 406 - Microprocessor Interfacing Techniques PHY 406 - Microprocessor Interfacing Techniques LabVIEW Tutorial - Part VI Error Handling Handling Errors Before I show you how to connect an error message handler into the system it is important to realise that an error handler has to do something with the error or it will happen again. In this case if we find an error array dimension 1 then unless we either increase the array dimension or abort the program it will immediately happen again and again and again. It is therefore important to always think about what to do about an error as well as report it. In addition if we are going to stop the program we must ensure that the error is reported before the program is stopped - ie the data flow must be through the error handler. The standard deviation box has an error output for exactly this purpose. It is an integer whose value is 0 in normal operation and nonzero if there is an error. A simple error handler therefore would stop the program if the error output was non-zero. Or phrased another way The program continues if the run switch is on true and the error output is zero. The logic looks like this This will certainly stop the VI if the error output becomes non zero but it won t tell you why it s stopping What we need is an indicator to tell us what the error is. If you actually put an indicator on the line it will indicate a number -20003 to be precise but that still doesn t tell me what the error is. I need that error to be interpreted in plain Canadian. This is the job of the simple error handler. Find that on functions Time Dialog bottom left corner and place it on the diagram. This function is quite complex as you can see from the help screen Ctrl-H remember . The only two leads you need at the moment are the error code input and the code out . Remember what I said about dataflow. The error handler must be traversed before the VI si stopped. We therefore wire the error output of the standard deviation analysis .

TỪ KHÓA LIÊN QUAN