Jump to content

LabVOOP Article - Reusing Code by Inheritance


Recommended Posts

I've posted a new article this weekend to EXPRESSIONFLOW in an article series Introduction to Object-Oriented Programming in LabVIEW.

The previous articles in the article series are:

Don't hesitate to comment the articles. All discussion is wellcome either here or on Expressionflow.

p.s. Please don't comment in the article series thread to keep that thread clean and easily browsable. I posted the same annoucement to NI forums.

Link to comment

Hi Tomi,

I don't know where to put this question to ask about the LabVOOP, so I put it here.

Do we have to set anything so I can use multiple instances of one class? And is there anyway to check the exit of those class?

When I use GOOP, I have the inspector, which give me the feature to check the status of each class. I thing there will not be that tool here, but I hope there is away to check this information.

In my project now, when I try to create multiple instance of one class, it hangs at the create VI after the first loop runs. Should I set all of the VI in that class reentrant? I try to set it, actually, but it still stuck there.

Waiting for your reply.

Thank you

Thang Nguyen

Link to comment

QUOTE(Thang Nguyen @ Apr 20 2007, 06:22 PM)

LabVOOP is what I call an "Objectflow" programming language. LabVOOP Objects flow along the wires in a similar way as data flows in conventional LabVIEW dataflow programming. LabVOOP objects are not by-reference objects, so you cannot refer to one object in multiple places of the program simultaneously. However you can have multiple instances of one class, so the exact answer to your question is yes but I guess you didn't quite understand what you were asking :)

QUOTE(Thang Nguyen @ Apr 20 2007, 06:22 PM)

And is there anyway to check the exit of those class?

Classes cannot exit. I guess you mean a destruction of a LabVOOP object?

QUOTE(Thang Nguyen @ Apr 20 2007, 06:22 PM)

GOOP is a general word for any graphical object-oriented programming. LabVOOP is one GOOP language. You should always specify which GOOP you are using. However I guess you are using Sciware GOOP.

LabVOOP objects only live in wires. They are complitely parallel and there is no central repository that even could be aware of all the objects "existing" in the system. So the answer is no. But you are misunderstanding the what LabVOOP objects really are.

QUOTE(Thang Nguyen @ Apr 20 2007, 06:22 PM)

In my project now, when I try to create multiple instance of one class, it hangs at the create VI after the first loop runs. Should I set all of the VI in that class reentrant? I try to set it, actually, but it still stuck there.

This is impossible to say without seeing any code.

Link to comment

Hi,

Thank you for your answer.

I think my problem is now not at the multiple instances of the class. Because I try to use the third example of Jim Kring to implement my application, then there are still some issues with this example.

I use the sciware GOOP before, so I am still affected by the old habit. :)

Link to comment

QUOTE(John Rouse @ Apr 20 2007, 10:51 AM)

Appreciate the article and the series Tomi,

I like the examples.

The pictoral way of representing classes is nice for learning concepts.

I agree, esp in the context of LV which is such a VISUAL experience. I was always struck by how NON-VISUAL the experience was with Visual Studio -- it really was just a hyperlinked Text Editor with supporting utilities. Now that was helpful in many ways but it really wasn't -- IMO -- a truly VISUAL interface/experience.

The more visual the process, the easier and more seamless it becomes for me -- and that's esp true in re: to "classes" as that's a term/word that just never "fit" well for me with what it was supposed to be representing.

Link to comment

QUOTE(Val Brown @ Apr 20 2007, 01:17 PM)

and that's esp true in re: to "classes" as that's a term/word that just never "fit" well for me with what it was supposed to be representing.

I first started learning about classes back in high school, where the word "class" had a very different meaning. For a long time I thought it was chosen because the keyword "class" delimited the section of your code where you taught your objects how to behave. It wasn't until college that someone pointed out to me that the word was short for "classifications", which would be a better term to use, perhaps, except that it is too long for programmers to type. ;-)

Link to comment

QUOTE(Thang Nguyen @ Apr 20 2007, 10:24 AM)

Hi,

Thank you for your answer.

I think my problem is now not at the multiple instances of the class. Because I try to use the third example of Jim Kring to implement my application, then there are still some issues with this example.

I use the sciware GOOP before, so I am still affected by the old habit. :)

As you request, I attach here the test application. In that, I try to create two instance of the object FieldPoint for two channels. I cannot create two objects here. Please take a look.

THank you,

Thang Nguyen

Hi Thang.

I created a small example that (I think) does what you want.

(Oh, you need to simulate a DAQmx device in order to use this example. I simulated an NI PCI-6221 for this example).

Ami

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.