02-22-2018 09:43 AM
Hi everyone,
I was looking at the Queued Message Handler Template and realized that in several Message Loop cases there is a Merge Errors function with only 1 input.
Does anybody know if this provides any functionality?
My best guess so far is that it is there because the "--Copy This Frame--" case has it. So you don´t have to add it when you are using queues, user events and/or notifiers.
Is my assumption correct? or does anybody know about any Merge Errors extra functionality?
02-22-2018 10:25 AM
I'm pretty sure this was placed in the template because other Code may need to be added and NI is hoping that users will make use of a (possibly-separate) Error Line in the VIs and Functions that they use. Since Errors are something that need to be handled in the QMH, NI put "Merge Errors" in here so there is "no excuse" for allowing an error in user-added code to be over-looked. I suspect that if "not expanded", the Merge Error function doesn't impact your code, so it is safe(r) to leave it alone.
Bob Schor
02-22-2018 03:07 PM
Yeah I think it is just easier to have it there than not, and we probably cannot even measure the minuscule amount of processing time it adds (if any). Similarly, the JKI State Machine has the "add states to queue" in every single frame, even if no states are being added to the queue, just out of convenience for the programmer.
02-23-2018 05:04 AM
@Gregory wrote:
Yeah I think it is just easier to have it there than not, and we probably cannot even measure the minuscule amount of processing time it adds (if any).
I am actually willing to bet the compiler will optimize out the Merge Error when there is just the one input. So the only negative thing it does is maybe confuse some people trying to read the diagram. But it definitely makes it easier to merge state errors with communication errors when needed.