01-23-2025 02:55 AM
Hi everyone, I have build a program which scans for temperature data and when certain conditions are met stops the scanning. The conditions are Max limit violation and other similar. But my vi is misbehaving. Even after the limits are violated or the other conditions are met the scanning is nit stopping. I have used Keysight DAQ970 for acquisition of the data. Please help me rectify my mistake. I have attached the vi for reference.
Solved! Go to Solution.
01-23-2025 07:10 AM
First, your code is overly complex for what it is accomplishing. Recommend you move all the controls into arrays. This would greatly simplify your code.
The maximum temperature loop only runs once ever 25 minutes (90,000 second pause) and doesn't stop other threads from what I see. Can you explain how the code is should operate and stop scanning?
01-23-2025 10:05 AM
why does you VI open with the menu bar way off screen? I can't even look at your block diagram because I can't get to the top of your panel to get to the menu to show block diagram.
01-23-2025 10:54 AM
That's actually 90,000 ms, or 90 seconds.
01-23-2025 07:08 PM
Consider using the attached code snippet to reduce the complexity of your software.
01-23-2025 10:56 PM
That's 90000ms or 90 secs. The max temperature check loop runs every 90 sec but the scan stop check loop runs every 65 sec. Also the channel writer is set at size unbounded. Probably I should change the size limit to 1 and the also make loop timing equal. Please think about this probable solution once.
01-23-2025 11:11 PM
I cant open the attached vi due to a version mismatch of labview.. Can you provide some clarity on what is this and how will this be useful?
01-24-2025 06:35 AM
This code replaces independent create channel controls. The code is larger and harder than it needs to be to accomplish the task.
Replaces
01-24-2025 07:02 AM
The software should technically stop eventually. The issue is you code is unresponsive due to the way it is structured. You need a higher loop rate for stop checking than acquisition. See attached example.
I would recommend that you consider taking the LabVIEW Core 1 & 2 classes. The code is currently not flexible and unmaintainable. With your purchase of a LabVIEW subscription, you get on-demand access to LabVIEW Core 1, which you can use to learn the basics of how to develop applications in the LabVIEW programming environment. These classes will be beneficial in developing better software.
Code sample has been converted down to LV 2015.