简体   繁体   English

通过Modbus RTU与Watlow F4进行Matlab串行通信

[英]Matlab serial Communication with Watlow F4 via Modbus RTU

I am trying to build a communication between Matlab and a Watlow F4 temperature controller via Modbus RTU. 我正在尝试通过Modbus RTU在Matlab和Watlow F4温度控制器之间建立通信。

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. 现在,我尝试读取寄存器100。控制器的地址为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! 谢谢!

Replacing a broken RS232/USB Adapter solved the issue btw. 更换损坏的RS232 / USB适配器可以解决此问题。 So if anyone runs into the same problem maybe, the message I described was correct and the communication works like this :) 因此,如果有人遇到相同的问题,我所描述的消息是正确的,通信方式如下:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM