The FGLink.dll needs other files to be located in the same folder with it to operate properly.
Maybe you have downloaded the following package: “SDK to control your PCG10/K8016 from Delphi or VB.” from the Velleman site: velleman.eu/distributor/supp … 8016&type=
Inside this package there is: FGLink_Demo_VB.zip
Extract this package to a folder.
Put the FGLINK.dll either to System32 folder (as you have done) or to your VB project’s subfolder where your application .EXE resides.
If you are using 32 bit version of Windows 7, your .EXE may be in the subfolder \bin\Debug.
If you are using 64 bit version, your .EXE may be in the subfolder : \bin\x86\Debug.
Run manually the FG.EXE before controlling the generator via the FGLink.DLL.
In your code change:
StartGen
to
StartGen()
If still no response, close the FG.EXE. In the folder where the FG.EXE resides, open the file WinDSO.ini with a text editor and check the lines:[Hardware]
LPT_Port=1
DemoMode=0
This is OK if you are using LPT port address 378h.
If you are using 278h change to:
LPT_Port=2
If you are using 3BCh change to:
LPT_Port=3
Here some example code:
[code]Public Class Form1
Private Declare Sub SetGen Lib "FGLink.dll " (ByVal func As Integer, ByVal freq As Single, ByVal ampl As Single, ByVal offset As Single)
Private Declare Sub StartGen Lib "FGLink.dll " ()
Private Declare Sub StopGen Lib "FGLink.dll " ()
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
StartGen()
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim iFunc As Integer = 1
Dim sFreq As Short = 500
Dim sAmp As Short = 10
Dim sOff As Short = 0
SetGen(iFunc, sFreq, sAmp, sOff)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim iFunc As Integer = 2
Dim sFreq As Short = 5000
Dim sAmp As Short = 5
Dim sOff As Short = 1
SetGen(iFunc, sFreq, sAmp, sOff)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
StopGen()
End Sub
End Class[/code]