| @@ -23,10 +23,34 @@ classdef Equipment < handle | |||||
| id = ecq.query('*idn?'); | id = ecq.query('*idn?'); | ||||
| end | end | ||||
| function clear(ecq) | |||||
| ecq.write('*cls'); | |||||
| end | |||||
| function opc(ecq) | |||||
| ecq.query('*OPC?'); | |||||
| end | |||||
| function unlock(ecq) | function unlock(ecq) | ||||
| if ecq.channel >= 0 | |||||
| fprintf(ecq.tcp,'++loc'); | |||||
| ecq.locked = false; | |||||
| else | |||||
| warning('Device does not support unlocking') | |||||
| end | |||||
| end | end | ||||
| function lock(ecq) | 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 | end | ||||
| function delete(ecq) | function delete(ecq) | ||||
| @@ -57,6 +81,8 @@ classdef Equipment < handle | |||||
| function e = get.error(ecq) | function e = get.error(ecq) | ||||
| e = ecq.query('SYSTem:ERRor?'); | e = ecq.query('SYSTem:ERRor?'); | ||||
| end | end | ||||
| end | end | ||||
| methods (Static) | methods (Static) | ||||
| function tcpobject = getTCP(ipAddress,port) | function tcpobject = getTCP(ipAddress,port) | ||||
| @@ -87,6 +113,10 @@ classdef Equipment < handle | |||||
| end | end | ||||
| end | end | ||||
| function bool = isnum(input) | |||||
| bool = isnumeric(input)&&isscalar(input); | |||||
| end | |||||
| function iptest(ipAddress) | 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'); | 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) | if isempty(validip) | ||||