Describe the bug
we have added a CAPL Test node named "MyFunc" with function defined with no arguments and named as "MyFunc". We are trying to call it using the latest py_canoe Package as below:
canoe_int = CANoe(user_capl_functions=('MyFunc'))
canoe_int.open(canoe_cfg=r"C:\Users\Public\Documents\Vector\CANoe\Sample_Configurations_17.3.91\XCP_AMD\XCP_FlexRay\FlexRayXCP.cfg")
canoe_int.start_measurement()
#Tried a few combinations:
canoe_int.call_capl_function("MyFunc")
canoe_int.call_capl_function("MyFunc.MyFunc")
canoe_int.call_capl_function("MyFunc:MyFunc")
canoe_int.call_capl_function("MyFunc::MyFunc")
The MyFunc.can contains :
/*@!Encoding:65001*/
int MyFunc(){
return timeNow();
}
To Reproduce
Steps to reproduce the behavior:
Go to Default Path for the XCPFlexray.cfg in "C:\Users\Public\Documents\Vector\CANoe\Sample_Configurations_17.3.91\XCP_AMD\XCP_FlexRay\FlexRayXCP.cfg"
Goto Simulation setup
Add Capl Test Node
Click on Edit - which will open a CAPL Browser
Then Enter the code as above
Open Cmd Prompt
pip install py_canoe - downloads the latest version of package
Run the above python code
Error :
*File "c:\Users\KXR1KOR\AppData\Local\Programs\Python\Python39\lib\site-packages\py_canoe.py", line 831, in call_capl_function
exec_sts = capl_obj.call_capl_function(self.application.measurement.user_capl_function_obj_dict[name], arguments)
KeyError: 'MyFunc::MyFunc'**
The Ket Error is for all the above combinations mentioned.
Expected behavior
Run the command and print the time in message console as:
[*] [Program / Model] 17032
py_canoe
Verison : py_canoe==2.1.3
OS and Vector CANoe (please complete the following information):
OS: Microsoft Windows 10 Enterprise
OS Version : 10.0.19045
Vector CANoe Version : 17.3.91
Vector CANoe Service Pack : SP3
We want an Example for the Function use : "call_capl_function"
Describe the bug we have added a CAPL Test node named "MyFunc" with function defined with no arguments and named as "MyFunc". We are trying to call it using the latest py_canoe Package as below:
The MyFunc.can contains :
To Reproduce Steps to reproduce the behavior:
Go to Default Path for the XCPFlexray.cfg in "C:\Users\Public\Documents\Vector\CANoe\Sample_Configurations_17.3.91\XCP_AMD\XCP_FlexRay\FlexRayXCP.cfg"
Goto Simulation setup
Add Capl Test Node
Click on Edit - which will open a CAPL Browser
Then Enter the code as above
Open Cmd Prompt
Run the above python code
Error :
*File "c:\Users\KXR1KOR\AppData\Local\Programs\Python\Python39\lib\site-packages\py_canoe.py", line 831, in call_capl_function exec_sts = capl_obj.call_capl_function(self.application.measurement.user_capl_function_obj_dict[name], arguments) KeyError: 'MyFunc::MyFunc'**
The Ket Error is for all the above combinations mentioned.
Expected behavior Run the command and print the time in message console as:
py_canoe Verison : py_canoe==2.1.3
OS and Vector CANoe (please complete the following information):
We want an Example for the Function use : "call_capl_function"
Thank You in Advance!
Thank You Mate