PPCAN-Editor applies no or wrong scaling on imported CAN signals

This forum covers issues concerning multiple hardware products.
Post Reply
Dominik M.
Posts: 10
Joined: Mon 27. Jan 2020, 09:58

PPCAN-Editor applies no or wrong scaling on imported CAN signals

Post by Dominik M. » Thu 20. Feb 2020, 12:57

Hello PEAK-Systems Support Team.

I was wondering if the the PPCAN-Editor behavior is correct: I import CAN signals / messages using an existing .dbc file but the PPCAN-Editor doesn't not apply the signal scaling factors. On top the scaling seems to be corrupted when I manually add factors in my case when I use a PCAN-Router IO variable as temporary storage.

I created a small example configuration to check if that's really the case.

I sent a signed signal of -12.0 m/s on CAN channel one (with scaling 0,1) and want to receive that signal in another CAN message on channel two (using scaling of 0.5), instead of receiving the same value of -12.0 m/s I receive a value of -3.0 m/s. The signal is stored in an IO variable inside of the CAN router before re-transmission, other function blocks are not active.

My expected behavior of the router would be as follows:
- Router takes signal scaling factors and applies them to the received CAN message (no manual change in PPCAN-Editor)
1. Router receives CAN message as raw value (--> -12,0 m/s) and applies scaling = physical value
2. Temporary storage of physical value
3. Router applies correct scaling and transmits raw value using the new scaling factor --> -12,0 m/s

I attached a picture of my test setup including PCAN explorer which I used to check the sent/received values:
the not correct signal values
the not correct signal values
scale.png (119.19 KiB) Viewed 1313 times

As well as the configurations I prepared:
test.zip
router and explorer configuration files
(6.22 KiB) Downloaded 55 times

Another thin I recognized that my scaling factor was changed automatically in lower digits from 0,1 to 0,1000xxx something. When I moved between the different configuration tabs:
issue with added digits when moving between tabs
issue with added digits when moving between tabs
scaling changes.png (12.24 KiB) Viewed 1313 times

Dominik M.
Posts: 10
Joined: Mon 27. Jan 2020, 09:58

Re: PPCAN-Editor applies no or wrong scaling on imported CAN signals

Post by Dominik M. » Thu 20. Feb 2020, 14:31

Sorry, but accidentally I posted my reply in the wrong forum. But I'm also currently not really sure if that's a Hardware or Software issue (or both) or if that's not at all an issue...

M.Heidemann
Sales & Support
Sales & Support
Posts: 466
Joined: Fri 20. Sep 2019, 13:31

Re: PPCAN-Editor applies no or wrong scaling on imported CAN signals

Post by M.Heidemann » Thu 20. Feb 2020, 15:26

Hello,

This is most likey the cause for this issue:
Factor.PNG
Factor.PNG (16.61 KiB) Viewed 1293 times
Since on transmission the factor of a PCAN-Explorer variable is interpretated as a division, you need to use the factor 2 indstead of 0.5 upon sending from PCAN-Explorer:
rightfactor.PNG
rightfactor.PNG (33.19 KiB) Viewed 1293 times
The PPCAN-Editor does not differentiate between incoming and outgoing factors, it's always division.


The values you see in your scaling factor are not a glitch,
this is due to the properties of the float data type used here.

Usally you will not see the values represented this way
since rarely is it shown with more than 3 decimal places.


Best Regards

Marvin

Post Reply