Unable to connect to Matlab through External Mode

I am trying to connect my pixhawk to matlab through external mode. Matlab version is 2015b. the serial console used is ttyS5 through FTDI cable which is working properly and connection assigned for external mode is ttyACM0. I have followed what the tutorial suggested:

  1. built and uploaded the code in pixhawk - Opted for external mode with 57600 baud rate in simulink. The code is controller I have developed.

  2. Inserted rc.txt with the file set as example in the tutorial.

  3. Gave the command in teraterm to start the module.

  4. Tried to connect simulink by clicking on ‘connect to target’ option.

After the last step I am getting a error message in simulink