主权项 |
1. A method for processing messages of a first processor and a second processor in a communication module of a programmable logic controller (PLC) comprising the first processor, the second processor and a shared memory comprising a first sector for storing high-priority messages and a second sector for storing low-priority messages, the method comprising:
determining, by the first processor, a priority order to be processed by the second processor and writing a request message in the first sector or the second sector of the shared memory according to the priority order; processing, by the second processor, communication for the request message of the first sector with precedence over the second sector; checking, by the second processor, the priority order of the request message and writing a response message in the first sector or the second sector of the shared memory according to the priority order; and reading, by the first processor, the response message of the first sector with precedence over the second sector and moving to a corresponding message function address. |