Sensoray 2410 API Manuel d'utilisateur Page 14

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 39
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 13
Sensoray 24xx Programming Guide
10
Module-Independent Functions
5.4 Error Functions
5.4.1 s24xx_ErrorText()
Function: Return an error description string.
Prototype:
const char * s24xx_ErrorText( u32 err );
Returns: Pointer to a text string that describes the error code contained in
err
.
Example:
// A simple application program.
int main( void )
{
int rtnval = 1;
u32 err = ERR_NONE;
char ipaddr[] = "192.168.24.10"
HSESSION sess;
// Open the API.
if ( !s24xx_ApiOpen() )
printf( "Failed to open API\n" );
else {
// Open a session on a Model 2410 I/O module.
if ( !s24xx_SessionOpen( &sess, &err, 2410, ipaddr, 23, 1000 ) ) {
printf( "Error: %s\n", s24xx_ErrorText(err) );
rtnval = err;
}
else {
// ... perform I/O operations as required by the application ...
s24xx_SessionClose( sess ); // Close the session and API.
}
s24xx_ApiClose();
}
return rtnval;
}
Argument Description
err
Error code. See Section 4.3.3 for list of error codes.
Vue de la page 13
1 2 ... 9 10 11 12 13 14 15 16 17 18 19 ... 38 39

Commentaires sur ces manuels

Pas de commentaire