PC Communication Driver
22
RS232 Communications Reference Manual
8/99
3.4
API Functions Common To All Drivers,
continued
long CElnApi::TransCeive(unsigned char* pbyTxMsg, unsigned char* pbyRxMsg, int nMaxTx int nMaxRx,
int* pnActualLength, int nUnitAddr);
pbyTxMsg:
Ptr to the outgoing message.
pbyRxMsg:
Buffer ptr for incoming message.
nMaxTx:
Outgoing msg length.
nMaxRx:
In buffer size.
pnActualLength:
Return value in disguise; length of incoming message.
nUnitAddr:
Address of unit.
This function sends a message to an instrument and receives the response. Make sure that the buffer that
pRxMsg points to is big enough to hold the instrument’s reply. If the reply is longer than MaxRx, it will be
truncated and a receive buffer overflow error will be returned.
Although the protocol makes it theoretically possible to transmit new messages while outstanding messages
are pending, this mode will be unsupported for the sake of simplicity
void CElnApi::SoftReset()
This function performs a reset of the port hardware. It shouldn’t be necessary to use it, but it has been
necessary in the past when dealing with some particularly ornery SCC chips.
3.5 Anatomy of a Standard Return Value
0 indicates success.
Bit 0-7: Error code returned from instrument if application error occurred.
Bit 8:
Receive buffer overrun.
Bit 9:
Application error; instrument returned ANAK.
Bit 10: Link error; bad CRC.
Bit 11: Physical error; bad framing or parity, timeout.
Содержание RS-232
Страница 12: ...Overview 2 RS232 Communications Reference Manual 8 99 ...
Страница 24: ...Protocol Description 14 RS232 Communications Reference Manual 8 99 ...
Страница 36: ...PC Communication Driver 26 RS232 Communications Reference Manual 8 99 ...
Страница 121: ...Function Parameter Index Reference 8 99 RS232 Communications Reference Manual 111 Static Configuration Parameters None ...
Страница 143: ...Function Parameter Index Reference 8 99 RS232 Communications Reference Manual 133 ...
Страница 150: ...Index 140 RS232 Communications Reference Manual 8 99 ...
Страница 151: ......
Страница 152: ...Industrial Automation and Control Honeywell Inc 1100 Virginia Drive Fort Washington Pennsylvania 19034 ...