User manual

CAN API reference
29 © 2007-2010 Analytica GmbH
CANStartAlive
CANStartAlive Starts the ALIVE mechanism, which checks periodically the state of the network
connection to the AnaGate hardware.
Syntax
#include <AnaGateDllCan.h>
int CANStartAlive(int hHandle, int nAliveTime );
Parameter
hHandle Valid access handle.
nAliveTime Default time out in seconds for the ALIVE mechanism.
Return value
Returns Null if successful, or an error value otherwise (Appendix A, Return Codes).
Description
The AnaGate communication protocol [TCP2010] supports an application specific connection control
which allows faster detection of broken connection lines.
The CANStartAlive function starts a concurrent process in the DLL in order to send defined alive
telegrams (ALIVE_REQ) peridically (approx. every half of the given time out) to the Anagate device via
the current network connection. Is the alive telegram not confirmed within the alive time the connection
is marked as disconnected and the socket is closed if not already closed.
Use the CANDeviceConnectState function to check the current network connection state.
Remarks
The CANStartAlive function is supported by library version 1.4-1.10 or higher.
It requires firmware version 1.3.8 or higher installed on the hardware, devices of type AnaGate CAN
(hardware version 1.1.A) does not support the application specific alive mechanism.
See also
CANDeviceConnectState
Section 2.1, “ Important properties of the network protocol”