Tomi Maila Posted April 17, 2007 Report Share Posted April 17, 2007 I've posted a new article this weekend to EXPRESSIONFLOW in an article series Introduction to Object-Oriented Programming in LabVIEW. Reusing Code by Inheritance The previous articles in the article series are: Inheritance and Class Hierarchies in Object-Oriented Programming Code Reuse with Interface Design and Composition Introduction to Objects and Classes 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. Quote Link to comment
Thang Nguyen Posted April 21, 2007 Report Share Posted April 21, 2007 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 Quote Link to comment
Tomi Maila Posted April 21, 2007 Author Report Share Posted April 21, 2007 QUOTE(Thang Nguyen @ Apr 20 2007, 06:22 PM) Do we have to set anything so I can use multiple instances of one class? 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) When I use GOOP, I have the inspector, which give me the feature to check the status of each class. 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. Quote Link to comment
Thang Nguyen Posted April 21, 2007 Report Share Posted April 21, 2007 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. Quote Link to comment
TG Posted April 21, 2007 Report Share Posted April 21, 2007 Appreciate the article and the series Tomi, I like the examples. The pictoral way of representing classes is nice for learning concepts. Quote Link to comment
Val Brown Posted April 21, 2007 Report Share Posted April 21, 2007 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. Quote Link to comment
Aristos Queue Posted April 21, 2007 Report Share Posted April 21, 2007 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. ;-) Quote Link to comment
MikaelH Posted April 22, 2007 Report Share Posted April 22, 2007 Hi Thang I just had a quick look at it, and you're using a named queue as the reference handle, but you have the same handle for both objects. Remove the "FieldPoint" ID Tag to create 2 objects. //Mikael Quote Link to comment
Ami Posted April 22, 2007 Report Share Posted April 22, 2007 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 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.