IEC function call with method for establishing a basic state

When a robot program is started, the so-called basic state of the robot is established. It is possible that, when the robot establishes the basic state, a corresponding method of the IEC function call linked to the robot is also automatically called. In this "EstablishBasicState" method, states and variables of the IEC function calls can be initialized. This allows a defined state to be established at the beginning of the robot program. This can be useful, for example, if an IEC function call has internal states or works with variables/flags. In particular, if the robot program is aborted, a defined state can be restored in the next run and the robot program functions independently of the previous history.

Example: In an IEC function call, a certain time should be waited before an action is triggered. If the program is now aborted "sometime", it is possible to use the "EstablishBasicState" method to reset the time when the program starts, so that the IEC function call starts again with a defined state and without old values from the aborted program sequence still being present.

So that the EstablishBasicState method of the IEC function call can be called automatically by the robot, the block must implement the "IEstablishBasicState" interface in addition to the ICallF interface (SEW_MK_Robotics.SEW_IRobLangPub.IEstablishBasicState). This interface includes the "EstablishBasicState" method in which the basic state of the IEC functions can be established. This method is then automatically called when a program is started as soon as the block has been linked to the robot via LinkICallF as described in the chapter IEC function call for the SRL program.

INFORMATION: The "EstablishBasicState" method is called only once at program start and must then return the value TRUE. If TRUE is not returned, the robot goes into the error state and the program is not started.