PicoScope 7 Software
Available on Windows, Mac and Linux
Code: Select all
Declare Function pl1000OpenUnit Lib "pl1000.dll" (ByRef handle As Integer) As Long
Declare Function pl1000CloseUnit Lib "pl1000.dll" (ByVal handle As Integer) As Long
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 Long, ByVal ideal_no_of_samples As Long, channels As Integer, ByVal No_of_channels As Integer) As Long
Declare Function pl1000GetSingle Lib "pl1000.dll" (ByVal handle As Integer, ByVal channel As Integer, ByRef value As Integer) As Long
Declare Function pl1000Run Lib "pl1000.dll" (ByVal handle As Integer, ByVal no_of_values As Long, ByVal method As Integer) As Integer
Declare Function pl1000Ready Lib "pl1000.dll" (ByVal handle As Integer, ByRef ready As Integer) As Long
Declare Function pl1000MaxValue Lib "pl1000.dll" (ByVal handle As Integer, ByRef maxValue As Integer) As Long
Declare Function pl1000SetDo Lib "pl1000.dll" (ByVal handle As Integer, ByVal do_value As Integer, ByVal doNo As Integer) As Long
Code: Select all
Sub startpico1()
flagpicostarted = True
If opened1 = 0 Then
Status = pl1000OpenUnit(handle)
opened1 = handle
opened1 = 1
Else
Status = pl1000GetSingle(handle, 1, Value1)
Status = pl1000GetSingle(handle, 2, Value2)
Status = pl1000GetSingle(handle, 3, Value3)
Status = pl1000GetSingle(handle, 4, Value4)
Status = pl1000GetSingle(handle, 5, Value5)
Status = pl1000GetSingle(handle, 6, Value6)
Status = pl1000GetSingle(handle, 7, value7)
Status = pl1000GetSingle(handle, 8, Value8)
Status = pl1000GetSingle(handle, 9, Value9)
Status = pl1000GetSingle(handle, 10, Value10)
Status = pl1000GetSingle(handle, 11, Value11)
Status = pl1000GetSingle(handle, 12, Value12)
Status = pl1000GetSingle(handle, 13, Value13)
Status = pl1000GetSingle(handle, 14, Value14)
Status = pl1000GetSingle(handle, 15, Value15)
Status = pl1000GetSingle(handle, 16, Value16)
'Voltage
Worksheets("live data").Cells(3, 2) = Value1
Worksheets("live data").Cells(4, 2) = Value2
Worksheets("live data").Cells(5, 2) = Value3
Worksheets("live data").Cells(6, 2) = Value4
.
.
.(continued for each of the called channels)
Code: Select all
Declare Function pl1000GetSingle Lib "pl1000.dll" (ByVal handle As Integer, ByVal channel As Long, ByRef value As Integer) As Long
Code: Select all
Dim value1 As Integer
Dim value2 As Integer
Dim value3 As Integer
Dim value4 As Integer
status = pl1000GetSingle(handle, 1, value1)
status = pl1000GetSingle(handle, 2, value2)
status = pl1000GetSingle(handle, 3, value3)
status = pl1000GetSingle(handle, 4, value4)
Cells(3, "C").value = (value1 / 4095) * 2500
Cells(4, "C").value = (value2 / 4095) * 2500
Cells(5, "C").value = (value3 / 4095) * 2500
Cells(6, "C").value = (value4 / 4095) * 2500