forked from Metaming/Time-varying-metasurface
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsessionlog.m
48 lines (41 loc) · 1.37 KB
/
sessionlog.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
%SESSIONLOG Code for communicating with an instrument.
%
% This is the machine generated representation of an instrument control
% session. The instrument control session comprises all the steps you are
% likely to take when communicating with your instrument. These steps are:
%
% 1. Create an instrument object
% 2. Connect to the instrument
% 3. Configure properties
% 4. Write and read data
% 5. Disconnect from the instrument
%
% To run the instrument control session, type the name of the file,
% sessionlog, at the MATLAB command prompt.
%
% The file, SESSIONLOG.M must be on your MATLAB PATH. For additional information
% on setting your MATLAB PATH, type 'help addpath' at the MATLAB command
% prompt.
%
% Example:
% sessionlog;
%
% See also SERIAL, GPIB, TCPIP, UDP, VISA, BLUETOOTH, I2C, SPI.
%
% Creation time: 12-Jan-2017 15:09:15
% Find a VISA-USB object.
obj1 = instrfind('Type', 'visa-usb', 'RsrcName', 'USB0::0x0699::0x0347::C038680::0::INSTR', 'Tag', '');
% Create the VISA-USB object if it does not exist
% otherwise use the object that was found.
if isempty(obj1)
obj1 = visa('NI', 'USB0::0x0699::0x0347::C038680::0::INSTR');
else
fclose(obj1);
obj1 = obj1(1)
end
% Connect to instrument object, obj1.
fopen(obj1);
% Disconnect all objects.
fclose(obj1);
% Clean up all objects.
delete(obj1);