It is possible to register for a callback in the case of a noncyclical enquiry. If a noncyclical query of the master is received by the PROFIBUS DPV1 slave driver, the query is first made to registered data areas.
Then, all registered user FB instances are called up which have been registered with the PROFIBUS DPV1 slave by means of the interfaces IF_AsyncRead and IF_AsyncWrite. At the same time, the state of the automatic enquiry processing is transferred as well, so that possible problems can be responded to. The current status is then written into parameter iq_stError.
If an alarm acknowledge message is received, only those callbacks are called up that have been registered by means of the IF_AsyncAlarmAck interface.
To call up the AsyncRead method in the case of an incoming read query, an instance of the same type as the function block that implements the IF_AsyncRead interface has to be registered with the PROFIBUS DPV1 slave.
If the AsyncRead method of this function block instance is no longer to be called up when a noncyclical read enquiry is received, the registration of the instance has to be removed.
NOTE: Use the method IsRegisteredAsyncRead to check whether a certain function block instance is already registered as callback with the PROFIBUS DPV1 slave.
An example program for registering a callback can be found here.A list of all relevant methods and the associated interfaces can be found under Relevant methods (Callback registration).