Hello Katharina,
Good news - the Bonsai soft code example is now on the main branch, here.
Is the idea to have Bonsai receive and process the rotary position data? Or is the idea to have Bonsai trigger position data streaming to MATLAB?
To have Bonsai receive the streaming data, you'd have Bonsai (instead of MATLAB) open the rotary encoder module's USB serial port. Bonsai would then send byte messages using the encoder module's serial interface. In Python syntax, you'd send:
(ord('S'), 1)
to start position streaming, and
(ord('S'), 0)
to stop streaming.
During streaming, data arriving at the port would be formatted as described in the interface docs.
If the goal is to have Bonsai trigger streaming to MATLAB (with the module controlled via the RotaryEncoderModule class), you'd set the state machine to react to an incoming APP soft code by sending a standard soft code back to the PC (e.g. here). The soft code handler would then call R.startUSBStream().
Please let me know if you run into any issues setting this up, I'd be glad to assist.
Josh