'Normal' code and OBJECT-oriented programming code in the same project

Hi guys,.

Have large existing application written in ordinary data workflow code.

Thought to add a new module, but he wrote in OOP - to learn.

Is it possible to add OBJECT-oriented programming code to an existing project?  If so, it's a good idea or not?  What kinds of things should I be conscious re. mix of types of codes?

Thank you.

LVOOP is a natural extension of type-def clusters in libraries, so he has no problem mixing with 'normal' LabVIEW code  The only precaution that I recommend is the following:

Class libraries always loading all their confined subVIs (called "methods" in the jargon of OBJECT-oriented programming), and the standard libraries of LVLIB always loading libraries contained everything (including class libraries).  This behavior "one thing costs so everthing charge" may be a domino effect through your project with all sorts of unnecessary things from loading.  To avoid this, be careful putting classes inside libraries and don't always put subVIs in classes if they do not need to be (I often have a regular library to hold 'to support' subVIs to a set of classes.)

-James

Tags: NI Software

Similar Questions

  • I'm still not sure how custom control and object-oriented programming interact, can someone enlighten me please?

    I spent some time trying to understand the relationship between the custom controls and object oriented programming. However, it is not quite clear to me yet.

    What I want to do:

    I want to have a custom control and hide its workings from the rest of the blockdiagram, so I don't have to wire for each similar object. Not only because I'm lazy , but also to keep the clean pattern and avoid mistakes.

    for example, a graph, a numerical factor and a button.

    When the button is pressed, the x scale must be changed according to the factor.

    So, this looks like a job for me to object-oriented programming. Once I created something that can do this, I can use it all through my program. The code that redraws the figure when you press the button as part of the object, so I can't connect extra wires and add a value change event when I add a new chart.

    Is this possible at all? I tried, but did not quite understand this time. I have to admit that I'm pretty new to OO programming and make custom controls. I use typedef clusters ' ed most my code so far, which works very well. But it's always a cluster of stupid, the only way to have nothing at all is in the block diagram in VI you use it in.

    The only thing I could come up with so far is to add an "event handler" Subvi who does and that he accepts a reference or a local variable to an object. Then, this sub - VI and the variable or reference can be put in parallel with the other stuff in the main loop of the program. But there must be a better way somewhere?

    I don't think I can solve this problem of definition of the objects of the Panel before custom and methods so that it can interact with the objects that it represents without help. I get the feeling that I must have missed it somewhere. The pointers will be appreciated.

    Thank you!

    Jacco.

    Jacco K wrote:

    What I want to do:

    I want to have a custom control and hide its workings from the rest of the blockdiagram, so I don't have to wire for each similar object. Not only because I'm lazy , but also to keep the clean pattern and avoid mistakes.

    ...

    The only thing I could come up with so far is to add an "event handler" Subvi who does and that he accepts a reference or a local variable to an object. Then, this sub - VI and the variable or reference can be put in parallel with the other stuff in the main loop of the program. But there must be a better way somewhere?

    Thank you!

    Jacco.

    Hi Jacco,

    These two things are exactly what are the Xcontrols, a basic VI with a façade that has an event structure (the façade VI).

    If you have any questions, I'm happy to guide you.

    Tone

  • Navigation in AS3 OBJECT oriented programming Menu does not

    OK, so frame 1 in the timeline/layer, I have this code

    Stop();

    var btn1:MCButton = new MCButton();

    Btn1.x = 1048;

    Btn1.y = 300;

    Btn1.label_txt. Text = "play";

    addChild (btn1);

    Btn1.gotoAndStop (10);

    var btn2:MCButton = new MCButton();

    btn2.x = 1048;

    btn2.y = 380;

    btn2.label_txt. Text = "help";

    addChild (btn2);

    var btn3:MCButton = new MCButton();

    btn3.x = 1048;

    btn3.y = 460;

    btn3.label_txt. Text = "highscore";

    addChild (btn3);

    and now I have a MCButton class (.as)

    package {}

    import flash.display.MovieClip;

    import flash.events.MouseEvent;

    SerializableAttribute public class extends MovieClip {} MCButton

    public void MCButton() {}

    manufacturer code #.

    Stop();

    this.buttonMode = true; a class film btn

    this.addEventListener (MouseEvent.MOUSE_OVER, sensitive); listen for a score event mouse

    this.addEventListener (MouseEvent.MOUSE_DOWN, down); listen for a mouse down event

    }

    private void hover(e:MouseEvent):void {}

    this.removeEventListener (MouseEvent.MOUSE_OVER, sensitive);

    this.addEventListener (MouseEvent.MOUSE_OUT, out);

    this.gotoAndStop (2);

    }

    private void out(e:MouseEvent):void {}

    this.removeEventListener (MouseEvent.MOUSE_OUT, out);

    this.addEventListener (MouseEvent.MOUSE_OVER, sensitive);

    this.gotoAndStop (1);

    }

    private void down(e:MouseEvent):void {}

    this.removeEventListener (MouseEvent.MOUSE_OVER, sensitive);

    this.addEventListener (MouseEvent.MOUSE_DOWN, down);

    this.gotoAndStop (3);

    }

    }

    }

    OK so I want btn1 (which is in my diapers) to frame 10, where I have a different menu for 'easy', 'medium' "hard", I put btn1.gotoAndStop (10); but that doesn't seem to work, so I'm really confused on what im doing wrong.

    Please help me,

    Thank you.

    You can not remove sth. not created:

    removeChild (btn6);

    ...

    var btn6:MCButton = new MCButton();


    you try to remove btn6-9, before they were created

    I understand why you want to do, but you must make sure that the part to be removed is left side first.

    You can do this by ensuring that the button you are trying to delete is really there

    Change each line that removes sth. TO:

    {if(btn6!=null)}

    removeChild (btn6);

    }

    {if(btn7!=null)}

    removeChild (btn7);

    }

    etc.

    Caution:

    Trying to set up a Navigation like this can not be considered good practice to OBJECT-oriented programming.

    That's why I said you should be aiming for a solution that does not rely on navigation of the timeline.

  • Queue in object-oriented programming

    Hello

    I'm currently building multiple classes for the different data acquisition devices. What they all have in common, is that they use a 3D array of integer in the data buffer. I want to be able to switch between devices, so I decided to create a VI called "Record.vi" and the use of dynamic allocation to decide what device to call at run time.

    But I don't want a buffer to separate data for each device, so I will try to figure out how to create a more "global" space to save my data. Now, I decided to use a queue for this (as I don't want to LabVIEW to make copies of my table 3D all the time). My question is now how the queues are really handled in object-oriented programming, because in non-object oriented programming, if I create a queue and name it, say, 'data' and create the queue even elsewhere (again with the ' data' as name), I have access to the first queue created and do not get a new one. If I create now, for my problem, a class parent where all devices data inherit from and make a member variable "queue in 3d-table", what will happen? All the data devices that inherit from this class calls the same queue? Or it is duplicated? What is the best way to use common storage place in all the data devices? A global variable in the parent (that is, a static variable) class? Or should I create a 'normal', accessible global variable of all the screws?

    Thanks for the help!

    Christian

    If you do not want the child to use the buffer of parents can create an override for the child who creates his own stamp.

    Named queues the override VI could use its name in the name of the queue.

    For non designated queues, just pass the reference.

    Notes:

    DVR (data value reference) is also another way to share a buffer.

    3-d arrays:

    Unless all dimensions of thre sense I generally avoid them because they rate of N cut into cubes where "N" is the largest of its very small size (or something like that) so just a slice of the buffer bigger (because of processing delays) the blow (voice of experience speaking).

    Ben

  • OBJECT-oriented programming using global vars, best way to do it?

    LS,

    Im a beginner when it comes to OOP.

    Not wanting all through calls to the class, I want to be able to have some application globals.

    Can set their standard package?

    Should I create a static class globals.as with vars?

    What is the right way to do this?

    Any help is greatly appreciated.

    Mac

    first of all, I would say that there are few cases where, you would need global variables, I have not used any in a long time and at the moment, I can't imagine any situation where I would do it. Although saying that it may be the easiest solution if you are new to OBJECT oriented programming.

    If I had to I would use a static class with vars, as you say

  • (help) how to extend textbox of scene to the method of object-oriented programming

    Hi guys, just a simple question. I have a box of text inside the scene. I just want to know how will access using the methodology of object-oriented programming. Thank you for your help guys.

    Select the textfield and then assign it and the name of the instance in the properties panel. If you do not see an option for this in the properties panel, you must change this setting to be a dynamic textfield.  Once you have an instance name are entrusted to him, you use this name to target for what you want to do with it.  For example, if you call it 'tField', then to give him a text you would use...

    tField.text = "of the text."

  • A matter of OBJECT-oriented programming

    I am new to OBJECT oriented programming, this is probably a stupid question, but if I want to create an app that involves students it is necessary to create a class of studen in as3.0? If so, it is also necessary to call this class when I'm querying data from my db?

    Thank you.

    Well, more like a question of application of an OO one design!

    in any case you do not have to! But it is certainly a good idea to have an object representation of your business domain artifacts.

  • When I try to defrag, a window opens and closes and a file download-security warning. A loop repeats. Other programs to do the same thing. Please help me fix this loop? SOS?

    When I run defrag, an IE window opens and closes and a file download-security warning comes up and asks me to run or save the file name: c:\windows\system32 dfrgui.exe, if I hit then another warning of IE - sec stands up and says 'the Publisher could not be verified. Are you sure that you want to run. I struck and the loop repeats. I run a diag of the F10 boot menu with dell. They say that its software and non-material, pay! Microsoft says that Dell is responsible. Other programs to do the same thing. I've updated and rerun my AVG security without error. We are automatically updated, and no other programs were added. Please help me fix this loop? SOS?

    Vista - open file - security warning
    http://www.Vistax64.com/Vista-security/125044-open-file-security-warning.html

    How to repair the operating system and how to restore the configuration of the operating system to an earlier point in time in Windows Vista
    http://support.Microsoft.com/kb/936212/#appliesTo

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
    http://support.Microsoft.com/default.aspx/KB/929135

    Your programs launch properly from Safe Mode?  Or Normal Mode if you create another user to test with?

    Vista advanced boot options
    http://Techblissonline.com/Vista-advanced-boot-options/

    Try running ChkDsk to check your drive for errors. Right click on your drive icon / properties / tools / error checking.  Try first by checking do not each box (that it will run in read-only mode) to see if it reports any problems file or hard drive.  If so, restart it by checking both boxes and restart to allow him to attempt to fix any problems found.

    I see a lot of recommendations here for programs such as -

    Malwarebytes' Anti-Malware
    http://www.Malwarebytes.org/MBAM.php

    SuperAntispyware
    http://SUPERAntiSpyware.com/

  • What is the difference in verses apps for each of the programs to purchase and download it?  They are the same thing and they are simply called "apps"?  Are the applications of complete programs?

    What is the difference in verses apps for each of the programs to purchase and download it?  They are the same thing and they are simply called "apps"?  Are the applications of complete programs?

    Yes.

    Adobe uses confusion of terminology in their efforts to explain things.

    Cloud desktop applications are the same as the purchase of the software on disk in the days avant-nuage. for example, the Photoshop Cloud desktop application is the full version of Photoshop CC 2015.

  • Help! CC of PHOTOSHOP: I want to reproduce the same project more than once and to modify their dynamic objects linked separately as different projects - can you help me? Please

    I want to reproduce the same project more than once and to modify their dynamic objects linked separately as different projects - can you help me? Please

    If related files please consult are located next to the file that contains the duplicate folder and edit files duplicate so corresponding should translate into changed content in the file duplicate.

  • Copy-paste an object of front panel to the same xy location

    Hello

    Just a practical question, but I would need very often this kind of functionality:

    How can I copy - paste an object of front panel to the same location? Lets consider the I have a TAB container, and on the first page, I have a chart. I would like to make a graph even on the second page tab, but at the same XY location compared to the TAB container.

    Thank you very much!

    HM, I just realized, there is an option 'double page' for the TAB containers and it's magic for me, creates the exact copy of all the objects

  • j105el envy: envy of hp can not right and made a left click at the same time

    my hp touchpad cant hp envy envy cannot not right and made a left click at the same time. I don't know if it's a driver. because of this I can not play games like GTA cause I need do a right click to aim and left click to shoot. is there a solution to this

    @gwatanaj ,

    Hello and thanks for the display on the HP support forums.  Here is a link that may be useful.

    HP laptops - use and troubleshooting of the TouchPad and ClickPad (Windows 8)

    What you are trying to do may not work with your touchpad.  Normally when it is best to use a mouse.  The hardware is built to be different and you might find it easier to work with.

    If you need help please post back.  First of all, check out this link.

    Tips for the "very best question.

    So, please indicate your model full and product number.

    I hope hear from you soon.

    Thanks again and have a great day.

  • In Windows 7 Action Center, MSE, and Windows Defender convertible 'ON' at the same time?

    In the center of Action of Windows 7, Microsoft Security Essentials (MSE) is enabled.  I tried to turn on Windows Defender 'manually' and get a status of "OFF"OBSOLETE"? that quickly toggles back and forth

    I'm trying to maximize my options "malicious."  I have NOT tried turning 'OFF' MSE to see if Windows Defender will be 'ON '.

    My real question is, can MSE and Windows Defender, being 'ON' at the same time or are mutually?

    A "full scan" using MSE detected the following malicious program "trojan:Win32 / Tracur.AV". I immediately deleted it. I think it's GONE!

    My "quick" weekly scans did not detect this malware. What a scare on my new laptop TOSHIBA P750.

    Now I take the time 'always' do a full scan.

    Help

    Hello

    Welcome to the Microsoft community.

    If you use Microsoft Security Essentials, there is no need to use Windows Defender. You can disable that and just let Microsoft Security Essentials run things.

    You should only use an antivirus program. using several programs at the same time will cause problems.

    Please refer to this link:

    http://answers.Microsoft.com/en-us/protect/Forum/MSE-protect_start/Windows-Defender-and-Microsoft-Security-Essentials/5309cb8d-02e1-40E8-974f-0dcedb9ab9fd

    It will be useful.

    Let us know if you have any questions about Windows and we will be happy to help you.

  • Using clips with different frame aspects and pixel in the same project

    Hello

    I have two clips:

    clip1: AVCHD 1440 x 1080 and the rationing of 1.3333 pixel aspect (the ratio of the image is 4:3)

    Clip2: AVI 720 x 576 pixel aspect ratio of 1.0940 (the ratio of the image is 5:4)

    I want to use the two clips on the same project.

    I chose a project suited to the preset clip1. (in this case most of my images will be of this format).

    If I do not make any changes to the elongation of pixel (using the Interpret Footage) the result is that the letter boxing serves around clip2. It is acceptable but not ideal.

    Can I change the format of clip2 pixels so that it is the same proportions as clip1? If I do this but I don't eventually clip2 distortion? What would be a worse result than the current situation with letter-boxing.

    Can someone advise; is it possible to merge these elements from two sources into a single output seamless file?

    With our thanks

    -Justin Wyllie

    Justin,

    If the IRON Clip 2 (size of pixels) is correct, i.e. the film doesn't look like stretched or squeezed, I wouldn't do any adjustment to that.

    To reduce or completely remove the black borders around it, you can adjust the fixed effect > Motion > scale, to fill the large size of the frame. Note: due to the difference in image format, to fill the full scope of the project, you will be actually reframe some of top and bottom. Using the fixed effect > Motion > Position, you can adjust exactly where culture goes, say all high, or to all of the background, or by a different ratio of high & low. This choice must be based by the framing of the topic in Clip 2. This choice is yours.

    Note: when scale upwards, quality will decrease, but maybe not too difficult to use only images, but the decision is yours also. There are several programs, and some that are plug-ins, this top-floor a little better than the Motion > pre scale. I would investigate those. One Magic Bullet Instant HD Red Giant, was used by many, even if some users were not enough to buy the pleasure. Just something to consider.

    Good luck

    Hunt

  • How to play stereo mix music and sing in my microphone at the same time?

    Hi guys, need help with Realtek HD audio driver

    I want to play stereo mix music and sing in my microphone at the same time... not for registration but in chat room, say.

    I'm using XP... Toshiba Satellite S4747 laptop
    In the Realtek software "Realtek HD audio input" microphone and two stereo mix... but I can only select one at a time...

    All solutions please thxxxx

    On a different note... a friend of mine using a non-Toshiba laptop with win XP has an older version of the Realtek audio driver and select the mic and stereo mix at the same time... I downloaded this version in my laptop, but still, I can choose only one at a time...

    Check that the audio settings of Windows and don t forget in the Realtek HD audio Manager. You can find it in the control panel.

    I think that your microphone is on Mute check so this.

Maybe you are looking for