mgoutier 3 years ago updated by Ulrik Zakariasson (Software development) 3 years ago 5

Using the J1939 set time solution in the library, does anyone know if its possible to get milliseconds? I have been working on this for about an hour and I'm starting to think it is not possible?


Hello Mgoutier.

If you take a timer that constantly have the increasing condition set to true and then use the 'DerivateOf()' with the seconds as the operand and then '<>' function with the result of the first and then 0 as the operands.

This is from the timer

This works fairly well, but I do loose 100 ms per scan, so essentially I will only get 900 ms. Which with scan time is pretty good. I don't think you actually need <> statement though. Thank you for the reply though sometimes I do enough repetitious things that thinking out of the box a bit gets tough! Now I'm just curious, can anyone get the full ms range another way?


You should not be loosing any time.

What cycle time do you have in the application?

You will not get the jump up to 1000 ms on the timer because that is a new second so the timer restarts there.

In the one i tested on i get the timer going from 0 when the second changes and then up to 950, the next cycle (50 ms) it would have been 1000 but the second counts up so it resets the timer.

If i have lower cycle time, say 10 ms, the timer count up to 990 and then resets the next cycle.

you are correct, thank you for the help, my scan time was 100ms