Owner`s manual

M SERIES DAC
BASE UNIT AND MODULE OPERATION
____________________________________________________________________________
171
Description: The serin(...) function reads data from the selected
module and stores the data as a null terminated
string in the specified character array. The
selected module must be a 4-port senal I/O
module.
Example: Assume a V74 4-port serial I/O module is installed as Module 2
and is receiving data from a modem connected to Port 1 after a
dial string has been sent.
int get_connect()
*
*
*
{
char from_modem[30];
char *p;
serin(2,1,from_modem);
p=strchr(from_modem, ‘C’);
if(strncmp(p,"CONNECT",7)==0);
return(1);
else
return(0);
}
*
*
*
In this code fragment, data received from Module 2, Port 1 is
stored in character array “from_modem". The "p" pointer is
positioned to the first occurrence of capital “C” and the next
seven characters are compared against”CONNECT". If a match
is found, a connection to the remote modem is assumed and
subsequent data can be sent to the modem.
4e. int charsout(int a,int b,char *s)
Input: a - module number (I to 16)
b - desired port number (1 to 4)
*s - pointer string for output
Output: 0 - successful