Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

Join our "Ask Me About" community webinar on May 20th at 9 AM CET and 5 PM CET to explore cybersecurity and monitoring for Data Center and edge IT. Learn about market trends, cutting-edge technologies, and best practices from industry experts.
Register and secure your Critical IT infrastructure

Derived Function Block

Modicon PAC Forum

A forum for topics related to the scope of Modicon PAC offers and ecosystem along the whole lifecycle: Modicon M580 and 340, EcoStruxure Control Expert, EcoStruxure Process Expert (Unity Pro) and more.

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • Industrial Automation
  • Modicon PAC Forum
  • Derived Function Block
Options
  • Subscribe to RSS Feed
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
MatthewM
Lt. Commander MatthewM
8
RoozeeR
Lt. Commander RoozeeR Lt. Commander
7
Trinxs1
Lt. Commander Trinxs1 Lt. Commander
6
ciupol
Lieutenant ciupol
6
View All
Related Products
product field
Schneider Electric
Modicon M340

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Back to Modicon PAC Forum
ryanAstiefes
Ensign ryanAstiefes
Ensign

Posted: ‎2022-12-15 03:11 PM

0 Likes
2
2560
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2022-12-15 03:11 PM

Derived Function Block

I have an issue with a Derived FB that creates a Run Times (Hours/Minutes/Seconds) of a motor based on a BOOL being TRUE. The FB works just fine until I have to download a new program to the PLC (Stop the Controller) where my output for Run Times resets back to 0. I did disable Initialize %MWi after cold start but problem still continues, I'm sure it has something to do with the way I've set the FB up.

I've read somewhere that the Output values used in the Derived FB will be overwritten when a cold start is initiated  and to use Input/Output in place of the Output so the values will not reset back to 0, but that isn't working for me.

I do have a Reset bit in the code which works, I've eliminated it being a factor by writing in 200 instead of zero. .

Maybe somebody could shed some light on this issue for me. Code and Variables attached.

RunTime1.PNGRunTime2.PNG

 

 

Labels
  • Labels:
  • 01. Modicon M340 PAC
  • Tags:
  • english
Reply

Link copied. Please paste this link to share this article on your social media post.

  • All forum topics
  • Previous Topic
  • Next Topic
Replies 2
ryanAstiefes
Ensign ryanAstiefes
Ensign

Posted: ‎2022-12-15 03:51 PM

0 Likes
0
2553
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2022-12-15 03:51 PM

I got it. The INC_UDINT resets it's INOUT to 0 when a cold start is activated. 

Reply

Link copied. Please paste this link to share this article on your social media post.

dnordenberg1
Lieutenant dnordenberg1
Lieutenant

Posted: ‎2025-03-20 01:32 AM

0 Likes
0
269
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Subscribe to RSS Feed
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

Posted: ‎2025-03-20 01:32 AM

It isn't that because INC_UDINT is a function and they do not store any internal info which can be lost on a cold start. They start fresh on each program cycle. It is your variable Inc_Value that is lost because it is internal in your function block and that resets to 0 on cold reboot or program download. To save anything inside a function block you have to expose the data as an In/Out and place a variable there on the outside with a %MW on it which holds the data. Or you can check the %S variable for cold start inside your function block, if it is a cold start you can calculate Inc_Value from your Hours, Minutes and Seconds. Or rewrite the code not to be dependant on the Inc_Value all the time, just keep increasing your time counters which is already on In/Out puts so I guess they are probably stored in %MWs outside. Use the r_trig of %S6 to increase Seconds, if it becomes larger than 59, reset to 0 and inc Minutes and so on. That way it is also possible to adjust the time values from the outside if need, maybe a component is changed to another that already has some runtime on it and you want to continue keeping track of that time for example.

Reply

Link copied. Please paste this link to share this article on your social media post.

Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

 
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

This is a heading

With achievable small steps, users progress and continually feel satisfaction in task accomplishment.

Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.

of