TLC FEVAL() function returns 0 always HELP!

조회 수: 12 (최근 30일)
Xenoepist
Xenoepist 2012년 9월 12일
댓글: Sameer 2014년 10월 15일
(Note: I took the "A" variable out to simplify the problem, so is not used for now.)
I'm trying the following TLC code:
%function Outputs(block, system) Output
%assign rollVars = ["U", "Y"]
%roll idx = RollRegions, lcv = RollThreshold, block, "Roller", rollVars
%assign A = LibBlockInputSignal(0,"",lcv,idx) %%Constant Amplitude
%assign t = LibBlockInputSignal(1,"",lcv,idx) %%Time from Simulink clock block
%assign x = 1.5708 %%Test Variable
%<LibBlockOutputSignal(0, "", lcv, idx)> = %<FEVAL("sin", t)>;
%endroll
%endfunction
But the output of FEVAL returns zero when I use a parameter from "LibBlockInputSignal()"... so the following formats for FEVAL return zero
%<FEVAL("sin", t)>, %<FEVAL("cos", t)>,
%<FEVAL("sin", A)>, %<FEVAL("cos", A)>
However, when I try %<FEVAL("sin", x)>, it returns the actual sine of x. (in this case x = pi/2 so it returns 1)
Also, if I set the variable "t" as an output (instead of FEVAL), I can see the time on the Simulink model scope block. So I know the variable "t" is holding the simulation run time as a double.
I am really confused on why this happens. Any help would be appreciated
  댓글 수: 1
Sameer
Sameer 2014년 10월 15일
Did your problem get solved?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Target Language Compiler에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by