6F8C0904
69
5.2 Sample Computer Link Protocol Program
5
/* SLW */
/**************************************************************************************************************/
/*
*/
/* cl_send - Register read/write processing
*/
/*
*/
/**************************************************************************************************************/
/*
*/
/* Calling sequence
*/
/*
*/
/* cl_send();
*/
/*
*/
/* Arguments: Isdp : int I : socket identifier
*/
/* ists : int O : return status
*/
/*
*/
/**************************************************************************************************************/
int cl_send( int Isdp )
{
int j, k ;
/* Loop counter
*/
int ists = 0 ;
/* Return status
*/
int iret ;
/* Return status
*/
int ircvsiz ;
/* Reception data length
*/
int isndsiz ;
/* Data length
*/
int icunt ;
/* Data setup index
*/
int idat ;
/* Temporary
*/
char csnd[ 1000 ] ;
/* Data send buffer
*/
char crcv[ 1000 ] ;
/* Data receive buffer
*/
fd_set ibits;
/* SELECT() bit mask
*/
struct timeval timeout;
/* SELECT() timer value
*/
struct sockaddr_in Snd, Rcv;
iret = -1 ;
memset( &Snd, 0x00, sizeof( Snd ) );
memset( &Rcv, 0x00, sizeof( Rcv ) );
memset( csnd, 0x00, sizeof( csnd ) );
/* Clear the send data buffer
*/
memset( crcv, 0x00, sizeof( crcv ) );
/* Clear the receive data buffer
*/
/* Set up the register write send data
*/
sprintf( &csnd[ 0 ], "(A01DW" ) ;
/* Set up the register write command
*/
/* Set the starting register number
*/
sprintf( &csnd[ strlen(csnd)], "%s", REG_TYPE );
sprintf( &csnd[ strlen(csnd) ], "%04s", REG_ADR );
sprintf( &csnd[ strlen( csnd) ], "," ) ;
idat = DATASIZ ;
/* Set the data count
*/
sprintf( &csnd[ strlen( csnd ) ], "%02d", idat ) ;
sprintf( &csnd[ strlen( csnd) ], "," ) ;
icunt = 0 ;
/* Comparison data storage index
*/
for( j = 0, k = 0; k < DATASIZ; k++ ){
/* Set register write data
*/
sprintf( &csnd[ strlen( csnd) ], "%04X", k ) ;
j = j + 4 ;
sprintf( &csnd[ strlen( csnd) ], "," ) ;
j = j + 1 ;
Содержание V Series
Страница 1: ...6F8C0904 Integrated Controller V Series Ethernet module EN311 User s Manual Sep 30 2004 ...
Страница 12: ......
Страница 16: ......
Страница 34: ......
Страница 40: ......
Страница 106: ......
Страница 180: ......
Страница 199: ...6F8C0904 179 7 5 RAS Information Readout 7 Figure 7 1 Packet Format IP Datagram ...
Страница 200: ...180 Ethernet module User s Manual Chapter 7 RAS Information 7 ...
Страница 224: ......
Страница 240: ......
Страница 244: ......
Страница 248: ......
Страница 250: ......
Страница 256: ......
Страница 258: ......