通过Modbus RTU与Watlow F4进行Matlab串行通信 [英] Matlab serial Communication with Watlow F4 via Modbus RTU

查看:508
本文介绍了通过Modbus RTU与Watlow F4进行Matlab串行通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过Modbus RTU在Matlab和Watlow F4温度控制器之间建立通信.

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);

现在我正在尝试读取寄存器100.控制器的地址为1.

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);

但随后发生以下错误:

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...

谢谢!

推荐答案

更换损坏的RS232/USB适配器可以解决此问题.因此,如果有人遇到相同的问题,那么我描述的消息是正确的,通信就可以像这样:)

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 :)

这篇关于通过Modbus RTU与Watlow F4进行Matlab串行通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆