Jump to content

Create Different Instances of a Class


Recommended Posts

Hi All

Is it possible to create different instances of the same class programmatically?

Suppose if i want to have a graphical displays, Can i create a Graph Class and create multiple instances it?

Regards

Suneel

Every wire of your class type is a separate object. Every object is an independent instance of a class.
Link to comment
Is it possible to create different instances of the same class programmatically?

Sure - branch the wire into two wires, and you have 2 objects. That's the difference between by-value and by-reference designs: LVOOP allows you to do by-value.

Link to comment

Thank You Crelf and Aristos Queue.

I have an application that has different types of displays. Each display has a button. On clicking the button n times, n displays of the same has to be launched.

Please let me know whether i achieve the above functionality using LVOOP. I know it can be achieved using VI Templates.

Regards

Suneel

Link to comment

The use of OO in this case is irrelevant -- you may decide to use it or not. What is key is the use of reentrant VIs. They are a much MUCH better solution than template VIs. Use "Open VI Reference" on a VI that has been marked as Reentrant to display multiple copies of the function.

Link to comment

The use of OO in this case is irrelevant -- you may decide to use it or not. What is key is the use of reentrant VIs. They are a much MUCH better solution than template VIs. Use "Open VI Reference" on a VI that has been marked as Reentrant to display multiple copies of the function.

AQ, can you go into detail here? Also, do Template VIs have a specific use case wrt instantiation of stuff?

Link to comment

If you take a look at this awesome video tutorial I posted on my VI Shots blog. You can see an example of using reentrant VIs to create multiple user interfaces that look the same but handle different data. It doesn't contain any classes but it's a small change to add classes to this design pattern.

Click here to watch the video.

Good video.

This is basically how all my software works.

Edited by ShaunR
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
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.