Vb.NET (Visual Studio 2008)
- Code: Select all
'Dim buffer() As Long
.
.
.
.
.
'Check if ETS is turned on (Fast or Slow)
If (VB6.GetItemData(Sample_Program.Cbox_ETS, Sample_Program.Cbox_ETS.SelectedIndex) <> PS5000_ETS_MODE.PS5000_ETS_OFF) Then
'ReDim Buffer(gc_BUFFER_SIZE)
ReDim bufferHigh(gc_BUFFER_SIZE)
ReDim bufferLow(gc_BUFFER_SIZE)
Status = ps5000SetEts(unit.handle, VB6.GetItemData(Sample_Program.Cbox_ETS, Sample_Program.Cbox_ETS.SelectedIndex), 20, 4, ets_sampletime)
If g_DEBUG Then Call dStatus("ps5000SetEts", Status)
Sample_Program.WriteText("ETS is ON : ETS Sample time is " & ets_sampletime & vbNewLine)
offset = CInt((gc_BUFFER_SIZE / 10) - 5)
'Status = ps5000SetEtsTimeBuffer(unit.handle, buffer(0), CLng(gc_BUFFER_SIZE))
Status = ps5000SetEtsTimeBuffers(unit.handle, bufferHigh(0), bufferLow(0), gc_BUFFER_SIZE)
If g_DEBUG Then Call dStatus("ps5000SetEtsTimeBuffers", Status)
Else
Status = ps5000SetEts(unit.handle, PS5000_ETS_MODE.PS5000_ETS_OFF, 0, 0, 0)
If g_DEBUG Then Call dStatus("ps5000SetEts", Status)
End If
gc_BUFFER_SIZE is a global constant = 1024
You can see that I currently have the ps5000SetEtsTimeBuffer call commented out...
In my .vb file:
- Code: Select all
Declare Function ps5000SetEtsTimeBuffers Lib "PS5000.dll" (ByVal handle As Short, ByRef timeUpper As Integer, ByRef timeLower As Integer, ByVal bufferLth As Integer) As Integer
Declare Function ps5000SetEtsTimeBuffer Lib "PS5000.dll" (ByVal handle As Short, ByRef buffer As Long, ByVal bufferLth As Long) As Long
I have basically tried to replicate your picoconsoleapp as a VB.NET application. As it is a .NET application, I had no doubt that it works but can't figure out why I'm bombing out. This application was converted from a VB6 application so you'll see some old VB6 converter class usage with the old style ComboBoxs...
Jay