Start a new topic

Hexa decimal values and id's

When working on bus messages and signals, values and id's are mostly defined as hexa decimal values.

But right now I only see that this has been handled with integer values.

Is it possible to get a feature like .ToString but insted .ToHexadecimal?


Any ideas?


Regard

/Stefan


Hi Stefan,


Currently, we don't have a path query method that transforms and type-casts an integer value into a hexadecimal value.
It could be something to implement in the future, but we have to do more analysis.


The question here, what is exactly the use case that you have? so we can help you to do that in some other ways, i.e., by extending the SWExtension.ExportDbc.


Thanks,

Bashar

Hi Stefan, 

After further analysis, the following path expression can actually be used in a computed attribute to convert an integer value to a hex string: 

mb:=@ASID.Div(16);
lb:=@ASID - (16 * mb);
mbc := if mb < 10 then mb.ToString else if mb = 10 then 'A' else if mb = 11 then 'B' else if mb = 12 then 'C' else if mb = 13 then 'D' else if mb = 14 then 'E' else 'F';
lbc := if lb < 10 then lb.ToString else if lb = 10 then 'A' else if lb = 11 then 'B' else if lb = 12 then 'C' else if lb = 13 then 'D' else if lb = 14 then 'E' else 'F';
mbc + lbc

Thanks, 

Systemite Support

Login to post a comment