Hello.
While looking into source code of powerlink stack, kernel part, i realized that i don't get how frequency of high resolution timer is set. When i checked pTxBuffer->timeOffsetNs variable, which, as i understood, is timer period, it showed 7220, and i can't understand where did it get this number from.
Can you help me?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The high resolution timer is controlled with the hrestimer_*() functions, so you are looking for hrestimer_modifyTimer(). The timeOffsetNs member gives the frame's transmission time offset seen from the cycle start (= SoC). Thus, for example the SoC has timeOffsetNs = 0 and any subsequent frame (PReq, SoA, ...) has a higher value as you have identified...
Hope this helps!
Best regards,
Joerg
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello, Joerg!
Thank you for reply. I understood where the timer is set, but i have problems understanding how this offset is calculated.
Best regards, Bogdan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I believe it is calculated in function dllknode_setupSyncPhase() that you can find in file dllknode.c (at least this was the case in OPLK v2.2.1). For calculation, it uses PResTimeout value (object 0x1F92 in OBD) for the CN obtained from the CDC file.
Best regards,
Mladen
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello.
While looking into source code of powerlink stack, kernel part, i realized that i don't get how frequency of high resolution timer is set. When i checked pTxBuffer->timeOffsetNs variable, which, as i understood, is timer period, it showed 7220, and i can't understand where did it get this number from.
Can you help me?
Hello Bogdan,
The high resolution timer is controlled with the
hrestimer_*()
functions, so you are looking forhrestimer_modifyTimer()
. ThetimeOffsetNs
member gives the frame's transmission time offset seen from the cycle start (= SoC). Thus, for example the SoC has timeOffsetNs = 0 and any subsequent frame (PReq, SoA, ...) has a higher value as you have identified...Hope this helps!
Best regards,
Joerg
Hello, Joerg!
Thank you for reply. I understood where the timer is set, but i have problems understanding how this offset is calculated.
Best regards, Bogdan
Hi Bogdan,
I believe it is calculated in function dllknode_setupSyncPhase() that you can find in file dllknode.c (at least this was the case in OPLK v2.2.1). For calculation, it uses PResTimeout value (object 0x1F92 in OBD) for the CN obtained from the CDC file.
Best regards,
Mladen