LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What do you think about ogject oriented programming in LabVIEW?

I've been exploring LabVIEW style 2 globals in LabVIEW and have found that they are very useful and can be used for data encapsulation. The hard part is instantiation. I've started looking at the GOOP Wizard to help solve this problem. Looking for comments on how well GOOP techniques work in LabVIEW.
0 Kudos
Message 1 of 4
(2,957 Views)
There is a Topic for discussions about GOOP:

Object Oriented Programming in LabVIEW
www.vartortech.com
0 Kudos
Message 2 of 4
(2,957 Views)
As mentioned, there is a topid for GOOP. However; to address your question, there is also another topic that does contain some discussion (and an example) of these 'objects'. I have been using these for some time now, and find them quite useful. Then, I find out that the are OOP components.

OOP in LabVIEW is somewhat of an enigma. LabVIEW is more function based that object oriented, but you can still do some OOP in LabVIEW (obviously, that's why we have the GOOP wizard.) The problem is that you will just have to live with the limitations that LabVIEW has for OOP. Just like C, you cannot always use every component of OOP, but you can still use some, so that an OO design for your software is in fact possible, just not as easy as it would be in an OO lan
guage such as C++.

As for instanciation of your objects, that has to be done manually for the most part. I have tried to mimic instanciation myself, and found it quite difficult, but still possible. In fact, I did this without even realizing it was OOP! I was trying to create a dynamic compact database that automatically generated these data objects. I ran into some trouble, but can't quite recall what my solution to that issue was (my solution to the problem was something completely unlike instanciation.)

In order to accomplish Instanciation, you have to use the VI Server and the ".vit" methods. If you do a search on this forum for ".vit" you should come across some discussions for this, which may help with instanciation.

Good luck, and post on the GOOP topic as well.
0 Kudos
Message 3 of 4
(2,957 Views)
....

> In order to accomplish Instanciation, you have to use the VI Server
> and the ".vit" methods. If you do a search on this forum for ".vit"
> you should come across some discussions for this, which may help with
> instanciation.
>



If you want to open multiple panels, this is indeed a good technique,
but technically, instantiation doesn't really need to involve panels.
In goop, when you instantiate an object, it gets stored in the GOOP
database and you are given a reference to it. Pretty much identical to
the way other object references work in C++, Java, etc.

Greg McKaskle
0 Kudos
Message 4 of 4
(2,957 Views)