3/20/2012 12:47 PM | |
Joined: 1/28/2009 Last visit: 7/15/2024 Posts: 6844 Rating:
|
Dear Khyzer, Please check the attachment for my solution with SFB2.I have tested it with PLCSIM. Best regards, Hamid Hosseini AttachmentSFB2.zip (70 Downloads) |
3/21/2012 1:00 AM | |
Posts: 140 Rating:
|
Dear Hamid, I am using this SFB CU within a FB and without any instance DB allocation as attached. Pleas elet me know how I can call this counter in OB100 and reset it. Thanks
AttachmentFB902.pdf (76 Downloads) |
3/21/2012 2:17 AM | |
Joined: 10/7/2005 Last visit: 7/25/2024 Posts: 3011 Rating:
|
Hello Khyzer the way I see it, you have the following two options: 1.) Do what the help on SFB0 (also applicable for SFB1-5) suggests: "If you want instances of this SFB to be initialized following a warm restart, you must call SFB 0 with R = 1 in OB100. If instances of this SFB are located within another block, you can reset these instances, for example, by initializing the higher-level block" 2.) An arguablymore elegant solution would be the usage of SFC 6 "RD_SINFO" inside your FB 902 though. Put simple, what you do is: -Call SFC 6 at the start of your FB902 -Evaluate its "TOP_SI" output to see if the call of FB902 took place fromOB 100 -Add SFB counters reset logic toFB902 which is only executed if FB902'scall took place from OB100 - Add the call of FB902 to OB100 Check SFC 6 "RD_SINFO" inbuilt help for more and below are a few links on it which I hope will help too: How can I determine the OB from which my function block was called? SCL call of the system function SFC6 |
Cheers |
|
This contribution was helpful to
1 thankful Users |
Follow us on