CANopen Master Documentation
Version 6.06.04
|
The TIME stamp Object is broadcasted periodically by the TIME producer. This TIME provides the simple network clock.
There may be a time jitter in transmission by the TIME producer corresponding approximately to the latency due to some other message being transmitted just before the TIME. In order to guarantee timely access to the CAN bus the TIME is given a very high priority identifier (see object 1012h).
Data Structures | |
struct | ComTimeOfDay_s |
Enumerations | |
enum | ComTimeMode_e { eCOM_TIME_MODE_CONSUMER = 0 , eCOM_TIME_MODE_PRODUCER = 1 , eCOM_TIME_MODE_DISABLE = 2 } |
Functions | |
void | ComTimeEventConsume (uint8_t ubNetV, ComTimeOfDay_ts *ptsTimeStampV) |
ComStatus_tv | ComTimeGetId (uint8_t ubNetV, uint32_t *pulIdV) |
ComStatus_tv | ComTimeGetMode (uint8_t ubNetV, uint8_t *pubModeV) |
ComStatus_tv | ComTimeProduce (uint8_t ubNetV) |
ComStatus_tv | ComTimeSetId (uint8_t ubNetV, uint32_t ulIdV) |
ComStatus_tv | ComTimeSetMode (uint8_t ubNetV, uint8_t ubModeV) |
ComTimeOfDay_ts * | ComTimeStampFromLocaltime (void) |
enum ComTimeMode_e |
The enumeration defines the values for setting the TIME service mode to either producer or consumer. The definitions are used by ComTimeGetMode() and ComTimeSetMode().
By default (i.e. after start-up of the protocol stack), the TIME service is disabled.
Enumerator | |
---|---|
eCOM_TIME_MODE_CONSUMER | Consume TIME service |
eCOM_TIME_MODE_PRODUCER | Produce TIME service |
eCOM_TIME_MODE_DISABLE | Disable TIME service |
void ComTimeEventConsume | ( | uint8_t | ubNetV, |
ComTimeOfDay_ts * | ptsTimeStampV | ||
) |
[in] | ubNetV | CANopen Network channel |
[out] | ptsTimeStampV | Pointer to time-of-day structure |
This function is called upon reception of a TIME message.
The action on this function is application specific. The function body is placed inside the file com_user.c
.
ComStatus_tv ComTimeGetId | ( | uint8_t | ubNetV, |
uint32_t * | pulIdV | ||
) |
[in] | ubNetV | CANopen Network channel |
[out] | pulIdV | Pointer to identifier value variable |
This function reads the identifier value for the TIME service.
ComStatus_tv ComTimeGetMode | ( | uint8_t | ubNetV, |
uint8_t * | pubModeV | ||
) |
[in] | ubNetV | CANopen Network channel |
[out] | pubModeV | Pointer to device mode variable |
This function reads the device mode for the TIME service.
ComStatus_tv ComTimeProduce | ( | uint8_t | ubNetV | ) |
[in] | ubNetV | CANopen Network channel |
This function is used by the application in order to trigger the transmission of the TIME service. The internal TIME_OF_DAY structure is copied into the service payload.
ComStatus_tv ComTimeSetId | ( | uint8_t | ubNetV, |
uint32_t | ulIdV | ||
) |
[in] | ubNetV | CANopen Network channel |
[in] | ulIdV | Identifier value |
This function changes the identifier value for the TIME service. If the ID_FLAG_EXTENDED is set, the CANopen service uses the Extended Frame Format (EFF, 29-Bit CAN-ID).
ComStatus_tv ComTimeSetMode | ( | uint8_t | ubNetV, |
uint8_t | ubModeV | ||
) |
[in] | ubNetV | CANopen Network channel |
[in] | ubModeV | Service mode |
This function changes the mode (producer/consumer) for the TIME service, possible values for the parameter ubModeV are defined by the enumeration ComTimeMode_e.
ComTimeOfDay_ts * ComTimeStampFromLocaltime | ( | void | ) |
The implementation is OS specific.