|
|
|
@@ -23,10 +23,34 @@ classdef Equipment < handle |
|
|
|
id = ecq.query('*idn?'); |
|
|
|
end |
|
|
|
|
|
|
|
function clear(ecq) |
|
|
|
ecq.write('*cls'); |
|
|
|
end |
|
|
|
|
|
|
|
function opc(ecq) |
|
|
|
ecq.query('*OPC?'); |
|
|
|
end |
|
|
|
|
|
|
|
function unlock(ecq) |
|
|
|
if ecq.channel >= 0 |
|
|
|
fprintf(ecq.tcp,'++loc'); |
|
|
|
ecq.locked = false; |
|
|
|
else |
|
|
|
warning('Device does not support unlocking') |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
function lock(ecq) |
|
|
|
if ecq.channel >= 0 |
|
|
|
fprintf(ecq.tcp,'++llo'); |
|
|
|
ecq.locked = true; |
|
|
|
else |
|
|
|
warning('Device does not support locking') |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
function beep(ecq) |
|
|
|
ecq.write('SYST:BEEP') |
|
|
|
end |
|
|
|
|
|
|
|
function delete(ecq) |
|
|
|
@@ -57,6 +81,8 @@ classdef Equipment < handle |
|
|
|
function e = get.error(ecq) |
|
|
|
e = ecq.query('SYSTem:ERRor?'); |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
end |
|
|
|
methods (Static) |
|
|
|
function tcpobject = getTCP(ipAddress,port) |
|
|
|
@@ -87,6 +113,10 @@ classdef Equipment < handle |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
function bool = isnum(input) |
|
|
|
bool = isnumeric(input)&&isscalar(input); |
|
|
|
end |
|
|
|
|
|
|
|
function iptest(ipAddress) |
|
|
|
validip = regexp(ipAddress,'^(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9]))$', 'once'); |
|
|
|
if isempty(validip) |
|
|
|
|