* - This is the module to be run on the TARGET.
* - This program is meant to be used with the RTDX Excel project's
* VBA module h_write().
********************************************************************/
#include <stdio.h> /* fprintf(), puts() */
#include <stdlib.h> /* abort() */
#include <rtdx.h> /* RTDX */
#include "target.h" /* TARGET_INITIALIZE() */
#define ITERATIONS 100
RTDX_CreateInputChannel(ichan);
void main()
{
int recvd; /* Data received*/
unsigned int i=2; /* loop counter */
int a,ocu;
unsigned int st;
/* Target initialization for RTDX */
TARGET_INITIALIZE();
/* Enable the channel, "ichan" */
RTDX_enableInput(&ichan);
st=RTDX_read(&ichan,&recvd,sizeof(recvd) );
a=sizeof(recvd);
for ( i = 0; i < ITERATIONS; i++ ) {
/* Request an integer from the host */
if ( (RTDX_read(&ichan,&recvd,sizeof(recvd) )) !=
sizeof(recvd) ) {
fprintf(stderr,
"\nError: RTDX_read() failed\n");
abort();
}
}
/* Disable the channel, "ichan" */
RTDX_disableInput(&ichan);
puts("\nProgram Completed!");
}