DQMH Consortium Toolkits Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

5 modules vs 2 modules for Arduino Smart Scale Program: Which would you use?

Solved!
Go to solution

   

Hello!

I am starting a new DQMH project and I always arrive at the same point: Do I make many modules or do I boil it down as much as possible eliminating a very "talkative" program. 

 

Background: I hooked up a strain gauge to an arduino, which connects with VISA to labview. I want to display the weight in real time (graph not necessary). A radio button allows me to choose between grams, dwt, oz. 

I fetch the price of bronze, silver and gold, multiply the weight by the specific density of those metals and then by the price per ounce and display how much it will cost to investment cast a part based on the weight of the wax model. 

 

Note: You'll have to forgive the liberties I took with the class diagrams, I just wanted a nice graphing tool that would work in mermaid. Essentially, broadcasts are in the top box and requests are in the bottom. Request and wait for reply are in the bottom box with the reply after the colon. 

AntiDoc does this very well, but you can't have an antidoc document until you've written the program!

 

Main Differences:

 

1)In 2 module option, the sensor module has a helper loop that listens to the arduino and gets a weight every  20 ms or so. It displays it directly to the front panel (no display module needed). In the 5 module version the main module is subscribed to the sensor module, as well as the prices module. It computes the prices for casting in different metals and sends all those values to display module.

 

*Another option would have been to embed the sensor model front panel into the display module. I would then make the table of prices for different metals in the prices module and embed that one in the display module as well, except that he depends on the sensor module, which is why I sent both of them "home" to the main module, to then send back out to display module. 

 

2) In the 2 module version, there is no settings module, just a settings.csv file. The sensor(i.e. main) module reads the COM port, price/oz, weight multipliers from there. It also reads (and writes) the gain and offset for the load cell.  

In the 5 module version, the settings module is subscribed to the price module. WHen a price is fetched and broadcasted by price module, Settings module writes it to the csv independently, while main module updates the local variable. Eventually this gets sent to the display module. 

 

In both cases, price module writes the price of the day to a .csv. that way if there is no internet connection or the module fails to init, you just get the last known value).

 

Let me know how you would do it! 

Regards, 

Chris

 

 

 

0 Kudos
Message 1 of 7
(6,567 Views)

@crouxel wrote:

   

Hello!

I am starting a new DQMH project and I always arrive at the same point: Do I make many modules or do I boil it down as much as possible eliminating a very "talkative" program. 


Hello there, and thank you for using DQMH and sharing your thoughts with us!

 

Short answer (excuse my brevity, sending this - with love - from my vacation): I have never thought "if only I had *not* created module". But I have many times thought "oh man if only I had created a module for this right from the start".

 

Edit: I'll leave it for my colleagues to comment on your specific project.




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 )


Message 2 of 7
(6,291 Views)

Thanks Peter! That's enough for me, 5 module version it is 🙂

Enjoy your vacation!

0 Kudos
Message 3 of 7
(6,288 Views)
PS its a Jörg, not a Peter
Message 4 of 7
(6,251 Views)

Sorry about that Jörg! I don't know what happened. 

 

0 Kudos
Message 5 of 7
(6,239 Views)

@crouxel wrote:

Sorry about that Jörg! I don't know what happened. 

 


Haha no worries!! Names are just names… 😉

 

Danke Marco für‘s „PS“




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 )


0 Kudos
Message 6 of 7
(6,228 Views)
Solution
Accepted by topic author crouxel

I just wanted to tell you that I liked your diagrams very much! 

 

I could follow your thought process and both approaches seem sensible. 

 

As Joerg said, it is more often that we regret not creating a module! Also, depending on how you create this Settings module, it could potentially be reusable for other applications later.

 

The DQMH Consortium also has a DQMH Configuration Editor for sale. It is overkill for your application... but just in case this comes in handy later. 

 

Thanks for your interest in DQMH and for sharing with the community.

 

Happy wiring!

Fab

For an opportunity to learn from experienced developers / entrepeneurs (Steve, Joerg, and Brian amongst them):
Check out DSH Pragmatic Software Development Workshop!

DQMH Lead Architect * DQMH Trusted Advisor * Certified LabVIEW Architect * Certified LabVIEW Embedded Developer * Certified Professional Instructor * LabVIEW Champion * Code Janitor

Have you been nice to future you?
Message 7 of 7
(3,940 Views)