Enabling shader messes up RS232 node


I have a patch where 48 bytes are received over RS232 (USB) and through a S+H node go to a very simple shader where the value of the byte adds colour to 48 textures.

The microcontroller that sends out the data sends out 48 bytes then pauses for 10ms which signals the end of the transmission, on the next transmission the RS232 buffer is cleared so there’s never more than 48 bytes in the buffer.

This all works fine as long as the shader is disabled, as soon as it’s enabled (even if the serial data isn’t connected to it) the serial buffer just fills with thousands of values and everything grinds to a halt. It stops seeing that 10ms break as the end of the transmission and just keeps filling the buffer. With the shader enabled I need about a 60ms break for the serial node to correctly register the end of the transmission which is way too slow for my purposes.

CPU usage is around 10% so it’s not a resource problem and the problem exists even if the renderer is minimised.

Really stumped!

Thanks in advance

hi space-face,

in order to solve your problem you need to understand how vvvv nodes are processing data. the vvvv mainloop has a certain framerate and all nodes only calculate once per frame. usually with 60fps if you have a directx renderer open, that is something like 16ms between two calls of the node. use a Timimg or Perfmeter node to see how your current framerate is. also compare it before and after enabling the shader.

in any case, if your microcontroller does a 10ms break its pretty unlikely that vvvv will catch that. a much better strategy is to send a unique byte sequence with every package that the Tokenizer node can detect to gather the packages for you…

see helpfile of the mentioned nodes (F1 on the node or right click in nodebrowser) for more info.

thank you tonfilm! Tokenizer is what I was looking for.