Skip to content

Interrmitent error with setWaveform #25

@phillipagres

Description

@phillipagres

Hi, I am an experiencing an intermittently recurring error while attempting to set the waveform. The code I'm running is below, where mvObject is my magventure object.

waveform = 'BiphasicBurst';
curDirect = 'Normal';
burstPulses = 3;
ipi = 20;
baRV = 1
mvObject.setPage('Main');
mvObject.setWaveform(waveform,curDirect,burstPulses, ipi, baRV, 0);

The error is :

Index exceeds the number of array elements. Index must not exceed 14.

Error in magventure/parseResponse (line 1759)
                  factorAmplitudeB = readData(15);

Error in magventure/processCommand (line 1627)
                                [~,deviceResponse] = self.parseResponse(readData);

Error in magventure/setWaveform (line 962)
               [errorOrSuccess, deviceResponse] =  self.processCommand(commandLength,commandBytes,getResponse,14);

This error occurs infrequently, and I am not always able to reproduce it. It occurs regardless of whether I set varargin for mvObject.setWaveform to 0(False) or 1(True) - refering to getResponse.

I am already aware of a related issue regarding setting 'currentDirection' to 'Normal' instead of '00'. I have previously fixed this issue by editing line 956 of magventure.m from:
commandBytes = [commandID;setVal;model;mode;currentDir;waveformN;burstPulseIndex;ipi_M;ipi_L;BARatio_M;BARatio_L];

to:

commandBytes = [commandID;setVal;model;mode;currentDirN;waveformN;burstPulseIndex;ipi_M;ipi_L;BARatio_M;BARatio_L];

Perhaps this edit inadvertently caused my current issue, although the current issue occurs irregularly and is not always reproducible.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions