Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » Graceful shutdown(How do I implement a graceful shutdown)
Graceful shutdown [message #1805219] Wed, 10 April 2019 06:56 Go to next message
Raimund Bruening is currently offline Raimund BrueningFriend
Messages: 5
Registered: June 2016
Junior Member
Hi there,
we use FORTE in our linux system and have added some FBs to access an internal database. This database needs a graceful shutdown. How do I implement this?
A callback function called from endForte would work for me.

Re: Graceful shutdown [message #1805220 is a reply to message #1805219] Wed, 10 April 2019 07:14 Go to previous messageGo to next message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 199
Registered: February 2016
Senior Member
where do you open the connection to the database? the shutdown normally is done at the same level. If you open in a handler, then close it there.
Re: Graceful shutdown [message #1805246 is a reply to message #1805220] Wed, 10 April 2019 11:41 Go to previous message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1235
Registered: January 2014
Senior Member

this strongly depends on how you shut down 4diac FORTE. The best way to do it is to send a KILL message to the device. This can either be done remotely or grammatically. On posix we have several signal handlers (e.g., sig term) . See the endForte method in src/arch/posix/main.cpp for details.

This will correctly shutdown 4diac FORTE and free all the memory as all destructors are invoked. Also the destructors from the handlers. And this is the first place where such code should go. Furthermore if this is a SIFB which will open the connection on an INIT+ you should also allow to disconnecting with INIT-. An example where this concept is followed are the communication SIFB.

I hope this helps you and solves your issue. If you need more let us know, as I think startup and shutdown is a curcial feature and it should be handled on run-time level uniformly for all.

Previous Topic:c++ SIFB code monitoring
Next Topic:FBRT not working
Goto Forum:

Current Time: Sat Jul 24 09:00:00 GMT 2021

Powered by FUDForum. Page generated in 0.01818 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top