How to test a real ECU via CANoe
I am new with CANoe, and now I am trying to test a real ECU by sending diagnostic requests to it and get response from the ECU via CANoe. I use VN5610A and CANoe software is CANoe.Ethernet. I connected the VN5610A to PC and the ECU. I configured the Diagnostics/ISO TP configuration by uploading a ODX file as database. Then when i start logging, I can see the ethernet package infomation in the trace window. And if i send request via other external tools, i can also see the communication in the trace window. But how can i send request via Caone?
I now have some questions firstly:
I want to test a real ECU, should I use the simulation setup? I mean should i need to simulate the real ECU as a simuLated ECU? If not, I would not use Diagnostics Console to send request. Actually I tried to setup the simulated ECU and send request via Diagnostics Console. But the real ECU did not really received the request, just the simuated ECU received.
in the Vector Hardware Config, we can define VN5610A's IP address, should this IP address the same as my PC IP address? If not the same? which IP address should be assigned to "Tester Present"?
If config below in the Vector Hardware Config correct? Should PC and CANoe be the same virtual Port?
Thanks a lot in advance.
do you know?
how many words do you know
See also questions close to this topic
-
Im having trouble with this assignment that has me write vectors and arrays to a file
So in this assignment I have to have one function that has the user enter the vector which is the driver name and then they enter the drivers 4 points. That function is fine. I also Have to do a second function that writes the name and the average that I get from the 4 points to the txt file. and then display the name and averages in main. Right now I am stuck on the second function because I'm having trouble getting it to where it would write the vector and then the average after it. right now it is writing both vector elements and then the first average, and then both vector elements and the second average. can someone help me
#include <iostream> #include <string> #include <cmath> #include <iomanip> #include <vector> #include <fstream> using namespace std; //function prototypes void Enter_Driver_Data(vector<string> &driverName, int points[8][4], string fileName, fstream& file, int& counter); void Calculate_Average(vector<string> &driverName, int points[8][4], string fileName, fstream& file, int& counter); int main() { int counter = 0;//this counter is for the average function int points[8][4]; vector<string>driverName; fstream file; string fileName; int average; //user will enter a text file name cout << "Please enter the file name: "; getline(cin, fileName); Enter_Driver_Data(driverName, points, fileName, file, counter); Calculate_Average(driverName, points, fileName, file, counter); cout << setprecision(1) << fixed << endl; fstream txtInput(fileName, ios::in); //outputting the txt file data for (string i : driverName) { cout << i << "'s average points is: "; txtInput >> average; cout << endl; } cout << endl << endl; system("pause"); return 0; } void Enter_Driver_Data(vector<string> &driverName, int points[8][4], string fileName, fstream& file, int& counter)//this function is for entering data { file.open(fileName, ios::out); string driverNameInput; //filestream declarations fstream txtOutput(fileName, ios::out); //again declaration bool again = true; //for loop for data for (int name = 0; name < 8 && again; name++)//name is for the row of the array { cout << "\nPlease enter the driver's name: "; getline(cin, driverNameInput); driverName.push_back(driverNameInput); txtOutput << driverName[name] << ": "; for (int score = 0; score < 4; score++)//score is for the column of the array { cout << "\nPlease enter " << driverName[name] << "'s score number " << score + 1 << ": "; cin >> points[name][score]; while (points[name][score] != 60 && points[name][score] != 70 && points[name][score] != 80 && points[name][score] != 90 && points[name][score] != 100) { cout << "Your input was invalid: please enter the scores which are 60, 70, 80, 90,or 100: "; cin >> points[name][score]; } cout << points[name][score] << endl; txtOutput << points[name][score] << " "; cin.ignore(); cin.clear(); } txtOutput << endl; cout << "Would you like to enter another driver?(1 for yes and 0 for no): "; cin >> again; cin.ignore(); cin.clear(); counter++; } file.close(); } void Calculate_Average(vector<string> &driverName, int points[8][4], string fileName, fstream& file, int& counter) { file.open(fileName, ios::app); fstream txtOutput(fileName, ios::app); double totalBeforeAverage, average; vector <double> avg; for (int name = 0; name < counter; name++) { totalBeforeAverage = 0, average = 0; for (int score = 0; score < 4; score++) { totalBeforeAverage += points[name][score]; } average = totalBeforeAverage / 4; avg.push_back(average); } for (string drivName : driverName) { txtOutput << drivName << ": "; } for (double averageToFile : avg) { txtOutput << averageToFile << endl; } file.close(); }
-
Attempting to solve this problem more efficiently
I read a natural number with at most 9 digits. I have to form a vector with the even digits of that number, in ascending order, with each digit appearing once (example : 98762222 is going to output: 2 6 8). I want to know what optimisations can I add to this code to make it more efficient.
#include <iostream> using namespace std; int main() { int x,i,k=0,copy,v[10]={0},j; cout<<"x="; cin>>x; copy=x; if (x==0) cout<<0; while (x>0) { v[x%10]++; x/=10; } for (i=0; i<10; i=i+2) { if(v[i]>0) { k++; } } int w[k]={0}; if (k>0) { j=0; for (i=0; i<10; i=i+2) if(v[i]>0) { w[j]=i; j++;} } for (j=0; j<k; j++) cout<<w[j]<<" "; if (k==0 && copy!=0) cout<<"No even digits"; return 0; }
-
Receiving error: "error: static assertion failed: result type must be constructible from value type of input range" when constructing class vectors
I am trying to create a script that uses polymorphism to create a set of linking vectors within parent/child class structure. So far I have got the classes setup, but when trying to test the code I receive an error involving static assertion. When analysing the code line by line, I run into the error when I call 'vector.begin() & vector.end()'.
Here is the full script:
#include <iostream> #include <vector> using namespace std; class A { public: vector<vector<A *>> Container; }; class B : A { }; class C : A { }; class D : A { }; int main() { A ABaseClass; B b1, b2; C c1, c2; D d1, d2; vector<B *> b_classes = {&b1, &b2}; vector<C *> c_classes = {&c1, &c2}; vector<D *> d_classes = {&d1, &d2}; ABaseClass.Container = { {b_classes.begin(), b_classes.end()}, {c_classes.begin(), c_classes.end()}, {d_classes.begin(), d_classes.end()}}; }
Compiling gives this error:
error: static assertion failed: result type must be constructible from value type of input range 138 | static_assert(is_constructible<_ValueType2, decltype(*__first)>::value, | ^~~~~ error: static assertion failed: result type must be constructible from value type of input range note: 'std::integral_constant<bool, false>::value' evaluates to false
I have narrowed down the cause of the error to this section:
ABaseClass.Container = { {b_classes.begin(), b_classes.end()}, {c_classes.begin(), c_classes.end()}, {d_classes.begin(), d_classes.end()}};
Following the root of the problem leads me to the file 'stl_uninitialized.h', and the line:
[138] static_assert(is_constructible<_ValueType2, decltype(*__first)>::value, ^~~~~
I have been trying to get the child classes to be tracked by the parents but I am unfamiliar with vectors and pointers so I am a bit stuck. Any help with moving forward would be greatly appreciated.
-
Software connected to LAN on XP, but not on Windows 10
I recently upgraded my operating system from windows XP SP3 to windows 10pro.
The problem is that I have a software that worked perfectly under XP, but which, once installed on Windows 10, cannot exchange data with other devices on the LAN network.
With the same network configurations as under XP, the software does not even connect to the LAN network.
However, the ping towards all the IP addresses of the network shows that everything is fine. But still, the software is not connected.
On other forums I have been told about certain security updates under windows 10 which could be the cause of this communication failure.
Is that the case ? If so, what would be the best solution to my problem please?
-
Getting around a VPN
I work at a very large company that requires a VPN at all times unless you are connected to their internet which is extremely common I know. There is one issue that this VPN causes that makes my job alot more work. For my job I have to connect to devices via ethernet to communicate with them kind of like a raspberry pi. But the issue is the VPN takes any ethernet connection as a internet connection and tries to encrypt it but obviously it fails because it's never able to connect to the VPN server because that ethernet connection doesn't connect to the world wide web. So it forces me to either use the internet or have a connection to one of the devices but never both unless I'm on my company's internet which almost never happens as I'm usually at many different buildings. My colleges and I have only been able to find one way around this and that was by using a virtual machine to forward the ethernet connection but this solution is extremely lengthy and a pain to use as the you need to boot into a vm everytime. Does anyone know of a solution to a problem like this? Is there a way to trick the vpn into not encrypting certain connections? Let me know what you guys know.
-
Can you cut an ethernet cable and use led and light resistor to make it Lifi?
I have been researching LiFi, it is a very new technology using LEDs and Light Resistors to send and receive data, however, I can't seem to find supported libraries in Python and all protocols have to be custom. So I had an idea, what if I cut an ethernet cable, and put led on the end of it, so it turns on and off as the data gets sent and an LDR on the other end to receive the said Data? is this theoretically possible?
-
How to enable resource dictionary diagnostics in WPF?
I'm tracking an instance of non-existing resource in WPF. What I'm given is an
InvalidOperationException
informing, thatUnsetValue
is not a proper value forBackground
property. However, I don't know, what is the missing resource key or where this setter resides.I see in WPF sources, that StaticResource markup extension uses an internal WPF class called
ResourceDictionaryDiagnostics
to log events regarding resource lookup (see eg. lines 137,152).Is there a way to enable this diagnostic and capture some information about failed resource lookups?
-
Fixed effect instrumental variable (IV) regression with available diagnostic tests
May I please know an R package and code to run fixed effect instrumental variable (IV) regression with available diagnostic tests (e.g., weak instrument test, exogeneity test (using Wu-Hausman), Sargan test)?
I know
plm
code provides the fixed effect IV regressions but its diagnostic tests are not available unfortunately.Even if I run the
iv_robust
code fromestimatr
package and specify asdiagnostics = TRUE
, it produces a warning message saying"In iv_robust(.. : Will not return
diagnostics
iffixed_effects
are used."So no diagnostics can be run in fixed effect using
iv_robust
code either.I also have both x and x^2 endogenous variables. I wonder what is the best way to run the fixed effect IV regression and how to do the diagnostic tests for these as well.
-
CAPL function to add a delay
I am using CAPL to control the power supply. I need to add a delay in my script, since I am not using the test node testwaitfortimeout() function can't be used. I tried giving the delay using while loop and timer function, but this crashes CANoe. Is there is any other way to add a delay?
-
Compilation errors in VTest studio script while importing configuration
While importing a new CANoe configuration the VTest studio script is showing errors. Rectifying it is time consuming.Is there any solution? What might be the reason. The same script works perfectly in old configuration.