Unable to send CAN signal through vector canoe application using py_canoe

136 Views Asked by At

Here, we are trying to send a CAN signal through vector canoe application using py_canoe library, but we are unable to send the CAN signal through the bus but at the same time we are able to read the CAN signal from the bus.

Note: In CANoe configuration the panels are designed by environment variables

Scenario 1: When we are sending the input signal as environment variable and trying to read the output from CAN signal through py_canoe library it's working.

Scenario 2: When we are sending the input signal as CAN signal and trying to read the output from CAN signal through py_canoe library it's not working.

This is the code:

import os
from py_canoe import CANoe
import time
 
canoe_inst = CANoe()
 
try:
    canoe_inst.open(canoe_cfg="demo.cfg")
 
    # Start CANoe measurement
    canoe_inst.start_measurement()
    time.sleep(5)
 
    canoe_inst.set_signal_value('CAN', channel_x, "message_xxx", "signal_yyy", value)
 
    time.sleep(5)
 
    sig_value = canoe_inst.get_signal_value('CAN', channel_x, "message_xxx", "signal_yyy")
    print(f"\Signal Value: {sig_value}")
 
except Exception as e:
    pass

Thanks for helping :-)

0

There are 0 best solutions below