AnsweredAssumed Answered

vrf User Manul for Consultronics NSA400 & Spirent xps

Question asked by VRFuser on Nov 29, 2007
Hello Alex,

Here are some data types and their corresponding counterparts in C

INT-->INT32
void * -->Int32 1D Array - in most cases char*--> Text
BOOL--> Int32
Unsigned long -->Int32 - works in most cases short *--> Int16 Long -->Int32.

But As for the _MVAPI and INFO_T* data types, you should look into programmers reference of the supplier of that .dll

PS: Thank you Zafer for your explanatory and in-depth explanation.
Regards
Cengiz EKEN


________________________________

Kimden: Zafer SAVAS [mailto:zsavas@aselsan.com.tr]
Gönderilmis: Çar 28.11.2007 20:14
Kime: VRF
Konu: RE: [vrf] Hi, I'm a new user. --> Problem with C-header file



Hello Alex,

If you want to call a C dll from VEE than you must have a header file (.h file) and declare that C function in that header file with the following format:
<return type> <function name> (<type> <paramname>, <type> <paramname>, ...)

VEE has some rules for this format;
The return type can be : int, short, long, float, double, char*, void The type for the parameters can be : int, short, long, float, double, int*, char*, short*, long*, float*, double*, char**, void.

So as you see, your C dll has of form;
_MVAPI mvGetBoardInfo (int boardno, INFO_T* pinfo);

The problems for this function decleration are;
1) The return type "_MVAPI" is unknown for VEE
2) the type of "pinfo" parameter is unknown for VEE

And finally the solution to your problem?
1) Check whether the type _MVAPI is compatible with known VEE types like "int"
2) Check wheter the type INFO_T* is compatible with known VEE types such as "char*"
if they are compatible then you have to write a new header file that VEE understands, i.e int mvGetBoardInfo (int boardno, char* pinfo);

But what if those types (_MVAPI and INFO_T*) are unknown types for VEE?
Then you have to write another C dll that encapsulates your video capture card dll and whose types are all known for VEE.

It is not very difficult if you know C/C++ and Microsoft Visual C++ environment.

Vendors usually write C drivers (dll files) which can be called by other programming languages (C#, Basic, java etc...). Most of the time data types for the languages other than C/C++ have difficulty in recognizing these C types so you build your own dll which uses common type variables for both languages or you use some conversion features of that programming language like Marshalling in .NET

Best Regards
Zafer


-----Original Message-----
From: Alexander Lorenz [mailto:alorenz@mail.upb.de]
Sent: Wed 11/28/2007 1:56 PM
To: VRF
Subject: [vrf] Hi, I'm a new user. --> Problem with C-header file

Hello everybody!

I want to import a .dll into VEE. The .dll and .h files came with the driver of a video capture card.
The .h file is written in C (I suppose).
I tried to use the 'improt library'-object.
'Load Lib' reports some errors in the .h file.

1. VEE cannot understand the declaration of a function, when the function is written in more than one line.

2. There is a number of lines of the form:

_MVAPI (int) mvGetBoardInfo (int boardno, INFO_T* pinfo);

VEE cannot interpret this kind of syntax (and I can't eigther).
The author of the .h file has commented this section with
/* resident functions */.

Can you help me?

Regards,

Alex


Alexander Lorenz

Physikalische Chemie
Universität Paderborn
Warburger Str. 100
33098 Paderborn
Tel. 0177 / 3051324
      05251 / 60 2581




---
You are currently subscribed to vrf as: zsavas@aselsan.com.tr To subscribe please send an email to: "vrf-request@lists.it.agilent.com" with the word subscribe in the message body.
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@agilent.com".
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".
Search the "unofficial vrf archive" at "http://www.vrfarchive.com/vrf_archive".
Search the Agilent vrf archive at "http://vee.engineering.agilent.com <http://vee.engineering.agilent.com/> ".


######################################################################
Dikkat:

Bu elektronik posta mesaji kisisel ve ozeldir. Eger size gonderilmediyse lutfen gondericiyi bilgilendirip mesaji siliniz.
Firmamiza gelen ve giden mesajlar virus taramasindan gecirilmekte, guvenlik nedeni ile kontrol edilerek saklanmaktadir. Mesajdaki gorusler ve bakis acisi gondericiye ait olup Aselsan A.S. resmi gorusu olmak zorunda degildir.

######################################################################
Attention:

This e-mail message is privileged and confidential. If you are not the intended recipient please delete the message and notify the sender. E-mails to and from the company are monitored for operational reasons and in accordance with lawful business practices.
Any views or opinions presented are solely those of the author and do not necessarily represent the views of the company.

######################################################################

---
You are currently subscribed to vrf as: ceken@mst.aselsan.com.tr To subscribe please send an email to: "vrf-request@lists.it.agilent.com" with the word subscribe in the message body.
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@agilent.com".
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".
Search the "unofficial vrf archive" at "http://www.vrfarchive.com/vrf_archive".
Search the Agilent vrf archive at "http://vee.engineering.agilent.com <http://vee.engineering.agilent.com/> ".



######################################################################
Dikkat:

Bu elektronik posta mesaji kisisel ve ozeldir. Eger size gonderilmediyse lutfen gondericiyi bilgilendirip mesaji siliniz.
Firmamiza gelen ve giden mesajlar virus taramasindan gecirilmekte, guvenlik nedeni ile kontrol edilerek saklanmaktadir. Mesajdaki gorusler ve bakis acisi gondericiye ait olup Aselsan A.S. resmi gorusu olmak zorunda degildir.

######################################################################
Attention:

This e-mail message is privileged and confidential. If you are not the intended recipient please delete the message and notify the sender. E-mails to and from the company are monitored for operational reasons and in accordance with lawful business practices.
Any views or opinions presented are solely those of the author and do not necessarily represent the views of the company.

######################################################################

---
You are currently subscribed to vrf as: ming_meng@agilent.com To subscribe please send an email to: "vrf-request@lists.it.agilent.com" with the word subscribe in the message body.
To unsubscribe send a blank email to "leave-vrf@it.lists.it.agilent.com".
To send messages to this mailing list,  email "vrf@agilent.com". 
If you need help with the mailing list send a message to "owner-vrf@it.lists.it.agilent.com".
Search the "unofficial vrf archive" at "http://www.vrfarchive.com/vrf_archive".
Search the Agilent vrf archive at "http://vee.engineering.agilent.com".

Outcomes