Slave monitoring method and device on bus
A bus and monitoring command technology, applied in the field of control, can solve problems such as low efficiency and complexity, and achieve the effect of simple monitoring process
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0059] see figure 1 , figure 1 It is a flow chart of a method for monitoring a slave on a bus provided by an embodiment of the present invention. Such as figure 1 As shown, the method includes:
[0060] Step S101, obtaining a start monitoring command;
[0061] Specifically, firstly, the start monitoring instruction input by the user is acquired.
[0062] Step S102, judging whether the immediate command queue is empty;
[0063] Specifically, after the start monitoring instruction input by the user is acquired, it is judged whether the immediate command queue is empty, if yes, execute steps S103-S106, if not, execute steps S107-S109. The immediate command queue is used for first-in first-out access of immediate commands generated by user operation or control logic.
[0064] Step S103, sending the read command indicated by the current node in the circular linked list to the slave corresponding to the read command;
[0065] Specifically, the current node in the circular lin...
Embodiment 2
[0081] see figure 2 , figure 2 It is a flow chart of another method for monitoring a slave on a bus provided by an embodiment of the present invention. Such as figure 2 As shown, the method includes:
[0082] Step S201, creating a read command, initializing a circular linked list corresponding to the read command, and marking the current node of the circular linked list;
[0083] Specifically, for slaves based on different communication protocols on different buses, the types of variables used by the slaves and the size of the address space of each variable may be different. Below, the present invention takes the Modbus communication protocol on the RS485 bus as an example to illustrate.
[0084] In the Modbus standard protocol, the most commonly used monitoring variables are divided into several fixed types, such as coils (readable and writable discrete variables), input discrete quantities (readable only discrete variables), holding registers (readable and writable an...
Embodiment 3
[0108] see image 3 , image 3 It is a flow chart of another method for monitoring a slave on a bus provided by an embodiment of the present invention. Such as image 3 As shown, the method includes:
[0109] Step S301, obtaining a start monitoring command;
[0110] Step S302, judging whether the immediate command queue is empty;
[0111] Specifically, after the start monitoring instruction input by the user is acquired, it is judged whether the immediate command queue is empty, if yes, execute steps S303-S307, if not, execute steps S308-S311.
[0112] Step S303, sending the read command indicated by the current node in the circular linked list to the slave corresponding to the read command;
[0113] Specifically, the current node in the circular linked list indicates a read command to be issued by the circular linked list at present, and the read command is used to monitor the current state of the slave.
[0114] Step S304, controlling the circular linked list to automa...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


