PicoScope 7 Software
Available on Windows, Mac and Linux
I noticed that you've missed ByRef in front of 'channels As Integer'Declare Function pl1000SetInterval Lib "pl1000.dll" (ByVal handle As Integer, ByRef us_for_block As Integer, ByVal ideal_no_of_samples As Integer, channels As Integer, ByVal No_of_channels As Integer) As Integer
Code: Select all
Declare Function pl1000SetInterval Lib "pl1000.dll" (ByVal handle As Short, ByRef us_for_block As Integer, ByVal ideal_no_of_samples As Integer, ByRef channels As Short, ByVal No_of_channels As Short) As Integer
ByRef in front of 'channels As Integer
Code: Select all
... public...
Declare Function pl1000OpenUnit Lib "pl1000.dll" (ByRef handle As Integer) As Integer
Declare Function pl1000CloseUnit Lib "pl1000.dll" (ByVal handle As Integer) As Integer
Declare Function pl1000GetUnitInfo Lib "pl1000.dll" (ByVal handle As Integer, ByVal S As String, ByVal lth As Integer, ByRef requiredSize As Integer, ByVal info As Integer) As Integer
Declare Function pl1000SetTrigger Lib "pl1000.dll" (ByVal handle As Integer, ByVal enabled As Integer, ByVal enable_auto As Integer, ByVal auto_ms As Integer, ByVal channel As Integer, ByVal dir As Integer, ByVal threshold As Integer, ByVal hysterisis As Integer, ByVal delay As Single) As Integer
Declare Function pl1000SetInterval Lib "pl1000.dll" (ByVal handle As Integer, ByRef us_for_block As Short, ByVal ideal_no_of_samples As Integer, ByRef channels As Short, ByVal No_of_channels As Integer) As Integer
Declare Function pl1000GetValues Lib "pl1000.dll" (ByVal handle As Integer, ByRef values As Short, ByRef no_of_values As Integer, ByRef overflow As Integer, ByRef triggerIndex As Integer) As Integer
Declare Function pl1000Run Lib "pl1000.dll" (ByVal handle As Integer, ByVal no_of_values As Integer, ByVal method As Integer) As Integer
Declare Function pl1000Ready Lib "pl1000.dll" (ByVal handle As Integer, ByRef ready As Integer) As Integer
Declare Function pl1000MaxValue Lib "pl1000.dll" (ByVal handle As Integer, ByRef maxValue As Integer) As Integer
Public values(200) As Short
Public channels(16) As Short
Public nValues As Integer
Public maxValue As Integer
Public ready As Integer
Public requiredSize As Integer
... local Sub...
Dim handle As Integer
Dim us_for_block As Short
Dim triggerIndex As Integer
Dim overflow As Integer
.
.
.
status = pl1000OpenUnit(handle)
status = pl1000MaxValue(handle, maxValue)
status = pl1000SetTrigger(handle, False, 0, 0, 0, 0, 0, 0, 0)
us_for_block = 10000 ; nValues = 1
status = pl1000SetInterval(handle, us_for_block, nValues, channels(0), 16)
status = pl1000Run(handle, nValues, 0)
status = pl1000Ready(handle, ready)
status = pl1000GetValues(handle, values(0), nValues, overflow, triggerIndex)
...
status = pl1000CloseUnit(handle)
Code: Select all
Public channels(15) As Short
Code: Select all
Declare Function pl1000OpenUnit Lib "pl1000.dll" (ByRef handle As Short) As UInteger
Declare Function pl1000Stop Lib "pl1000.dll" (ByVal handle As Short) As UInteger
Declare Function pl1000CloseUnit Lib "pl1000.dll" (ByVal handle As Short) As UInteger
Declare Function pl1000SetTrigger Lib "pl1000.dll" (ByVal handle As Short, ByVal enabled As UShort, ByVal enable_auto As UShort, ByVal auto_ms As UShort, ByVal channel As UShort, ByVal dir As UShort, ByVal threshold As UShort, ByVal hysterisis As UShort, ByVal delay As Single) As UInteger
Declare Function pl1000SetInterval Lib "pl1000.dll" (ByVal handle As Short, ByRef us_for_block As UInteger, ByVal ideal_no_of_samples As UInteger, ByRef channels As Short, ByVal No_of_channels As Short) As UInteger
Declare Function pl1000GetValues Lib "pl1000.dll" (ByVal handle As Short, ByRef values As UShort, ByRef no_of_values As UInteger, ByRef overflow As UInteger, ByRef triggerIndex As UInteger) As UInteger
Declare Function pl1000Run Lib "pl1000.dll" (ByVal handle As Short, ByVal no_of_values As UInteger, ByVal method As UInteger) As UInteger
Declare Function pl1000Ready Lib "pl1000.dll" (ByVal handle As Short, ByRef ready As Short) As UInteger
Declare Function pl1000MaxValue Lib "pl1000.dll" (ByVal handle As Short, ByRef maxValue As Integer) As UInteger