Prosoft-technology MVI69-ADMNET Manual do Utilizador Página 72

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 122
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 71
Application Development Function Library - ADMNET API MVI-ADMNET 'C' Programmable
Developer's Guide 'C' Programmable Application Development Module with Ethernet
Page 72 of 122 ProSoft Technology, Inc.
February 20, 2013
5.5 ADMNET API Receive Socket Functions
This section describes the ADMNET API Receive Socket functions.
ADM_receive_socket
Syntax
int ADM_receive_socket(char *skName, char *holdRecPtr, int *readLen, int
protocol);
Parameters
skName
Name of the socket that has been initialized and used to receive data.
holdRecPtr
Pointer to a buffer to hold data that will be received by the API.
readLen
Length of data received by the API.
protocol
Specified protocol to receive over Ethernet (USE_TCP or USE_UDP).
Description
To simplify a program, this function opens connection and receives message.
Return Value
SK_SUCCESS
Socket is successfully sent.
SK_NOT_FOUND
Socket could not be found.
SK_PROCESS_SOCKET
Socket is in the process of sending.
Example
char hold[5000];
int readLen;
int se, i;
se = ADM _receive_socket("receiveSK", holdingReg, &readLen, USE_UDP);
if(se == SK_SUCCESS)
{
printf("Length == %d\n", readLen);
for (i=0; i<readLen; i++)
{
printf("%02X ", *(holdingReg+i));
if(i%10 == 0) printf("\n");
}
printf("\n");
}
See Also
ADM_send_socket (page 70)
Vista de página 71
1 2 ... 67 68 69 70 71 72 73 74 75 76 77 ... 121 122

Comentários a estes Manuais

Sem comentários