Results 1 to 2 of 2

Thread: Using the value() function with calculated PIDs

  1. #1
    Junior Member
    Join Date
    Jan 2004
    Posts
    22

    Default Using the value() function with calculated PIDs

    Hi guys,

    I am working on a custom PID to calculate horsepower based on changes in Kinetic Energy of the car over time (like a dynojet works). I am trying to break up this PID into several pieces to make it easier to read, however I am having a bit of trouble with the value() function. I have a calculated PID which determines kinetic energy, and I am trying to determine the value of this PID, 10 frames in the past.

    The pid calculates fine when I close the log file and re-open it after logging, however it will not calculate 'on the fly' while logging occurs.

    So, does Value({CALC.PID}, frame) where frame is any frame in the past only work "offline"? I have the same problem with the dx() function, where it wont calculate the rate of change in Kinetic Energy, my calculated PID when logging. Perhaps calculated PIDs are not usable in these function if you want to seem them in real time?

    Thanks guys, hope this question is clear enough.

  2. #2
    EFILive Developer Site Admin Blacky's Avatar
    Join Date
    Mar 2003
    Posts
    9,503

    Default

    I have been investigating this issue, there is a bug with the value() function when the specified frame is less than 0 or greater than the number of frames. No bounds checking is performed - at best random data will be returned, at worst it will crash the EFILive Scan Tool program with an "Access Violation" error.

    Say you wanted to calculate the rpm 10 frames ago, do it like this:
    value({SAE.RPM},frame()-10)
    Just be aware that there will be problems displaying the first 10 frames due to the requested frame being less than zero.

    Also another bug was found while testing, the unary operators were not implemented correctly :oops: :oops: :oops:
    That means expressions that have only one operaand like "-10" will evaluate to random values.
    Note: the expression "frame()-10" will evaluate correctly because it is a binary expression - it has two operands.

    Both bugs have been fixed in the next release.

    Regards
    Paul

Similar Threads

  1. How to modify calculated PIds
    By 2000ssnb in forum Tips and tricks
    Replies: 12
    Last Post: July 4th, 2008, 04:14 AM
  2. Pid Creation / Calculated pids
    By Gelf VXR in forum General (Petrol, Gas, Ethanol)
    Replies: 19
    Last Post: June 26th, 2008, 03:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •