-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
Bytearray index out of range #180
Comments
OK, this is mainly a documentation issue, i.e. my fault... The complete DAQ process -- setup, ODT allocation and recording is part of pyXCP; the example file run_daq.py is exactly what you are you looking for. There is some documentation in form of this discussion (will be reworked to offical documentation soon). |
Unfortunately, I had already tried that approach and this was the output:
Created a TRANSPORT = "ETH"
HOST = "HOSTNAME"
PORT = 1111
PROTOCOL = "UDP"
IPV6 = false
CREATE_DAQ_TIMESTAMPS = false And this is the script I ran: ap = ArgumentParser(description="DAQ test")
a2l = A2lParser(a2l_path)
signal = XcpUtils.get_attribute_dict_from_a2l_list(a2l.variable_list, signal_name)
event = XcpUtils.get_attribute_dict_from_a2l_list(a2l.event_list, event_name)
daq_lists = [
DaqList(
"part_1",
event.get("channel_number"),
False,
False,
[
(signal_name, signal.get("ecu_address"), 0, "U32"),
],
)
]
daq_parser = DaqRecorder(daq_lists, "run_daq", 1) # Record to ".xmraw" file.
with ap.run(policy=daq_parser) as x:
x.connect()
if x.slaveProperties.optionalCommMode:
x.getCommModeInfo()
x.cond_unlock("DAQ") # DAQ resource is locked in many cases.
print("setup DAQ lists.")
daq_parser.setup()
print("start DAQ lists.")
daq_parser.start()
time.sleep(10) # Run for 10 seconds.
print("Stop DAQ....")
daq_parser.stop()
print("finalize DAQ lists.\n")
x.disconnect() |
The timestamping code at this point is brand new; I didn't test the "no-timestamping" case; this is (hopefully) fixed now. |
Hi, I'm currently using pyxcp to read some signal's values using DAQ, but ran into a "bytearray index out of range" error that makes me unable to read the values.
As you can see in this image, response is an empty bytearray, but data is a bytearray of length 1799.
Here is the script I'm running that gets me this error
I'm running commands in the same order as Vector's CANape, and CANape does return some values with the same signal I'm reading in this script, any ideas what might I be doing wrong?
Python version, OS and pyxcp version:
The text was updated successfully, but these errors were encountered: