Question

I'm currently trying to get readings from an ez430 Chronos watch with accelerometer through a USB dongle. I'm using the instrument-control library in Octave to achieve this, but I'm running into issues when accessing members of the serial() function's returned octave_serial object. My code is as follows for now:

clear
% SETUP of USB AccessPoint

port_number='/dev/ttyACM0';   
%port_number='/dev/ttyS101';

s = serial(port_number, 115200)
s.InputBufferSize
s.InputBufferSize = 1024;
s.FlowControl='none';
s.Timeout=1;
s.ReadAsyncMode='continuous'; % !!!!!!! important
if s.Status(1:4)=='open'
  disp('Closing formerly opened port');
  fclose(s);
end;

s.ErrorFcn=@mycallback; % not important - you can specify your own error callback

The error I'm getting when running this is error: can't perform indexing operations for octave_serial type The trace only specifies this file, so there's no issues with anything in the libraries, but I'm getting frustrated because I can't find any documentation on what the format of an octave_serial object is.

This is not the issue where I accidentally typed the full filename with extension when running the program. If it was I would have found it by now thanks to the thousands of hits on google dealing with that issue ;)

Any help would be greatly appreciated. Thanks guys!

Was it helpful?

Solution

The functions/class you are using are part of Octave Forge instrument control package, they are not part of Octave core. While most of the packages there are compatible with Matlab syntax, this package is not. The syntax you are trying to use for Matlab only.

However, the instrument control package has quite good documentation with many examples on Octave's wiki. I would recommend you take a look there. Plus, you mention it's a USB dongle. Shouldn't you be using usbtmc instead of serial ?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top