Suneel Posted May 17, 2011 Report Share Posted May 17, 2011 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 Quote Link to comment
Aristos Queue Posted May 17, 2011 Report Share Posted May 17, 2011 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. Quote Link to comment
crelf Posted May 17, 2011 Report Share Posted May 17, 2011 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. Quote Link to comment
Suneel Posted May 17, 2011 Author Report Share Posted May 17, 2011 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 Quote Link to comment
Aristos Queue Posted May 18, 2011 Report Share Posted May 18, 2011 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. Quote Link to comment
jgcode Posted May 18, 2011 Report Share Posted May 18, 2011 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? Quote Link to comment
Michael Aivaliotis Posted May 18, 2011 Report Share Posted May 18, 2011 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. 1 Quote Link to comment
ShaunR Posted May 19, 2011 Report Share Posted May 19, 2011 (edited) 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 May 19, 2011 by ShaunR Quote Link to comment
Grampa_of_Oliva_n_Eden Posted May 19, 2011 Report Share Posted May 19, 2011 resolved on the dark-side... re-entrant switch http://forums.ni.com/t5/LabVIEW/Create-Different-Instances-of-a-Class/m-p/1566012/message-uid/1566012#U1566012 Ben Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.