chaitu-ycr / py_canoe Goto Github PK
View Code? Open in Web Editor NEWPython ๐ Package for controlling Vector CANoe ๐ถ Tool
Home Page: https://chaitu-ycr.github.io/py_canoe/
License: MIT License
Python ๐ Package for controlling Vector CANoe ๐ถ Tool
Home Page: https://chaitu-ycr.github.io/py_canoe/
License: MIT License
When i use this library,i got an error.
from utils.py_canoe_logger import PyCanoeLogger
ModuleNotFoundError: No module named 'utils'
# import CANoe utils here
from utils.py_canoe_logger import PyCanoeLogger
from utils.application import Application
from utils.bus import Bus, Signal
from utils.capl import Capl
from utils.configuration import Configuration
from utils.measurement import Measurement
from utils.networks import Networks
from utils.system import System, Namespaces, Variables
from utils.ui import Ui
from utils.version import Version
I have set the CANoe config to offline mode via python, but unable to add an offline source file to start the config using python
When i use the method start_measure
, sometimes i got this error.
(-2147352567, 'ๅ็ๆๅคใ', (0, 'Measurement::Start', 'User interface is busy', 'D:\\Softwares\\canoe\\Help01\\CANoeCANalyzer.chm', 4470, -2147418113), None)
This is only an occasional occurrence, and most of the time it works. But I don't know why this happens.
Could you help me analyze the cause of this problem? Thank you very much!!!
Hello Chaitu,
This is Rajadeepan, a devops engineer.
This py_canoe project is very useful for the people like me who are new to CANoe Panels.
I have some configuration which has some test environments which i would like to execute all the test cases one by one. So I have written a code which might be useful if we integrate with this project.
So I would like to contribute to this project to parse test environments and execute all test modules in the CANoe test environment configuration.
I don't have any documentation updated for this. But I have followed some of your standards which you can modify later.
Regards,
Rajadeepan
I'm trying to use py_canoe package to open CANoe and send diagnostic requests to the ECU. The package seems to open the CANoe cfg file but when i try to send the diagnostic request ('10 01'), I'm facing the below error.
Traceback (most recent call last):
File "D:\CS_Python_MSV\canoe.py", line 14, in
resp = canoe_inst.send_diag_request("Door", '10 01')
File "C:\Users\VF_KPIT\AppData\Roaming\Python\Python39\site-packages\py_canoe.py", line 629, in send_diag_request
diag_req.Send()
File "", line 2, in Send
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2147467259), None)
I'm using Python 3.9.9 version and pywin32 is installed properly.
Any solution on how to get this issue sorted would be appreciated. Thank you
Hello,
Thank you for taking an interest in implementing this, but unfortunately it doesn't work.
When calling function it returns KeyError, it cannot find the function in self.meas.user_capl_function_obj_dict
.
I have passed the function name as argument during CANoe instance creation.
I'm using CANoe v15 with py_canoe v2.0.1 release.
Hello, Is possible to use py_canoe with CANalyzer instead of Canoe?
Hello, having this feature would be really useful in my setup. Unfortunently, I couldn't figure out how to add it to your code.
Here's a working example: https://stackoverflow.com/a/37068335
Thank you.
Hello, I've been using your package to open a target file and a diagnosis file, adding a time delay of more than 20 seconds, but I can't manage to open them both, only one of them, maybe you could give a hand ? I'll leave you my code below so you can give it a look.
//////////////////////////////////////////////////////////////////////////
import os
import sys
import subprocess
import time
import threading
import keyboard
import win32com.client
from win32com.client import *
from win32com.client.connect import *
from py_canoe import CANoe
from time import sleep as wait
def just_open():
diagnose = CANoe()
diagnose.open(canoe_cfg=r'my_path_for_diagnose_file')
diagnose.start_measurement()
time.sleep(20)
target = CANoe()
target.open(canoe_cfg=r'my_path_for_target_file')
target.start_measurement()
if name=="main":
just_open()
//////////////////////////////////////////////////////////////////////////
When I run it, the diagnose file opens, it turns on for 20 seconds, then I get Exception Thrown for the return.
def Open(self, config=defaultNamedNotOptArg, autoSave=defaultNamedNotOptArg, promptUser=defaultNamedNotOptArg):
'method Open'
return self.oleobj.InvokeTypes(7, LCID, 1, (24, 0), ((8, 1), (11, 17), (11, 17)),config, autoSave, promptUser)
Here is the exception: (-2147352567, 'Exception occurred.', (0, None, None, None, 0, -2147467259), None)
I got the same exception when I try to open and start the target file first.
If I don't start the measurement before opening the second one, the first one closes and the second opens and runs without a problem.
Maybe you can give me a hand and try to give me a clue on how to keep both open and run them. Good luck!
Hello, I've found a few more use cases which aren't covered:
hex(value&0xFF)
on them.This error occurs when object of canoe using as local in Flask app.
Diag ECU qualifier (ECU_NAME) not available in loaded CANoe config.
If I am passing canoe object outside of the any route in Flask app, It shows pywin32 related error.
File: <COMObject >", line 2 in CreateRequestFromStream.
like: pywintypes.com_error (-21473221008, "CoInitialize has not been called, None, None")
2nd time while changing the parameter through flask frontend, I got these 2 above error.
I don't want to start and stop canoe measurement for every single request.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context or screenshots about the feature request here.
When installing this package (v2.0.1) via pip, the utils directory is not created and py_canoe won't work. I had to add it manually.
How to check message signals from canoe once measurement start is it possible to check or get message signals with periodicity/cyclicity
On my environment sometime I restart the Python script but I dont want py_canoe reload everything.
It can be useful to make a dispatch method that not load a configuration in my opinion.
For now I modified the open method removing commenting this line for my configuration and works as expected.
166. # self.__canoe_objects['Application'].Open(canoe_cfg, auto_save, prompt_user)
Describe the bug
Attribute 'Name' does not seem to exist for the instance of type Library.IReplayBlock. This prevents setting a replay block file with the set_replay_block_file() function.
To Reproduce
Steps to reproduce the behavior:
I tried to run the exact example code, that is in the docstring. Of course I provided valid paths to .cfg file and valid info for the replayblock.
>>> # The following example sets replay block file
>>> canoe_inst = CANoe()
>>> canoe_inst.open(r'D:\_kms_local\vector_canoe\py_canoe\demo_cfg\demo.cfg')
>>> canoe_inst.set_replay_block_file(block_name='replay block name', recording_file_path='replay file including path')
>>> canoe_inst.start_measurement()
The following error will appear when executing:
[CANOE_LOG] [INFO] failed to fetch replay blocks. '<win32com.gen_py.CANoe 16.4 Type Library.IReplayBlock instance at 0x12345>' object had no attribute 'Name'
Expected behavior
I expected no error message and that the provided replay log file would be set successfully.
Screenshots
N/A
Desktop (please complete the following information):
Vector CANoe (please complete the following information):
Additional context
Please let me know if anyone can reproduce this bug. If so maybe we can find a solution to fix the problem.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.