Register and receive messages
By registering with RSLinx Classic, an application can provide an address for other objects in the CIP system to use if they want to send messages to the application. The messages may be sent either unconnected, or via a connection made with the RSLinx Classic Message Router; it makes no difference to the application.
To receive and respond to such messages, complete the following steps:
- Specify a Link Address and an International String symbol for the application.CIP devices that send messages to the application will use Port 1 and the specified Link Address in a CIP path segment in order to address the application. Or, alternatively, they could use the (optionally) specified symbol in a CIP symbolic segment in order to address the application.
- Call DTL_CIP_APPLICATION_REGISTER to register the application with RSLinx Classic.
- This function (see DTL_CIP_APPLICATION_REGISTER) causes RSLinx Classic to create an Identity Object and a CIP Software Registration Object for the application.
- The parameters to the DTL_CIP_APPLICATION_REGISTER function include the link address and International String symbol chosen for the application, as well as a callback function (of type DTL_CIP_APPLICATION_SERVICE_PROC) which RSLinx Classic can call when a message is received for the application.
- The DTL_CIP_APPLICATION_REGISTER function will return a registration ID for the application to use in later references to the registration.
- Wait for a CIP message.
- When a message for the application is received, RSLinx Classic will call the DTL_CIP_APPLICATION_SERVICE_PROC callback function specified by the application in its DTL_CIP_APPLICATION_REGISTER call.
- One of the parameters of the callback function is a transaction ID for the application to use in its response.
- Call DTL_CIP_MESAGE_REPLY to send a response.The application can call DTL_CIP_MESSAGE_REPLY either from within the DTL_CIP_APPLICATION_SERVICE_PROC callback function or at some later time. In either case, the transaction ID provided with the DTL_CIP_APPLICATION_SERVICE_PROC call must be used to match the response to the original message.
- Call DTL_CIP_APPLICATION_UNREGISTER to unregister the application with RSLinx Classic.The registration ID returned from the DTL_CIP_APPLICATION_REGISTER call is used to identify the registration.
Provide Feedback