How to implement interfaces or inheritance in LabVIEW?

Hi all

I try to implement oriented OBJECT in my LabVIEW code and require heritage or just an interface (such as might be required in java).  I have a good knowledge of OOP is just how do me in LabVIEW, I'm curious.

I'll try to stick with my own example for now, so that someone is able to tell me exactly how to implement this.

in any case, I have two different DMM and each come with their own GPIB commands to get the measures and set the measurement configurations.  This seems to be a perfect example to learn how to use inheritance.  I figured out how to make a class for each DMM but was curious as to how I might be able to create a parent class for each of them because they both require the same fields in their configuration (AC/DC, Measurment Type, rank, address VISA).  I think that I could create a parent class with these fields, then the methods of use of these fields and have then child classes inherit fields and override the methods of the parent class so that depending on what the user selected DMM, it would be able to use the correct class to issue the right GPIB commands.

If anyone can point me to a good example or explain how this could be implemented in labview that would be super.  I'm also browsing the forums LVOOP to LavaG trying to figure this out, thanks!

Brent

Brent,

LabVIEW help contains a lot of detailed information on the use of classes.  I recommend reading through it, before we begin with OOP in LabVIEW.  In the content of the Help window tab, search for "Fundamentals > LabVIEW Object - Oriented Programming > How - to's»  There is an article entitled 'change the legacy of a LabVIEW class' that should be what you're looking for.

Chris M

Tags: NI Software

Similar Questions

  • How to implement the wafer map using LabVIEW?

    Hello LabVIEW Masters!

    I have a project which includes control and searching for information on a PROBER. One of the difficulties I have now is how to implement a WAFER card using LabVIEW. According to the requirements of my client, the element of pads varies between 6 k and 23 k. I guess that do everything (a = a ctl/indicator led) will be a hell of a task, especially on how to effectively manipulate each elements. Does anyone have a better idea on the way whose that?

    Please, I seriously need your help...

    Thank you and best regards,

    Dennis DG

    Hi Dennis,

    This wafer GerdW post card appears to me as a sort of histogram (for example http://www.ni.com/white-paper/4158/en#toc3);

    Altenbach post well this example that shows how to use a plot of intensity to create a 2d histogram:

    http://forums.NI.com/T5/LabVIEW/overlay-plots-as-intensity-graph/m-p/211222#M119248

    Learn how it works and try to adapt it to your specific task.

    Alex

  • How to implement logical equations such as LabView?

    Hello

    I have this bit logical test I need to implement a Labview code.

    Can I use formula node or anything similar to this already in Labview?

    "((var & (1

    a certain number of bits. 0 is the least significant bit.

    Thank you

    Do

    Spin and not equal to zero

  • How to implement the ScreenUiEngineAttachedListener Interface?

    How to implement the ScreenUiEngineAttachedListener Interface? It is somewhat a mystery reading through the API.

    I have a class that implements ScreenUiEngineAttachedListener:

    public class UiListener implements ScreenUiEngineAttachedListener {
      public void onScreenUiEngineAttached(Screen screen, boolean attached) {
      }
    }
    

    Then I have a class MyScreen which extends from screen and has two methods:

    public void addScreenUiEngineAttachedListener(ScreenUiEngineAttachedListener listener) {
      super.addScreenUiEngineAttachedListener(listener);
    }
    
    private void removeScreenUiEngineAttachedListener() {
    
    }
    
    • What is the correct positioning of everything?
    • Can I define an instance of UiListener and pass in the addScreenUiEngineAttachedListener?
    • How to remove UiListener in removeScreenUiEngineAttachedListener?

    You will need:

    • an instance of your UiListener - probably a static member inside your UiApplication;
    • a method that allows to retrieve the reference to this instance of UiListener;
    • a call in your constructor for the screen at addScreenUiEngineAttachedListener (yourApplication.getUiListener ()) or similar;
    • potentially a call within your onScreenUiEngineAttached (attached screen, boolean) routine, the branch (attachment is false) : screen.removeScreenUiEngineAttachedListener (this);

    However, all this is too much work for no gain. Just override protected void onUiEngineAttached (boolean attached) in your screen class and make your logic there - all members of your class are accessible and all the code is placed where it belongs.

  • How to interface ADAM 4060 in Labview 7.0?

    I had difficulties in interfacing ADAM 4060 with Labview 7.0. I tested the device by using the utility software of Advantech ADAM and it works properly. So, its not the hardware error or failure.

    However, when I want the interface using Labview, I couldn't make it work. LabVIEW does not communicate with ADAM-4060. I try to use user libraries > Advantech DA & A > Advanve > SlowDIO > DioWritePortDword.vi, DioWritePortWord.vi, and also library standard srandard, COMWrite.vi

    http://docs.Google.com/View?docid=0Aak_OiJCAY8kZGd2dmpiMl80NmRxNmJrc2Y2&revision=_latest

    I use the right function? FYI, I'm newby of Labview.

    Can someone help me please? Thanks in avdance.

    a - kay

    Hi a - kay,

    Where did you find this instrument driver? I'm not on IDnet. What is the manufacturer? They may have more documentation?

    In the other thread, you will notice that it is simply a communication series. You may be able to write your own driver quite easily.

  • How to implement Canopen on FPGA to run the engine using NOR-9881?

    Dear,

    Your support will be highly appreciated,

    There is only one available for NOR-9881 example.
     
    Please note that the following materials were properly connected:
    cRIO-9024, cRIO-9113, OR-9881 and motor Nanotec (SMCI36 against L2818L0604-T5X5), the following
    sites Web shows the engine Nanotec in details:
     
    http://us.Nanotec.com/products/660-L28-linear-actuators-with-trapezoid-spindle/
     
    http://us.Nanotec.com/products/1041-SMCI36-stepper-motor-and-BLDC-motor-position ing-control /
     
    The main problem is how to configure the inputs and outputs, where, in most examples, the entry and exit have been automatically
    configured.
     
    the following three examples and I wonder how to start:

    1 - example Nanotec: dependent VISA controls for data transfer
     
    http://us.Nanotec.com/support/application-notes/LabVIEW-example/
     
    2 - reference example CANopen for series C OR - 9853 Module CAN:
    the NOR-9853 has default Can0 which was used in the code

    http://zone.NI.com/DevZone/CDA/EPD/p/ID/6093
     
    3 - from finder labView example: search for 9881 then choose
    NOR - CANopen_cRIO.lvproj, which depended on SDO orders for transfer orders
     
    The attached picture shows that NEITHER-9881 can be seen, after compilation and
    loading the bitfile FPGA.
     
    Please, please advice me:
    1. how to start?
    2. how to create variables of entry for NI9881?
    3. how to implement CANopen mode FPGA? where there is no CANopen palette.

    Thanks in advance and

    Hello!

    From my understanding, the 9881 can be treated from the FPGA, but only from the application of the RT. I think that the point 3 of your post examples of the use of the module fine.

    Kind regards

    Georg

  • How to pass a pointer in calling labview library using dll programmed in Labwindows?

    Hello

    I'm trying to interface a camera with Labview.  However, the camera can only be programmed in C, so I use Labwindow CVI.

    I need to pass a handle from the camera of a function to another, for example. leave an opencamera function to function setparameter.

    / * Loading the Qcam driver and open the first camera * /.
    Sub DLLEXPORT LoadDriverAndOpenCamera()
    {
    QCam_CamListItem cameraList [10];
    unsigned long cameraListLength is sizeof (cameraList) /sizeof(cameraList[0]);.

    load the driver
    QCam_LoadDriver();
    a list of cameras
    QCam_ListCameras (cameraList, & cameraListLength);
    listLength is now the number of available cameras

    QCam_Handle CMAH;
    Open the first camera in the list
    QCam_OpenCamera (cameraList [0] .cameraId, &hCam);)
    }

    Apparently, the caemraId is a long unsigned (unsigned 32-bit by 32-bit Labview 2012?) and QCam_Handle is defined as void *, so it is a pointer that points to a non signed 32 bit.

    When I only use C for programming, I can pass variable CMAH to other duties so it is declared as a global variable.  Ex, the following function can be Sub SetParameter(QCam_Handle hCam).  However, here, I trying to do a Labwindows/CVI dll and then call LoadDriverAndOpenCamera() through library function call in Labview.

    My question is: How can I switch CMAH to other functions in the same dll?  I have to add the parameter to the function? For example:

    Sub DLLEXPORT LoadDriverAndOpenCamera(unsigned long cameraId, QCam_Handle* cameraHandle)

    And then add two lines:

    cameraId = cameraList [0] .cameraId;
    cameraHandle = CMAH;

    in the service?  So I spend cameraHandle out?  However, the CMAH will always have kind of vacuum.

    Even if this is the case, how can I configure node call library on Labview?  In the arg parameter set up, I do not see pointers?  It seems that I can not put in place an exit node to be a pointer that points to an unsigned long.

    Thank you very much for your help!

    Best,

    Charles

    Hello Charles,

    I noticed that you posted something similar here. you have questions about the use of the call library function node?

  • Implement the json JWT with labview web token

    I need to implement of JWT authentication with labview, how can it be done?

    I'm not aware of an existing library of JWT for LabVIEW. You can see the site of JWT to the creation and analysis of JWT requires:

    JSON encoder / decoder

    base64 encode / decode

    and a signature / encryption method (commonly built HMACSHA256 depends on the Oracle application)

    JSON encoding and decoding is available for LabVIEW 2013: https://zone.ni.com/reference/en-XX/help/371361K-01/glang/flat_unflat_string/

    The other two are not available of NEITHER, but have implementations in the LabVIEW community:

    Base64:

    https://decibel.NI.com/content/docs/doc-5544

    https://decibel.NI.com/content/docs/doc-23233

    Signature:

    https://lavag.org/files/file/198-encryption/

    https://decibel.NI.com/content/docs/doc-22585

    If unfortunately JWT support is not provided by default, but all the necessary parts to the realization that he should be here.

  • How can implement you not with Tim Capsule and AirPort their simulation on the iMac?

    Hello

    How can implement you not with Time Capsule and AirPort their simulation on the iMac?

    I don't know what you're asking.

    AirPort Extreme is a wireless router.

    A Time Capsule airport is an AirPort Extreme with a built-in hard drive for data storage.

    An iMac is a Mac computer.

    An iMac is not a wireless router, so he is unable to perform the functions of a wireless router.

  • How we implemented personal signatures in Thunderbird?

    How we implemented personal signatures in Thunderbird?

    http://KB.mozillazine.org/Signatures_%28Thunderbird%29

  • How to implement point filters fixed for FPGA

    Hello!

    I am applying the bandpass filter Butterworth for FPGA.

    I managed to develop filters of fixed point that suits my needs, but I don't know how to implement on a table in a project after the FPGA code generation. I tried to understand it in the examples, but I was not very successful.

    My time to finish what runs, any help would be really appreciated...

    Any suggestions?... some examples?

    Thanks in advance

    I've already done that and solved the problem.

    In any case thank you and have a nice day

    Ljubica

  • How to change a file lvproj in LabVIEW?

    Hi all

    I have a complex project with a number of specifications of generation.  Each of these build sheet has the inside version number in several places.  Opening each build specification takes looooong for LV to treat, so the chore of bumping the version numbers on this project is a major pain.

    It works:

    • Close the project

    • Open the .lvproj file in Notepad ++

    • Find and replace if necessary

    • Save the file

    • Open the project in LV

    I just wrote a script from LV to do other things before generation and when I try to encode search and replace in labview (with reading from and writing to a text file), the project file will not be opened because it is corrupt.

    I guess it's a matter of unicode, but I don't know how to fix it.  Any tips?

    The XML code is still valid? I think you can tell by opening it in Internet Explorer. Simply make a copy of your .lvproj with the .xml extension and do a file/open in Internet Explorer.

    How can you "Find and replace" in LabVIEW? You use the features in xml?

  • How to implement the reading of data from a matte file on a cRIO?

    Hi all!

    I'm still not sure, it is plausible, but I'll ask rather before you begin complicating. So far, I found no useful information on reading in the data to a device of RT from a file (type of a simulation test - data is simulated).

    I have the MatLab plugin that allows the storage of data read a MAT file, which has a number of columns that represent the different signals and lines representing the samples at a time (depending on the time of the sample - sample every time has its own line of signal data).

    I have no idea how to implement this at cRIO.

    The idea is:

    I have some algorithms running on the controller of RIO in a timed loop. As the entries of these algorithms I need to access each of the values of columns in the row, which is the time of the sample (sort of a time series - without written actual times).

    I am fairly new to RT and LV development, so any help would be appreciated.

    Thank you

    Luka

    Dear Luka!

    I think the reading of all the samples in a single channel is exactly what you need here, because reading the files may take some time and is not deterministic, so it is best to read all the data in memory (or if this is not feasible due to problems of size, fairly large pieces may be sufficient). The table read can be provided and then in the loop simulating outings, something like this:

    I used here separate channels so it's more graphic, but you can build all the channels in a 2D array and array index corresponding to the samples fom 1 who. You can also use for loops with indexing as tunnels are setup and then you won't need the index functions and the number of iterations is also set automatically, but you have to take care of synchronization settings.

    Best regards:

    Andrew Valko

    National Instruments

  • How to get the evaluation version of labview for linux mint

    Hello

    Can anyone suggest me how to download the evaluation software of labview 2014/15 for linux mint?

    I knew the trial versions are only available for windows.

    Thanks in advance

    Best regards

    Manasa M

    According to this information, the Mint is not a Linux Distribution supported: http://www.ni.com/product-documentation/52786/en/

    I can't find the linux version on the page of downloads-I suggest you ask OR through your local office to see if they can provide you with a copy.

  • How to run the VI developed in labVIEW 2011 in its previous versions

    Hi all

    I am currently using LabVIEW 2011 in my PC at home.

    But, all my school's computers are installed with LabVIEW 2010 and 2010 SP1.

    How to run the VI developed in LabVIEW 2011 in its previous versions?

    Is there any conveter why?

    Concerning

    Prasanth T

    Open the VI in LabVIEW 2011 and use the file menu option, save for the previous Version.

Maybe you are looking for

  • Pouvez utility disk scan for malware?

    Utility scan disk for malware? And it can search the malicious software on an external hard drive?

  • Someone has perfectly answered my dilemma

    I am a new Member today of your forum. Someone has saved my life by stopping my neck - display was on his side on my satellite200 and I couldn't fix it.Vainly attempted to pass to the Toshiba support line. Even reduced to the Comet, they didn't. BUT

  • R & S FS300 pilot, "failed to load the front panel.

    Hello I am developing a software of remote control for Rhode & Schwarz FS300 with LabVIEW 2011 Student Version and VXI Plug & Play drivers downloaded from the official site: http://www2.Rohde-Schwarz.com/en/products/test_and_measurement/spectrum_anal

  • Updates Windows installation stuck at 50%

    My windows update has been installed for a week and still States it is only 50% full when I try to stop the instalation it won't let me

  • problem with the Luxor game

    Purchased the game via MSN games a year ago and finally made it through all the stages/levels. How to return to the starting point-first stage/level?