Input and Output S16A User’s Guide
16 EDT, Inc. October, 1996
s16a_serial_str
Description
Send a command string to the Analog Input Module. Read the response from the AIM and return it only if
it differs from the command string sent. Otherwise return NULL. This routine is especially useful for
command strings, which echo the command string, unless an error occurs.
Syntax
char *s16a_serial_str(S16aDev *s16a_p, char *str);
Arguments
s16a_p S16A device struct, returned from s16a_open
str Null-terminated command string to send to the Analog Input Module
Return
NULL indicates a response string that matches the input command string, which indicates successful
transmission. Otherwise, this routine returns a pointer to a string containing the characters received in
response to the command string. The response string is in a single buffer allocated by the library. Therefore,
if you need to preserve the response string, you must copy it to another buffer before making another
libs16a.a library call. Sets errno on failure.
s16a_serial_write
Description
Send a command string to the Analog Input Module.
Syntax
int s16a_serial_write(S16aDev *s16a_p, char *buf, size);
Arguments
s16a_p S16A device struct, returned from s16a_open
buf Array of characters containing the command string to send to the Analog Input Module
size Number of characters in the command string
Return
Success: number of characters transferred; –1 on driver error. Sets errno on failure.