Overview
This example VI shows how to extracting error information from status bytes sent from an external instrument.
Description
External equipment will often send information about the device status or errors as a byte or multiple bytes of information, where each bit represents a unique piece of information about the device. The bit convention for error or no error state can often differ even within the same status byte or word. This example shows how we can isolate the error information from general staus information. So the first step is to invert the logic of any bits that have an error represented by a 0. (XOR with "inverted" bitmask). The second step is to remove the none error status bits. (AND with "error" bitmask). This will leave us with a binary value with 1s wherever an error exists.
Requirements
Steps to Implement or Execute Code
Additional Information or References
VI Snippet
**This document has been updated to meet the current required format for the NI Code Exchange.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.