GithubHelp home page GithubHelp logo

chaitu-ycr / py_canoe Goto Github PK

View Code? Open in Web Editor NEW
38.0 38.0 19.0 4.43 MB

Python ๐Ÿ Package for controlling Vector CANoe ๐Ÿ›ถ Tool

Home Page: https://chaitu-ycr.github.io/py_canoe/

License: MIT License

Python 97.39% Batchfile 2.61%
canoe python vector

py_canoe's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

py_canoe's Issues

ModuleNotFoundError: No module named 'utils'

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

(-2147352567, 'ๅ‘็”Ÿๆ„ๅค–ใ€‚', (0, 'Measurement::Start', 'User interface is busy', 'D:\\Softwares\\canoe\\Help01\\CANoeCANalyzer.chm', 4470, -2147418113), None)

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!!!

Have an Idea

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

Getting error while trying to send diagnostic request

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.
image

Any solution on how to get this issue sorted would be appreciated. Thank you

Call capl function does not work

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.

Opening 2 files at the same time

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!

Systen variable handle enhacements

Hello, I've found a few more use cases which aren't covered:

  • A method to set/get variables of type array (Integer Array, Double Array, Data) is missing
    Note: Some elements in Data Array are inverted, so you need to apply hex(value&0xFF) on them.
    Also, make an option to only set part of an array (so add an optional argument for start position).
  • System defined variables cannot be read (getting them works a bit different compared to User defined variables, the namespaces are nested in the same object)

image

Problem opening a CANoe cfg

I followed the documentation and I tried to open a cfg of my configuration.
I get the problem in the picture below.

immagine

Cannot open canoe cfg

Hi ,

i am facing issue with Canoe cfg .when i run the script, its showing below error , i have updated py_canoe also
image

Communicating Flask app with py_canoe module, through send_diag_request method getting ECU respond only 1st time.

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.

Can we run vtest module through python?

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.

Dispatch CANoe without opening a configuration

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)

Library.IReplayBlock instance has no attribute Name

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):

  • OS: Windows
  • Version: 10

Vector CANoe (please complete the following information):

  • Version 16.4.4
  • Service Pack SP4

Additional context
Please let me know if anyone can reproduce this bug. If so maybe we can find a solution to fix the problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.