🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Simplified C Block for Embedded Code Generation

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

Hi'
When I define a new function with input and output argument like as "float a_new_function (float x1, float x2){}" in Simplified C Block for Embedded Code Generation for TI DSP, simulation is ok. But generated code is not compiled in code composer studio v6. I think the problem is that the defined function is imported into Simplified C Block fuction labeled as "interrupt void Task() {}", so compiler returned an error.
Is there any way to define a global function in Simplified C Block ?
Thank you.

Find more posts tagged with

Sort by:
1 - 3 of 31
    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    Hi,

    Please view this tutorial video, https://youtu.be/cN_NSfuUPno, it shows the routines are generated for use by the DSP. In summary every function needs to be setup with an interrupt rate which is defined with the ZOH, which defines how often it will be called. Without knowing exactly what the purpose of your function is I can't give additional advice.

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    Unfortunately the video didn't help me. Because I didn't use any block in my TI DSP based project. I used only DSP related modules and Simplified C block. my project is only C based that is implemented using Simplified C block, So I need separate subroutine ( sub function) in Simplified C block.
    Also I need a global variable declaration in Simplified C Block.

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    You will need to use your subroutines as separate functions and include them as a library. You will be able to set the path where the library is found under 'Options->Set Path'

    Global variables can be declared in the parameter file with the (global) tag. You will need to read the help for the parameter file section 6.7 of the user manual.