From: Syed Ameer Ahmed Gillani on
Hi!

I am working on RIO 47200 Motion Controller for antenna steering. I have developed an interface in Matlab to access the C code written in Mex file format for antenna steering.
I can compile the Mex file in Matlab for the first time and the program runs fine. If i recompile the program then it crashes the Matlab. You can see the sample C code below:

#include <stdlib.h>
#include <stdio.h>
#include"Galil.h"
#include "mex.h"

void mexFunction(int nlhs, mxArray *plhs[],int nrhs, const mxArray *prhs[] )
{
Galil g("129.16.208.166");
g.command("SB4");
g.command("SB5");
}
After recompiling the code in Matlab, i get the following error:
Segmentation violation occurred within signal handler. Unable to complete stack trace (stack was probably corrupted)

Plz. let me know, how can i get rid of this error. Looking forward to your positive response.

Ameer