Hi everybody
In my Matlab code I'd like to use an exernal ocx-file as API that is provided by the manufacturer of my measurement equipment. This provides an ActiveX user interface that allows to extract data from their system specific data files.
Within my code I initialize a COM server:
VTR = actxserver('vxaebas.VallenTRFileX');
This works fine. I can then read the file properties via the provided methods. E.g. get the ActiveX version by
disp( ['ActX Version',num2str(VTR.GetVersionInfoString)] );
I like to use the following method to extract the measured data:
VTR.OpenFile([filePath,fileName]);
RetCode = VTR.SeekAndRead(SetNo,OffsetSamples,SamplesToRead,DataArray);
The variables are: - RetCode: bool, 1=success, 0=nope
- SetNo: longint, the dataset to be extracted
- OffsetSamples: longint, starting point for reading data in specified set
- SamplesToRead: longint, number of samples to be read into buffer
- DataArray: OleVariant, Holds TR data and each entry is of type smallint
This method somehow opens the file and I'm able to read the sets specifics (e.g. the sampling rate at which it was recorded). But the function does not write on "DataArray". I need somehow to call-by-reference. So I tried to write my own data class for this, didn't work...
Is there any good trick?
Thanks a lot!
Best, Chris