PicoScope 7 Software
Available on Windows, Mac and Linux
Code: Select all
status = ps6000SetChannel
Code: Select all
Call ps6000SetChannel
Code: Select all
Type TRIGGER_CONDITION
channelA As Long
channelB As Long
channelC As Long
channelD As Long
external As Long
aux As Long
pulseWidthQualifier As Long
End Type
Declare Function ps6000OpenUnit Lib "ps6000.dll" (ByRef handle As Integer, ByVal serial As Byte) As Long
Declare Sub ps6000CloseUnit Lib "ps6000.dll" (ByVal handle As Integer)
Declare Function ps6000GetUnitInfo Lib "ps6000.dll" (ByVal handle As Integer, ByVal str As String, ByVal length As Integer, ByRef requiredSize As Integer, ByVal info As Integer) As Long
Declare Function ps6000SetChannel Lib "ps6000.dll" (ByVal handle As Integer, ByVal channel As Long, ByVal enabled As Integer, ByVal dc As Long, ByVal range As Long, ByVal analogueOffset As Single, ByVal bandwidth As Long) As Long
Declare Function ps6000GetTimebase Lib "ps6000.dll" (ByVal handle As Integer, ByVal timebase As Long, ByVal noSamples As Long, ByRef timeInterval As Long, ByVal oversample As Integer, ByRef maxSamples As Long, ByVal segment As Long) As Long
Declare Function ps6000SetDataBuffer Lib "ps6000.dll" (ByVal handle As Integer, ByVal channel As Long, ByRef buffer As Integer, ByVal length As Long, ByVal downSampleRatioMode As Long) As Long
Declare Function ps6000GetValues Lib "ps6000.dll" (ByVal handle As Integer, ByVal startIndex As Long, ByRef numSamples As Long, ByVal downSampleRatio As Long, ByVal downSampleRatioMode As Long, ByVal segmentIndex As Long, ByRef overflow As Integer) As Long
Declare Function ps6000Stop Lib "ps6000.dll" (ByVal handle As Integer) As Long
Declare Function ps6000RunStreaming Lib "ps6000.dll" (ByVal handle As Integer, ByRef sampleInterval As Long, ByVal sampleIntervalTimeUnits As Long, ByVal maxPreTriggerSamples As Long, ByVal maxPostTriggerSamples As Long, ByVal autoStop As Integer, ByVal downSampleRatio As Long, ByVal downSampleRatioMode As Long, ByVal overviewBufferSize As Long) As Long
' Trigger functions
Declare Function ps6000SetSimpleTrigger Lib "ps6000.dll" (ByVal handle As Integer, ByVal enable As Integer, ByVal source As Long, ByVal Threshold As Integer, ByVal direction As Long, ByVal delay As Long, ByVal autoTriggerMs As Integer) As Long
Declare Function ps6000SetTriggerChannelConditions Lib "ps6000.dll" (ByVal handle As Integer, ByRef conditions As TRIGGER_CONDITION, ByVal nConditions As Integer) As Long
Declare Function ps6000SetTriggerChannelDirections Lib "ps6000.dll" (ByVal handle As Integer, ByVal channelA As Long, ByVal channelB As Long, ByVal channelC As Long, ByVal channelD As Long, ByVal ext As Long, ByVal aux As Long) As Long
Declare Function SetTriggerProperties Lib "ps6000Wrap.dll" (ByVal handle As Integer, ByRef triggerChannelPropertiesArray As Long, ByVal nProperties As Integer, ByVal autoTrig As Long) As Long
Declare Function RunBlock Lib "ps6000Wrap.dll" (ByVal handle As Integer, ByVal noPreTriggerSamples As Long, ByVal noPostTriggerSamples As Long, ByVal timebase As Long, ByVal oversample As Integer, ByVal segmentIndex As Long) As Long
Declare Function GetStreamingLatestValues Lib "ps6000Wrap.dll" (ByVal handle As Integer) As Long
Declare Function AvailableData Lib "ps6000Wrap.dll" (ByVal handle As Integer, ByRef startIndex As Long) As Long
Declare Function AutoStopped Lib "ps6000Wrap.dll" (ByVal handle As Integer) As Integer
Declare Function IsReady Lib "ps6000Wrap.dll" (ByVal handle As Integer) As Integer
Declare Sub setChannelCount Lib "ps6000Wrap.dll" (ByVal handle As Integer, ByVal channelCount As Integer)
Declare Function setEnabledChannels Lib "ps6000Wrap.dll" (ByVal handle As Integer, ByRef enabledChannels As Integer) As Integer
Declare Function setAppAndDriverBuffers Lib "ps6000Wrap.dll" (ByVal handle As Integer, ByVal channel As Integer, ByRef appBuffer As Integer, ByRef driverBuffer As Integer, ByVal bufferLength As Long) As Integer
Declare Sub Sleep Lib "kernel32.dll" (ByVal time As Long)
Dim handle As Integer
Dim status As Integer
Dim str As String * 20
Const maxADCCount = 32512 ' Maximum ADC Count for device is 32512