Matlab serial Communication with Watlow F4 via Modbus RTU

核能气质少年 提交于 2019-12-12 06:02:11

问题


I am trying to build a communication between Matlab and a Watlow F4 temperature controller via Modbus RTU.

My code looks like this so far:

obj = serial('COM4');
fopen(obj);
set(obj, 'BaudRate', 9600);
set(obj, 'Terminator', 'CR');
set(obj, 'Timeout', 100);
set(obj, 'InputBufferSize', 3000);

now I am trying to read register 100. The address of the controller is 1.

fwrite(obj, [1 3 00 100 0 1 197 213]);
fread(obj, 7);

but then the following error occurs:

Warning: Unsuccessful read: The specified amount of 
data was not returned within the Timeout period. 

Does anyone of you have experience with this communication? Do you have an idea what solves this problem? Unfortunately the Watlow support could not help me with the communication...

Thanks!


回答1:


Replacing a broken RS232/USB Adapter solved the issue btw. So if anyone runs into the same problem maybe, the message I described was correct and the communication works like this :)



来源:https://stackoverflow.com/questions/34406677/matlab-serial-communication-with-watlow-f4-via-modbus-rtu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!