Skip to content

Commit 47d768a

Browse files
committed
Added functions for connecting to PicoVNA108
1 parent 9182702 commit 47d768a

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

functions/connectVNA108.m

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
%% connectVNA108
2+
%
3+
%% Description
4+
%
5+
% |connectVNA108()| creates and returns a COM object to a PicoVNA108 device.
6+
%
7+
% *Output Arguments:*
8+
%
9+
% * |obj| - the VNA108 COM object corresponding to the PicoVNA device
10+
%
11+
% See also <disconnectVNA.html disconnectVNA> .
12+
13+
function [obj] = connectVNA180()
14+
15+
% Create VNA COM object.
16+
obj = actxserver('PicoControl3.PicoVNA_3');
17+
18+
% Check for an available VNA.
19+
findPicoVNA = obj.FND();
20+
21+
if (findPicoVNA==0)
22+
error('connectVNA:VNANotFound', 'No PicoVNA device found.');
23+
end
24+
25+
end
26+
27+
%%
28+
% *Copyright:* © 2017-2020 Pico Technology Ltd. All rights reserved.

functions/connectVNA108_SN.m

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
%% ConnectVNA108_SN
2+
%
3+
%% Description
4+
% CONNECTVNA108_SN Creates PicoVNA108 COM object.
5+
%
6+
% connectVNA() returns a COM object to a PicoVNA108 device.
7+
%
8+
% Copyright: © 2017-2020 Pico Technology Ltd. All rights reserved.
9+
%
10+
% See also DISCONNECTVNA.
11+
12+
function [obj] = connectVNA_SN(serialNumber)
13+
% Create VNA COM object.
14+
obj = actxserver('PicoControl3.PicoVNA_3');
15+
16+
% Check for an available VNA.
17+
findPicoVNA = obj.FNDSN(serialNumber);
18+
19+
if (findPicoVNA==0)
20+
error('ConnectVNA:VNANotFound', 'No PicoVNA device found.');
21+
end
22+
23+
end

0 commit comments

Comments
 (0)