The calculation results show "NaN",pls help me

SIMATIC S7-200/300/400, Step7, PCS7, CFC, SFC, PDM, PLCSIM,
SCL, Graph, SPS-VISU S5/S7, IBHsoftec, LOGO ...
Post Reply
auto_man
Posts: 1
Joined: Wed Aug 09, 2017 1:38 am

The calculation results show "NaN",pls help me

Post by auto_man » Wed Aug 09, 2017 2:07 am

I have a project used PCS7V8.2 & IL & 315-2DP,
and I create a FB like "Lag" in APL.
The SCL program is shown as follows:

Code: Select all

OUT := SEL(G:=LAG_T<=0.0,IN0:=IN + (sr_lv_out-IN)*(EXP(-Sample_T/LAG_T)),IN1:=IN);
sr_lv_out := OUT;
If the input ("IN") is fixed in a negative number always , and a few hours later,the output("OUT") shows “NaN”.
Why?
Is floating-point calculation overflow ?

qqwww
Posts: 7
Joined: Wed Apr 21, 2010 6:24 pm

Re: The calculation results show "NaN",pls help me

Post by qqwww » Wed Aug 09, 2017 5:59 pm

Show whole FB (with interface)

Enrico999
Posts: 2
Joined: Mon Aug 23, 2010 6:32 pm

Re: The calculation results show "NaN",pls help me

Post by Enrico999 » Thu Aug 10, 2017 7:05 pm

"NaN" means "Not a Number".

To find the error we need to see the whole block !

AlekMalek
Posts: 29
Joined: Wed Mar 27, 2013 2:37 pm

Re: The calculation results show "NaN",pls help me

Post by AlekMalek » Mon Dec 18, 2017 7:43 am

Check your formula. It seems that the output of your function divides on 0 or the output is infinit or out of range of your variable.

Post Reply