LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Replace HP4140b libraries with keithley 2450&2401 in my vi

Hi everyone. I'm relatively new in Labview. A few months ago I modifιed a vi which initial role was to make Id-Vg diagrams of MOSFET with a HP4140BpA meter/DC voltage. I modificated it in a  sensing version which makes a Id-time diagram for specific Vg,Vd (inputs by user in the front panel). Everything OK so far. 
Now I have to make the same sensing version work with Keithley 2450 and 2401. One will produce Vd and measure Id and the other will produce Vg and measure Ig (current leakage). I've set up the required configuration for this combined measurement and it works properly (no remote control-without labview). My question is if I can do that with Labview, that is replace the 4140b components in my program with the proper ones from 2450 and 2401. The program should be the same except for the leakage current which isn't in the initial sensing version.

 

The vi is written in Labview 8.2 and the new version with the 2450&2401 have to play with Labview 2013

Download All
0 Kudos
Message 1 of 8
(3,413 Views)

The above vi seems to be locked. I replace it with the unlocked below.

0 Kudos
Message 2 of 8
(3,369 Views)

I understood that you want to take that VI and all the vi's that are in it replace them with the vi's of Keithley 2450 and 2401. Is this correct? because I didn't understand very well what you are trying to do. If what I said is correct basically you can do it but you need a very deep knowledge of what you are doing because each driver is made for one specific hardware. It's better for you create one new application with the respective drivers and start from there.

0 Kudos
Message 3 of 8
(3,326 Views)

Yes, you've understood very well.

0 Kudos
Message 4 of 8
(3,287 Views)

There are some LabVIEW Objects examples of doing this, with one listed here -- Hardware Abstraction Layers Using LabVIEW Object-Oriented Programming.

 

If you are not "into" LabVIEW OOP, you can still use the idea of an API to help ease the transition between the two types of hardware.  Basically, what you do is to decide what functions you need.  For example, they might be "Initialize Device", "Set Sample Rate", "Take Samples", and "Stop Device".  The two devices, of course, will implement these functions entirely differently, but you can "hide" that level of detail within a sub-VI called "Initialize Device" that might have, as a parameter, the device you plan to use.  Alternatively, you can use a conditional Enable/Disable structure to "hand-make" the function work for the specific device you are using.

 

The advantage is that your main code doesn't change.  You now have sub-VIs that carry out the functionality for two devices -- if you need to add a third, you only need to modify the API functions.

 

Bob Schor

0 Kudos
Message 5 of 8
(3,281 Views)

Thank's for the response Bob, it looks promising, I'll be able to check it in a couple of months. There's something wrong with the  link you provided  ,  it returns "Sorry, your request failed. A notification has been sent to the development team to investigate.

Exception ID: 3D2EA688".   I've found this tutorial http://www.ni.com/webcast/3431/en/, I hope it's sufficient.

0 Kudos
Message 6 of 8
(3,238 Views)

Oops, it is broken for me, as well.  I actually went to a presentation where they discussed how to do a HAL using OOP -- there was also code, but it was "pretty bad" (I recall trying to clean it up, and succeeding, but not really understanding everything I was doing).  I went to look again for a link -- there are some newer (and probably working) links, but the most recent ones are even fancier, and (I suspect) may be even more of a challenge for novices (and I'm including myself) to follow.

 

But here (and I hope the link still works) is a talk Elijah Kerry gave at NI Week in 2011 that is about OOP, but includes the HAL stuff, and a link to the Hands On Exercise (probably with solutions).  Oops, he talks about HAL, but doesn't have the HAL-specific stuff.  Let me look some more (at least I'll know it if I find it ...)

 

Well, it is not easy to find any more, but I think this is the code I was thinking about.

 

Bob Schor

0 Kudos
Message 7 of 8
(3,189 Views)
For an existing solution, consider using IVI. This abstracts the instrument functions to those in defined classes though I have not checked to see if IVI drivers are available for your instruments. NI provides many and vendors provide them as well.
0 Kudos
Message 8 of 8
(3,158 Views)