hardbyte / hardbyte/python-can

IXXAT send_periodic not works with interface that does not include FEATURE_SCHEDULER

Offen
#1,121 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
backend:ixxat bug
Vorherrschende Sprache
Python
Sterne
1.6k
Forks
697
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

**Describe the bug**
Some of IXXAT board does not include FEATURE_SCHEDULER and as IXXAT internal scheduler is used by default in python CAN it return error "Division by Zero" when send_peridic_message is used.

**To Reproduce**
Try to use send_peridic_message with IXXAT PCI_Can card.

**Expected behavior**
_send_periodic_internal should check caps.dwFeatures if FEATURE_SCHEDULER is available on the hardware if not fall down to to generic send_periodic feature (thead)

```python
def _send_periodic_internal(self, msg, period, duration=None):
"""Send a message using built-in cyclic transmit list functionality."""
if self._scheduler is None:
self._scheduler = HANDLE()
_canlib.canSchedulerOpen(self._device_handle, self.channel,
self._scheduler)
caps = structures.CANCAPABILITIES()
_canlib.canSchedulerGetCaps(self._scheduler, caps)
self._scheduler_resolution = float(caps.dwClockFreq) / caps.dwCmsDivisor
_canlib.canSchedulerActivate(self._scheduler, constants.TRUE)
return CyclicSendTask(self._scheduler, msg, period, duration,
self._scheduler_resolution)
```

also Doc of VCI API :
> dwCmsDivisor:[out] Divisor factor for the timer of the cyclic transmit list. The frequency of the timer is calculated from the frequency of the primary timer divided by the value specified here. If no cyclic transmit list is available, the field has the value 0.

dwCmsDivisor = 0 when schedule feature is not available

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.