Skip to content

Refactor IXXAT PR #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: ixxat_unified_class2
Choose a base branch
from

Conversation

zariiii9003
Copy link

I thought it might be easier to just create a PR against your PR instead of writing a long review. Could you take a look and test on your hardware?

@zariiii9003
Copy link
Author

@MattWoodhead Regarding the extended-Parameter, are there really any non-ancient interfaces, that do not support both standard and extended IDs at the same time?

@MattWoodhead
Copy link
Owner

Sorry @zariiii9003, thanks for pinging me. I got the email notifications, but the links kept sending me to the PR in the main repo so I wasn't sure where your comments were! I will take a look at this after work today.

@MattWoodhead
Copy link
Owner

Apologies @zariiii9003, there were some careless copy paste errors in this.

Just to keep you updated, I am getting some test failures:

FAILED test/test_interface_ixxat.py::TestHardwareCaseStd::test_send_periodic - can.exceptions.CanOperationError: No messages have been received
FAILED test/test_interface_ixxat.py::TestHardwareCaseStd::test_send_single - ValueError: Response does not match the sent message
FAILED test/test_interface_ixxat.py::HardwareTestCaseFd::test_send_after_shutdown - AssertionError: CanOperationError not raised

I have added the following line to both my branch and your PR (on my machine locally), as part of investigating the failures, and have found that something is causing the VCI canControlInitialize function call to fail in this branch.

INFO     can.ixxat:canlib.py:473 CAN Filters: None
INFO     can.ixxat:canlib.py:715 Searching for first available device
INFO     can.ixxat:canlib.py:534 Using unique HW ID b'HW509182'
INFO     can.ixxat:canlib.py:536 Initializing channel 0 in shared mode, 16 rx buffers, 16 tx buffers
INFO     can.ixxat:canlib.py:638 Initialising Channel 0 with the following parameters:
dwMode=0, dwBPS=250000, wTS1=6400, wTS2=1600, wSJW=1600, wTDO=0
dwMode=0, dwBPS=2000000, wTS1=1600, wTS2=400, wSJW=400, wTDO=1600
WARNING  can.ixxat:canlib.py:131 VCI_E_ACCESSDENIED error raised when calling VCI Function canControlInitialize
WARNING  can.ixxat:canlib.py:131 VCI_E_ACCESSDENIED error raised when calling VCI Function canControlStart
WARNING  can.ixxat:canlib.py:131 VCI_E_ACCESSDENIED error raised when calling VCI Function canControlStart
WARNING  can.ixxat:canlib.py:131 VCI_E_ACCESSDENIED error raised when calling VCI Function canControlReset

I will investigate more tomorrow.

@zariiii9003
Copy link
Author

Why are the TS1, TS2 and SJW values so big in your log file? That's weird. Which test is that?

@zariiii9003 zariiii9003 force-pushed the ixxat_unified_class2_refactor branch from 7ab5f58 to 3060d33 Compare June 22, 2023 20:26
@zariiii9003
Copy link
Author

@MattWoodhead i rebased onto your branch.

@zariiii9003
Copy link
Author

Could you try again?

@MattWoodhead
Copy link
Owner

Why are the TS1, TS2 and SJW values so big in your log file? That's weird. Which test is that?

It is the same or similar values (depending upon chosen bitrate) in any of the tests that use one of the predefined bit timing settings from the constants file - these were added in PR hardbyte#1119 (although I did add in some more predefined bitrates). Based on dwMode being 0, I think the timing get set by the ratio of the quanta value to the sum of the two time segmant quanta - see page 136 (138 in a pdf reader) of the API docs

@MattWoodhead
Copy link
Owner

Hi @zariiii9003.
I have tested the latest version from this branch but unfortunately still getting the same errors. I have attached the pytest results json from my branch and this branch below (as txt files unfortunately as it wouldnt allow me to attach a JSON file).
I have also noticed that my branch introduced a regression compared to the main repo - it does not allow multiple connections to the same channel (raising the same VCI_E_ACCESSDENIED error in the logs) - I am just going to push a test case for this to my branch shortly.

ixxat_unified_class2_pytest_result.txt

ixxat_unified_class2_refactor_pytest_result.txt

Do you think that the change in the VCI function call order from
_canlib.canControlOpen -> _canlib.canControlInitialize -> _canlib.canControlGetCaps
to
_canlib.canControlOpen -> _canlib.canControlGetCaps -> _canlib.canControlInitialize
may have caused any of these issues?

@zariiii9003
Copy link
Author

I think VCI_E_ACCESSDENIED was just silenced. See here: hardbyte#488

Can you show bOpMode and bExMode on your branch? I really don't understand, why my branch does not work 😩

@MattWoodhead
Copy link
Owner

I think VCI_E_ACCESSDENIED was just silenced. See here: hardbyte#488

Can you show bOpMode and bExMode on your branch? I really don't understand, why my branch does not work 😩

INFO     can.ixxat:canlib.py:707 Initialising Channel 0 with the following parameters:
bOpMode=7, bExMode=0
pBtpSDR=dwMode=0, dwBPS=500000, wTS1=6400, wTS2=1600, wSJW=1600, wTDO=0
pBtpFDR=dwMode=0, dwBPS=2000000, wTS1=1600, wTS2=400, wSJW=400, wTDO=1600

I don't really understand why either :(
I shall continue to try and investigate.

@zariiii9003
Copy link
Author

@MattWoodhead did you find anything?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants