DQMH Consortium Toolkits Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Architecture Validation

Hi,

 

I just learned about DQMH a few days ago have decided to use it for my next project.  My project is pretty standard one - testing product in a thermal chamber and controlling stimulus test equipment and monitoring, displaying, logging data from measurement test equipment.  

 

I've come up with a rough architecture of the program and wanted to get some feedback from the DQMH community to determine whether this will work.

 

My goal from using the DQMH is to make my program as modular as possible.

 

Here are the modules I want to create: 

 

CONFIGURATION MODULE - This is used by the operator to set configuration data for instruments, file data paths, etc.

 

CHAMBER CONTROLLER - Get config data from CONFIGURATION MODULE and set instr config settings. Sets ramp rate, set temp set point, enables/disables chamber, acquire temp data.

 

DMM MODULE - Get config data from CONFIGURATION MODULE and set instr config settings.  Get measurement readings

 

PSU MODULE - Get config data from CONFIGURATION MODULE and set instr config settings.  Enable/disable PSU.

 

DISPLAY MODULE - Provides live graph/chart of data (temp, voltage, current) to a GUI during runtime. Gets data from CHAMBER, DMM, PSU MODULES.

 

LOGGER MODULE - Logs data to file. Gets data from CHAMBER, DMM, PSU MODULES.

 

MAIN MODULE - Controller for system.  My goal would be that for future projects, all I would need to do is revise this program/module and just reuse the other modules and not have to modify the other modules at all.

 

Does anyone see any issue with my current architecture?  Any tips for improvement?  My program needs to be ran for up to a month, 24/7 so I need this to be robust.

 

Also I'm still trying to understand how the Round Trip event would be useful?  What are typical use cases?

 

Any feedback is appreciated. Thank you!

0 Kudos
Message 1 of 18
(3,837 Views)

Sounds like a good general start.

 

I would draw some bubble diagrams similar to what Anti-doc generates. It will help you manage dependencies.

 

I would certainly change some of your terminology.

 

Instead of the DMM getting the configuration data (which implies it knows where to get it from), I would have the Main Module supply the configuration data to the various modules.

 

If the display and logger modules aren't intended to be reused then having them register directly for broadcasts from the various modules might be ok.

 

You really just want to give thought to your message routing and your dependencies.

 

See these:

https://youtu.be/_YcfT-Ec0ws

https://www.sasworkshops.com/simple-dqmh-dos-donts/

Sam Taggart
CLA, CPI, CTD, LabVIEW Champion
DQMH Trusted Advisor
Read about my thoughts on Software Development at sasworkshops.com/blog
GCentral
Message 2 of 18
(3,834 Views)

thank you for the advice!

0 Kudos
Message 3 of 18
(3,827 Views)

I second what Sam said.

 

Be purposeful in your design and the relationships between each module.  Once you establish, try not to break that design.

 

Try to avoid having all modules talk to any module they choose.  This leads to circular dependencies, which results in some tricky debugging challenges.  And it won't make things reusable.

 

Follow Sam's advice from his article: "Do be very cognizant of coupling"

Christopher Farmer

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

Message 4 of 18
(3,785 Views)

The other thing that helps is to run AntiDoc often. It will easily show your dependencies and where you have issues like circular dependencies.

 

That lets you do a little less design upfront. You can almost use it like an iterative design tool. Say you have some feature where you need to add a bunch of messages. You can quickly add a bunch of messages and get it working with some tests in place. Then you can run Antidoc and make sure the dependencies look ok and if they don't then just refactor until they do.

Sam Taggart
CLA, CPI, CTD, LabVIEW Champion
DQMH Trusted Advisor
Read about my thoughts on Software Development at sasworkshops.com/blog
GCentral
Message 5 of 18
(3,780 Views)

Suggestions:

 

You're more likely to get reusability from your three hardware modules than your other ones, so pay most attention to making them independent.  Consider letting those modules handle allowing the User to adjust configuration parameters, with the Main module handling reading and writing to a config file (eliminating the "configuration module" entirely).

 

 

 

Message 6 of 18
(3,760 Views)

I think what I am going to do for the logger module is have it send request and wait for reply events to the instrument modules and have them return the measurements (temp, current/voltage, etc.).  Is there any problem in doing this?  Acquisition rate is probably at most 1 acquisition per second.

 

Can someone please explain the use case for the "wait for reply" terminal of the Request event?  I understand it has something to do with async vs synchronous communication but can some one explain when I would set the "wait for reply" terminal to true/false?

 

Also, what is an example of when would you use the "Round Trip" event?

 

Thank you!!!

0 Kudos
Message 7 of 18
(3,700 Views)

Why something synchronous?

 

also does your logger need to know about the instruments? Adding an instrument would then require changing your logger.

 

Couldn't your logger have a request that says log this piece of data (with some kind of identifier telling you what channel)?

 

Then whatever launches your logger and instruments registers for the broadcasts from the instruments and forwards them to the logger.

 

The wait for reply flag is just that, do you want to wait for a reply or not? Depending on the context the caller (module sending the request) may care about the return or may not. If you don't care about the return data, no sense in waiting.

 

for the round trip: (from the DQMH help)

  • Round Trip: A request and wait for reply event and a broadcast event where the Reply Payload and the Broadcast Argument are the same typedef. The request and wait for reply event has an input to determine whether the code should wait or not for the reply. In the case where the code doesn't wait for the reply, these events are asynchronous but may be logically related (i.e., Do Something and Did Something). In the case where the code does wait for the reply, the broadcast provides the opportunity of notifying other VIs, registered to listen to the broadcast, when another VI has called the request and is waiting for a reply. This is particularly useful in TestStand projects where the TestStand step needs to wait for the reply and we might want to use the API Tester as a sniffer and still see the reply reported there via the broadcast event. 

So you have a module, say a power supply and you have a request that sets the voltage. You may want that to be synchronous because you want to make sure that is set correctly before you do the next thing. So you would make it a request and wait for reply event. But let's say you also want other modules in your program to be notified when the voltage changes. If you make it a roundtrip message, then the module will also broadcast the new voltage in addition to returning it as part of the wait for reply data. 

 

It's honestly mostly a convenience, because you could just create the broadcast yourself.

Sam Taggart
CLA, CPI, CTD, LabVIEW Champion
DQMH Trusted Advisor
Read about my thoughts on Software Development at sasworkshops.com/blog
GCentral
0 Kudos
Message 8 of 18
(3,693 Views)

Why is that called a "Roundtrip"?  That seems non-intuitive.  I would have guessed that something called a roundtrip would involve circular message passing like A-->B-->C-->A.

0 Kudos
Message 9 of 18
(3,626 Views)

@drjdpowell wrote:

Why is that called a "Roundtrip"?  That seems non-intuitive.  I would have guessed that something called a roundtrip would involve circular message passing like A-->B-->C-->A.


Ask Fab.

Sam Taggart
CLA, CPI, CTD, LabVIEW Champion
DQMH Trusted Advisor
Read about my thoughts on Software Development at sasworkshops.com/blog
GCentral
0 Kudos
Message 10 of 18
(3,620 Views)