We often encounter Vector Informatik's CANape software, described as a "measurement, calibration and diagnostic tool", when working on projects with automotive customers. While it's rather like the automotive software equivalent of a Swiss army knife, supporting a number of different functions that are useful when developing and testing automotive ECUs, reading an array with more than 16 values is a problem. How do you overcome this issue?
Collecting and transferring instrumentation data
Combined with a CCP or XCP driver on the ECU, CANape provides a useful mechanism to collect and transfer instrumentation data from an automotive device using its existing CAN or FlexRay connection to the rest of the vehicle. This approach allows for data to be collected in a variety of test scenarios, ranging from bench tests by the software developers all the way through to in-car tests on the road or test track.
Using a memory buffer
One approach we have used to transfer instrumentation data is to use a memory buffer on the target device to store the trace. When the buffer is full, an XCP event is raised that causes the entire buffer to be transferred to the host machine. The host logs the received buffers in an output file which is then reassembled to produce a continuous trace after the data collection has been completed.
Expanding beyond the first 16 values of an array
This approach works well, however there is a CANape "feature" that can cause problems to arise depending on the size of the memory buffer in use. By default, CANape will only expand the first 16 values of an array - if an array contains more than 16 elements, these will be ignored. For cases where it is necessary to transfer more than 16 array elements, this limit can be raised. The process for doing this is as follows:
- You first need to start the CANape database editor (choose Editor from the Database menu, or press F6);
- In the database editor, choose 'Editor Settings' from the 'Tools' menu;
- Click on 'Linker Map Reader';
- Set the value in 'Maximum field' to at least the size of the array you wish to view;
- Click OK, then close the database editor;
- You need to close and restart CANape before the change will take effect.
The maximum number of array values that can be read is 65,535. Obviously, the more elements that are expanded, the more bandwidth it will take to transfer the array data.