![Advantech UbiQ Скачать руководство пользователя страница 84](http://html1.mh-extra.com/html/advantech/ubiq/ubiq_user-manual_2856809084.webp)
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
Содержание UbiQ
Страница 1: ...User Manual UbiQ Scenario Manager User Manual V1 03...
Страница 4: ...UbiQ Scenario Manager User Manual iv...
Страница 7: ...Chapter 1 1 Introduction...
Страница 13: ...Chapter 2 2 Getting Started...
Страница 37: ...Chapter 3 3 Tutorials...
Страница 47: ...Chapter 4 4 Basic of Smart C Script Language...
Страница 62: ...UbiQ Scenario Manager User Manual 56...
Страница 63: ...Chapter 5 5 Functions Reference...