PicoScope 7 Software
Available on Windows, Mac and Linux
Code: Select all
Declare Function ps5000aOpenUnit Lib "ps5000a.dll" (ByRef handle As Integer, serial As Ptr, resolution As Int64) As Int32
Declare Function ps5000aCloseUnit Lib "ps5000a.dll" (ByVal handle As Integer) As Int32
Declare Function ps5000aGetUnitInfo Lib "ps5000a.dll" (handle As Integer, S As Ptr, stringLength As Integer, ByRef requiredSize As Integer, info As Int64) As Int64
Dim handle As Integer
Dim status As Int32
Dim requiredSize As Integer
Dim resolution as Int64
Dim info as Int64
Dim serial As New MemoryBlock(255)
Dim S As New MemoryBlock(255)
Dim SLegnth As Integer
serial="CQ178/005"
status = ps5000aOpenUnit(handle, serial, 1)
If status <> 0 Then
MsgBox ("Unit not opened")
Text1.Text = Str(status, "###")
Else
Text1.Text = "ps5000a is opened"
End If
SLegnth = ps5000aGetUnitInfo(handle, S, 255, requiredSize, 3)
TextInfo1.Text = S.StringValue(0,requiredSize)
SLegnth = ps5000aGetUnitInfo(handle, S, 255, requiredSize, 4)
TextInfo2.Text = S.StringValue(0,requiredSize)
SLegnth = ps5000aGetUnitInfo(handle, S, 255, requiredSize, 0)
TextInfo3.Text = S.StringValue(0,requiredSize)
Call ps5000aCloseUnit(handle)
Code: Select all
System.BadImageFormatException was unhandled
HResult=-2147024885
Message=An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
Source=PS5000a
StackTrace:
at PS5000a.PS5000aVBCon.ps5000aOpenUnit(Int16& handle, String& serial, DeviceResolution resolution)
at PS5000a.PS5000aVBCon.Main() in C:\PicoSDK\PS5000A\VB .Net\PS5000aVBCon.vb:line 329
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Code: Select all
status = ps5000aOpenUnit(handle, "", 1)
Code: Select all
status = ps5000aOpenUnit(handle, Nil, 1)