There is a try-catch functionality in matlab that (to me) sort of looks
like java's try-catch. There is no generic multi-threading support in
Matlab like there is in java as far as I know. That being said, Matlab
always ships with a complete JRE so you can always use java's
multi-threading. Mathworks doesn't actively advertise this fact, probably
because they want their users to use the matlab language and matlab
solutions (like their parallel computing toolbox e.g.) instead of java.
I was also thinking about a boilerplate-like function. You could even make
it universal for octave and matlab when you detect in which environment it
runs. If you are interested I could make something like that e.g. a
function that looks like this: "myioio = createIOIO('COM4');", and "myioio
= createIOIO;" to do auto probing. Or maybe a `connectIOIO` function that
also connects. I could also do other examples, e.g. to plot the analog
inputs.
But since I don't fully understand ioiolib and don't know how things like
exceptions, events, connections over TCP and bluetooth should work in this
context, I'm not sure what a proper boilerplate function should look like
beyond a simple com-port connection. Also, ideally I imagine that it would
be nice when the firmware version is detected, and automatically the proper
PC side ioiolib version is used (maybe even resolve and use the correct
versions of the dependancies, jna and purejavacomm). Or at least give a
warning when there is a mismatch.
That's why I thought I'd post just simple one-file example scripts that can
easlily be adapted for other means. That way at least I don't obstruct
other solutions by hiding or obscuring the mechanisms involved behind
potentially ill designed abstraction layers.
Op vrijdag 11 april 2014 17:50:08 UTC+2 schreef Ytai:
>
> Very nice! I didn't know you can do that from MATLAB. How are exceptions
> and multi-threading handled there?
> Also, it would be cool to wrap all the boilerplate code in a separate file
> (function) that can be reused across apps. This function can take the
> serial port as an argument.
>
>
> On Thu, Apr 10, 2014 at 7:12 AM, Ronald <[email protected]
> <javascript:>>wrote:
>
>> Hi,
>>
>> See attachments for examples to control the IOIO OTG using Matlab and Gnu
>> Octave. You'll also need the jar files for purejavacomm, jna and a jar of
>> the ioiolib.
>> This allows me to experiment with my IOIO OTG board with an interpreted
>> high level language without any java compilation! It may also be possible
>> to make Simulink blocks this way.
>>
>> For octave, make sure you have the java package installed. I've used this
>> version to test the script:
>>
>> http://sourceforge.net/projects/octave/files/Octave%20Windows%20binaries/Octave%203.6.4%20for%20Windows%20Microsoft%20Visual%20Studio/
>>
>> To whom it may concern: Thanks for creating this nice little board and
>> it's accompanying software! I hope it will become very successful. I thing
>> the price could come down quite a bit when production volumes increase.
>>
>> Kind regards,
>>
>> Ronald
>>
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "ioio-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> To post to this group, send email to [email protected]<javascript:>
>> .
>> Visit this group at http://groups.google.com/group/ioio-users.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
--
You received this message because you are subscribed to the Google Groups
"ioio-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/ioio-users.
For more options, visit https://groups.google.com/d/optout.