our board controls a cnc machine that has ability to move in three axises. ın z axis it can drill pcb cards. and we have programs that are written in C language. And these C programs are loaded to keil. So for example when we write a command "circle" with its parameters(i.e centre and radius) the cnc machine draws a circle with the given centre and radius. Here we want to do this by using Matlab.So we want our running 8051 program to communicate with Matlab over an RS232 link.The data is the commands like circle,line,freemotion etc.. that is written on Matlab as a string. I wrote a matlab code to transmit the data to the board like this: s = serial('COM1') fopen(s) fprintf(s,'freemotion') fclose(s) delete(s) clear s By running this code we expect to run the cnc machine properly. When only matlab program is running(Keil is inactive) we measured the data from serial port by using an oscilloscope,we saw that an information transmitted but we don't know if it is the real command or not. But if we run the Keil we don't know if Matlab transmits the data or not.
the baudrate values for keil and matlab are the same and equal to 9600. But when we run the matlab program it gives an error as below warning: a timeout occured before the terminator was reached
Please stick to just one thread! Here: http://www.keil.com/forum/docs/thread7205.asp#msg33584
Have you ever tried a different way: http://www.keil.com/pr/article/1073.htm Reinhard