PicoScope 7 Software
Available on Windows, Mac and Linux
Code: Select all
Declare Function ps3000aGetValues Lib "ps3000a.dll" (ByVal handle As Short, ByVal startIndex As Integer, ByRef numSamples As Integer, ByVal downSampleRatio As Integer, ByVal downSampleRatioMode As Integer, ByVal segmentIndex As Integer, ByRef overflow As Integer) As Integer
Code: Select all
Private Sub cmdTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdTest.Click
Dim status As Short
Dim handle As Short
Dim intReturnValue As Integer
'This call works
'Declare Function ps3000aOpenUnit Lib "ps3000a.dll" (ByRef handle As Short, ByVal serial As System.Text.StringBuilder) As Short
status = ps3000aOpenUnit(Handle, Nothing)
If handle <> 0 Then
Dim sng As Single
'Declare Function ps3000aSetChannel Lib "ps3000a.dll" (ByRef handle As Short, ByVal channel As Integer, ByVal enabled As Short, ByVal type As Integer, ByVal range As Integer, ByVal analogueOffset As Single) As Short
Call ps3000aSetChannel(shthandle, 0, 1, 1, 1, sng)
Dim channel As Integer
Dim buffer As Integer
Dim bufferLth As Integer
Dim segmentIndex As Integer
Dim mode As Integer
buffer = 0
channel = 0
bufferLth = 1024
segmentIndex = 0
mode = 0
'This call works
'Declare Function ps3000aSetDataBuffer Lib "ps3000a.dll" (ByVal handle As Short, ByVal channel As Integer, ByRef buffer As Integer, ByVal bufferLth As Integer, ByVal segmentIndex As Integer, ByVal mode As Integer) As Integer
intReturnValue = ps3000aSetDataBuffer(handle, channel, buffer, bufferLth, segmentIndex, mode)
If intReturnValue = 0 Then
Dim startIndex As Integer
Dim numSamples As Integer
Dim downSampleRatio As Integer
Dim downSampleRatioMode As Integer
'Dim segmentIndex As Integer
Dim overflow As Integer
numSamples = 1024
downSampleRatioMode = 2
'Here I get the returnValue 70 (Hex 46) --> PICO_BUFFERS_NOT_SET
'An attempt was made to get data before a data buffer was defined
'Declare Function ps3000aGetValues Lib "ps3000a.dll" (ByVal handle As Short, ByVal startIndex As Integer, ByRef numSamples As Integer, ByVal downSampleRatio As Integer, ByVal downSampleRatioMode As Integer, ByVal segmentIndex As Integer, ByRef overflow As Integer) As Integer
intReturnValue = ps3000aGetValues(handle, startIndex, numSamples, downSampleRatio, downSampleRatioMode, segmentIndex, overflow)
End If
End If
End Sub
Code: Select all
Private Sub cmdTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdTest.Click
Dim status As Short
Dim handle As Short
Dim intReturnValue As Integer
'This call works
'Declare Function ps3000aOpenUnit Lib "ps3000a.dll" (ByRef handle As Short, ByVal serial As System.Text.StringBuilder) As Short
status = ps3000aOpenUnit(Handle, Nothing)
If handle <> 0 Then
Dim sng As Single
'Declare Function ps3000aSetChannel Lib "ps3000a.dll" (ByRef handle As Short, ByVal channel As Integer, ByVal enabled As Short, ByVal type As Integer, ByVal range As Integer, ByVal analogueOffset As Single) As Short
Call ps3000aSetChannel(shthandle, 0, 1, 1, 1, sng)
Dim channel As Integer
Dim buffer As Integer
Dim bufferLth As Integer
Dim segmentIndex As Integer
Dim mode As Integer
buffer = 0
channel = 0
bufferLth = 1024
segmentIndex = 0
mode = 0
'This call works
'Declare Function ps3000aSetDataBuffer Lib "ps3000a.dll" (ByVal handle As Short, ByVal channel As Integer, ByRef buffer As Integer, ByVal bufferLth As Integer, ByVal segmentIndex As Integer, ByVal mode As Integer) As Integer
intReturnValue = ps3000aSetDataBuffer(handle, channel, buffer, bufferLth, segmentIndex, mode)
If intReturnValue = 0 Then
Dim startIndex As Integer
Dim numSamples As Integer
Dim downSampleRatio As Integer
Dim downSampleRatioMode As Integer
'Dim segmentIndex As Integer
Dim overflow As Integer
numSamples = 1024
downSampleRatioMode = 2
'Here I get the returnValue 70 (Hex 46) --> PICO_BUFFERS_NOT_SET
'An attempt was made to get data before a data buffer was defined
'Declare Function ps3000aGetValues Lib "ps3000a.dll" (ByVal handle As Short, ByVal startIndex As Integer, ByRef numSamples As Integer, ByVal downSampleRatio As Integer, ByVal downSampleRatioMode As Integer, ByVal segmentIndex As Integer, ByRef overflow As Integer) As Integer
intReturnValue = ps3000aGetValues(handle, startIndex, numSamples, downSampleRatio, downSampleRatioMode, segmentIndex, overflow)
End If
End If
End Sub