Jelenlegi hely

Voltage and current logging solution in Python

Contact: Bányász József, jozsef.banyasz@continental-corporation.com

Summary: Create a solution in Python to log voltage and measurement values, and their respective timestamps into a log file

Utilized technologies: Python, default Python libraries, basic data structures, multithreading

Continental utilizes complex test benches with multiple hardware and software elements running in parallel, conducting and evaluating an automated test. A core part of any test is the creation of logs and reports for clients, and for traceability. As extensive as a test logging is, there are still spots where there are rooms for improvement, and one such spot is the logging of power supply voltage and current.

The task at hand is the creation of a Python based solution capable of logging the voltage and current values of one or multiple power supplies into one common measurement log file. There is already a solution where the user can retrieve data from the power supply via Python, but that solution only allows for single momentary polling. This implementation is a set of simple Python functions, such as ’get_voltage()’, and ’get_current()’. These functions return a float type value. It is not a constant stream of data on the Time axis, only single values.

The solution should utilize these two already existing functions to request the value for voltage and current. The returned values should then be stored in some sort of data structure, and should be loadable into a freely available visualization library like Pyplot (such as: plt.plot(Time, Voltage) should present a plot with the voltage on the Time axis). For this, the exact Time should also be saved into the structure, and measurement should happen every N milliseconds. This solution must also take into consideration that it should run parallel with active background processes (such as already running Python test scripts), so threading is needed.

For this task, the developer will not need an actual power supply, The returned values can be mocked by simply returning a randomly generated value for voltage and current.

During this task, the developer will learn:

  • how to write maintainable, clean Python code
  • how to implement simple multithreaded solutions
  • basic concepts of implementing and manipulating data structures