I have a vi that initializes, measures, and releases
an OSA instrument. I want to call this routine from VB.
I used Standard calling convention when making DLL from LV.
Here is my VB declaration:
Private Declare Sub OSAMeasurement Lib "C:\ADE\OSAMeasurement.dll" Alias "OSADFBMeasurement" _
(ByVal GPIB As Long, _
ByVal Serial_Number As String, _
ByVal FileName As String, _
ByVal File_Path As String, _
ByVal Start_Wavelength_nm As Double, _
ByVal Stop_Wavelength_nm As Double, _
ByVal Level_Scale_dB As Double, _
ByVal Res_nm As Double, _
ByVal Peak_Wavelength As Double, _
ByVal Peak_Level As Double, _
ByVal SMSR As Double, _
ByVal FWHM As Double, _
ByVal Mode_Offset As Double, _
ByRef Level_Array() As Double, _
ByRef Wa
velength_Array() As Double, _
ByVal Array_Length As Long)
Here is my VB call:
Call OSAMeasurement(Form1.OSA.PrimaryAddress, _
(strOXM & Form1!txtOPMNumber), _
(CStr(CInt(dblSetVoltage)) & "v_Scan.txt"), _
(txtDataStoragePath & strOXM & " " & Form1!txtOPMNumber & "\"), _
1520, 1620, 5, 1, Peak_Wavelength, Peak_Level, _
SMSR, FWHM, Mode_Offset, _
Level_Array, Wavelength_Array, 1001)
I get RunTime Error "49"
Bad DLL calling convention
What is wrong?
Any suggestions/comments?