This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/CODECOMPOSER: CCSv6.2: Some GEL expressions not working in expressions window

Guru 20035 points
Part Number: CODECOMPOSER

Tool/software: Code Composer Studio

Hello

I am able to get a simple GEL function like square working in the expressions window, i.e.

square(a)
{
    return a*a;
}

However, the expressions window is returning an error with a more complicated function like Limit(value,lower,upper), i.e.

Limit(value,lower,upper)
{
    if (value >= upper)
    {
        return upper
    }
    else if (value <= lower)
    {
        return lower
    }
    else
    {
        return value;        
    }
}

The error is 

Limit(u32VoltageError,0,16777216) unknown 'Limit()' not found
at Limit(u32VoltageError, 0, 16777216)

What am I doing wrong.

Stephen

  • Hi Stephen,
    I assume u32VoltageError is a variable in your code that is in scope when you are trying to evaluate the GEL function. If so, that should work. You are missing semi-colons at line 5 and 9 in the code snippet so maybe the gel file that contains the function did not load successfully?

    Thanks
    ki
  • The missing semicolons were causing the problem.
    Thanks,
    Stephen