Appeal of c# classes for LabVIEW instruments

The c# programmers here in my company have developed a great c# class that contains all of the interfaces of instrument for our various test stations.  Instead of re - write all this LabVIEW code that would cause a maintainability nightmare, I want to use the class that they have created (and as an asset, tested and verified).

I can get to all different methods, etc. so, using the .NET / LabVIEW connectivity is not a problem.  In addition, it's a matter of how exactly should I create the interop so that it is usable for our effective use of LabVIEW programmers.

A quick description of the structure of language c#, using the Switch class for example:

Upper level of the class has all the features of base common to all switches, and then as is normal, specific instruments have common methods in their breast and a few additional methods specific to this model.

They use the Ifactory model for all this.

Now I can be reading too far into this, or perhaps not far enough.

I know that when we create classes in BT we can do a general change of class, and then have children of this class of specific instruments. In my case, I duplicated their structure and I all methods of higher level in a class of 'Switch', then a folder of children of switch has classes for each of the classes of children. I then put in place so that the child class inherits from the parent for each child.  All this with the intention of using dynamic dispatching.

My first question is: who don't already be managed in c# code?  By calling the method of the parent class, wouldn't not on the c# code to take the correct child?  Or is it since I was using just the class, but not all of the air capacity of c# (I'm NOT an expert in c# if it isn't obvious now) I'm having to manage the dynamic send in LabVIEW?

How exactly should I do after I have integrated LV class and configuration in pallets for future programmers? It's their programming, they know that they need a function from a specific switch, so they put that and by plugging in this interface of method, the class switch, it automatically performs the dynamic send call in the class (in fact, I typed, it made sense).  What I was wondering, is that we are so concerned about the adaptability / changability; We have a proverb which says that if Exchange you an equivalent switch in, it should work without having to re - write the code.  So of course, I am writing for this purpose.  Again, as I write this, I find to say to me, 'If you must use a particular method to pass type, because it is what is needed, then would still have an equivalent switch, with this same ability of method.

I know I have rambled on this, but these are the roadblocks which my mind throw out there that I have create the method interfaces.

Did anyone done something like this before? Is there an example that you could send me or tell me?  I can't believe I'm the first to try to take advantage of c# code that has already been written. I believe that I understand the nuances of make it right.

Thanks for reading and potentially for helping me through this. It's very appreciated.

Dan

You could still do the objects accessible .NET via pallets is to put them in a merger of VI - one that its content when it falls from a palette on the block diagram. You probably wouldn't want to do it for every single method, but if make you at least the major top-level classes or the available constructors in this way (or property or call node for a static class), you're going to do the hard part (finding the right assembly and class) easy.

Tags: NI Software

Similar Questions

  • How to use the class IIA for LabVIEW driver wrappers?

    Hi all

    I've read some texts on IVI compliance, but I have not quite how I wrap an IVI - COM to an IVI - C. Where is this done?

    In MAX, I see:

    -Configuration-> software-> IVI Compliance Package 3.3

    But no properties in there...

    I have an analizer spectrum available drivers are only IVI - COM, but I want to wrap them up in IVI - C...

    can someone tell me step by step how can I do this?

    or maybe tell me some beginner tutorial?

    Kind regards

    JPLO

    Hello JPLO,

    Before trying to communicate with your instrument using any sort of instrument drivers, you must confirm that you can connect at a lower level.  In most cases, this means through VISA, using MAX.  IVI - COM driver installation program should add a software module to the IVI Configuration, which is the MAX.  Most installers IVI - C also adds a pilot session, but you'll need to create a.

    We include adaptors IVI - COM for class IVI - C with PKI pilots.  Here's a knockout who talk about them: IVI-C class for specific drivers IVI-COM driver Support

    You can also simply treat the IVI - COM driver like any other ActiveX object.

    What type of instrument you are using?

    See you soon,.

    NathanT

  • Automing instruments LabVIEW without using specific and coding drivers for each instrument?

    Hello

    I'm new to programming in labVIEW, but I had a few questions about its use in automation and remote controlling several instruments.

    It is an ideal software for automation of various instruments remote control/test. Assuming that I have several different companies spectrum analyzers, I understand that labVIEW drivers of instruments or special VI who would control these instruments. But if I wanted that all these spectrum analyzers to say, to display on another computer using the remote control, but I wanted to use the same program for effeciency, is it possible to do so universally for all instruments using labVIEW? Or do I have to adapt this program for each instrument to instrument drivers cause?

    If labVIEW can do that, is - anyone had good success for such scenarios in other programming languages?

    Thanks in advance for your help.

    Look for the Abstraction Layer material (that you can implement with LabVIEW, even if it's a slightly advanced topic).

    The idea of having a specific Test and be able to enforce it against different Instruments, decided at run time, is the kind of situation that LabVIEW and use of HALs was designed to facilitate.

    The concept is to 'Levels of Abstraction'.  When you create a test, you can design it for an abstract Framistan, since all the Framistans are supposed to be able to measure Vorbels in the range of 0 to 100, so you just plug a generator of Vorbel to generate Vorbels in a certain sequence of Test (linear, random, quickly, slowly, pulsatile, continuous, you decide), measure your Abstract Framistan records readings and compare with the results you expect write the results in a nice report.

    Of course, Framistat of OR uses Ethernet as the means of communication, while HP uses a serial port (depending on the model, series settings can change) and uses of the Intel one. DLL to communicate with the low-level API.  So you also need to develop, for each specific instrument, an "interface" between its API and the Framistan abstract (not everyone uses Vorbels as the input unit, for example).

    So the good news is that it can be done, the bad news is that one of the best ways of handling this type of question on the programming is to use OOP (OOP).  A number of languages (LabVIEW, C++, JAVA) support OOP, but LabVIEW might have the advantage when it comes to interact with the material.

    I you are looking for Hardware Abstraction Layer?  Add LabVIEW to the search query and you should find some nice presentations by Elijah Kerry...

    Bob Schor

  • 2651 a conversion of TSP Script for LabVIEW

    Hello

    I have a problem on the conversion of all TSP scripts that contain functions and appeal for the end loops. I'm new to the TSP with models of trigger scripts. I used the Script Builder (TSB) Test tool and am able to run any TSP and generate raw data, but I don't seem able to convert most of the codes in the command of LabVIEW VISA or loader LV TSP TSP and run it to generate data... I can't find any tutorial or examples how to do it.

    Let's say that... Use the example of KE2651A_Fast_ADC_Usage.tsp (pulse) and I'll just focus on the portion of function CapturePulseV (pulseWidth, pulseLimit, pulseLevel, numPulses). I have seen a few examples of LV that says loadscript myscript and close on endscript.  I did a lot of different approaches, and I kept getting errors in particular the print function that I am not able to generate data through LV by to read the data in the buffer to inside the instrument. Some approaches, I have had no errors but no data... Some approaches, I got error-285.

    The part of the code TSP pulse that works in TSB is here (I'm not including loadscript and endscript) and what is the RIGHT way to modify the code for LabVIEW and run it and obtain data? Thank you:

    function CapturePulseV(pulseLevel, pulseWidth, pulseLimit, numPulses)
        if (numPulses == nil) then numPulses = 1 end
    
        -- Configure the SMU
        reset()
        smua.reset()
        smua.source.func            = smua.OUTPUT_DCVOLTS
        smua.sense                  = smua.SENSE_REMOTE
        smua.source.rangev          = pulseLevel
        smua.source.levelv          = 0     -- The bias level
        smua.source.limiti          = 5     -- The DC Limit
        smua.measure.autozero       = smua.AUTOZERO_ONCE
    
        -- Use a measure range that is as large as the biggest
        -- possible pulse
        smua.measure.rangei         = pulseLimit
        smua.measure.rangev         = pulseLevel
    
        -- Select the fast ADC for measurements
        smua.measure.adc            = smua.ADC_FAST
    
        -- Set the time between measurements.  1us is the smallest
        smua.measure.interval       = 1e-6
    
        -- Set the measure count to be 1.25 times the width of the pulse
        -- to ensure we capture the entire pulse plus falling edge.
        smua.measure.count          =
                        (pulseWidth / smua.measure.interval) * 1.25
    
        -- Prepare the reading buffers
        smua.nvbuffer1.clear()
        smua.nvbuffer1.collecttimestamps    = 1
        smua.nvbuffer1.collectsourcevalues  = 0
        smua.nvbuffer2.clear()
        smua.nvbuffer2.collecttimestamps    = 1
        smua.nvbuffer2.collectsourcevalues  = 0
        -- Can't use source values with async measurements
    
        -- Configure the Pulsed Sweep setup
        -----------------------------------
        -- Timer 1 controls the pulse period
        trigger.timer[1].count          = numPulses - 1
        -- -- 1% Duty Cycle
        trigger.timer[1].delay          = pulseWidth / 0.01
        trigger.timer[1].passthrough    = true
        trigger.timer[1].stimulus       = smua.trigger.ARMED_EVENT_ID
    
        -- Timer 2 controls the pulse width
        trigger.timer[2].count          = 1
        trigger.timer[2].delay          = pulseWidth - 3e-6
        trigger.timer[2].passthrough    = false
        trigger.timer[2].stimulus       =
                    smua.trigger.SOURCE_COMPLETE_EVENT_ID
    
        -- Configure SMU Trigger Model for Sweep/Pulse Output
        -----------------------------------------------------
        -- Pulses will all be the same level so set start and stop to
        -- the same value and the number of points in the sweep to 2
        smua.trigger.source.linearv(pulseLevel, pulseLevel, 2)
        smua.trigger.source.limiti      = pulseLimit
        smua.trigger.measure.action     = smua.ASYNC
        -- We want to start the measurements before the source action takes
        -- place so we must configure the ADC to operate asynchronously of
        -- the rest of the SMU trigger model actions
    
        -- Measure I and V during the pulse
        smua.trigger.measure.iv(smua.nvbuffer1, smua.nvbuffer2)
    
        -- Return the output to the bias level at the end of the pulse/sweep
        smua.trigger.endpulse.action    = smua.SOURCE_IDLE
        smua.trigger.endsweep.action    = smua.SOURCE_IDLE
        smua.trigger.count              = numPulses
        smua.trigger.arm.stimulus       = 0
        smua.trigger.source.stimulus    = trigger.timer[1].EVENT_ID
        smua.trigger.measure.stimulus   = trigger.timer[1].EVENT_ID
        smua.trigger.endpulse.stimulus  = trigger.timer[2].EVENT_ID
        smua.trigger.source.action      = smua.ENABLE
    
        smua.source.output              = 1
        smua.trigger.initiate()
        waitcomplete()
        smua.source.output              = 0
    
        PrintPulseData()
    end
    
    function PrintPulseData()
        print("Timestamp\tVoltage\tCurrent")
        for i=1, smua.nvbuffer1.n do
            print(string.format("%g\t%g\t%g",
                                smua.nvbuffer1.timestamps[i],
                                smua.nvbuffer2[i],
                                smua.nvbuffer1[i]))
        end
    end
    

    I finally solved it myself! I first create support shell, according to the documents, but the problem was with functions of scripts but I solved by introducing VISA separate, feature writing and THEN retrieve the data from the instrument directly by VISA buffer read more. I did TSP_Function Script Loader that allows simply copy/paste codes teaspoon (any * .tsp) of: TSB program or incorporated into this type of function and loader.vi, name (parameters), defined by its own pasted script then it will generate RAW files directly in the array of strings that can be broken into pieces or restructured into what you want as for the graphics, etc..

    That's all I really need to do, I can do codes of tsp in LV and get the data off of it easily via the function defined. Now, this Loader.VI behaves in the same way that TSB keithley-made program I use.

    Here I add Loader.vi Script TSP_Function (in LV 2011 +).

  • Is there a decompiler for LABView v4 - v6

    Hello

    One of our customers (pharmaceutical industry) has a LABView application compiled on Win98 + 10 years. The source code is not available, and it seems that no one knows what is under the hood. According to the dates of Win98, I expect to run a version of LABView between v4 and v6.

    Is there a decompiler software, ways to look at the source code or to retrieve information of bases to start reverse engineering.

    Thanks for you answers!

    Alex

    [email protected]

    The whole issue is a bit more complicated. Prior to LabVIEW 8.6 the internal resources of the executable was indeed an archive VI LabVIEW (LLB) and since LLBs didn't have a single hierarchy depth that is somewhat like a single directory. This caused trouble with the latest library LV based instruments as well as classes LVOOP drivers that uses the same name of VI, but with another library prefix each, so that LabVIEW had to move these files to directories external during the generation of executable files, to avoid name collisions.

    In all new versions of LabVIEW, the internal executable resource in which the screws are stored is actually a default ZIP file. You can always force LabVIEW use a LLB format to store files, options by checking the 'use LabVIEW 8.x file layout' in the advanced compile options. Now the ZIP resource was initially stored as a simple ZIP to the format of data resources, and that caused some problems because most ZIP utilities simply analyzes a file for the header of the ZIP file and open it as such, even if the ZIP file resource is anywhere within the file, so that almost all ZIP tools could open an executable of LabVIEW. NEITHER changed this format: ZIP tools can recognize him either.

    Now, yes you can look in the resource LLB and ZIP in the past (and still with a little extra effort) but before everyone screams oh "My precious IP is in the street" Please be aware that the only thing you can do for this resource is to obtain the names of VI and if you manage to load in the fall version of LabVIEW exactly just generic icons on a diagram to see the component connector. Unless of course you also check the "enable debugging" checkbox in the advanced build options, that leaves patterns and the frontpanels in the VIs and actually create something similar to a source distribution packaged.

    So without activate debug compilation option, someone is actually not much more than what he can do by opening any binary DLL created from C, C++, or any public compiler with the tool of Microsoft dependence and MUCH MUCH less than what you can get in any just put such DLL through a disassembler.

    And to my knowledge there isn't a disassembler as tool for LabVIEW VIs to date, and I would consider about 1 billion things more interesting to do than to try to create such a thing.

  • How to convert the file with VI for LabView .lib to CVI?

    Hello

    I have the .lib file for my lock in the amplifier. The lib file is written for labView and already contains a visual interface (like ActiveX). The point is that I need this file for programming in CVI (8.5). How can I convert a LabView ICB .lib?

    Thank you.

    Denis.

    You said that you had a .lib file and in fact you have an llb file. There is a huge difference between an "i" (eye) and a 'l' (ell).

    There is a LabVIEW Instrument Driver Export Wizard but it's only for new pilots of project lifestyle and you need LabVIEW. There is no other way to convert a LabVIEW driver to a driver of the CVI. If the LabVIEW driver uses methods and properties of the ActiveX, you will need to write the same thing in CVI.

  • What type of support for labview usb protocols?

    Hello guys I want to connect a device to your pc via a usb port and I want to use labview to analyze the data.

    But first of all, I would like to know what usb protocols support for labview.

    USB, USB CDC and other TMC?

    I ve read labview recognizes a raw device to the usb, but what is? Is it VI to read and send data, or I have to do? If these VI exists, they do the handshake? flow control?

    Thank you.

    Please read the chips and have a look at the USB specification (it is linked to in the nuggets).

    TMC, CDC, MAss Storage are all built on the basic USB protocols.

    LabVIEW has no built-in support for one of these classes of devices except Test and measurement.

    Shane

  • Mcc usb 1208FS for labview 10.0 connection problems

    I have version 10.0 of Labview installed on windows XP computer. I want to connect MCC USB 1208FS for Labview. Not able to see the device MCC in device of measurement and Automation Explorer interface. It appears? Please let me know the steps to access the device of the MCC in Labview.

    I can see the MCC card detected in the software InstalCal of MCC supported. I installed the latest version of the CMC the CMC site software.

    As far as I know, you will not be able to see physical computer as in MAX.

    From the file of help from MAX: "Measurement & Automation explore (MAX) allows to access your National
    Instruments of devices and systems. "that is material MCC is not a feature of National Instruments.

    Why not stick with the InstaCal software and the MCC screws provided?

    Ian

  • modulation toolkit for labview for embedded controller PXI-8106

    Hello

    I have an on-board controller: 8106 PXI OR PXI 5661 and 5671. He came with DAMA RFSG but not the Modulation Toolkit (TM). Now I cannot access some screws RF Toolkit as NI DAMA close.vi etc. I opened a code that uses this DAMA close.vi and since I donot have probably MT, I can't run since the claim code to choose the path!

    I checked for the TM in the start menu-> all programs-> national instruments-> modulation but in vain. Also, I opened MAX and under "Software", I could find DAA, pilots RFSG etc but not the Mt.

    When I checked online it says I have to buy the cd/dvd of MT. If I do, how I run on my controller?  What are my other options?

    PK

    Hello

    I think I solved the above problem. I had to install the RFSG and ACD for labVIEW. For some reason, the equipment was delivered to me with DAMA and RFSG, but only for C. This part was misleading because I saw on my National Instruments system but not the DAMA DAMA and RFSG vi. Also spectral measurement Toolkit (SMT) has not been installed. SMT is a MUST for the good functioning of the RF VSA. After you install the required drivers and tool boxes, I am able to run and use the VI completely.

    Thanks for your support Abhishek.

    PK

  • You looking for LabVIEW Keysight/Agilent/HP 6634 B drivers

    Hi all

    I tried seraching everywhere but I can't find drivers for labview for power supply Keysight/Agilent/HP 6634 B. The only ones I can find are for the 6xxxA series, but not the series of 6xxxB.

    If anyone has or knows where to find them, I would be very grateful!

    Thank you

    You are in error. This is indeed the driver LabVIEW, class IIA type. If you don't like that this driver calls dll, as I wrote above, you could simply create your own driver following the information of the SCPI, located in your device manual package...

    If you want to use the driver, follow these steps:

    1. Download and install the package corresponding to your version of LV IVI: http://search.ni.com/nisearch/app/main/p/bot/no/ap/tech/lang/en/pg/1/sn/n8:3, ssnav:ndr / sb / - nigenso4-...
    2. Restart the PC
    3. Install the driver of the IVI of the site: http://sine.ni.com/apps/utf8/niid_web_display.download_page?p_id_guid=E3B19B3E947E659CE034080020E748... (direct link to the exe: http://sine.ni.com/apps/utf8/niet_download_id.log_ids?p_profile_id=1270941&p_doc_id=E3B19B3E947E659C... )
    4. Enjoy:

  • Why the basis of NOR-DAQmx for LabVIEW options are grayed out using a custom installation (with Action: Skip)?

    I try to install NOR-DAQmx Base 3.7.0 LabVIEW 2013 (LV is installed). When I try to install Standard, it does not settle for LabVIEW (only the tools common and C and USB), but gives a successful installation message.

    When I try to custom installation, all the "...". for LabVIEW 20XX"options are unchecked, dimmed and Action says 'Skip '.

    I try this on a 2011 MacBook Air 11 '' running OS 10.9. LabVIEW works very well.

    Thanks for your suggestions.

    Hello

    DAQmx Base gray if poster LabVIEW Installer is not detected on the LabVIEW support system. Did you install LabVIEW and then move it to another location?

    The LV location controls DAQmx Base is...

    / Applications / National Instruments/LabVIEW LabVIEW.app

    Thank you

    Steven T.

  • Data for LabView - Motorolla RAZR dashboard

    When view LabView, the Android Market data dashboard tells me, 'your device is not compatible with this item."

    I have a Motorola RAZR.  Any suggestions?

    Hello duane,.

    At that time, dashboard of data for LabVIEW is available on shelves.  In addition to the Apple iPad and iPad 2, Android tablets only under 2.3 or later are supported.  To support the Tablet 7 '' Android, we had to make some design changes.  It should be even more changes due to the small size of a phone.  We might consider a version for phones based on the popularity of the application on each platform and the information received in return.  For more information, see the product page or the LabVIEW Web Interface Builder and data dashboard discussion forum.

    Grant M.
    Senior Software Engineer | LabVIEW tablets | National Instruments

  • Support for LabVIEW 2016

    Can someone tell me what VirtualBench drivers will be available for LabVIEW 2016?

    Release date is... right now! NOR-VirtualBench 16.0, with the help of LabVIEW 2016, is available here:

    (My apologies for yesterday, does not but it takes a little while to download pages to go live.)

  • Support of NOR-DNET for LabVIEW 2013

    We currently use OR DNET 1.6.6 with LabVIEW 2011. I installed LabVIEW 2013 now also on my computer and tried to synchronize all of the drivers with my installation of LabVIEW 2011.

    Well, it seems that NEITHER-DNET does not support LabVIEW 2013, at least officially. compatibility of Version of LabVIEW and NOR-DNET indicates that NEITHER-DNET 1.6.6 supports 2011 NOR-DNET 1.6.7 2012 LabVIEW and LabVIEW.

    The list NOR system driver November 2013 set OR DNET 1.6.7 defined pilot. When I try to install it, there is no support for LabVIEW 2013.

    My question is, if there is a plan to include support OR DNET for LabVIEW 2013 or later in the game to pilot?

    I copied the directories vi.lib\DeviceNet and vi.lib\nidnet of LabVIEW 2011-2013 and I can load my programs without any problems. I always did not build an executable and does not run on the test set-up, but projects can be loaded in LabVIEW 2013 without any screws of brocken. should I expect any problems running LabVIEW 2013 with the NOR-DNET to 1.6.6 and 1.6.7 driver?

    Nick

    There should not be problems but it is a former pilot, we will not be updated for the future version of labview.

  • Is there a Module NXT for LabVIEW 2010

    Is there a Module NXT for LabVIEW 2010?  If not, are there plans to bring a available and if so, when?

    Hello

    I found a link to a download for the module 2010 here.

    I hope this helps.

Maybe you are looking for

  • Re: Error while restoring my Equium U400-124

    I started restore my U400-124 with the recovery but, disc to halfway, even if she has a message error that a file failed to be copied and only allows me to go out and turn off the power.How do get me another copy of the recovery diskette that is not

  • Satellite A300 GPU upgrade

    Hello world I have Satellite A300 Hi and wonder if it is possible to change a graphics card in this laptop A300 (ATI Radeon 3400HD)? Thank you!

  • not able to hear the sound of the cellular caller

    my brother bought a Apple Watch 38 mm sport. But after the update to os 2.1 we couldn't here the voice of the caller please say a quick solution Rgds Ajith

  • Zoom in the photo and the line at the same time?

    So, I accomplished the ability to zoom in/out of an image on the front panel, with user input. And I discovered separately how to programmatically create a line in the block diagram with draw several Lines.vi, and it appears on the front panel to run

  • WRT 120 n PPPoE config problem

    Hello I have been using my wrt 120n with my network pppoe for a long time. Now I just reset the router and now I have a problem with the connection. I put my username and pass into Control Panel, clone my MAC and when click on connect button on the s