-
Notifications
You must be signed in to change notification settings - Fork 3
/
realterm.m
28 lines (28 loc) · 1.09 KB
/
realterm.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
hrealterm=actxserver('realterm.realtermintf'); % start Realterm as a server
% Only use these 3 lines to see what properties and methods realterm has.....
fprintf(1,'\nProperties of Realterm\n\n');
get(hrealterm) %List all properties.
try
set(hrealterm) %In later versions of matlab, this will show you what possible values the enumerations can take
catch
end
fprintf(1,'\n\nMethods of Realterm\n\n');
invoke(hrealterm) %List all functions
% some example properties
hrealterm.baud=9600;
hrealterm.caption='Matlab Realterm Server';
hrealterm.windowstate=1; %minimized
hrealterm.PortOpen=5; %open the comm port
is_open=(hrealterm.PortOpen~=1); %check that it opened OK
hrealterm.displayas=2; %show hex in terminal window
hrealterm.CaptureFile='c:\temp\matlab_data.dat'
invoke(hrealterm,'startcapture'); %start capture
%do what you want here
fprintf(1,'\n\nTry what you want here. Type RETURN to end demo and close realterm\n')
keyboard
invoke(hrealterm,'stopcapture');
try %try to close any we can in case they are faulty.
invoke(hrealterm,'close'); delete(hrealterm);
catch
fprintf('unable to close realterm')
end; %try