Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I use a labview VI as a CVI instrument driver

I have a VI for the Keithley 485 that would like to convert into a form usable by CVI. I don't have labview so I cannot generate a DLL based on the VI.
0 Kudos
Message 1 of 9
(3,575 Views)
You wont be able to use that VI directly in CVI without making a dll out of it. You would need to get in touch with the manufacturer of your instrument to see i they can provide you with a C driver for your instrument.

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 2 of 9
(3,575 Views)
daquiy:

What does this VI do, and where did you get it? Is it part of an instrument driver, or available anywhere where I could download it? A lot of times, especially with legacy instrument drivers, simple VIs are written around C DLLs, and the block diagrams are just Call Library Nodes which call into the DLL. In that case, you can just call directly into that underlying DLL in CVI, and don't need to use LabVIEW at all. I can supply more details on how this is done, if this turns out to be the case.

Hope this helps,
-- Chris
0 Kudos
Message 3 of 9
(3,575 Views)
this VI is the labview instrument driver for the Keithley 485 autoranging picommeter. You can get it from NI's driver network and probably from Keithley as well. I'm not sure if this is a legacy driver. I've heard that name but I'm not sure how's different from a non-legacy driver.

In fact what I need is to use library calls locked in the VI wrapper that I can use in CVI. That's why I'm trying to get a DLL from the vi without sucess so far.

If you can help me to get to the library calls that initialize, configure, read and close the instrument that would be exactly what I'm looking for.
0 Kudos
Message 4 of 9
(3,575 Views)
daquiry:

I've downloaded the 485 driver from both the NI Instrument Driver Network and the Keithley site, any they are both written natively in G (LabVIEW). The driver is rather simple, and is just making 488.2 / VISA calls. Keithley's site also doesn't offer drivers for the 485 in any language other than LabVIEW. This surprises me. I would suggest contacting Keithley and verifying that no C driver exists for the 485. If that's the case, then you may have to write a driver yourself. The 485 Quick Reference guide should have a description of all the available GPIB commands, along with sample code. Since you probably won't need the full range of functionality of the GPIB interface, writing a driver for what you do need shouldn't be t
oo bad.

I've written a short instrument driver which contains only a simple read() function. In implementing this, I've endeavored to translate the G code into C, but unfortunately, I don't have an instrument, so I haven't been able to test it.

Hope this helps..
-- Chris
0 Kudos
Message 5 of 9
(3,575 Views)
I downloaded your driver and tried testing it with my 485 unit. I get a meesage that says "unable to open user interface resource file (The control type passed was not a valid type)" when trying to execute from CVI.
I'll try creating a new UIR file that uses your code and see if I can comunicate with the instrument.
0 Kudos
Message 6 of 9
(3,575 Views)
I haven't heard of problems like this when running an application from the CVI IDE. What version of CVI are you using? Does the environment break at any certain line? At any rate, the most important thing is the FP. The little test application is quite trivial, and even if you needed to rewrite it, it should only take you a few moments. Have you been able to try the FP and see if the Read() function I translated from G works?
0 Kudos
Message 7 of 9
(3,575 Views)
I'm using CVI 5.5. When I try to use the read function from the FP it breaks at the VI_read line. Seems like the session handle is not there since the instrument has not been initialized by some prefix_init function that returns the session handle (judging by my experience with the other instruments). Since there are no init functions on that FP how does the instrument get initialized and obtains a session handle?
0 Kudos
Message 8 of 9
(3,575 Views)
You should initialize and close the instrument with the VISA CVI library. I tried to document something to this effect in the FP.

Does CVI say that the session handle is unintialized when the line breaks?
0 Kudos
Message 9 of 9
(3,575 Views)