Code covered by the BSD License  

Highlights from
Eurotherm Modbus RS232 Control

Eurotherm Modbus RS232 Control

by

 

11 Jul 2009 (Updated )

Reads and writes information to Eurotherm controllers via Modbus RTU protocols.

tempobjwritesettemp.m
function tempobjwritesettemp(serialObject, setTemp)
% TEMPOBJWRITESETTEMP changes the set point of Eurotherm controllers
% tempobjwritesettemp(serialObject, setTemp) changes the set temperature of
% Eurotherm temperature controllers given a valid serial port object and a
% temperature from -199.9 to 500.0.  The temperature is sent as single
% precision.

% e.g. tempobjwritesettemp(tempobj(7), 37.596) - changes set point to
% 37.596 C on the device on COM7

% Range:

% serialObject = valid serial object (generated by tempobj)

% setTemp = number: -199.9 - 500


% checks the number of input arguments
error(nargchk(2, 2, nargin))

% error handling (the numbers are tested more thoroughly in tempobjcomm
if setTemp < -199.9 || setTemp > 500
    % errors
    error('Set temperature must be between -199.9 and 500 C')
end

% sends command
tempobjcomm('writefullres', serialObject, 1, 2, setTemp);

Contact us