Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simulink not recognizing output variable....

Status
Not open for further replies.

slammedkg

Mechanical
Dec 10, 2013
1
0
0
US
Hello all,

As you can tell from my signature, I'm very new here, so please be patient.

I have a Simulink model of a HVAC fan controller with multiple plants/controllers in the system. The s-functions are templates found in Simulink's library. One controller in particular is intended to output a 7-element vector to a dmux. When I attempt to run the simulation, Simulink gives an error that "Output returned by S-function "...." in "...." during flag=3 call must be a real vector of length 7."

Doing a bit of digging - the vector length is fine, but it believes one variable is NaN. If I remove the variable from the output string, the simulation runs fine (not accurately, but it runs). If I allow the variable to output to the workspace (by removing a semi-colon) - the variable has a value. No doubt about it. If I shorten the simulation run time, and check the variable values at start-up, it still gives a positive, real number.

Some people have mentioned using a structure on it - which I attempted, but was stopped by Matlab, which stated I could not use a structure on a double.

I'm at my wits end - any ideas?

 
Status
Not open for further replies.
Back
Top