Parse serial data

Whats up everyone! Im trying my first scratch TD project and running into a bit of difficulty. Sorry if this is a noob question!

I currently have two sensors sending a set of values via the Serial Dat. Eventually it may be as many as fifty sensors.

it comes in looking like this

POS,0,15A4,1.37,1.42,2.32,50,xE8
POS,0,0714,0.70,-0.26,1.29,100,x21

Each parameter is separated by commas. The third parameter (15A4 and 0714) are the differentiators. I would like to use these to parse out the following three parameters.

In the case of 15A4 that would be 1.37, 1.42, 2.32.

Ideally i would have a select (i think?) chop called 15A4, that would output 1.37, 1.42, 2.32 on separate channels that i could then play with.

Anyone have any ideas on how to do this? Attached is a screenshot, I would attach the project, but it wouldn’t do any good without the sensors sending the data stream.

Thank you!

Hi there,

You can use a convert DAT to split the cells at the comma’s, then a select DAT to discard the first 2 columns, then a datto CHOP where the first column is ‘names’.
This way you have your columns as chop samples. Using a select & trim CHOPs you can easily fetch the data.

Hope this helps.

Cheers,
Tim

Hey Tim,

Thank you so much! I tried your suggestion (i think) and have one of the parameters isolated although I’m not sure its clean yet.

This gets me closer! The way that the data comes into the table sometimes 15A4 is in row 1 and sometimes its in row 2. I really need to use 15A4 as the string identifier rather then the cell position. I think I’m looking for the routepass maxmsp object (if your familiar with max.)

I should be able to figure the rest out, but would welcome any more tips!

Thanks for taking the time!

  • Andrew