Serial data being chopped short.

Jul 8, 2013 at 9:32am

Serial data being chopped short.

Hi,

I’ve been getting some help in my other post, about unpacking a packet of data, and sorry if its confusing starting a new topic, but I have the serial data unpacking now, however somewhere along the line in my patch, the serial data is being chopped short, i.e if you look at screen shot one, with the print object placed right after the serial in, each number of the serial packet is placed on a new line in the max window. Screen shot two, with the print object further down the patch, a limit of 12 characters will be placed on a line of the max window.

The serial data is coming from an arduino, which is using and external library to collect data from a brain reader (eeg device), the external declares the values as unsigned long variables… so some of the numbers coming through are in the millions, but mostly in the hundreds of thousands. So and example packet coming through will be:

200,0,0,103589,698790,247658,278765,172456,567898,678543,456763,27

however the numbers within the patch are being chopped up where they aren’t supposed to be, rather than being split at the commas, it will cut at 12 characters whether its in the middle of a number or not. So something is stopping the [unpack] working neatly, it all gets out of synch because the numbers are being split up ad-hoc.

I’m not sure if its a timing thing, or if one of the objects is imposing a limit or something???

I’m new to max, this is the first project I’ve attempted, and I’m sure its some beginners fundamental error I’m making, but I’ve spent the good part of the past week trying to fix the bugs, and this part has me stumped…

Thank you very much for any help!

#255246
Jul 8, 2013 at 9:33am

The screenshots and max patch attached above…

#255247
Jul 8, 2013 at 9:38am

And this is the original topic, where SeejayJames and Karrrlo have been amazing with their help:

http://cycling74.com/forums/topic/unpacking-a-packet-of-parsed-data/#post-254229

Attachments:
  1. maxscreen21
#255251
Jul 8, 2013 at 9:50am

I added a second zl group a few days ago, as with one group object, the [unpack] wasn’t working for some reason, I dont know why but a second one at least got the unpack to work.

Attachments:
  1. maxscreen1
#255255
Jul 9, 2013 at 8:48am

Hi I had this problem it think,

you haven’t got arduinos serial monitor open have you?

if so close that and try it,

i think the both fight for the serial data so they steal some from the other!

give it a go worked for me.

cheers!

#255424

You must be logged in to reply to this topic.