Control PCSGU250 inside MS Excel App using VBA or else

Hello,

is it possible to control PCSGU250 inside MS Excel interface using VBA macros or something else?

I mean… not only receive the measurment data from osci in an array by DSOLink.dll, but run PC-LAB2000 in hide mode and send some commands to it to define osci and generator settings, generator function, start generator, etc…

Regards

This is possible using the PCSGU250.dll.
You can download the software development kit for PCSGU250, including the DLL with examples.
Here is the link to the download page:
velleman.eu/distributor/supp … u250&type=

[quote=“VEL255”]This is possible using the PCSGU250.dll.
You can download the software development kit for PCSGU250, including the DLL with examples.
Here is the link to the download page:
velleman.eu/distributor/supp … u250&type=[/quote]

There are some examples in the PC-LAB2000 manual how to use DSOLink.dll library inside MS Excel, but nothing about PCSGU250.dll.

Would be very helpful, when you describe in which directories must be placed the libraries and co… in the windows system32 or direct in the Excel App folder? How can I make all this classes visible in my VBA script? I’m not really good in VBA, so some code examples relative to Excel will help.

You can create a folder where to put the following files:
PCSGU250.dll
mpusbapi.dll
PcLab2000LT.exe
pcgu250.bit

In the Excel select Tools / Options
Select General tab.
There enter the file path to “Default File Location”.

Here a VBA code to test some functions:

[code] Dim DataBuffer1(0 To 5000) As Long
Dim DataBuffer2(0 To 5000) As Long
Private Declare Sub ReadCh1 Lib “PCSGU250.dll” (ByRef Buffer As Long)
Private Declare Sub ReadCh2 Lib “PCSGU250.dll” (ByRef Buffer As Long)
Private Declare Function DataReady Lib “PCSGU250.dll” () As Boolean
Private Declare Sub Voltage1 Lib “PCSGU250.dll” (ByVal Volts As Long)
Private Declare Sub Voltage2 Lib “PCSGU250.dll” (ByVal Volts As Long)
Private Declare Sub Time Lib “PCSGU250.dll” (ByVal Rate As Long)
Private Declare Sub RunOn Lib “PCSGU250.dll” (ByVal Run_on As Long)
Private Declare Sub SingleOn Lib “PCSGU250.dll” (ByVal Single_on As Boolean)
Private Declare Sub YPosition1 Lib “PCSGU250.dll” (ByVal y_pos As Long)
Private Declare Sub YPosition2 Lib “PCSGU250.dll” (ByVal y_pos As Long)
Private Declare Sub TrgOn Lib “PCSGU250.dll” (ByVal trg_on As Long)
Private Declare Sub TrgLevel Lib “PCSGU250.dll” (ByVal Trg_Level As Long)
Private Declare Sub TrgSource Lib “PCSGU250.dll” (ByVal Trg_Source As Long)
Private Declare Sub TrgEdge Lib “PCSGU250.dll” (ByVal Positive_Negative As Long)
Private Declare Sub Coupling1 Lib “PCSGU250.dll” (ByVal AC_DC_GND As Long)
Private Declare Sub Coupling2 Lib “PCSGU250.dll” (ByVal AC_DC_GND As Long)
Private Declare Sub Show_PCSGU250 Lib “PCSGU250.dll” (ByVal Visible As Long)
Private Declare Function Start_PCSGU250 Lib “PCSGU250.dll” () As Boolean
Private Declare Sub Stop_PCSGU250 Lib “PCSGU250.dll” ()
Private Declare Function GetSettings Lib “PCSGU250.dll” (ByRef SettingsArray As Long) As Boolean

Private Declare Sub StartGen Lib "PCSGU250.dll" ()
Private Declare Sub StopGen Lib "PCSGU250.dll" ()
Private Declare Sub SetGen Lib "PCSGU250.dll" (ByVal func As Long, ByVal freq As Single, ByVal ampl As Single, ByVal offset As Single)
Private Declare Sub SetSweep Lib "PCSGU250.dll " (ByVal freq1 As Single, ByVal freq2 As Single, ByVal ampl As Single, ByVal offset As Single, ByVal Time As Single)
Private Declare Sub SetLibWave Lib "PCSGU250.dll " (ByVal freq As Single, ByVal ampl As Single, ByVal offset As Single, ByVal Pointer As String)

Sub Button1_Click()
Start_PCSGU250
End Sub

Sub Button2_Click()
Stop_PCSGU250
End Sub

Sub Button3_Click()
Time 9
Coupling1 0
Voltage1 3
YPosition1 50
TrgOn 0
End Sub

Sub Button4_Click()
RunOn 1
End Sub

Sub Button5_Click()
RunOn 0
End Sub[/code]