[Python] VBox data reading with Python

Discussão em 'Python' iniciado por Stack, Março 6, 2025.

  1. Stack

    Stack Membro Participativo

    I would like to check with the community some support with a task I have.

    I have an equipment called VBox, which is used for data measuring in the Automotive segment. Here is the link to its webpage - Racelogic's VBox I use this equipment to measure vehicle speed, number of satellites, time and some other information.

    This information can be stored on a SD Card in the equipment and it can also be sent through USB to a PC.

    The developer already offers a software for data visualization and handling, called Test Suite.

    The issue here is that this software does not performs the calculations I need, which is to calculate real time f0 and f2 (for those who knows).

    As breakdown of my activities I have it like this:

    1. Read data from USB
    2. "Translate" information
    3. Data Sorting
    4. Calculations
    5. Data Visulization
    6. Testing

    I believe for step 1, I can already do it by following this code:

    import serial
    import struct
    import can
    import datetime
    import pytz

    serial_port = 'COM6'
    baud_rate = 500000

    try:
    with serial.Serial(serial_port, baud_rate, timeout=timeout) as ser:
    print(f"Connected to VBOX 3i on {serial_port}")
    while True:
    # Read a line of data from the serial port
    line = ser.readline()
    if line:
    # Decode the byte string to ASCII
    decoded_line = line.decode('ASCII', errors='ignore')
    print(f"Received: {decoded_line}")
    except serial.SerialException as e:
    print(f"Serial error: {e}")
    except KeyboardInterrupt:
    print("Program interrupted by user.")


    Of course, to get to this point, I used come ChatGPT or CoPilot for support. I am no expert in Python.

    The output of this script is what I believe the next step: "Translate" information.

    Output:
    Connected to VBOX 3i on COM6
    Received: VBOX3i,,f$NEWCAN,,]@]@]@$VBOX3i,,$NEWCAN,,]@]@]@$VBOX3i,,$NEWCAN,,]@]@]@$VBOX3i,,*#$NEWCAN,,]@]@]@$VBOX3i,,b$NEWCAN,,]@]@]@$VBOX3i,,x$NEWCAN,,]@]@]@$VBOX3i,,Q$NEWCAN,,]@]@]@$VBOX3i,,$NEWCAN,,]@]@]@$VBOX3i,,O$NEWCAN,,]@]@]@$VBOX3i,,$NEWCAN,,]@]@]@$VBOX3i,,$NEWCAN,,]@]@]@$VBOX3i,,p

    Received: $NEWCAN,,]@]@]@$VBOX3i,,YK$NEWCAN,,]@]@]@$VBOX3i,,"$NEWCAN,,]@]@]@$VBOX3i,,$NEWCAN,,]@]@]@$VBOX3i,,;u$NEWCAN,,]@]@]@$VBOX3i,,4$NEWCAN,,]@]@]@$VBOX3i,,i$NEWCAN,,]@]@]@$VBOX3i,,@$NEWCAN,,]@]@]@$VBOX3i,,q$NEWCAN,,]@]@]@$VBOX3i,,0$NEWCAN,,]@]@]@$VBOX3i,,$NEWCAN,,]@]@]@$VBOX3i,,$NEWCAN,,]@]@]@$VBOX3i,,a\$NEWCAN,,]@]@]@$VBOX3i,,H$NEWCAN,,]@]@]@$VBOX3i,,3$NEWCAN,,]@]@]@$VBOX3i,,$NEWCAN,,]@]@]@$VBOX3i,,X$NEWCAN,,]@]@]@$VBOX3i,,$NEWCAN,,]@]@]@$VBOX3i,,$NEWCAN,,]@]@]@$VBOX3i,,$NEWCAN,,]@]@]@$VBOX3i,,$NEWCAN,,]@]@]@$VBOX3i,,)$NEWCAN,,]@]@]@$VBOX3i,,RT$NEWCAN,,]@]@]@$VBOX3i,,{$NEWCAN,,]@]@]@$VBOX3i,,$NEWCAN,,]@]@]@$VBOX3i,,$NEWCAN,,]@]@]@$VBOX3i,,P$NEWCAN,,]@]@]@$VBOX3i,,$NEWCAN,,]@]@]@$VBOX3i,,Z$NEWCAN,,]@]@]@$VBOX3i,, s$NEWCAN,,]@]@]@$VBOX3i,,

    $NEWCAN,,]@]@]@$VBOX3i,


    Following this page CAN Output it could be possible to make some understanding of the output. However, I am not able to make it happen.

    Additionally, there is this GitHub VBox GitHub I found with some class already defined, however, I am able to confirm if it works or not...

    Based on this information, I would like the community support to make this happen.

    Thank you all in advance.

    Continue reading...

Compartilhe esta Página