08-01-2018 04:38 AM
08-01-2018 04:40 AM
08-01-2018 06:17 AM
the message hadling loop and event handling loop will execute parallely.. right?
Also whether I have to add more message handling loops, to execute more functions parallely?
08-01-2018 06:26 AM - edited 08-01-2018 06:27 AM
normally yes, unless you mess it up explicitly
08-01-2018 06:53 AM
rakesh@labview wrote:
the message hadling loop and event handling loop will execute parallely.. right?
Also whether I have to add more message handling loops, to execute more functions parallely?
To quote GerdW: THINK DATA FLOW!
If there is no data dependency between loops (ie Loop A does not have an output wire going to Loop B), they will run in parallel. This is the whole point of having a QMH and Producer/Consumer.
08-01-2018 07:27 AM
You can certainly have multiple Message-Handling Loops in one VI, but they each should probably be handling different Messages. Notice the "probably" -- a counter-example is when the Message being handled has significant "block/idle" time (like I/O to a slow device) and you want, say, a few processes working on a single Queue, in parallel, to optimize throughput (we actually did this once, but a much better solution that was adopted was to design a better "saving" algorithm).
Bob Schor
08-07-2018 01:35 AM
I have to design a system with followiing requirements
I have to run several tests parallely.
Each test VI will generate some data. (Test VI)
That data has to be logged (Raw data log VI), parallely some processing have to be done on that data and to generate pass/fail status (processor VI). Processed data also have to be logged (Test data Logger). This all VI has to run parallely.
I have attached my source code using QMH template. Whether this is correct way of implementation?. Whether each VI has to use separete queues. Please help
the Realtime_Data folder contains my main VI. GUI.VI
RandomData_Generation.vi
process.Vi
Saving_to_Textfile.vi
Save_to_textfile_with_status.vi
08-07-2018 01:37 AM
code added
08-07-2018 09:34 AM
The Message Handler is the "Conductor" that "handles messages" (sequentially, not in parallel!) that come from other (possibly parallel) Proceses (or, indeed, from itself).
When designing with the QMH as (one of) your Design Pattern, it is helpful to make a list of the Messages it receives, and what it should do in response to these messages. Since it handles Messages serially, you want it to not spend a lot of time processing any single Message, but handing off the task to other routines, as appropriate (i.e. being a Producef for a Producer/Consumer Design).
Here are some typical Messages:
Once you have the Design, start coding it. It should not look exactly like the Template that NI provides ...
Bob Schor