Login | Register 

Parse serial data

General discussion about anything TouchDesigner

Parse serial data

Postby ahlynsky » Tue Jun 19, 2018 3:44 pm

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


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!
Screenshot 2018-06-19 15.33.29.png
Screenshot 2018-06-19 15.33.29.png (80.29 KiB) Viewed 934 times
Posts: 26
Joined: Mon Mar 19, 2018 10:46 am

Re: Parse serial data

Postby timgerritsen » Tue Jun 19, 2018 6:18 pm

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.

screenshot.jpg (72.83 KiB) Viewed 924 times
Posts: 66
Joined: Sun Jan 24, 2016 6:57 am

Re: Parse serial data

Postby ahlynsky » Tue Jun 19, 2018 7:19 pm

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
Posts: 26
Joined: Mon Mar 19, 2018 10:46 am

Return to General TouchDesigner Discussion

Who is online

Users browsing this forum: guarana and 15 guests