11-12-2019 09:56 AM
@champion2019 wrote:
Well, I might get how to do that. Here is a link that exactly described this issue. And it is a little bit hard for me to understand. But finally I figured it out.
This is a little hard for everyone. It isn't easy stuff.
I started with 'pick your battles'. Do you really need this or is it the thrill of finding 'the holy grail'. Or is it a pink fluffy unicorns in disguise (aka chasing rainbows)? Nothing wrong with HALs I guess, but I'd stop at a level I need. You wouldn't be the first to create a HAL that's so complex nobody dares to use it.
11-12-2019 10:42 AM
Haha, yeah! That is hard. But you know, it is really fasinating for me. I like the OOP design. That has many advantages. It is easy to code. I think it is good to learn and HAL is very useful for very complecated project.
11-12-2019 10:54 AM
I would say that developing a good HAL design is a lot more work than developing a somewhat less flexible and universal approach. So a HAL design will only pay off if you intend to reuse it in several projects. That said the chance is pretty big that in your next project you will find that the design constraints you have come up with for a practical approach don't align well with the new requirements, making you reinvent at least part of the wheel again. 😀
11-12-2019 11:01 AM
That is true. But in my project, I designed just like normal way. Then I really came across deffirent hardware. And I had to recode that. That is so annoying. In fact, I think before a big project, using the HAL design is always a good choise that you can extend your project very easily. After all, HAL is just an abstraction layer that you can add some method when you need.
11-12-2019 11:53 AM
@champion2019 wrote:
That is true. But in my project, I designed just like normal way. Then I really came across deffirent hardware.
I've been there. We had 5 spectrum analyzers, 6 multimeters, 4 power supplies and so on.
Somehow it made sense to management to buy a random 2nd hand spectrum analyzer to save 2000$, and let us make a new driver in a week or so (including testing)...
Still, normal polymorphism worked just fine. DIY polymorphism with VI references, this was 2005. Put all multimeter in a hierarchy, and the power supplies in another. I couldn't exchange a multimeter for a power supply, but why would I want that?
11-12-2019 12:35 PM
wiebe@CARYA wrote:
. I couldn't exchange a multimeter for a power supply, but why would I want that?
Hah, I have a system like that actually... I use a programmable power supply to set a voltage, then measure the current draw as measured by the power supply. There's been some question if the current draw is accurate enough, so I may have to switch that for a multimeter, or even a DAQ card (for transient measurements).
I'm looking forward to the interfaces in LV2020 🙂