12-01-2015 06:25 AM
Hi, I want to use the object-oriented-programming to program for the FPGA, the FPGA wil control a pumpe to create pressure, is there any advise for the design pattern?
Solved! Go to Solution.
12-01-2015 01:46 PM
It seems that not all features of LabVIEW OO are available in FPGA. I'm guessing things like dynamic dispatch aren't something that can be represented in gates easily.
http://zone.ni.com/reference/en-XX/help/371599H-01/lvfpgaconcepts/fpgaclassesinvis/
http://digital.ni.com/public.nsf/allkb/376C9F5112F10A8C8625795A0059D2D5
I've never needed OO in FPGA. Usually OO is great for flexibility and ever changing requirements, and to me an FPGA is usually a very dedicated piece of hardware doing a specified task that it can do deterministically. These two things in my mind don't mesh well.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
12-01-2015 01:53 PM
While I agree with what hooovahh posted in that LVOOP on FPGA strikes me as forign that does not rule out applying OO paterns to define the design and the interface presented by the FPGA.
Example:
Factory Pattern - On RT offers a variety of modes of operation for the FPGA under RT and the appropriate bit file file is loaded the make the realize the mystery-magic machine spit out by the Factory Pattern.
Just my 2 cents,
Ben
12-02-2015 01:33 AM
Thank you for all your answer.
01-14-2016 10:05 AM
As one of the developers of LabVIEW Class support on FPGA, I might be a bit biased : ) but there are many use cases for classes on the FPGA. As others have previously mentioned, the FPGA compiler doesn't currently support all of the features of LabVIEW classes, but the features it does support are still quite powerful.
For instance, run-time dynamic dispatch is not supported, but dynamic dispatch calls that can be determined at compile-time are. Therefore, one can design libraries that are generic across multiple families of targets, servos, I/O adapters, etc. and quickly create small composite classes that define the proper behavior for each specific use case.
I have personally helped some customers refactor some complicated multi-target code into simpler, actor-driven designs using classes to help wrap the customizable (e.g. pluggable) behaviors.
Also, keep in mind that classes can be used for OO design, but they are not strictly for OO design. You can use features of classes for other design patterns without having to use OO. For instance, you can do a more aspect-oriented design using classes if that suits your application better.
LabVIEW classes are still in their infancy in hardware designs, and not just for LabVIEW but for the entire hardware industry. So I would love to see some of your designs and talk through on the forums how they can be class-ified : )
01-14-2016 10:09 AM
Oh, and for those that are worried about performance implications of classes, I wanted to mention that classes are optimized as efficiently as any other feature by the LabVIEW FPGA compiler.
In other words, the LabVIEW class abstraction does not add any overhead that would not be required by your application anyway for what you are trying to solve. Essentially, the classes are lowered to clusters and the compiler optimizes them like they would any application that does not use classes.