pyxcp icon indicating copy to clipboard operation
pyxcp copied to clipboard

Help

Open aaroniza0 opened this issue 1 year ago • 2 comments

Hello,

I'm a senior computer engineering student working on my senior design project at the moment, my project requires reading some hardware through ethernet and the hardware lists xcp on udp/ip as the communication protocol.

My team has to use a raspberry pi, would this library achieve this and work on the pi? If so, how would I install it on my raspberry pi?

I'm new to reading github docs so I apologize if the answer is right in front of me.

Thanks,

aaroniza0

aaroniza0 avatar Aug 30 '23 15:08 aaroniza0

I'm looking at the xcp_skel.py script in the main branch but how and what would I send to pull data off of a daq?

aaroniza0 avatar Aug 31 '23 13:08 aaroniza0

Considering that you have a Raspberry Pi enabled as an XCP slave device, you can use the Master interface. To my knowledge, pyXCP uses an abstract factory design pattern where you can do the following to use the ethernet transport layer via UDP:

from pyxcp.master import Master
xcp = Master("eth", {"HOST": "<slave_ip_address>", "PORT": <slave_port>, "PROTOCOL": "UDP"})

From there you can use the XCP commands as documented in: Vector's reference manual

The library already has support for: connect, disconnect short download and download (For writing values), and short upload and upload (For reading values).

Note: These commands are for polling data only (CTO messages), this will not retrieve anything from DAQ (DTO messages), perhaps @christoph2 has more input on this.

To further understand the library you can review Vector's documentation and take a look into the Master and Eth transport layers.

JavierCorado avatar Sep 12 '23 18:09 JavierCorado