Continuously read data from a serial data feed via TCP/IP socket technology?
Show older comments
Hello I have referenced a couple matlab TCP/IP examples and am trying to continuously read data from a serial feed via TCP/IP sockets.
Running example code as below produces a 1x45 uint8 array with each entry being a 2 digit integer.
%%Establishes connection to host server
t = tcpclient('172.30.16.25', 50005);
read(t);
The expected output is to be something like this.
$H¦N¦1E1DE¦QC.I¦U¦59A06A74¦0¦0¦2255100
Direct quote from the data supply manual. "Every record starts with a header (see description below) and ends with a CR/LF. Inside the record, the fields are separated by a “broken bar” symbol 0xA6 (not to be confused with the pipe symbol 0x7C). The length of a record is not defined and can therefore be more than 256 characters. The data specific to each record Command is contained between the header and CR/LF."
My goal is to continuously read the data and if possible store it in a struct similar to the example line. Any ideas on the syntax required to do so? Would it be quite strenuous to complete?
Answers (0)
Categories
Find more on TCP/IP Communication in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!