diff --git a/@MyCeCryo/MyCeCryo.m b/@MyCeCryo/MyCeCryo.m index 9a1ad19..5154cb4 100644 --- a/@MyCeCryo/MyCeCryo.m +++ b/@MyCeCryo/MyCeCryo.m @@ -1,44 +1,65 @@ % Class for controlling the auto manifold of ColdEdge stinger cryostat. -% The manifold is controlled by an Arduino board that communicates with +% The manifold is managed by an Arduino board that communicates with % computer via serial protocol. -classdef MyCeCryo < MyInstrument +classdef MyCeCryo < MyScpiInstrument - properties - valve_states - end - - methods (Access=public) - function this = MyCeCryo(interface, address) - % A visa-serial Device object is created by the superclass - % constructor - % Below the serial port is configured according to the labview - % program that came with the cryostat. - % These settings are the same as usual default, - % but still set them explicitly to be sure. - this.Device.BaudRate=9600; - this.Device.DataBits=8; - this.Device.FlowControl='none'; - this.Device.Parity='none'; - this.Device.StopBits=1; - this.Device.DataTerminalReady='on'; + methods (Access = public) + function this = MyCeCryo(interface, address, varargin) + this@MyScpiInstrument(interface, address, varargin{:}); % Buffer size of 64 kB should be way an overkill. The labview % program provided by ColdEdge use 256 Bytes. this.Device.InputBufferSize=2^16; this.Device.OutputBufferSize=2^16; - - this.Device end - function idn(this) - this.idn_str=query(this.Device,'LAINI*'); + function switchAllOff(this) + writePropertyHedged(this, ... + 'valve1', false, ... + 'valve2', false, ... + 'valve3', false, ... + 'valve4', false, ... + 'valve5', false, ... + 'valve7', false, ... + 'recirc', false, ... + 'cryocooler', false); end - - function toggleValve(this, n) - cmd=['LAcV',num2str(n),'*']; - query(this.Device, cmd); + end + + methods (Access = protected) + function createCommandList(this) + + % Valve states + for i=1:7 + if i == 6 + continue % No valve 6 + end + + tag = sprintf('valve%i',i); + cmd = sprintf(':VALVE%i',i); + addCommand(this, tag, cmd,... + 'default', false, ... + 'fmt_spec', '%b', ... + 'info', 'Valve open(true)/clsed(false)'); + end + + addCommand(this, 'recirc', ':REC',... + 'default', false, ... + 'fmt_spec', '%b', ... + 'info', 'Recirculator on/off'); + + addCommand(this, 'cryocooler', ':COOL',... + 'default', false, ... + 'fmt_spec', '%b', ... + 'info', 'Cryocooler on/off'); + + addCommand(this, 'press', ':PRES',... + 'default', false, ... + 'fmt_spec', '%e', ... + 'access', 'r', ... + 'info', 'Supply pressure (PSI)'); end end end diff --git a/GUIs/GuiCeCryo.mlapp b/GUIs/GuiCeCryo.mlapp new file mode 100644 index 0000000..32738b5 Binary files /dev/null and b/GUIs/GuiCeCryo.mlapp differ