UbiQ Scenario Manager User Manual
78
5.2.24
sendComData
Syntax
int sendComData (int nPort, char *OutBuf, int nOutLen, char *ReadBuf, int
nReadLen, int nTimeout)
Parameters
nPort: Specifies the COM port
OutBuf: Specifies output data buffer address
nOutLen: Specifies the length of sending data
ReadBuf: Specifies receiving data buffer address
nReadLen: Specifies the length of receiving data
nTimeout: Specifies the timeout of receiving data
Description
This function sends the data to the COM nPort and waits until return data is
received or timeout. The return value is the actual length of receiving data.
Example
char pOut[20];
char pRead[50];
char pTemp[5];
int nRet;
int i;
pOut="#011001\r";
setdebug(TRUE);
debug("Digital Out in", 0);
nRet = sendComData(2,pOut,8,pRead,2,1000); //send data to COM2
if (nRet==2) {
debug("Data is correct!",nRet);
return (1);
}
return (0);
See Also
OpenPort
Summary of Contents for UbiQ
Page 1: ...User Manual UbiQ Scenario Manager User Manual V1 03...
Page 4: ...UbiQ Scenario Manager User Manual iv...
Page 7: ...Chapter 1 1 Introduction...
Page 13: ...Chapter 2 2 Getting Started...
Page 37: ...Chapter 3 3 Tutorials...
Page 47: ...Chapter 4 4 Basic of Smart C Script Language...
Page 62: ...UbiQ Scenario Manager User Manual 56...