I want to send some diagnostics request using python. Code:
clr.AddReference('Vector.CANoe.Interop')
clr.AddReference('Vector.Diagnostics')
import CANoe
import Vector.Diagnostics
mCANoeApp = CANoe.Application()
mCANoeApp.Open("myPath")
mCANoeMeasurement = mCANoeApp.Measurement
mCANoeMeasurement.Start()
mCANoeBus = CANoe.Bus(mCANoeApp.get_Bus("Ethernet"))
MNetwork = CANoe.Networks(mCANoeApp.get_Networks(11))
net = CANoe.Network(MNetwork.get_Item(1))
devices = CANoe.Devices(net.Devices)
device = CANoe.Device(devices.get_Item("myDevice"))
I also attached the following image with the COM Hierarchy from CANoe. COM Object Hierarchy Where it says that device should have a object Diagnostic. But on my side device isn`t having the Diagnostic object, only: ApplicationSocket, AudioInterface and MostDisassambler. Because of this I can not access Diagnostic object in order to create a request.
diag_ob = device.Diagnostic #isnt creating a Diag object
diag_ob.CreateRequest("Default_Start") #Error
Because i cant get access to the Diagnostic object i tried to use directly the Vector.Diagnostics which is seem is not recognize the measurement and im trying to understand how can I link them.
When I'm trying to use the Vector.Diagnostics.Application.GetEcu()
I'm receiving a NoneType and My assumption is that GetEcu()
method is not seeing the CANoe opened.
Do you have any idea how can a link them ?
Few things to note at the beginning:
Check out the following code for sending a default session request:
Try this out and post any errors which you see in the console. The measurement is to be started before executing the above code.