Send_Receive_Binary - ICP DAS USA MP-8 43 Series Function Reference

Hide thumbs Also See for MP-8 43 Series:
Table of Contents

Advertisement

4.2.3 Send_Receive_Binary

Description:
This function is used to Send binary data and receive binary data with the
fixed length.
Syntax:
long Send_Receive_Binary(unsigned char
in_Len,char
ByteResult[], WORD out_Len, WORD wTimeOut, WORD
wSTimeOut=0)
Parameter:
cPort :
ByteCmd[]:
in_Len:
ByteResult[]:
out_Len:
wTimeOut:
[wSTimeOut]:
Return Value:
0:
NO_ERROR
Others:
Error code, please refer to "Appendix A Error Code".
Example:
unsigned char
m_ComPort=3;
DWORD m_baudrate=9600;
char
m_databit=8;
char
m_parity=0;
char
m_stopbit=0;
char
m_ByteCmd[100],ByteResult[100];
int
in_Len=10,out_Len=10;
Word wTimeout=10;
long
RET;
RET =Open_Com(m_ComPort, m_baudrate, m_databit, m_parity, m_stopbit);
http://www.icpdas.com
[Input] 1=COM1, 2=COM2 .... , MAXPORT
Pointer to binary data to be send.
Number of binary data bytes to send.
Buffer into which received data will be stored
Number of bytes binary data to be received.
Timeout for receiving result string in ms Unit
Optional
[Input] for the sending timeout in ms Unit.
Before use this, you must enable the flow control first.
//Com_port of PAC
MP-8x43 Function Reference V 1.0
++
[C
]
cPort,
char
ByteCmd[],WORD
92 

Advertisement

Table of Contents
loading

Table of Contents