LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

instrument driver only for C++

Hi
 
The drivers for an instrument (55292A USB Expansion Module from Agilent Technologoes) are written in C++. They have built a dll but LabView 7.1 crashes, when I try to select this dll in a call library function node.
It's possible to write an exe file for command line, which exepts commands and returns the values, and use it under LabView? I saw the System exec.vi, but I can only run an exe and take the returned value. It would be good, if I can run this exe parallel (in the background) to the labview program and any time I need some values, I can write the command to the command line and get the returned value. I also need to run two exe's because I have another instrument with only C++ drivers.
 
Thanks for answers 
0 Kudos
Message 1 of 13
(5,027 Views)
Hi,

your problem sounds familiar to me. At my application the problems are the parameters of the DLL.
You ought to use exactly the in and out parameters of the c++ Developer.
My system broke down when I used the wrong callconvention or one wrong parameter.
So a function "unsigned long _CloseInterface@0(void);" have only one return type parameter, the type number and the datatype 32-Bit-Integer.

Greets


0 Kudos
Message 2 of 13
(5,012 Views)

Hi

The problem is, that when I only place the "call library function node" and select the dll, it crashes. I can't set a function or run the program. But I dont know if I really can use this dll, because in the manual are written things I have to do first. I attach the manual. Maybe someone can tell me if its possible to use this drivers with labView.

0 Kudos
Message 3 of 13
(5,009 Views)

Sounds like a mayor problem.....

The discribed problems sound like a systemfailure from the DLL.

If the "call library function node" dont´t work and the system halt or crash, there are some worst case reasons:

1. the DLL is currupt in anykind

2. the DLL is compiled for a System older than Win2k and some priviledges of your actual system (e.g. WinXP) prevent to get access.

3. Sorry I don´t know any other reason.....

Unfortunately the manual don´t mention any problems like that.

I am really sorry having no better news!

 

0 Kudos
Message 4 of 13
(5,001 Views)
I'm using Win XP and the drivers should work in Win XP because there's an example program written with visual C++ and they work with them.
 
Have you read the beginning of the manual? In chapter How to start are described many things I have to do to use the dll. It sounds like i can use this dll only with visual C++. Do you think it should work with labView if I manage the problem with the crashing?
0 Kudos
Message 5 of 13
(4,999 Views)
I realised now, that it crashes, when I try to write a function name. That's because i can select only four functions:
 
DllCanUnloadNow
DllGetClassObject
DllRegisterServer
DllUnregisterServer
 
But this aren't functions from the dll or they are not described in the manual...
 
Does anyone knows what I can do with this functions?
0 Kudos
Message 6 of 13
(4,995 Views)
Those are functions exposed by a COM class - you don't have a C DLL but a COM object. You need to register it on your system (regsvr32 - the docs should tell you how or it should already be registered by the installer) and use the ActiveX VI's in LV to call it. You'll find that much easier...
0 Kudos
Message 7 of 13
(4,985 Views)

Hi Brian

I'm sure you are rigth because i had to register this dll first (it is written in the manual I attached above).

I now have an "automatic open.vi" in which I select the dll and then an "invoke node" but I cant select any methods there. I think I'm doing something wrong.... 
0 Kudos
Message 8 of 13
(4,978 Views)
I took a look at the document you posted and also checked out Agilent's system - this isn't an Agilent driver is it?
 
From looking over the document, it also doesn't look like it followed the COM standard for the API creation and I am willing to bet that it does not have a COM Type Library. If this is the case, then you cannot call it from LabVIEW.
 
The COM Type Library is a special binary component that is either seperate (.tlb) or bundled into the DLL. This component describes the entire API for the COM class and is what LabVIEW uses to display the properties and methods. Since this file is automatically generated if you following the IDL approach in Visual Studio, it is very common to have it. I would recommend checking with the authors to see if they have or plan to supply a Type Library.
 
If you want, you can post the DLL here and I'll take a look at it to make sure my assumption is correct.
0 Kudos
Message 9 of 13
(4,963 Views)

Hi Brian

You're right. The 55292a usb expansion Module is from Agilent Technologies. It can house the Agilent 10887A calibrator board (ISA Slot) for the interferometer hp 5519A. Because we want to use this interferometer with a pc that has no ISA slot, we bougth that expansion module (3 years ago). Unfortunately the cd from agilent has no driver for this device. There's only a program on it. The other point is, that Agilent sold this device to another company and this company sold me this drivers (I think there are no others).

The problem is now, that Agilent don't support the device at all. The other company won't support the drivers running in LabView and national Instruments (Germany) also told me that they won't support me in this case.

But you were right about the COM library I think. I now can see the methods from the drivers, but they are grayed out (except two of them, see attachement).

Thanks for your offer to have a look at the dll. The problem is, that I had to buy this drivers and think the company wouldn't be happy to see me share them here... Can I send them by email to you? My adress is: sn4mail@hotmail.com

 

Thank you very much for your help!

0 Kudos
Message 10 of 13
(4,957 Views)