I'm trying to use PCAN-UDS API 2013 (ISO 14229-1:2013) to read values from my BMS controller.
I'm able to initialize the UDS object (code is given below) but I'm not able to understand how to define the request format to put in the read function.
How should I write my request format in the read function to read values stored at id 100?
Should I call any other PCAN UDS functions (like SvcDiagnosticSessionControl_2013) before the read function?
Code: Select all
pcanObj= PCAN_UDS_2013()
request = uds_msg()
response = uds_msg()
status = pcanObj.Initialize_2013(PCAN_USBBUS1,PCANTP_BAUDRATE_500K,0,0,0) # returning PUDS_STATUS_OK as success on execution
if pcanObj.StatusIsOk_2013(status, PUDS_STATUS_OK, True):
print("Initialized")
try:
read_status = pcanObj.Read_2013(channel,response,request, None)
if pcanObj.StatusIsOk_2013(read_status, PUDS_STATUS_OK, False):
print("Read error")
except Exception as e:
print("Exception")
print(e)
pcanObj.Reset_2013(channel)
pcanObj.Uninitialize_2013(channel)