[?]: Wincc Flex 2008 Sp2 script problem

ProTool, WinCC flexible, WinCC, PP/OP/TP/TD/MP
vashello
Posts: 4
Joined: Sun Aug 22, 2010 5:07 pm

[?]: Wincc Flex 2008 Sp2 script problem

Post by vashello » Wed Sep 01, 2010 8:58 am

Goodmorning Guys and girls,
We found a strange iussue on flex2008 (in flex 2005 and 2007 works better), on IPC 427C with WINAC 4.5
and we make a little example to explain to Siemens the problem, so I share with You this little example so maybe someone have any idea.

The problem is related to the refresh on flexible of a value on the plc.
all the variable in flexible is setup to 100msec and continuosly cycle

-so we have an OB at 10msec
in this OB we have a simple istruction : a varibale that increment +1 everycycle

Code: Select all

IF (Var_counter <0 or Var_counter>1000) THEN 
     Var_counter := 0;
ELSE
    Var_counter := Var_counter + 1;
END_IF;
on a flexible page wi show this variable (I/O field), and on the paramenter of the variable, ON CHANGE VALUE we lunch a simple script that
make the difference from the actual value and the old value saved on the cycle before, and we show on the page this GAP:

Code: Select all

SmartTags("VAR_GAP") = SmartTags("VAR_Counter") - SmartTags("VAR_old_value")

SmartTags("VAR_old_value") = SmartTags("VAR_Counter")
on the video page if you show the variable VAR_GAP you will see that this Gap is variable and is not 100msec (=value 10) but for the most times 200msec (=value 20)

I hope this example is clear and I hope someone can Help us, Siemens are looking for, but until now no answer;)

Best regards


PS. if we use the variable :: SmartTags("VAR_old_value") and SmartTags("VAR_GAP") as internal variable of flexible nothing change, we have the same iussue!

vashello
Posts: 4
Joined: Sun Aug 22, 2010 5:07 pm

Re: [?]: Wincc Flex 2008 Sp2 script problem

Post by vashello » Fri Sep 17, 2010 12:26 pm

Only for information, the Mom Siemens admit the problem, and say that there is no solution inside Flex, but only use OPC or other external system.

The answer from Siemens:

Code: Select all

"the tag data is fetched by a component called datacollector, it uses channels to get the data.
It has a cycle thread, which sleeps 100ms and checks then if any data is due to be fetched.
On 2007 rt , the sleep(100) lasts 109 ms mostly. the elapsed time is measured by using windows GetTickCount() call,
which has an inaccuracy of 15.625 ms on 2000/xp/w7 ( this is the clocktick intervall) therefore if as sleep last 109 ms
you will get 110 ms, but if sleep would last exactly 100 ms you would get 94 ms or 110 ms. 2008 runtime comes with a s7dos version
which install s7oiehsx helper service. This service call timeBeginPeriod(1), which enhances timer accury of windows system wide.
Now a sleep exctaly lasts 100 ms for all processes. Now the runtime gets often 95 ms as result how long the cycle thread slept.
the cycle thread checks the data item "left time" and thinks, there is 6 ms left, lets do the item in the next cycle. therefore item with 100ms cycle
are fetched mostly delayed in the next cylce so the cylce is 200ms in fact."

Maybe can help someone!

Bye