April 27, 2024, 05:07:03 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Using IWbasic dll with VB.NET

Started by dabil, September 01, 2017, 05:44:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

dabil

I have tried the manufacture first and they were not able to help either.  That is why I tried here.

Thanks for your help.  I'll just assume it is not possible at this point and move on.


dabil

ckoehn

Add to top of your source file:
Imports System.Runtime.InteropServices

Where ever you need your import:
<DllImport("AIM_863_DLL.dll", SetLastError:=True, CharSet:=CharSet.Auto)>_
public function AIM_InitVars(ByVal flag as integer) as integer
end function

<DllImport("AIM_863_DLL.dll", SetLastError:=True, CharSet:=CharSet.Auto)>_
public function AIM_CommPort(ByVal flag as integer, ByVal port as integer, ByVal baud as int) as integer
end function

<DllImport("AIM_863_DLL.dll", SetLastError:=True, CharSet:=CharSet.Auto)>_
public function AIM_ScanPoint(ByVal flag as integer, ByVal freq_  as double, ByRef  Rss as double, ByRef Xss as double) as integer         
end function

<DllImport("AIM_863_DLL.dll", SetLastError:=True, CharSet:=CharSet.Auto)>_
public function AIM_AvgReadings (ByVal avg as integer) as integer
end function

<DllImport("AIM_863_DLL.dll", SetLastError:=True, CharSet:=CharSet.Auto)>_
public function AIM_LoadCalFile (ByVal _str as string) as integer
end function

<DllImport("AIM_863_DLL.dll", SetLastError:=True, CharSet:=CharSet.Auto)>_
public function AIM_ProgRelay(ByVal flag as integer) as integer ' flag = 1 => close relay,  0 => open relay
end function

<DllImport("AIM_863_DLL.dll", SetLastError:=True, CharSet:=CharSet.Auto)>_
public function AIM_GetVersion(ByVal flag as integer) as string
end function

<DllImport("AIM_863_DLL.dll", SetLastError:=True, CharSet:=CharSet.Auto)>_
public function AIM_GetSerialNum (ByVal flag as integer) as integer
end function

<DllImport("AIM_863_DLL.dll", SetLastError:=True, CharSet:=CharSet.Auto)>_
public function AIM_GetRFVoltage (ByVal flag as integer) as double
end function

<DllImport("AIM_863_DLL.dll", SetLastError:=True, CharSet:=CharSet.Auto)>_
public function AIM_Sync(ByVal flag as integer) as integer  ' 1 or 2=enable,  0=disable sync output
end function

It should be something like that.  Maybe it will give you something to start with.

Later,
Clint