From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DQMH Consortium Toolkits Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Better way of sending broadcasted data to helper loop than local variable

Solved!
Go to solution

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:

BroadcastPosition.PNG

 

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:

AndrazS_0-1629191290300.png

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:

AndrazS_2-1629191687030.png

 

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?

AndrazS_3-1629191895967.png

 

 

0 Kudos
Message 1 of 4
(1,653 Views)
Solution
Accepted by Taggart

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.

Christopher Farmer

Certified LabVIEW Architect and LabVIEW Champion
DQMH Trusted Advisor
https://wiredinsoftware.com.au

Message 2 of 4
(1,638 Views)

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?

0 Kudos
Message 3 of 4
(1,573 Views)

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® (The Future of Team-Based LabVIEW Development)


Message 4 of 4
(1,570 Views)