Search the Community
Showing results for tags 'inheritance'.
Hello, Bit of an odd one and I am probably doing something fundamentally wrong however I am fairly new to OOP. Essentially I have a hierarchy of 3 items say A, B and C. I have a DD VI called "ModifyUI.vi" in each class and I am calling this VI and its parents in parrallel (Probably not a great idea but it is my end goal). After each "ModifyUI.vi" has completed doing what it needs to I would then like to collect each VI's data as they were all run in parrallel back into the initial class that called them all. I have attached an overview of what I am trying to achieve in a mockup of my problem. I am willing to change tack as long as the same goal is reached (Modify all class data in parrallel). Thanks in advance Craig Lava Temp.zip
I've started a project as a way of transitioning from task-based to object-oriented programming. So far, I wish I'd put the effort in sooner. OOP solves a lot of problems I spent frustrating hours considering ways to get around. Platitudes aside, I want to make sure I'm making the right choices as I learn, so that the right practices are in place beginning early in the process. I favor a hierarchical architecture similar to what's been discussed in other topics on the board, and an observation I've made as I write is that much of the code falls into two categories: abstraction layers and mediators. There are both general similarities (queues in and out, auto/manual mode, etc.) and functional differences (power supply vs. multimeter vs. stepper motor), which spawned a thought and a series of questions. I'm considering building a class for a parent abstraction layer and/or a class for a parent mediator, then inheriting as needed. What pitfalls or advantages might I have missed? Will I discover as my skills progress that I've imposed a need for work-arounds? Or, if I'm careful to keep the parent classes away from anything application-specific, will it provide a good base to my coding that can be managed by version control?
I have a question relating to inheritance in one of my programs. When at a customer's site we have Ethernet IP available, which will ultimately be what is used for communication between a PLC and our application upon delivery. However, because I don't have ethernet IP available elsewhere, I was hoping to use TCP/IP when in the office and write a simulator to substitue for E-IP when I don't have it available . The issue is, it doesn't really make sense to have TCP/IP and ethernetIP classes both inherit from a same base class (say, communication class) because the ethernet IP drivers don't really have similar functionality to TCP/IP exposed. With ethernet IP, although it uses TCP/IP underneath it, the API is just a polymorphic VI with an input for the address and tag name. You don't need to open anything, or hold a reference to the session etc. I am wondering if there is some way to set up the class structure so I can easily switch out ethernetIP with TCP/IP and vice versa, even if it does not make sense for them to both inherit from the same base class.