Data persistance as Static or IN_OUT ?

LucSnijers

Member
Join Date
Mar 2019
Location
Antwerp
Posts
3
Hi all,

( i use Siemens S7)

I'm writing code to calculate a totalizer: a trigger adds a value to a counter, the counter is written to a DB, where it is read by the HMI. The counter cycles at 1000000. The value is historised and used for shift reports.

My question is where you prefer to persist the total value?


A. As a Static variable in the FB
>> The FB writes the value as an OUT parameter.
>> The DB/HMI value is always overwritten by the FB.
>> When you update the FB, the totalizer is reset.

B. In the DB / HMI tag
>> The FB reads and writes the values as an IN_OUT parameter.
>> When the FB is updated, it uses the DB value to continue the count.
>> When the DB is updated, the totalizer value is lost.

thanks, Luc
 
If the data is used only inside the FB, then part of the instance (STAT).
If the data is also used elsewhere outside the FB, including HMI, then in a shared DB, possibly defined via a UDT (via IN_OUT).

So you may very well have a combination of STAT and IN_OUT data in an FB.
 
If the data is used only inside the FB, then part of the instance (STAT).
If the data is also used elsewhere outside the FB, including HMI, then in a shared DB, possibly defined via a UDT (via IN_OUT).

So you may very well have a combination of STAT and IN_OUT data in an FB.

So your idea is never to use OUTPUT parameters on an FB ?
 
No, I replied to your question regarding persistence of data.
OUTPUTs are usually used for what must be controlled.
They do not have persistance. It is very important that outputs are always assigned in the FB. They must not be bypassed or read before assigning.
 

Similar Topics

Hello I have a s7-1200 and I would like to read the tags present in this controller with my controllogix controller. The two controllers don't use...
Replies
5
Views
97
Hi folks, I'm not as accustom with Siemens & WinCC, however I've been asked to increase the amount of data an existing application is logging...
Replies
2
Views
65
Has anyone migrated Proficy Historian data to a new server? I followed the guide to move all the data over, but when I run the utility, it stops...
Replies
0
Views
46
I cannot add SLC500 analog input tag (I: 8.3) to EZSeries Touch Panel Editor (V 5.3). I used all the listed tag datatype but it all says "Invalid...
Replies
10
Views
257
Hi, Wy we log data in PLC using DLG instruction, when we have option to log data in HMI
Replies
1
Views
80
Back
Top Bottom