问题
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