(This text has been automatically translated. Please excuse any errors.)
I am currently conducting CAN testing and have encountered a strange phenomenon.
I would like to know if this is due to my configuration.
The configuration data is as follows
cantest.emupro (29.3 KB)
The counter, which transmits at 100Hz and counts up every 25Hz, works correctly.
However, there is an issue with a separate counter that cycles through 4 counts (0–3) at 25 Hz.
While actual ECU data would normally be used for the non-counter fields, I am currently testing using fixed data.
The system references a table based on the count value and transmits the corresponding data, but count skips occur relatively frequently.
Interestingly, the table lookup values indicate the correct count sequence.
What are the problems with this?
This issue arises because, with the current setup, the calculation in the project tree and the CAN export are not working synchronously.
And since frequencies are never perfect, the 100 Hz events can shift relative to the 25 Hz event.
You are not skipping the count. You are sending the same value twice. For example, in one place there are two zeros instead of three, followed by a zero. The zero value was sampled twice, instead of sampling three and then zero.
In this case, you have to synchronize the counter and frame transmission. In the CAN transmit settings window, you can select “Triggered” mode instead of “Cycle”. Now create a counter/signal that can be used to trigger the transmission 100 times a second. This should solve your issue.
Thank you for the valuable tip.
it helped me resolve the issue.
To generate a 25Hz signal, I have set the Flash interval to 0.16 seconds.
It appears that a problem arises at the moment this turns OFF (at the 0.15 + 0.1 mark).
Increasing the count frequency seemed to cause a conflict with the moment the Flash turns OFF, triggering the issue mentioned above.
When I set up a separate Flash instance configured for 0.16 + 0.1, it works perfectly. In practice, if the Flash timing could be adjusted in increments of 0.002 or 0.005, a single Flash instance would likely suffice, though I realize that might be asking too much.
Update:
It was not possible to adjust the timing of the two counters when using a frame counter with Flash.
This was due to the minimum time resolution setting.
Consequently, I implemented the counter using a different method.
While there may be a more elegant approach, verification via CAN data logging confirms that it is working correctly.
cantest2.emupro (29.2 KB)