From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Queued Message Handler: how to get a Subvi to continuously run while the queue goes on.

You can also take a look at the Continuous Measurement and Logging sample project...it uses 5 parallel loops (UI events, main message handler, logging message handler, acquisition message handler, and data display). It's a good illustration of having multiple QMH loops pass messages between each other.

0 Kudos
Message 11 of 14
(1,442 Views)

@MccGarthur wrote:

@RavensFan wrote:

When the RPM subVI finishes running, then go to a state where the next set of speed codes to run.


Could you please elaborate on what you mean by this?  

 

During our tests, when the "Add" subVI was running and we measured the RPM of the motor, the DC relay was not turned off, but the motor was not running at synchronous speed.


In your case where your RPM subVI loop is running, you are also encoding a command to stop the DC motor.  Once the RPM VI stops, then the case structure can end and the loop can iteration again.  Now it will dequeue and execute the stop motor command, whether you actually want to stop it or are planning to enqueue up another speed command.

0 Kudos
Message 12 of 14
(1,430 Views)

I'm sorry if I am not following or if I am confusing you, but I explained in my previous responses that the VI I uploaded is different than the VI we used during the tests where we noticed an RPM drop. The VI I attached simply turns on the required relays, brings the motor up to synchronos speed, then turns off the relays, which turns off the motor. The VI I attached is not the "main program" that I reference in my posts. 

 

In the tests that we noticed the RPM drop, directly after the "RPM" subVI finnishes running, the "turnoffDCcontrol" message is replaced with the "Add" message and then the "Add" subVI runs and the front panel opens, allowing the user to input values into the two numeric controls. The "turnoffDCcontrol" message in this case is not sent until the "Add" subVI is finnished running.

 

During the test, we did not input any values and simply let the "Add" subVI run while measuring the RPM of the DC motor directly with an optical tachometer. If the analog output does not change like you say, then at this stage of the program the motor should still be running at synchronous speed while the "Add" subVI is running, and would not decrease until after the "Add" subVI finishes and the "turnoffDCcontrol" message is sent.  

 

Is this logic correct?  Again, I apologize if I have been unclear or confusing. I appreciate you taking the time to reply. 

0 Kudos
Message 13 of 14
(1,417 Views)

@Darren wrote:

You can also take a look at the Continuous Measurement and Logging sample project...it uses 5 parallel loops (UI events, main message handler, logging message handler, acquisition message handler, and data display). It's a good illustration of having multiple QMH loops pass messages between each other.


Thank you for your input. I will take a look at the sample project and see if it can help my understanding. 

0 Kudos
Message 14 of 14
(1,414 Views)