Skip to content

Commit af9d232

Browse files
committed
adds basic S11 LogMag example and python wrapper
0 parents  commit af9d232

File tree

6 files changed

+464
-0
lines changed

6 files changed

+464
-0
lines changed

.vs/PicoVNAExamples/v15/.suo

29.5 KB
Binary file not shown.

PicoVNAExamples.sln

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.27703.2000
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "PicoVNAExamples", "PicoVNAExamples\PicoVNAExamples.pyproj", "{8F2A247D-7A6F-4878-903F-DF1ED8C10549}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{8F2A247D-7A6F-4878-903F-DF1ED8C10549}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{8F2A247D-7A6F-4878-903F-DF1ED8C10549}.Release|Any CPU.ActiveCfg = Release|Any CPU
16+
EndGlobalSection
17+
GlobalSection(SolutionProperties) = preSolution
18+
HideSolutionNode = FALSE
19+
EndGlobalSection
20+
GlobalSection(ExtensibilityGlobals) = postSolution
21+
SolutionGuid = {C82D22E3-508C-4C19-85A0-0AFB6C351757}
22+
EndGlobalSection
23+
EndGlobal

PicoVNAExamples/PicoVNAExamples.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
import win32com.client
3+
import numpy as np
4+
import matplotlib.pyplot as plt
5+
6+
picoVNACOMObj = win32com.client.Dispatch("PicoControl2.PicoVNA_2")
7+
8+
print("Connecting VNA")
9+
findVNA = picoVNACOMObj.FND()
10+
print('VNA ' + str(findVNA) + ' Loaded')
11+
12+
print("Load Calibration")
13+
ans=picoVNACOMObj.LoadCal('?');
14+
print("Result " + str(ans))
15+
16+
print("Making Measurement")
17+
picoVNACOMObj.Measure('ALL');
18+
19+
print("getting S11 LogMag Data")
20+
raw = picoVNACOMObj.GetData("S11","logmag",0)
21+
splitdata = raw.split(',')
22+
converteddata = np.array(splitdata)
23+
converteddata = converteddata.astype(np.float)
24+
frequency = converteddata[: : 2]
25+
data = converteddata[1 : : 2]
26+
27+
plt.plot(frequency, data)
28+
plt.ylabel("S11 LogMag")
29+
plt.xlabel("Frequency")
30+
plt.show()
31+
32+
a = picoVNACOMObj.CloseVNA()
33+
34+
print("VNA Closed")
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
2+
<PropertyGroup>
3+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4+
<SchemaVersion>2.0</SchemaVersion>
5+
<ProjectGuid>8f2a247d-7a6f-4878-903f-df1ed8c10549</ProjectGuid>
6+
<ProjectHome>.</ProjectHome>
7+
<StartupFile>PicoVNAExamples.py</StartupFile>
8+
<SearchPath>
9+
</SearchPath>
10+
<WorkingDirectory>.</WorkingDirectory>
11+
<OutputPath>.</OutputPath>
12+
<Name>PicoVNAExamples</Name>
13+
<RootNamespace>PicoVNAExamples</RootNamespace>
14+
<InterpreterId>Global|ContinuumAnalytics|Anaconda27-32</InterpreterId>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
17+
<DebugSymbols>true</DebugSymbols>
18+
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
19+
</PropertyGroup>
20+
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
21+
<DebugSymbols>true</DebugSymbols>
22+
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
23+
</PropertyGroup>
24+
<ItemGroup>
25+
<Compile Include="PicoVNAExamples.py" />
26+
<Compile Include="PicoVNAPython Wrapper\2060C37E-D05E-4D5B-AB88-E29373C3C8ECx0x1x0.py" />
27+
</ItemGroup>
28+
<ItemGroup>
29+
<InterpreterReference Include="Global|ContinuumAnalytics|Anaconda27-32" />
30+
<InterpreterReference Include="Global|ContinuumAnalytics|Anaconda36-32" />
31+
</ItemGroup>
32+
<ItemGroup>
33+
<Folder Include="PicoVNAPython Wrapper\" />
34+
</ItemGroup>
35+
<ItemGroup>
36+
<Content Include="PicoVNAPython Wrapper\2060C37E-D05E-4D5B-AB88-E29373C3C8ECx0x1x0.pyc" />
37+
</ItemGroup>
38+
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Python Tools\Microsoft.PythonTools.targets" />
39+
<!-- Uncomment the CoreCompile target to enable the Build command in
40+
Visual Studio and specify your pre- and post-build commands in
41+
the BeforeBuild and AfterBuild targets below. -->
42+
<!--<Target Name="CoreCompile" />-->
43+
<Target Name="BeforeBuild">
44+
</Target>
45+
<Target Name="AfterBuild">
46+
</Target>
47+
</Project>

0 commit comments

Comments
 (0)