dapperfu / python_CANape

Python Module for Vector CANape API
40 stars 9 forks source link

Start/stop measurement in CANape via python #1

Closed StanPPS closed 4 years ago

StanPPS commented 4 years ago

Dear Jed-Frey

First of all, you made a really nice and usefull API for Python-CANape. It's rear to find good interfaces between those two software packages as yours.

For a project I want to use Python to control mainly the starting and stopping of measurements within CANape, additionally direct datatransfer between both would be ideal. Do you think it is possible to start/stop measurements with this API? If yes, could you provide some info to get me on trail?

Thanks a lot in advance for the effort!

Kind regards, Stan.

dapperfu commented 4 years ago

What version of CANape are you using?

If you already have a CANape project & .ini you would just need to call Asap3Init5 to launch CANape then Asap3StartRecorder. Then reading it with asammdf.

For passing data directly. I never quite got it working since it was a lot of trial and error development, but it looks like Asap3InitDataAcquisition() and Asap3GetNextSample() should work.

Alternatively, if you use pymatbridge or you may be able to use the CANape<->MATLAB interface through it. https://assets.vector.com/cms/content/know-how/_application-notes/AN-IMC-1-004_Interface_Programming_between_CANape_and_MATLAB.pdf

Unfortunately I don't have access to any licensed CANape hardware right now. I'd be happy to help how I can since Python was a huge time saver for automating CANape at Caterpillar. (But all the code I wrote for them on their hardware belongs to them, so this is just a skeleton of what I once had working).

StanPPS commented 4 years ago

Dear Jed-Frey

Thanks a lot for the quick reply and being so interested in helping me out!

Currently I'm using CANape 11.0 SP7.

It would indeed be a huge time saver for the tool I'm designing in python. Unfortunately, I'm not familiar with the kind of coding neseccary to conversate between te both software packages.

dapperfu commented 4 years ago

I have updated the readme to reflect that this is not a mature project. If you are interested in seeing this developed and could lend a license for development I would be happy to contribute.

The fastest way may be to contact your local Vector representative and tell them you would like to see the Python module developed.