03-21-2022 11:46 AM - edited 03-21-2022 11:49 AM
hello,everyone!I am newer to DQMH,Some issue bothered me for many days about broadcast event,please help me
The first is,I have A module and B module,I added a helper loop in module B to receive broadcast data。Module A broadcasts the cluster array. Module B registers to broadcast, but the broadcast events received by module B will be delayed by 10 seconds。 Just like I click the Boolean button in Module A, module B will receive data after about 10 seconds.
Second,I use private request in MHL to update the parameters of helper loop. It always delays or does not happen, so I use local variables to update data
This situation gets worse when I insert module B into the sub panel of module C (UI)
thanks a lot!!!
Solved! Go to Solution.
03-21-2022 12:04 PM
In module B, I used the replace array subset of multicolumnlistbox by Qcontrol
03-21-2022 04:45 PM
Hi SuperKevin,
I have some questions for you:
1) Have you run just the Module A tester, and tested that broadcast? Does it still take 10 seconds? If yes, your problem is in Module A
2) What else is going on in that Helper loop that could be preventing Module B from receiving and processing the data?
3) Did you put a breakpoint on receiving that event in Module B - does that take 10 secs?
03-23-2022 10:52 AM - edited 03-23-2022 10:59 AM
Thanks, Ozfarmboy
I have verified it through the three ways you said. I think I already know the answer. That is, I should not use the for loop in broadcast events. If the for loop is disabled, everything will return to normal
But I have to read the data through a loop, because the number and value of my array index elements are variable
At present, I use request and wait for reply in the timeout of module B instead of broadcasting to obtain data
Or do I still use broadcast events? Is there any other way to meet my needs
thanks again
03-23-2022 10:54 AM
Or do I still use broadcast events, Is there any other way to meet my needs?
03-23-2022 07:12 PM
Depends largely on your application needs.
If you want Module A to be an independent module that constantly monitors the sensors and let calling modules know when something happens, then broadcasting that data is a good idea
If you need Module B to get data at a very specific time, then a request might be a better idea.
Quite often our modules will do both - regular broadcasts at a constant rate (say every few seconds), and then also have the ability to handle a request to provide immediate data to the caller.