Hi All!
to communicate with pumps in a test rig, I use a RS232 bricklet. Communication seems alright when I use BrickViewer and was already able to send commands and recieve data (see image).
As future communication should be run by a MATLAB script, I tried sending the same command in the following code (derived from the RS232 Bricklet Example), which did not work at all.
clear
clc
import com.tinkerforge.IPConnection;
import com.tinkerforge.BrickletRS232V2;
import java.lang.String;
HOST = 'localhost';
PORT = 4223;
UID = 'MyUID'; % Change XYZ to the UID of your RS232 Bricklet 2.0
ipcon = IPConnection(); % Create IP connection
rs232 = BrickletRS232V2(UID, ipcon); % Create device object
ipcon.connect(HOST, PORT); % Connect to brickd
rs232.disableReadCallback();
rs232.write(String('OUT_SP_1 100').toCharArray());
ipcon.disconnect();
I also tried adding \r\n to the char, which also did not work. Can you tell, where my fault is?