CANopen FD Master Library
Making your systems precise, reliable and high-quality - 5.10.01
Functions
LSS service

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)
 
ComStatus_tv ComLssIdentifyNonConfiguredSlave (uint8_t ubNetV)
 
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)
 

Detailed Description

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.

Function Documentation

◆ ComLssConfigureBitTiming()

ComStatus_tv ComLssConfigureBitTiming ( uint8_t  ubNetV,
uint8_t  ubBittimeSelV 
)
Parameters
[in]ubNetV- CANopen Network channel
[in]ubBittimeSelV- New bit-timing value
Returns
eCOM_ERR_NONE on success, negative ComErr_e value on failure

By means of the Configure Bit Timing Parameters service the LSS Master sets the new bit-timing on a LSS Slave.

◆ ComLssConfigureNodeId()

ComStatus_tv ComLssConfigureNodeId ( uint8_t  ubNetV,
uint8_t  ubNodeIdV 
)
Parameters
[in]ubNetV- CANopen Network channel
[in]ubNodeIdV- New Node-ID value
Returns
eCOM_ERR_NONE on success, negative ComErr_e value on failure

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.

◆ ComLssEventReceive()

void ComLssEventReceive ( uint8_t  ubNetV,
uint8_t  ubLssProtocolV 
)
Parameters
[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.

◆ ComLssFastscan()

ComStatus_tv ComLssFastscan ( uint8_t  ubNetV,
uint32_t  ulVendorIdV,
uint32_t  ulProdCodeV,
uint32_t  ulRevisionNumV,
uint32_t  ulSerialNumV 
)

Run Fastscan protocol.

Parameters
[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)
Returns
eCOM_ERR_NONE on success, negative ComErr_e value on failure

The function starts the LSS Fastscan protocol on the given logical network ubNetV. If one of the parameters ulVendorIdV .. ulSerialNumV is not equal to zero the value is assumed to be known and will not be scanned. The result of the operation is notified via the ComLssEventReceive() function.

◆ ComLssIdentifyNonConfiguredSlave()

ComStatus_tv ComLssIdentifyNonConfiguredSlave ( uint8_t  ubNetV)
Parameters
[in]ubNetV- CANopen Network channel
Returns
eCOM_ERR_NONE on success, negative ComErr_e value on failure

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.

◆ ComLssSetTimeout()

ComStatus_tv ComLssSetTimeout ( uint8_t  ubNetV,
uint16_t  uwTimeV 
)
Parameters
[in]ubNetV- CANopen Network channel
[in]uwTimeV- Timeout value in milliseconds
Returns
eCOM_ERR_NONE on success, negative ComErr_e value on failure

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.

◆ ComLssStoreConfiguration()

ComStatus_tv ComLssStoreConfiguration ( uint8_t  ubNetV)
Parameters
[in]ubNetV- CANopen Network channel
Returns
eCOM_ERR_NONE on success, negative ComErr_e value on failure

This function is used to store the configured parameters.

◆ ComLssSwitchModeGlobal()

ComStatus_tv ComLssSwitchModeGlobal ( uint8_t  ubNetV,
uint8_t  ubModeV 
)
Parameters
[in]ubNetV- CANopen Network channel
[in]ubModeV- LSS mode
Returns
eCOM_ERR_NONE on success, negative ComErr_e value on failure
See also
ComLssSwitchModeSelective()

The Switch Mode Services control the mode attribute of a LSS Slave. LSS provides two ways to put a LSS Slave into configuration mode, Switch Mode Global and Switch Mode Selective. Switch Mode Selective switches exactly one LSS Slave between configuration and operation mode. Switch Mode Global switches all LSS Slaves between configuration and operation mode.

Possible values for the parameter ubModeV are defined by the enumeration ComLssMode_e.

◆ ComLssSwitchModeSelective()

ComStatus_tv ComLssSwitchModeSelective ( uint8_t  ubNetV,
uint32_t  ulVendorIdV,
uint32_t  ulProdCodeV,
uint32_t  ulRevisionNumV,
uint32_t  ulSerialNumV 
)
Parameters
[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)
Returns
eCOM_ERR_NONE on success, negative ComErr_e value on failure
See also
ComLssSwitchModeGlobal()

The Switch Mode Services control the mode attribute of a LSS Slave. LSS provides two ways to put a LSS Slave into configuration mode, Switch Mode Global and Switch Mode Selective. Switch Mode Selective switches exactly one LSS Slave between configuration and operation mode. Switch Mode Global switches all LSS Slaves between configuration and operation mode.