08-17-2021 04:22 AM
Hello.
I have 2 questions about my application.
1. Question:
I have 2 modules: Server and Reference Encoder module.
In Reference Encoder modules main.vi I implemented reading position from FPGA card using I/O nodes inside of a Helper Loop. Then, I have created DQMH Broadcast event and put "Position Updated.vi" into helper loop. Is that correct way of broadcasting real-time data from FPGA into other modules? Reference Encoder Module Main.vi is like this:
2. Question
Broadcasting data as described in Question 1 I want now to be send to my other module called "Server". Server module starts and then it is registered to Position Updated Brodcast Event like this:
So in the EHL I created Event <Brodcast Events.Position Updated>: User Event and created indicators on my Server Front Panel (Position [counts], RI found, RE Count at Ri). This actually works fine.
The question here is...How can I get this broadcasted data "Position[counts]" into helper loop otherwise than using local variable? For example: In my MHL event loop I have event Inicialize Magnetic scale axis, that is trigered after user press "Move to 0" Axis:
Then in the helper loops timeout case I'm constantly checking for Position[counts] is in range near 0 and then stop motor. I'm doing this using Local Variable but I'm not sure if this is the best way.
My Question 2 is: What would be the best way of reading position from broadcasted data in Server Modules helper loop?
Solved! Go to Solution.
08-17-2021 06:00 AM
In Reference Encoder modules main.vi I implemented reading position from FPGA card using I/O nodes inside of a Helper Loop. Then, I have created DQMH Broadcast event and put "Position Updated.vi" into helper loop. Is that correct way of broadcasting real-time data from FPGA into other modules? Reference Encoder Module Main.vi is like this:
This is ok, however how fast do you want (or need) to broadcast this? What is the timeout of the Helper loop event case set to? If it's small (ie. 0), then this will generate a lot of broadcasts. Perhaps you want to adjust your timeout code to only broadcast on a change (ie check what the previous value was and if different, broadcast).
Then in the helper loops timeout case I'm constantly checking for Position[counts] is in range near 0 and then stop motor. I'm doing this using Local Variable but I'm not sure if this is the best way.
My Question 2 is: What would be the best way of reading position from broadcasted data in Server Modules helper loop?
Instead of registering for this event in the EHL, you could have your helper loop registered for this event , and then you wouldn't need to pass data from EHL to Helper loop.
08-18-2021 01:30 AM
Thank you for information, but I cannot figure out what do you mean to "Register for Broadcast Event in the Helper Loop instead of MHL". Can you give me additional description about this idea?
08-18-2021 01:53 AM - edited 08-18-2021 01:54 AM
Hey AndrazS, there’s a blog post explaining different kinds and aspects of DQMH helper loops here, it might be interesting for you:
https://www.hampel-soft.com/blog/dqmh-actors-self-messaging-or-helper-loops/
DSH Pragmatic Software Development Workshops (Fab, Steve, Brian and me)
Release Automation Tools for LabVIEW (CI/CD integration with LabVIEW)
HSE Discord Server (Discuss our free and commercial tools and services)
DQMH® (Developer Experience that makes you smile )