User manual

CAN API reference
19 © 2007-2010 Analytica GmbH
CANSetTime
CANSetTime — Sets the current system time on the AnaGate device.
Syntax
#include <AnaGateDllCAN.h>
int CANSetTime(int hHandle, long nSeconds, long nMicroseconds);
Parameter
hHandle Valid access handle.
nSeconds Time in seconds from 01.01.1970.
nMicroseconds Micro seconds.
Return value
Returns Null if successful, or an error value otherwise (Appendix A, Return Codes).
Description
The CANSetTime function sets the system time on the AnaGate hardware.
If the time stamp mode is switched on by the CANSetGlobals function, the AnaGate hardware adds a
time stamp to each incoming CAN telegram and a time stamp to the confirmation of a telegram sent via
the API (only if confirmations are switched on for data requests).
Remarks
The CANSetTime function is supported by library version 1.4-1.8 or higher.
The setting of the base time for the time stamp mode is not supported by the AnaGate CAN (hardware
version 1.1.A). This setting is ignored by the device.