CANopen Master Documentation
Version 6.06.04
|
LSS offers the possibility to inquire and change the settings of certain parameters of the local layers on a CANopen module with LSS Slave capabilities by a CANopen module with LSS Master capabilities via the CAN Network. The following parameters can be inquired and/or changed by the use of LSS:
By using LSS a LSS Slave can be configured for a CANopen network without using any devices like DIP-switches for setting the parameters.
Data Structures | |
struct | ComLssAddress_s |
Typedefs | |
typedef struct ComLssAddress_s | ComLssAddress_ts |
Enumerations | |
enum | ComLssMode_e { eCOM_LSS_MODE_WAITING = 0 , eCOM_LSS_MODE_CONFIGURATION } |
enum | ComLssProt_e { } |
enum | ComLssStat_e { eCOM_LSS_STAT_ACTIVE = 1 , eCOM_LSS_STAT_SUCCESS , eCOM_LSS_STAT_ERROR , eCOM_LSS_STAT_TIMEOUT } |
enum | ComLssInqSrv_e { eCOM_LSS_INQ_SRV_VID = 0 , eCOM_LSS_INQ_SRV_PRD , eCOM_LSS_INQ_SRV_REV , eCOM_LSS_INQ_SRV_SRN , eCOM_LSS_INQ_SRV_NID } |
Functions | |
ComStatus_tv | ComLssConfigureBitTiming (uint8_t ubNetV, uint8_t ubBittimeSelV) |
ComStatus_tv | ComLssConfigureNodeId (uint8_t ubNetV, uint8_t ubNodeIdV) |
void | ComLssEventReceive (uint8_t ubNetV, uint8_t ubLssProtocolV) |
ComStatus_tv | ComLssFastscan (uint8_t ubNetV, uint32_t ulVendorIdV, uint32_t ulProdCodeV, uint32_t ulRevisionNumV, uint32_t ulSerialNumV) |
uint32_t | ComLssGetAddrSerialNum (uint8_t ubNetV) |
ComStatus_tv | ComLssGetIdentity (uint8_t ubNetV, ComLssAddress_ts *ptsLssAddressV) |
ComStatus_tv | ComLssGetStatus (uint8_t ubNetV, uint8_t *pubStatusV) |
ComStatus_tv | ComLssIdentifyNonConfiguredSlave (uint8_t ubNetV) |
ComStatus_tv | ComLssIdentifyRemoteSlave (uint8_t ubNetV, uint32_t ulVendorIdV, uint32_t ulProdCodeV, uint32_t ulRevisionNumLowV, uint32_t ulRevisionNumHighV, uint32_t ulSerialNumLowV, uint32_t ulSerialNumHighV) |
ComStatus_tv | ComLssInquiryService (uint8_t ubNetV, uint8_t ubServiceV) |
ComStatus_tv | ComLssSetTimeout (uint8_t ubNetV, uint16_t uwTimeV) |
ComStatus_tv | ComLssStoreConfiguration (uint8_t ubNetV) |
ComStatus_tv | ComLssSwitchModeGlobal (uint8_t ubNetV, uint8_t ubModeV) |
ComStatus_tv | ComLssSwitchModeSelective (uint8_t ubNetV, uint32_t ulVendorIdV, uint32_t ulProdCodeV, uint32_t ulRevisionNumV, uint32_t ulSerialNumV) |
typedef struct ComLssAddress_s ComLssAddress_ts |
CANopen Master - LSS address.
The structure ComLssAddress_s defines a 128-bit number to identify each node uniquely, consisting of the vendor-ID, product code, revision number and serial number with 32 bit each, defined in /CiA301/ object 1018h. The value can be determined by calling ComLssGetIdentity() after an successful LSS fastscan procedure.
enum ComLssInqSrv_e |
enum ComLssMode_e |
This enumeration defines the allowed modes for the LSS switch mode global command.
Enumerator | |
---|---|
eCOM_LSS_MODE_WAITING | switch LSS state machine to LSS waiting mode |
eCOM_LSS_MODE_CONFIGURATION | switch LSS state machine to LSS configuration mode |
enum ComLssProt_e |
CANopen Master LSS protocol
enum ComLssStat_e |
ComStatus_tv ComLssConfigureBitTiming | ( | uint8_t | ubNetV, |
uint8_t | ubBittimeSelV | ||
) |
[in] | ubNetV | CANopen Network channel |
[in] | ubBittimeSelV | New bit-timing value |
By means of the Configure Bit Timing Parameters service the LSS Master sets the new bit-timing on a LSS Slave.
ComStatus_tv ComLssConfigureNodeId | ( | uint8_t | ubNetV, |
uint8_t | ubNodeIdV | ||
) |
[in] | ubNetV | CANopen Network channel |
[in] | ubNodeIdV | New Node-ID value |
By means of this service the LSS Master configures the NMT-address parameter of a LSS Slave. This service allows only one LSS Slave in configuration mode. The remote result parameter confirms the success or failure of the service. In case of a failure optionally the reason is confirmed.
void ComLssEventReceive | ( | uint8_t | ubNetV, |
uint8_t | ubLssProtocolV | ||
) |
[in] | ubNetV | CANopen Network channel |
[in] | ubLssProtocolV | LSS protocol |
The function is called by the LSS master state machine upon reception of a LSS response message issued by the LSS slave device. The parameter ubNetV defines the CANopen network. The value of the parameter ubLssProtocolV is defined by the enumeration ComLssProt_e.
An example implementation is available in the file com_user.c
.
ComStatus_tv ComLssFastscan | ( | uint8_t | ubNetV, |
uint32_t | ulVendorIdV, | ||
uint32_t | ulProdCodeV, | ||
uint32_t | ulRevisionNumV, | ||
uint32_t | ulSerialNumV | ||
) |
[in] | ubNetV | CANopen Network channel |
[in] | ulVendorIdV | Vendor ID (1018h, sub 1) |
[in] | ulProdCodeV | Product code (1018h, sub 2) |
[in] | ulRevisionNumV | Revision number (1018h, sub 3) |
[in] | ulSerialNumV | Serial number (1018h, sub 4) |
uint32_t ComLssGetAddrSerialNum | ( | uint8_t | ubNetV | ) |
[in] | ubNetV | CANopen Network channel |
The function returns the serial number of a LSS slave device that was found by the LSS fastscan protocol.
ComStatus_tv ComLssGetIdentity | ( | uint8_t | ubNetV, |
ComLssAddress_ts * | ptsLssAddressV | ||
) |
[in] | ubNetV | CANopen Network channel |
[in,out] | ptsLssAddressV | Pointer to LSS address structure |
The function allows access to the elements of the LSS address structure ComLssAddress_ts
after a LSS slave device was found by the LSS fastscan protocol.
ComStatus_tv ComLssGetStatus | ( | uint8_t | ubNetV, |
uint8_t * | pubStatusV | ||
) |
[in] | ubNetV | CANopen Network channel |
[in] | pubStatusV | Pointer to status variable |
This function returns the status of the LSS master state machine. Valid codes passes the the pointer pubStatusV are given in the enumeration ComLssStat_e.
ComStatus_tv ComLssIdentifyNonConfiguredSlave | ( | uint8_t | ubNetV | ) |
[in] | ubNetV | CANopen Network channel |
This function starts the Identify non-configured remote slave protocol. If there are non-configured remote slaves in the network, the status will be set to eCOM_LSS_STAT_SUCCESS, otherwise the status will be eCOM_LSS_STAT_TIMEOUT.
ComStatus_tv ComLssIdentifyRemoteSlave | ( | uint8_t | ubNetV, |
uint32_t | ulVendorIdV, | ||
uint32_t | ulProdCodeV, | ||
uint32_t | ulRevisionNumLowV, | ||
uint32_t | ulRevisionNumHighV, | ||
uint32_t | ulSerialNumLowV, | ||
uint32_t | ulSerialNumHighV | ||
) |
[in] | ubNetV | CANopen Network channel |
[in] | ulVendorIdV | Vendor ID (1018h, sub 1) |
[in] | ulProdCodeV | Product code (1018h, sub 2) |
[in] | ulRevisionNumLowV | Revision number (1018h, sub 3) |
[in] | ulRevisionNumHighV | Revision number (1018h, sub 3) |
[in] | ulSerialNumLowV | Serial number (1018h, sub 4) |
[in] | ulSerialNumHighV | Serial number (1018h, sub 4) |
This function starts the Identify remote slave protocol. The boundaries are included in the interval. All LSS slave devices with matching vendor-ID and product-code and whose major revision-number and serial-numbers are located within the given ranges, shall identify themselves with the LSS identify slave service.
ComStatus_tv ComLssInquiryService | ( | uint8_t | ubNetV, |
uint8_t | ubServiceV | ||
) |
[in] | ubNetV | CANopen Network channel |
[in] | ubServiceV | Service type (ComLssInqSrv_e) |
The inquiry services are available only in configuration mode.
ComStatus_tv ComLssSetTimeout | ( | uint8_t | ubNetV, |
uint16_t | uwTimeV | ||
) |
[in] | ubNetV | CANopen Network channel |
[in] | uwTimeV | Timeout value in milliseconds |
This function sets a timeout value for a LSS communication. If the response to a LSS request by the master takes longer than this timeout value, the state of the communication will be changed to eCOM_LSS_STAT_TIMEOUT. The state of the LSS communication can be evaluated by calling ComLssGetStatus(). Please note that the timeout value is a multiple of the timer period (COM_TIMER_PERIOD). A value supplied to this function will be rounded towards the next lower value if necessary.
For LSS Fastscan, the configured timeout value is uwTimeV / 10 in order to increase the speed of # Fastscan algorithm.
ComStatus_tv ComLssStoreConfiguration | ( | uint8_t | ubNetV | ) |
[in] | ubNetV | CANopen Network channel |
This function is used to store the configured parameters.
ComStatus_tv ComLssSwitchModeGlobal | ( | uint8_t | ubNetV, |
uint8_t | ubModeV | ||
) |
[in] | ubNetV | CANopen Network channel |
[in] | ubModeV | LSS mode |
The Switch Mode Services control the mode attribute of a LSS Slave. LSS provides three ways to put LSS Slave into configuration mode:
Switch Mode Selective and Fastscan switch exactly one LSS Slave from operation mode to configuration mode. Switch Mode Global switches all LSS Slaves from operation mode to configuration mode and vice versa.
Possible values for the parameter ubModeV are defined by the enumeration ComLssMode_e.
ComStatus_tv ComLssSwitchModeSelective | ( | uint8_t | ubNetV, |
uint32_t | ulVendorIdV, | ||
uint32_t | ulProdCodeV, | ||
uint32_t | ulRevisionNumV, | ||
uint32_t | ulSerialNumV | ||
) |
[in] | ubNetV | CANopen Network channel |
[in] | ulVendorIdV | Vendor ID (1018h, sub 1) |
[in] | ulProdCodeV | Product code (1018h, sub 2) |
[in] | ulRevisionNumV | Revision number (1018h, sub 3) |
[in] | ulSerialNumV | Serial number (1018h, sub 4) |
The Switch Mode Services control the mode attribute of a LSS Slave.