Page 1 of 1

How to create a box with an integer output

Posted: Thu Jun 27, 2019 3:21 pm
by Tristan
Hi,

I am trying to create a box with an integer as an output, I want to send a score to a Matlab box. However since the only output compatible is a stimulation I don't know how the conversion is done.
I am sending the git link of the .h and the .cpp
https://github.com/TristanVenot/Score.git

Thank you in advance,

Tristan

Re: How to create a box with an integer output

Posted: Mon Jul 01, 2019 8:49 am
by Thibaut
466/5000
I looked at your code diagonally, You want to send any int by stimulation. I have never tested sending anything, but normally the stimulations are codified (http://openvibe.inria.fr/stimulation-codes/). Between 0 and 31 you have the OVTK_StimulationId_Number_XX. You can put a stimulation listener after your box to see if he agrees by sending a little bit of everything.
On the other hand, the encode header is necessary to do it only once

Code: Select all

m_oOutput0Encoder.encodeHeader();
There is also the possibility to send a (1,1) matrix

Re: How to create a box with an integer output

Posted: Tue Jul 02, 2019 9:36 am
by Tristan
Hi,

Thank you for your answer, sending int with the stimulation is possible, the identifier will just send the number, I think the limit is uint32, after this my memory was overloaded when I tried to send a stimulation this big. However, you cannot send directly negative int (it will give you a gigantic number instead of for example -1). My data were between -10 and 10 so I came up with a simple solution, you do the absolute value of your data and if it is negative you multiply them by a 100, at the reception you just reconfigure by saying if it is superior to 100, you divide them by 100 and put a negative sign. if you check on the gitHub the new version it works fine now.

Best,
Tristan V.