# MATLAB error - An error occurred while starting the logging session (error code 6)

**URL:** <https://forum.liquidinstruments.com/t/matlab-error-an-error-occurred-while-starting-the-logging-session-error-code-6/766>\
**Category:** Software & APIs\
**Created:** [July 20, 2023, 8:59pm UTC](https://forum.liquidinstruments.com/t/matlab-error-an-error-occurred-while-starting-the-logging-session-error-code-6/766 "2023-07-20T20:59:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gvaldes](https://avatars.discourse-cdn.com/v4/letter/g/4bbf92/32.png) [@gvaldes](https://forum.liquidinstruments.com/u/gvaldes)\
**Post date:** [July 20, 2023, 8:59pm UTC](https://forum.liquidinstruments.com/t/matlab-error-an-error-occurred-while-starting-the-logging-session-error-code-6/766/1 "2023-07-20T20:59:53Z")

</div>

I am trying to run the matlab script below, but I get the error code 6.

```auto
m = MokuPhasemeter('192.168.xxx.xxx',true);
%%% Configure instrument to desired state

% start logging session and download file to local directory
m.start_logging('duration',10);

% Track the progress of data logging session
is_logging = true;
while is_logging
    progress = m.logging_progress();
    is_logging = progress.time_to_end > 1;
    pause(1);
end

```

Full error message:

```auto
Error using Requests/parse_response (line 36)
An error occurred while starting the logging session (error code 6)

Error in Requests/http_post (line 128)
            response = obj.parse_response(output, extras);

Error in MokuPhasemeter/start_logging (line 324)
            response = obj.session.http_post(obj.formatString('slot%d/phasemeter/start_logging',
            obj.slot_id), params);

Error in CheckIfLogs (line 5)
m.start_logging('duration',10);

```
