MATLAB EMBEDDED IDE LINK 4 - FOR USE WITH TEXAS INSTRUMENTS CODE COMPOSER STUDIO Guía de usuario Pagina 56

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 575
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 55
2 Automa tion Interface
and exit the program, or respond in s ome way. When you are writing or
reading data to your processor in a script or M-le, checking the status of
the channels can help you avoid errors during execution.
As your application runs you may nd it helpful to display progress
messages. In this case, the program directed MATLAB software to print a
message as it reads the data from the p rocessor by adding the function
disp('writing to processor...')
Function cc.rtdx.writemsg('ichan', int16(indata)) results in 20
messages stored on the processor. He re’s how.
When you write
indata to the processor, the following code running on the
processor takes your input data from
ichan, adds one to the values and
copiesthedatatomemory:
while ( !RTDX_isInputEnabled(&ichan) )
{/* wait for channel enable from MATLAB */}
RTDX_read( &ichan, recvd, sizeof(recvd) );
puts("\n\n Read Completed ");
for (j=1; j<=20; j++) {
for (i=0; i<MAX; i++) {
recvd[i] +=1;
}
while ( !RTDX_isOutputEnabled(&ochan) )
{ /* wait for channel enable from MATLAB */ }
RTDX_write( &ochan, recvd, sizeof(recvd) );
while ( RTDX_writing != NULL )
{ /* wait for data xfer INTERRUPT DRIVEN for C6000 */ }
}
Program int16_rtdx.c contains this source code. You can nd the le in a
folder in the
..\tidemos\rtdxtutorial directory.
5 Type the following to check the number of available messages to read from
the processor.
num_of_msgs = cc.rtdx.msgcount('ochan');
2-34
Vista de pagina 55
1 2 ... 51 52 53 54 55 56 57 58 59 60 61 ... 574 575

Comentarios a estos manuales

Sin comentarios