12-22-2025 11:38 PM
Hello,
I need some assistance with my first LabVIEW program (ver. 22.3) with a NI-9171 Chassis and a NI-9211 module. We want LabVIEW to compare temperatures and send a text message when the temperature exceeds 65 degrees Celsius. I decided to try to use Case Structures. I think I have the False Case Structure figured out, But, I cannot figure out how to include the True Case Structure and how to loop back to read another sample. Any assistance would be greatly appreciated.
12-23-2025 01:42 AM
I recommend you to explore state machine architecture.
Application Design Patterns: State Machines
Modify the Simple State Machine LabVIEW Template
12-23-2025 01:45 AM
You saved the VI in LabVIEW version 24, so I can't open it. (Try to save your VI for a previous version, some prefer a version down to 2019)
In your message you write about a "false case structure" and a "true case structure", but you only need one Case Structure. This structure has two cases "True" and "False". Wire the result of the comparison to the case selector (?) of the structure and the .
12-23-2025 04:58 AM
please check
12-23-2025 08:06 PM
ZYOng, Thank you for your response. I will take the next day or so to look into working with the state machine architecture. I am not familiar with this programming option. Thanks~Angela
12-23-2025 08:51 PM
Hi UliB, Thank you for responding, I did not realize that I uploaded the vi from the TEST computer. PROD will be version 22.3. I have attached a 2019 version. I will try the case structure solution you recommended below. Thank You! ~Angela
12-23-2025 10:07 PM
Hello Ahmed99, I thank you as well for responding to my inquiry. I will check out your response as soon as I get to the Test computer. Thank you~Angela
12-24-2025 10:09 AM
@Angela_DC wrote:
I have attached a 2019 version. I will try the case structure solution you recommended below. Thank You! ~Angela
As a very fist step you need to do a few basic LabVIEW tutorials and learn about the core principles of dataflow.
Your while loop spins every 5 ms (or however long it takes for the DAQ assistant express VI to complete.I cannot look at the properties, because I don't have drivers installed). The VI outputs dynamic data which gets discarded until stop is pressed, at which time only the data of the very last iteration is output at the tunnel, where the comparison happens and the code completes. Game over!
In parallel to the above, there is a second independent "code island" consisting of a case structure which immediately starts in parallel to the while loop and completes when done, never to run again in the same session.
In a proper code architecture, there should be a toplevel while loop containing all code that needs to repeat until the program is done. If the acquisition should be regular, you might even want a simple produce/consumer architecture.
I would also strongly recommend to get away from dynamic data, because it is too opaque and can contain a lot of things. A comparison with scalars is vague.