03-12-2025 12:11 PM
Hello,
I am a student working on developing a VI to control a test bench. One of the requirements is to initiate data acquisition based on a button press by the user. The user should also be able to select the desired channel before starting the temperature measurements. I am implementing a producer-consumer architecture using the Queued Message Handler (QMH) framework. Currently, I have placed the DAQmx Create Channel VI outside the while loop. However, this leads to an issue: if the DAQ device is not connected to the computer, the program continuously throws an error.
03-12-2025 12:35 PM
You could place a Delete Error between your loop and create channel
03-12-2025 01:13 PM
Maybe have an "initialize" consumer case. Create your queue and then add "initialize" before it enters the loops. If you get an error on bootup, clear the error and send your consumer to case that has a dialog to instruct the user to verify the setup, reboot the device, etc. When they dismiss the dialog, re-enter the "initialize" case.
03-12-2025 03:45 PM
@Bonapg wrote:
Hello,
I am a student working on developing a VI to control a test bench. One of the requirements is to initiate data acquisition based on a button press by the user. The user should also be able to select the desired channel before starting the temperature measurements. I am implementing a producer-consumer architecture using the Queued Message Handler (QMH) framework. Currently, I have placed the DAQmx Create Channel VI outside the while loop. However, this leads to an issue: if the DAQ device is not connected to the computer, the program continuously throws an error.
The initialization needs to be inside the loop in one of the states of your state machine (called once first and then as needed).