An initial idea:
% Create the tcpclient object (assuming you have already connected)
% t = tcpclient('192.168.1.1', 12345);
% Properly escape the nested quotes in the string
compositeString = 'Unit.CommandAsText("myFile",1,"Millisecond")';
% Send the composite string directly
writeline(t, compositeString);
% Alternatively, convert the string to a uint8 array and use fwrite
asciiArray = uint8(compositeString);
write(t, asciiArray, 'uint8');
If you are still facing issues, ensure that:
- The TCP connection is properly established and configured.
- The server on the other end can interpret the received data correctly.