LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

appel de dll en delphi

Bonjour,

 

Je dois contrôler un appareil d'analyses via LabView, en utilisant un port série RS232 du pc. 

Le constructeur m'a simplement procuré une dll (AA3.dll, écrite en delphi), avec un petit programme démo (Testdll.exe). fichiers attachés.

J'arrive à communiquer avec l'appareil en utilisant le programme démo. Maintenant il me faut utliser cette dll avec LabView.

 

Voici les informations du constructeur pour utiliser cette dll:

 

" the AA3.dll functions for the AA3HR system:

function AA3HROpen( Port : Integer ) : Integer; stdcall;
Create the communication object and open the comport
Port from 1 to 8

function AA3HRConnect : Integer; stdcall;
this function check the firmware and start the AA3HR tasks, only necessary if the console was switched on

function AA3HRStart( Channel, Base, Gain, Lamp : Integer ) : Integer; stdcall;
start the data acquisition and flush the internal circle buffer

function AA3HRGetValue( Channel : Integer; Value : pInteger ) : Integer; stdcall;
(pInteger is an integer pointer, int*)
get one AD-value from the circle buffer of the channel, normally should called all 2 seconds
return value:
0 :  ADErrLastVal OK, only one value was available
1 :  ADErrMoreVal OK, more values are available, repeat this function
-1:  ADErrBufEmpty ERROR
-2:  ADErrBxValLost ERROR
-3:  ADErrChannel  ERROR
-4:  ADErrCmd      ERROR

function AA3HRSetLamp( Channel, LampValue : Integer) : Integer; stdcall;
set lamp value, Attention, if you use a normal lamp, don't use values over 150

function AA3HRSetBase( Channel, BaseValue : Integer) : Integer; stdcall;
set base is only fort internal calculation, between -50000 and 50000

function AA3HRSetGain( Channel, GainValue : Integer) : Integer; stdcall;
sat gain is only for internal calculation, range from 1 to 1000

function AA3HRStop( Channel : Integer) : Integer; stdcall;
stopped the data acquisition

function AA3HRClose : Integer; stdcall;
closed the com port and destroy the communication object

for all functions: Channel parameters start with 0 = channel 1 "

 

 

Je bloque déjà sur la première fonction, ouverture du port com voulu. Je ne vois pas comment savoir quelle commande de la fonction de la dll correspond au port com voulu..  

D'une manière plus générale, comment savoir comment cabler chaque fonction de la dll?

 

Je vous remercie de bien vouloir m'aider dans cette manip, car bien qu'utilisateur de LabView depuis un certain temps, c'est la première fois que je dois utiliser une dll et je suis perdu au milieu de tout ça...

 

Cordialement,

Rémi Dallmayr. 

 

 

 

0 Kudos
Message 1 of 2
(2,416 Views)

That is a lengthy one

 

 


Translation

 

I have to control a device via LabView analysis, using an RS232 serial port of pc.

The manufacturer just bought me a dll (AA3.dll written in Delphi), with a small demo program (Testdll.exe). attachments.

I can communicate with the device using the demo program. Now I need this dll utliser with LabView.

 

Here are the manufacturer's information to use this dll:

 

"AA3.dll the AA3HR functions for the system:

AA3HROpen function (Port: Integer): Integer; stdcall;
Create the communication object and open the Behavior
Port from 1 to 8

AA3HRConnect function: Integer; stdcall;
this function check the firmware and start the AA3HR tasks, necessary only if the console was switched on

AA3HRStart function (Channel, Base, Gain, Lamp: Integer): Integer; stdcall;
start the data acquisition and flush the internal buffer circle

AA3HRGetValue function (Channel: Integer; Value: pInteger): Integer; stdcall;
(pInteger is an integer pointer, int *)
AD-get one value from the circle of the buffer channel, normally called should all 2 seconds
return value:
0: ADErrLastVal OK, only one value was available
1: ADErrMoreVal OK, more values are available, repeat this function
-1: ERROR ADErrBufEmpty
-2: ADErrBxValLost ERROR
-3: ADErrChannel ERROR
-4: ADErrCmd ERROR

AA3HRSetLamp function (Channel LampValue: Integer): Integer; stdcall;
lamp set value, Caution, if you use a standard lamp, do not use values over 150

AA3HRSetBase function (Channel BaseValue: Integer): Integer; stdcall;
basis set is only strong internal calculation, between -50,000 and 50,000

AA3HRSetGain function (Channel GainValue: Integer): Integer; stdcall;
sat gain is only for internal calculation, range from 1 to 1000

AA3HRStop function (Channel: Integer): Integer; stdcall;
stopped the data acquisition

AA3HRClose function: Integer; stdcall;
closed the com port and destroy the communication object

for all functions: Channel parameters start with 0 = channel 1

 

 

I already blocked on the first function, opening the com port you want. I do not know how to control what the function of the dll is the desired com port ..

In more general terms, how do you know how to wire each function in the dll?

 

Thank you kindly help me in this manip, because many user of LabView for a while, this is the first time I have to use a dll and I'm lost in the middle of it all ...


 

 

 

0 Kudos
Message 2 of 2
(2,410 Views)