Jump to content

Search the Community

Showing results for tags 'oop'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Software & Hardware Discussions
    • LabVIEW General
    • LabVIEW (By Category)
    • Hardware
  • Resources
    • LabVIEW Getting Started
    • OpenG
    • Code Repository (Certified)
    • LAVA Code on LabVIEW Tools Network
    • Code In-Development
  • Community
    • LAVA Lounge
    • LabVIEW Feedback for NI
    • LabVIEW Ecosystem
  • LAVA Site Related
    • Site Feedback & Support
    • Wiki Help

Categories

  • *Uncertified*
  • LabVIEW Tools Network Certified
  • LabVIEW API
    • VI Scripting
    • JKI Right-Click Framework Plugins
    • Quick Drop Plugins
    • XNodes
  • General
  • User Interface
    • X-Controls
  • LabVIEW IDE
    • Custom Probes
  • LabVIEW OOP
  • Database & File IO
  • Machine Vision & Imaging
  • Remote Control, Monitoring and the Internet
  • Hardware

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Personal Website


Company Website


Twitter Name


LinkedIn Profile


Facebook Page


Location


Interests

Found 41 results

  1. I currently have a project that I am refactoring. There is a lot of coupling that is not sitting well with me due to typedefs belonging to a class, then getting bundled into another class which is then fired off as event data. Effectively, I have class A with a public typedef, then class B contains ClassA.typedef and then class B gets fired off in an event to class C to be handled. Class C now has a dependency on class A which is causing a lot of coupling I don't want. For my real world example I query a bunch of data from our MES, which results in a bunch of typedef controls on the connector panes of those VIs. Those typedefs belong to the MES class. I then want to bundle all that data into a TestConfig class and send that via an event to our Tester class. But, now our tester has a dependency on the MES. I see a few ways to handle this. First is move the typedefs currently in the MES class, to the TestConfig class. The MES VIs will now have the typedefs from the TestConfig class on their connector panes, but at least the dependency is the correct "direction." Or, I can move the typedefs out of classes all together, but then I am not sure the best way to organize them. Looking for how others have handled these sorts of dependencies.
  2. Hi everyone. I need help regarding LVOOP implementation. I have gone through several examples and documents on LVOOP for quite some time, and finally decided to use it in this simple application. In my project LabVIEW application communicates between a PLC(local) and a server(TCP).I have used command pattern.For the server part i have created class and methods and it runs in a separate loop(i pass messages from main process loop). my problem is how can i make my main process using the same method? In QMH and state machine i can do it easily by checking condition and queuing next action how can i implement the same using OOP? I have tried passing the next command in the current method. Is it the right way to do? I am also thinking using a while loop inside methods for checking for validating conditions is it okay to do so? Or should i use QMH for the main process to send commands to the server loop? Or am i doing it all wrong? Thanks. LVOOP attempt.zip
  3. Hello all, I am programming with LabVIEW for around 2 years and was recently stumbled upon LVOOP. I am required to write a communication protocol to work with a micro-controller, which later will be also used for ATP and debug purposes. I want to build the program "correctly" from the beginning so it will be maintainable and flexible to additions and changes. My natural way of building a program would have been a queued state machine, with several loops, each loop is in charge of a different module (one for GUI obviously), but as I stated in the beginning, I want to use LVOOP. Does anyone have a LVOOP project I can use as reference? I've searched online and found some nice examples, but they are small and teach you the basic stuff. For me it's important to see the how to use the project tree wisely, where to place the classes, see the managing loop and to learn as much as possible before I create one of my own. Thanks in advance, Voklaif
  4. Hi! Silixa is looking for a LabVIEW Software Developer - SURF (London, UK). https://silixa.com/about-us/careers/ If you are looking for variety and using LabVIEW for something other than equipment control/test. Contact details are provided on the web site.
  5. Hey everyone, I am working on a backup function for a test executive. The backup uses the 'class to XML' vi to create an XML string and then save it to a file to be reloaded later. All of my test specific information lives in the class (or one of it's children). I like this functionality because it makes backup and reload brainless. It just works.... until now... I've got a test class for my current tester that's grown rather large. Everything works fine, until the tester loads some waveform data into either of the waveform arrays. Without data in this field the class reloads just fine, otherwise if fails and says the XML is corrupted. As you can see in my backup vi I have built in a work around that flattens the waveform arrays to strings, drops them back into the class private data, deletes the waveform arrays and then writes the class. This works! Much to my surprise both waveform data and the rest of the class data are written to file and reloaded without error. Does anyone have any knowledge or experience with this? Cheers, Tim
  6. 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
  7. Hi, I'm fairly new to the JKI SMO framework and I have been looking at many examples online about how to use the framework (the HAL Webinar was very helpful) and I think I understand most of what is being presented but I'm having trouble making the next step of actually implementing it into my applications. At a basic level I'm having difficulty with launching the splash screen SMO. When I launch a splash screen using the created TestLauncher.vi it launches without difficulty, but when I try to create the Splash Screen SMO from another SMO, it gets stuck in the SMO.lvclass:Start.vi. Particularly, the subVI StartProcesses.vi. It's waiting in the Event structure for an event never seems to happen. Any ideas as to what I'm doing wrong? Thanks, Bruce
  8. Hello, I am trying to make communication between Two LabVIEW(Version 10 & Version 14) application through TCP\IP. I am sending cluster(Inc.Variant and String Control) from LabVIEW14 To LabVIEW 10 over TCP\IP. In this case everything work fine but when I include German word (Ex. Ü or Ö) there is error like 'Error 74 occurred at Unflatten from String.' Additional if i try to send data through Class than again there is flatten to string or XML error. Anyone has idea what to do with it ? NOTE: Same Communication between LabVIEW10 and LabVIEW 11 work fine even If I send (Ü, Ö,).
  9. Hello Everyone, i am creating a LabVIEW Application in OOP that communicate with two different version of LabView(10 & 14) through TCP\IP.. In procedural programming I do by converting cluster data to string(Flatten to string) but in OOP should I also use class and Flatten to string function? whether i will receive correct information.?
  10. How do I instantiate every child so that I can call supported modules in each child to then determine which child to instantiate? In addition, how do I only call children that I am their parent? I have stumbled upon a difficult problem. I am writing a HAL where the parent is the type of instrument (for example, power supply) and the child contains the specific code for a specific instrument. It also seemed to make sense that the child also contained the code specifying which specific instruments it supports. Does it make sense to try to instantiate every child object so that I can call supported instruments and then determine which one to keep? Is there a better way to do this? Also, since this is a plug-in architecture, I plan to have one folder with each class in it as a packed project library. But it will potentially have power supply parent and children as well as spectrum analyzer parent and children and so on. How do I only open the power supply classes?
  11. Hello Everyone, I need litter suggestion about object oriented with Producer Consumer design pattern. I have One MAIN program and Other 7 module that controlled (mean sending message or command by queue to module) by MAIN program and it has producer consumer design pattern.Now i want to convert this application into OOP but my doubt is if I will convert in OOP then each case in consumer loop is become a class(Command pattern).In such case I have more than 100-200 class in entire application. is it good idea to have such big amount of class in application? or i misunderstand something? looking forward to your suggestion.thanks
  12. Hi, I've decided to take the temperature on a known issue, that lvclass files retain knowledge of some of their old content after it's deleted. Proof For some reason I'm not allowed to upload lvclass files, so I'll describe it instead (using LV2014SP1): 1) Create a new class and save it on disk as class1.lvclass. No member data nor methods, file size on disk is 8 kB. 2) Add one piece of significantly sized (to easier see the issue) member data, I added a 1000x100 array of DBL (with random default data in it). Save the class again, and now class1.lvclass is 4604 kB (why so much, should be around 1000 kB?). 3) Delete all member data again and resave the class. File size on disk is now 1171 kB, I'd have expected 8 kB. 4) I can't ever get rid of that extra data in the lvclass file, not even when I "save as" to create a similar class. Questions A) What's the reason behind this issue? B) Is there any way to really delete stuff from a class file, or is the only way to recreate every class from scratch if you want something truly gone? C) Is there a list (perhaps internal to NI) of which problems this issue causes? Here I'm talking about stuff like this and numerous other threads about class data suddenly not being updated or member data or methods not being called correctly with DD. Cheers, Steen
  13. Hello Everyone, I am new to object oriented programming in LabVIEW. I am working with injector measurement system in LabVIEW that use (Procedure Programming Style) Producer Consumer Design pattern After careful reading about object oriented, I come to know its benefit. So I want to use OOP in my current application. Anyone could give some idea which design pattern is equivalent to producer Consumer. Thank you in advance .
  14. I am trying to wrap my head around something i've been dealing with lately: I want to implement a "Messenger" Class for facilitating a switch of communication interfaces in my programs. Basically my current thought process is that I have: - A parent class called "Messenger" with the methods: initialise(?), connect(), [U8] recieveData(), sendData([U8]), disconnect(), that I can use in my code. - A child class "TCP Messenger", which overrides the methods: initialise(IP, Port, Timeout, DVR, ConnectionType), connect(), [U8] recieveData(), sendData([U8]), disconnect(). - A child class "Serial Messenger", which also overrides the methods: initialise(Port Number, Timeout, DVR, ConnectionType), connect(), [U8] recieveData(), sendData([U8]), disconnect(). - A child class "Profibus Messenger", which again overrides the methods: initialise(FPGA ref, SlaveAddress, ConnectionType), connect(), [U8] recieveData(), sendData([U8]), disconnect(). ... I would like to change the communication type by simply loading a different class and letting dynamic dispatch do the rest. All of the methods have similar interfaces, except the initialise method, as every type of connection necessitates different types of parameters. Everything else is basically getting byte Arrays and setting Byte arrays. How would one go about solving this? Do I just create an Initialise method with every possible parameter and only use what I need in the specific implementation? Robert
  15. I am not sure the best way to handle state in this scenario so I am looking for insight. I have some hardware, call it class A. Class A has some state. I have a status byte handler, call it class B. This status byte handler may be different depending on the command I sent, so I have a few Child Class Status Byte handlers. For example, a status byte may be an error we want to acknowledge, ignore, take some action etc depending on the command that was sent. So, I have set this up so class B can have a HandleStatusByte received method which can be overriden when necessary. But, it needs to set the state of class A. It feels like friendship is the proper relationship to allow the status byte handler method to set the state of the hardware class A. But for some reason I feel like there is a bit of a code smell here. Maybe it's just because I don't use friendship that often and I feel as if I have read some not-so-great things about it in LabVIEW in the past. Maybe I'm wrong? Anyways, what are other's thoughts?
  16. So this will seem fairly long winded but I believe some people here will find this to be an interesting question and hopefully people can point me in the right direction. To give you guys some background I am a process control integrator working with PLC's and CRIO's to create automated solutions for out clients. I have a background in Software engineering and have worked a great amount in the past in Object Oriented languages such as Java or C#. I have only been using LabVIEW for the past 2 years and this is the first time I have utilized the OO features of LabVIEW. One of the first things I looked into was if interfaces and abstract classes existed in the OO concepts for LabVIEW. I learned quickly they do not and after looking through the white paper I had a grasp as to why. Which is fine but it lead to the rest of what I am going to explain. The end goal is to create some Equipment control modules based on the S88 standard that is used in process control. Typically an EM would have a Start(),Stop(), and Abort() function. We would like to create a library of these EM’s and keep with an overall good structure using inheritance in a OO style. I can inherit information from a parent class, and I can override the functions from a parent class as well. What is giving me problems however is that I am encapsulating a parent class object in the child object data area and I am attempting to utilize an override function on this encapsulated object. Our reasoning for an encapsulated object is to allow for dynamic creation of new EM’s that can be utilized by a previously created EM. I would like to be able to abort a parent EM and have that abort any cascaded EM’s that are children of it. With my current setup that I would use in C# I am running into a recursion error. Picture should be attached. I believe I understand the reason for this error, which is that technically we are recursively creating these EM’s and therefore can have essentially an infinite amount in memory to interact with. This wraps into why I was wondering in the first place about interfaces and abstract classes. If my top Object was actually a interface instead of an actual class you would be able to declare it but it would not be instantiated until a constructor created the more lower down classes. This would get rid of this recursive error as I could check if the child EM is instantiated before I decided whether a function could be utilized on it. So my question to everyone is, is there a work around that would give me the same result or is there a more LabVIEW acceptable way to do this? Attached is my UML diagram, the error I am receiving, and the LabVIEW Project that I created to attempt to demonstrate the architecture I wanted. Thanks for any help! ClassOOTest.zip
  17. Hello LAVA, I have been working on a configuration interface lately for my framework, and have found a situation in which it seems desirable to be able to decide between a child and parent implementation of a class method at run time. The idea is that each level of a class hierarchy is responsible for some data which is to be configured at the start of operation. To avoid having to rebuild then extend the Config UI for each child, I have been trying to find a way to display each level (Parent, Child, Grandchild) UI in an "Options Dialog" style window. The user should be able to select the hierarchy level to view and configure it's data. I have attached some sample code to illustrate, but it basically entails a listbox for the different hierarchy implementations, and a subpanel to display the selected implementation. The code starts by traversing the class hierarchy to populate the listbox with any ancestors of the selected (Child) class that implement "UI.vi". Then it waits for the user to select one of these implementations before setting the class object vi Control reference, running the VI and inserting it into the subpanel. Note: It seems like it would be much easier to use the CBR/ACBR nodes to do this, but I was unable to figure out a way to call the different implementations, due to the dynamic dispatch terminals. Because this was not particularly straightforward to implement, I have a strong suspicion that it breaks OOP, is generally terrible, which is exactly why I am posting it here. Can someone give me a reason why this is a good or bad idea? LVOOP UI.zip
  18. I am trying to figure out if i'm missing something in my approach. I am using an Array of Objects as Class Data of a handler Class. I Dynamically add these Instanced to the handler and when i'm done, I'd like them to be released from memory. When adding the Instance of the class (using the Insert Into Array function of LabVIEW), I call methods to add the data, set a status and create a file backup of the object so it can be retrieved after a program restart. When I'm done I'd like to remove the Instance from the Array by using the Delete From Array function of LabVIEW and delete the file backup of the object like this: My question is if the Instance of the probe object still remains in memory after this and if so, is there any way I can tell LabVIEW to destruct it? Cheers, Robert
  19. Goal: Find the best methods (or at least some good options) for message decoupling that are simple to implement and efficient to execute. Background: Messaging architectures in LabVIEW that use a class for each unique message type are strongly coupled to the recipient process (aka ‘Actor’). This is due to the need within the message execution code (a method of the message class) to access the private data of the recipient process or to call methods in the recipient process in order to do the work that the message intends. (See Actor Framework for an example of this). The problem arises when you wish to send these messages across a network between two separate applications. In most cases, these applications are not duplicates of each other, but rather serve completely separate purposes. An example would be a client and a server. The client needs to message requests to the server and the server needs to push data to the client. For a process to send a message, it needs to package the inputs in the private data of the message class and then transmit it via the network transport (which can be implemented in multiple different ways and is not material to this discussion). In order to construct the message, the sender will need a copy of the message class included in their application. This will mean they will need to also load the class of the message recipient since it is statically linked to the message class within the method that executes the message. And since that will trigger many other class dependencies to load, the end results is the majority of the classes in the recipient application will need to be included in the sending application. This is not an optimal solution. So, we need to find a way to decouple messages from their recipients but still be able to execute them. My solution: The way I have been handling this is for each message that needs to cross the network I create a message class whose execute method calls an abstract method in a separate class (call this my network message execution class). Both the sender and the recipient will have a copy of these message classes and the network message execution class. Inside the message class’s execution method, I access a variable that stores an instance of the network message execution class and then calls the specific abstract method in the network message execution class for this particular message. In each recipient application, I create a child of the network message execution class and override the abstract methods for the messages I intend to receive, placing the actual execution code (and static links to the recipient process) within the child class methods. Finally, when each application initializes, I store its child network message execution class in the aforementioned variable so it can be used to dynamically dispatch to the actual method for message execution. The advantages of this are: Messages are decoupled between my applications. The disadvantages are: For each message I wish to transmit, I must create a new message class, a method in the network message execution class and a method override with the real implementation in the recipient’s network message execution class child and then edit the message class to call the method in the network message execution class. This also means that each application must have a copy of all the message classes passed between applications and the network message execution class. The problem arises when you add a 3rd or fourth application or even a plugin library to the mix and wish to decouple those from the other applications. You must either extend the current set of messages and the abstract methods in the network message execution class, having each entity maintain a copy of all of the messages and the network message execution class even though they never send or receive most of those messages, or you must add additional variables to your application to store different implementations of the network message execution class for each link between entities. So, now that you have read my long explanation, does anyone have ideas for a better way to solve this? I would love to simplify my code and make it easier to maintain, while retaining the functionality that class based message architectures offer. But decoupling must be addressed somehow.
  20. Hi, I posted this question in OOP forum, but may be the right place is here... Have you experienced that LV takes very long time to build executables when you use a certain number of classes? I have noticed that when my app uses many classes (e.g. 30 classes) LabVIEW IDE slows down ("busy pointer" appears very often during VI editing) and compiling executables takes more than half an hour. It's not due to my machine because larger projects are built in less time if they don't contain so many classes. Are there properties that can speed up the build?
  21. Hello, I am developing a PXI system and thought I would use OOP to do all the DAQmx calls for all the different cards in my chassis. It all looks nice and neat and works a treat when running in LabVIEW 2013. All my Network Shared Variables are updated on my host application and the host can happily control the PXI chassis. However, as soon as I try and create an executable to run at startup the code stops working, it simply appears not to deploy. There are no errors or warnings, the PXI executable simply no longer works. I presume I am missing something simple, like a missed check box or an automated deploy command. If anyone can see what I might be doing wrong then I'd be mighty grateful. My class structure is fairly simple LabVIEW Class >> DAQmx Class >> PXIe 6363 AI, PXIe 6363 DI, etc Thanks Malcolm
  22. Hi Everyone, This is my first post and am just beginning to learn OOP so please bear with me. I was curious on whether when you use a DVR to encapsulate a class i.e. force an initialization to occur before other methods, and then close the reference to that DVR. Is the class removed from memory completely or is it just the reference that is cleared. Thanks!
  23. Hi, Here comes a rather basic question but which I'm always struggling with since you can often argue both ways. Hopefully some of you have a few nuggets to share here... 1) A parent class should have no knowledge of any child class' concrete type, i.e. only data and methods that is inherently common to all decendents of that parent should be defined by it. 2) For dynamic dispatching to work the parent class must define virtual methods for dynamic dispatchees to work from. Those two rules often contradict each other. Methods vetted against 1) will often eliminate the possibility of 2). A specific example: Currently at GPower we're working on a set of classes that enables us to do a lot of stuff on all the different LabVIEW files. So, we have a parent file.lvclass and then a collection of specific children that inherits from "file", for instance vi.lvclass, lvproj.lvclass, ctl.lvclass, facadevi.lvclass etc. A) Generic stuff that has to do with any file obviously goes into file.lvclass data (together with data member access methods for each). For instance IsWriteprotected?, FileSize, FilePath and such. A FileRefnum should probably go into each child class to enable us to have it most specific. B) Then there are data elements that definetely has to do with each concrete file type and thus should be in each child class' private data, such as AllowsDebugging?, IsFPStyleOK?, Icon etc. - as those are only valid for a subset of file types. C) Now it gets a bit more murky; If we define data elements in file that each child can use to flag if it has this or that feature (like HasIcon? or SupportsProtection?), then you can ask each and every file type if it support that, before calling a method to work on that. For the subset of file types that supports a given feature (those that has an icon for instance) it'd be great to have dynamic dispatching though. But for that to work file.lvclass would have to implement virtual methods like GetIcon() and SetIcon() (where the latter maybe recalculates the IsIconStyleOK? data field for instance). But implementing these (numerous it turns out) virtual methods in the parent class, suddenly riddles the parent class with specific knowledge or nomenclature that is very specific to different subsets of descendent file types. I always vet the parent against each piece of information I'd like to put in there by asking myself something like this: Does my generic file know anything about disk write protection? Yes, all files deal with that, so it can safely go into file.lvclass. Does my generic file know anything about block diagrams? No, only a handful LabVIEW file types knows about block diagrams, so I can't put it into file.lvclass. But the latter forces me to case out the different file types in my code, so I can call the different specific methods to work on block diagrams for those file type objects that supports this. Hence, if I want to be able to just wire any file type object into a "block diagram worker" method I need dynamic dispatching, and that only works if my parent has a virtual method for me to override with meaningful code in a few child classes... How do you go about selecting this balance, on one hand abstracting the parent from the concrete types, and on the other hand implementing the necessary dynamic dispatch virtual methods in the parent? Regards, Steen I must add that I'm currently leaning towards the more pure approach of not mixing abstract and concrete. Thus I tend to omit dynamic dispatching except for the very generic cases. I only allow the "do I support this feature" flags into the parent data, and then I implement static dispatch methods for each concrete type - even though these static dispatch methods then will often be quite similar, but that is solved with traditional LabVIEW modularization and code reuse (like subVIs, typedefs and such). It works well, but I feel I don't get the full benefit of dynamic dispatching. But that is what I'd do in C++... /Steen
  24. I am working on some labview code that I really want to use OOP. I have some classes, ie, motor, relay, potentiometer, etc that I am using and wanted to incorporate in a state machine. I wonder if there are some good examples of this? I found a thread on here discussing it http://lavag.org/topic/13064-object-based-state-machine-pattern/ , but I am not clear if it answers my question. 1. When I try to wire a class into a state machine (while loop with a case structure), I always get a broken wire in the while loop. It says the wire type is different? Am I thinking of this incorrectly. I have a class object I put on the block diagram, i wire it to 'Initialize.Vi' and it breaks (there and on any vi from that class). Thanks,
  25. Hi, I am making a determined effort to migrate a particular application of mine over the fence to OO, but I would like to be "herded" towards using the correct or proper design pattern(s). This application of mine is a TCP Client app that allows the user to connect to one (1) test server as to display test data in various forms (i.e. tabular, time-histories, gauges, etc.) using a single tab control. There can be up to ten (10) such Clients logged in at one time to the same Server. I have read recently that several folks on NI & LAVA forums advise to move away from the tab control and to use sub panels instead. Combine that with this web page's neat UI plugin example, I seem to be getting close to finding the proverbial "light switch" in the dark room, but ... it could be something else .... Some notes: I do have LabVIEW 2012 at my disposal. The test server is written in C++. Down the road a bit we may need to encrypt the XML stream so I may need to put a LabVIEW web service in between the Server and each Client using SSL - if that's a future design bit to note here but not as important as the basic environment or use case of a TCP Client that displays data via several types of displays - which the display types will only grow in the near future as we all have experienced. So adding different displays should be as "easy" as possible. Note: My question was originally posted here, but I was advised to post it here on LAVA for a more experienced architect to respond. Thank you very much in advance !!! CS
×
×
  • Create New...

Important Information

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