Eurotherm Modbus RS232 Control

버전 1.74.0.0 (450 KB) 작성자: Geoffrey Akien
Reads and writes information to Eurotherm controllers via Modbus RTU protocols.
다운로드 수: 2.8K
업데이트 날짜: 2017/3/31

라이선스 보기

Reads and writes information to Eurotherm controllers via Modbus RTU protocols. Currently only tested with serial RS232, but should work the same with RS485 if wired correctly. So far only tested with Eurotherm 2416 and 3216 temperature controllers but they all use the same language so it should be widely applicable. The code is well commented so you should be able to modify it easily. I've currently only implemented it using read and write n words (codes 3 and 16), but I'd be happy to implement the other features, such as fast status read etc. (code 7). This code is derived from that in CO2gui, but is implemented using the native MATLAB serial interface only.
To use it:
1. Generate the serial object (this one is done on COM7)
serialObject = tempobj(7);
2. Connect to the object:
tempobjconnect(serialObject)
3. Start sending commands!
format:
tempobjcomm(commandType, serialObject, deviceAddress, parameterAddress, values)
e.g. to get the set temperature and the current temperature (process variable) in one go, do:
(assuming a default device address of 1)
data = tempobjcomm('read', serialObject, 1, 1, 2);

where data(1) is the current temperature and data(2) is the set temperature. Note that if your temperature controller has decimal places on the front panel, the outputs using 'read' will be scaled. E.g. if 1 decimal place, 24.2 will be returned as 242.

Higher resolution can be obtained using 'readfullres' instead, and also avoids any scaling issues.

To set a new set temperature:

tempobjcomm('write', serialObject, 1, 2, newTemperature)

'writefullres' can be used again if required for higher resolution. The same scaling issues apply as above for reading temperatures.

UPDATE

A deviceAddress can included in the initial serial object (see notes) for persistence' sake.

A host of sample settings files for Eurotherm controllers are included (with a device address of 1, but these can be easily modified).

인용 양식

Geoffrey Akien (2024). Eurotherm Modbus RS232 Control (https://www.mathworks.com/matlabcentral/fileexchange/24696-eurotherm-modbus-rs232-control), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R14SP3
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Modbus Communication에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.74.0.0

Added onoff into the package

1.73.0.0

Bugfix: added missing files serialread, serialwrite, serialflush, isrunning

1.72.0.0

Bugfix: added the missing isserial into the package

1.71.0.0

Bugfix for tempobjcomm allowing NaN values through when using write/writefullres

1.7.0.0

Bugfix, now allows parameter addresses of 0 (formally not supported by Eurotherm, but other modbus devices e.g. Omron do use it).

1.6.0.0

Added attribution to CRC append (used to be there, not quite sure where it went).

1.5.0.0

Bugfix.

1.4.0.0

tempobjcomm.m bugfix: isvaliddeviceaddress is now isvalidtempobjdeviceaddress.

1.3.0.0

Updated description.

1.2.0.0

Cleaned up commenting and some MLint messages (2012b), abstracted some functions for future use, and added capability to specify deviceAddress in tempobj. Also bundled a range of m.files for reading specific parameters.

1.0.0.0