Skip to content

Use physical value in PDO callback #578

@gennartan

Description

@gennartan

I have an EDS file describing a VARIABLE with a Factor 1e-3.

When reading the physical value using SDO, the factor is properly applied.
When receiving the value through PDO and using the .phys attribute, I get the raw value.

Currently I have a workaround, I simply read the raw value and re-apply the conversion after reception of the PDO. I would like to be able to use the Factor attribute to avoid duplicating the Canopen device parameters at different locations.

Here is the EDS file.

...

[3300]
ParameterName=Battery
ObjectType=0x9
SubNumber=4

[3300sub0]
ParameterName=Number of entries
ObjectType=0x7
DataType=0x0005
AccessType=ro
DefaultValue=4
PDOMapping=0

[3300sub1]
ParameterName=Vbat pin
ObjectType=0x7
DataType=0x0006
AccessType=ro
DefaultValue=0
PDOMapping=0
Factor=1e-3
Unit=V

...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions