Quellcode durchsuchen

Class update met beep, isnum, clear en opc-functies

keep-around/c5216e76cad262723738e350daf9fd25abbc8ea7
Wouter Horlings vor 8 Jahren
Ursprung
Commit
ebf8f6f9e0
1 geänderte Dateien mit 30 neuen und 0 gelöschten Zeilen
  1. +30
    -0
      OOequipment/Equipment.m

+ 30
- 0
OOequipment/Equipment.m Datei anzeigen

@@ -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)


Laden…
Abbrechen
Speichern