CANtrace Python Script for Custom Signal Conversion
TK Engineering executed a project for a customer that utilized CANtrace’s Python scripting to decode float signals from channel multiplexed CAN messages. This meant that the signals were converted to fixed point and transmitted without multiplexing on a virtual CAN channel, allowing the data to be plotted and logged like standard CAN signals. Python code was also used to log CAN channel data in multiple CSV files for spreadsheet analysis.
Custom Python Scripting for Float-to-Fixed Point Conversion and Custom Log File Generation
The project aimed to improve CAN data analysis, with a focus on improving the precision and readability of specific signals. We developed custom Python scripts to convert float signals to fixed point representations and enable data logging in custom log files.
At the customer’s request, our team expanded CANtrace’s Python scripting functions. We handled the conversion of float signals to fixed point and generated customized CSV log files. A major challenge was decoding float signals from a multiplexed CAN message, converting them to fixed point, and transmitting the refined data on another virtual CAN channel. Additionally, we tailored the Python script to save CAN data, including converted fixed point signals, in CSV files for further analysis. Working closely with the customer, we utilized the platform’s robust Python scripting support to extend existing scripts for float-to-fixpoint conversion and custom log file generation.
Python Script Optimization, CSV File Generation
Python script enhancement: We developed Python code within CANtrace to decode float signals from channel multiplexed CAN messages. We implemented an advanced algorithm to convert float signals to fixed points, ensuring precision and accuracy. Additionally, we created a logical framework to transmit the converted fixed point signals on a designated virtual CAN channel, facilitating non-multiplexed data transmission. We extended our Python script to save the CAN data, including the newly converted fixed point signals, to CSV files for further analysis. These carefully structured files facilitate easy access, streamlining post-processing analysis. This improvement gives our customers significantly better opportunities to analyze special CAN messages in spreadsheets.
User-friendly configuration
We provided clear instructions for seamlessly integrating the right database with the relevant CAN channel within CANtrace. We also implemented a user-friendly configuration process for signals in both the graph and data tabs. This allows users to easily visualize and analyze the fixed point signals, improving the overall user experience.
Seamlessly Converting Floats to Fixed Points and Enhancing CAN BUS Analysis
The extended Python script in CANtrace met the customer’s needs by seamlessly converting floats to fixed points. Customized CSV log files improved data analysis and increased the accuracy of signal interpretation for efficient CAN BUS analysis. CANtrace’s flexibility and Python scripting capabilities enabled us to customize the solution to meet the customer’s specific needs. We delivered an advanced script for converting floats to fixpoints and generating CSV files. Additionally, Python scripting in CANtrace decodes non-standard data. This creates advanced data filters, generates custom log files for interfacing with proprietary systems, simulates CAN nodes. Additionally it combines existing data on the CAN bus into new aggregate signals in real-time for quick data analysis.