An encoder and protocol switching method supporting multiple protocols
By integrating protocol processing and interface modules into the encoder, multi-protocol switching is achieved, solving the hardware replacement problem caused by the single protocol of existing encoders, and realizing flexible adaptation and stable data transmission.
Patent Information
- Application Number
- CN202610405120.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-30
- Publication Date
- 2026-07-03
AI Technical Summary
Existing encoders typically only support one or a few communication protocols, which means that the entire encoder needs to be replaced when the device is replaced or upgraded, making it difficult to flexibly adapt to the communication standards of different systems.
Design an encoder that supports multiple protocols, including a protocol processing module and an interface module. The protocol processing module switches communication protocols according to external instructions, and the interface module is configured to adapt to different communication protocols. It integrates multi-protocol parsing and port adaptive functions.
It can adapt to the communication interface standards of different systems without changing hardware devices, reducing peripheral components and wiring, avoiding frame loss, bit errors, and timing disorder, and ensuring real-time, stable and accurate data transmission.
Smart Images

Figure CN122329374A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of sensor technology, and in particular to an encoder that supports multiple protocols and a protocol switching method. Background Technology
[0002] In numerous fields such as robotics, industrial automation, intelligent device control, and automobiles, encoders, as core sensors that acquire critical information such as position and speed in real time, make the choice of their communication protocol crucial. Currently, common encoder communication protocols on the market include RS485, BISSC, and SSI. However, most existing encoder products have limitations, typically supporting only one or a few specific protocols. In practical applications, due to differences in communication standards between different devices and systems, as well as changes in user needs during project upgrades and modifications, it is often necessary to change the communication protocol used by the encoder. However, because existing encoders support only one protocol, when a protocol change is required, the entire encoder device must be replaced. Summary of the Invention
[0003] This invention provides an encoder that supports multiple protocols and a protocol switching method, in order to solve at least one defect in the prior art.
[0004] In a first aspect, embodiments of the present invention provide an encoder that supports multiple protocols, including:
[0005] The protocol processing module and the interface module are electrically connected.
[0006] The protocol processing module is configured to acquire a protocol switching instruction received through the interface module, control the switching of communication protocols according to the protocol switching instruction, and configure the interface module according to the current communication protocol to control the interface module to communicate according to the current communication protocol.
[0007] The communication protocols include synchronous communication protocols and asynchronous communication protocols.
[0008] Optionally, the interface module includes a configuration interface and / or a communication interface.
[0009] Optionally, the communication interface includes at least two differential signal ports.
[0010] Optionally, the differential signal port is configured to support multiplexing of two differential signal communications (Clock and Data) and one differential signal communication (Data).
[0011] Optionally, the communication protocol includes at least one of BISSC and SSI, and at least one of RS485, RS422, T485, BUS, PERIOD, CAN, SENT, and AK.
[0012] Optionally, the configuration interface includes a USB interface.
[0013] Secondly, embodiments of the present invention also provide a method for switching multiple protocols of an encoder, applicable to any of the encoders described in the embodiments of the present invention, wherein the encoder includes a protocol processing module and an interface module, and the protocol processing module is electrically connected to the interface module;
[0014] The protocol processing module is configured to acquire a protocol switching instruction received through the interface module, control the switching of communication protocols according to the protocol switching instruction, and configure the interface module according to the current communication protocol to control the interface module to communicate according to the current communication protocol.
[0015] Optionally, controlling the switching of communication protocols according to the protocol switching instruction includes:
[0016] The protocol processing module is controlled to be placed in protocol switching mode. In protocol switching mode, the protocol processing module modifies the protocol information stored internally. After the protocol information is modified, the protocol processing module is controlled to exit the protocol switching mode. Subsequently, the protocol processing module initializes the interface module according to the current protocol information.
[0017] Optionally, the protocol switching instruction includes a switching signal control code, which is used to put the protocol processing module into a protocol switching mode;
[0018] In the protocol switching mode, the control maintains the current connection state of the interface module unchanged.
[0019] Optionally, the protocol processing module is also configured to identify the current communication protocol.
[0020] Compared with existing technologies, the advantages of this invention are as follows: This invention proposes an encoder, which includes a protocol processing module and an interface module. The protocol processing module can flexibly switch according to external commands, adapting to different communication interface standards of host computers, controllers, or back-end systems without replacing hardware devices. By integrating multi-protocol parsing and port adaptive configuration functions into a single encoder, it replaces the traditional solution that requires multiple single-protocol encoders or external protocol conversion modules, reducing external adapters, simplifying system wiring, and reducing installation space occupation. After switching protocols, the protocol processing module simultaneously configures specific parameters for the interface module, avoiding frame loss, bit errors, and timing misalignment problems that easily occur when using multiple protocols, ensuring real-time, stable, and accurate data transmission. Attached Figure Description
[0021] Figure 1 This is a block diagram of the encoder structure in the embodiment;
[0022] Figure 2 This is another encoder structure block diagram in the embodiment;
[0023] Figure 3 This is a flowchart of the protocol switching method in the embodiment. Detailed Implementation
[0024] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.
[0025] Example 1
[0026] Figure 1 This is a block diagram of the encoder structure in the embodiment, for reference. Figure 1 The encoder includes: a protocol processing module 1 and an interface module 2, which are electrically connected.
[0027] Protocol processing module 1 is configured to acquire protocol switching instructions received through interface module 2, control the switching of communication protocols according to the protocol switching instructions, and configure interface module 2 according to the current communication protocol to control interface module 2 to communicate according to the current communication protocol.
[0028] In this solution, interface module 2 is located inside the encoder. Interface module 2 is used for encoder communication during normal operation and for configuring the encoder protocol. Interface module 2 may include one or more interfaces.
[0029] For example, interface module 2 may include an RS485 interface, a BISSC interface, and a T485 interface. The RS485 interface, BISSC interface, and T485 interface are used for encoder communication during normal use of the encoder, and the RS485 interface is also used to configure the encoder protocol.
[0030] In this solution, the protocol processing module 1 is an internal module of the encoder used to control protocol switching. After receiving the protocol switching command through the interface module 2, the encoder controls the switching of communication protocols through the protocol processing module. This embodiment proposes an encoder that includes a protocol processing module and an interface module. The protocol processing module can flexibly switch according to external commands, adapting to different communication interface standards of host computers, controllers, or back-end systems without changing hardware devices. By integrating multi-protocol parsing and port adaptive configuration functions into a single encoder, it replaces the traditional solution that requires multiple single-protocol encoders or external protocol conversion modules, reducing external adapters, simplifying system wiring, and reducing installation space occupation. After switching protocols, the protocol processing module simultaneously configures specific parameters for the interface module, avoiding frame loss, bit errors, and timing misalignment problems that are prone to occur when using multiple protocols, ensuring real-time, stable, and accurate data transmission.
[0031] Based on any of the aforementioned solutions, in one possible implementation, the interface module includes a configuration interface and / or a communication interface. This configuration interface and communication interface can be the same interface or different interfaces. For example, for a given encoder, the RS485 interface can serve as both a configuration interface and a communication interface.
[0032] Figure 2 This is another encoder structure block diagram in the embodiment. In this scheme, the protocol processing module includes a protocol processing unit 200, and a protocol switching unit 100 is communicatively connected to the protocol processing unit 200. The protocol switching unit 100 is configured to receive protocol switching instructions sent by an external control device (e.g., a host computer) through the configuration interface 300, and control the protocol processing unit 200 to switch the communication protocol according to the protocol switching instructions. The protocol processing unit 200 is configured to configure the configuration interface 300 according to the current communication protocol, and control the configuration interface 300 to communicate according to the current communication protocol. The communication protocols include synchronous communication protocols and asynchronous communication protocols.
[0033] In this solution, the protocol switching unit 100 can be a microcontroller unit (MCU). The protocol switching unit 100 supports decoding protocol switching instructions and outputting protocol switching control signals. The MCU can be configured with a power supply, which can be designed using an LDO voltage regulator chip. The power supply configuration is used to power the MCU. The MCU can also be configured with a storage unit, which can be designed using an EEPROM chip. The storage unit configuration is used to store information such as the current protocol type and switching instruction parameters.
[0034] In this scheme, the protocol switching unit 100 can communicate with the host computer through the configuration interface 300. The protocol switching unit 100 can receive the protocol switching command sent by the host computer through the configuration interface 300. The protocol switching unit 100 can convert the protocol conversion command into an instruction code that can be recognized by the protocol processing unit 200.
[0035] In this scheme, when the protocol switching unit 100 receives an instruction to enter the protocol switching mode, it can set the protocol processing unit 200 to the protocol switching mode. In this mode, the protocol processing unit 200 locks the current configuration of the communication interface 400 and prohibits data transmission. When exiting the protocol switching mode, the protocol processing unit 200 is set to the working mode, in which the data transmission function is enabled.
[0036] In this solution, the protocol processing unit 200 can be designed as an MCU. The MCU can be configured with a Flash memory unit to store multi-protocol switching processing programs, control configuration interface parameter configuration requirements, etc. The MCU can be configured to communicate with the protocol switching unit 100 via an SPI interface and with the communication interface 400 via an I2C interface to realize data transmission between modules, ensuring timely receipt of protocol switching commands and acquisition of raw sensor data.
[0037] In this scheme, the protocol processing unit 200 can be configured to store processing programs for multiple protocols. After the communication protocol is determined, the protocol processing unit 200 calls the corresponding protocol processing program to process the input data according to the format of the selected protocol.
[0038] In this scheme, after the communication protocol is determined, the protocol processing unit 200 configures the function and transmission parameters of the configuration interface according to the current protocol type. For example, the BISSC protocol requires the Clock frequency to be configured to 1MHz, so the GPIO corresponding to the configuration interface is configured as Clock and Data differential output; the T485 protocol requires the UART baud rate to be configured to 9600bps, so the corresponding GPIO is configured as Data differential output.
[0039] In this scheme, when the protocol switching unit 100 outputs a protocol switching command to the protocol processing unit 200, a protocol conversion interrupt is generated. The priority of the protocol conversion interrupt is configured to be higher than that of the interrupt generated during normal data processing, so as to ensure that the protocol switching command can be responded to quickly.
[0040] In this solution, the configuration interface 300 is used for communication between the encoder and the host computer. The configuration interface 300 can be designed using a serial port chip, and the configuration interface 300 configures the serial port driver. The protocol switching unit 100 can be configured to trigger a protocol conversion interrupt when the configuration interface 300 receives a protocol switching command sent by the host computer, and the protocol processing unit 200 performs protocol switching when it detects the protocol conversion interrupt.
[0041] In this solution, the communication interface 400 can adopt a multi-channel differential transceiver chip design. The multi-channel differential transceiver chip is configured to support synchronous and asynchronous communication, and different channels can be configured to be used for synchronous and asynchronous communication.
[0042] In this solution, the operation and usage of the encoder can include:
[0043] The user sends a protocol switching command through the host computer. This command is transmitted to the protocol switching module 100 via the configuration interface 300. After parsing the command, the protocol switching unit 100 sends a protocol switching control signal to the protocol processing unit 200. The protocol processing unit 200 switches to the target protocol according to the control signal and simultaneously configures the communication interface 400 to adapt to the target protocol, enabling the encoder to achieve normal communication according to the target protocol.
[0044] This solution proposes an encoder equipped with a protocol switching module, a protocol processing module, a configuration interface, and a communication interface. The protocol switching module can control the protocol processing module to quickly switch communication protocols according to the protocol switching command issued by the host computer. The protocol processing module can automatically configure the communication interface according to the current communication protocol, so that the working mode of the communication interface is precisely matched with the protocol requirements, ensuring the stability and reliability of data transmission. The two work together to ensure the convenience of protocol switching.
[0045] In this solution, the encoder is equipped with a configuration interface, which serves as a dedicated channel for receiving protocol switching commands. This interface accurately receives protocol switching commands from the host computer, enabling the protocol switching module to respond promptly to external configuration needs and achieve rapid switching of communication protocols. This effectively enhances the encoder's flexibility and configurability. The configuration interface and communication interface are independent of each other, ensuring that the protocol switching process and data communication process do not interfere with each other. Even in protocol switching mode, the communication interface maintains its original connection state, avoiding data transmission interruptions caused by protocol switching and improving the encoder's continuous operation capability in industrial environments.
[0046] Based on any of the aforementioned schemes, in one possible implementation, the communication interface includes at least two differential signal ports.
[0047] In this solution, the communication interface can adopt a multi-channel differential transceiver chip design. The multi-channel differential transceiver chip includes at least two differential signal channels, and the communication interface is configured to support synchronous and asynchronous communication.
[0048] For example, in this solution, different channels of the communication interface can be configured to correspond to synchronous or asynchronous communication. For instance, channel CH1 can be configured to support synchronous communication, including Clock and Data signals; channel CH2 can be configured to support asynchronous communication, including a Data signal. The differential transceiver chip of the communication interface controls its operating mode according to the protocol type: channel CH1 is enabled for synchronous protocols, and channel CH2 is enabled for asynchronous protocols.
[0049] Based on any of the aforementioned schemes, in one possible implementation, the differential signal port is configured to support multiplexing of two differential signal communications for Clock and Data, as well as one differential signal communication for Data.
[0050] In this scheme, the differential signal port is configured to support the reuse of both synchronous and asynchronous communication protocols in the hardware design, so that the differential signal port of the communication interface can support both Clock and Data differential signal communication and be compatible with one Data differential signal communication.
[0051] In this solution, the electrical characteristics of differential signals and the functional multiplexing logic of hardware pins are used to adapt the same set of differential ports to the instruction transmission requirements of different types of host computers: For host computers that issue instructions using synchronous communication, the port enables two differential signals, Clock and Data, with the Clock signal as the synchronization reference to ensure that instruction data is received accurately in time sequence; For host computers that issue instructions using asynchronous communication, the port only enables one differential signal, Data, and relies on a preset baud rate to achieve instruction transmission without the need for external clock synchronization.
[0052] For example, in this solution, the communication interface design includes two independent differential transceiver channels (CH1 and CH2). The CH1 channel is configured as a Clock differential signal channel, and the CH2 channel is configured as a Data differential signal channel. The multiplexing function is achieved by combining and individually enabling the two channels.
[0053] For example, in this solution, the communication interface is electrically connected to the UART interface of the protocol processing module via the UART interface. The protocol processing module is configured to control the on / off state of the CH1 and CH2 channels via an analog switch. When the protocol processing module determines that the communication protocol is a synchronous communication protocol, it turns on both the CH1 (Clock) and CH2 (Data) channels. When it determines that the communication protocol is an asynchronous communication protocol, it turns on the CH2 (Data) channel and turns off the CH1 (Clock) channel via the analog switch, thereby realizing single-channel differential Data signal communication.
[0054] In this scheme, under synchronous communication mode, a Clock signal edge-triggered mechanism is used. When the rising edge of the Clock signal is detected, an interrupt is triggered and the differential signal data of the Data channel is read. Data latching is completed on the falling edge of the Clock signal. During reception, the timing of the Clock signal is used as a reference to ensure the accurate sampling timing of each bit of instruction data, avoiding instruction errors caused by timing deviations. In asynchronous mode, instructions are received via UART interrupt. After the Data channel receives the differential signal, it is converted into a single-ended signal through the communication interface and transmitted to the receive buffer of the protocol processing module. After an interrupt is triggered, the buffer data is read and the data format is parsed according to the preset baud rate.
[0055] Based on any of the aforementioned schemes, in one possible implementation, the communication protocol includes at least one of BISSC and SSI, and at least one of RS485, RS422, T485, BUS, PERIOD, CAN, SENT, and AK.
[0056] In this solution, the encoder is compatible with both synchronous and asynchronous communication protocols. The synchronous communication protocol includes at least one of BISSC and SSI, and the asynchronous communication protocol includes at least one of RS485, RS422, T485, BUS, PERIOD, CAN, SENT, and AK.
[0057] In this solution, the communication interface can adopt a dual-channel differential transceiver chip design. This chip can be configured with UART interface, SPI interface, timer, CAN controller, etc., thereby realizing timing control and data parsing of different protocols.
[0058] Based on any of the aforementioned solutions, in one possible implementation, the configuration interface and communication interface are integrated as an interface module.
[0059] In this solution, the interface module may include an MCU, a USB chip, and a dual-channel differential transceiver chip. The USB chip is configured to connect to the MCU via a UART interface, and the dual-channel differential transceiver chip is configured to connect to the MCU via a GPIO, UART, or CAN interface.
[0060] The interface module may also include an AND gate chip. The AND gate chip is configured to allow the protocol processing module to be placed in protocol switching mode after the USB chip receives a protocol switching command and the protocol switching module completes its internal configuration, so as to avoid data output and command reception conflicts.
[0061] In this solution, a unified power supply is configured for the MCU, USB chip, and dual-channel differential transceiver chip, and the power supply output voltage supports 5V and / or 12V.
[0062] In this solution, the configuration interface and communication interface are integrated into one interface module. By integrating the hardware resources of the two interfaces, the number of physical interfaces, wiring complexity and hardware cost can be reduced, which can meet the industrial design requirements of encoder miniaturization and integration.
[0063] Based on any of the aforementioned solutions, in one possible implementation, the configuration interface includes a USB interface.
[0064] In this solution, the configuration interface uses a USB interface, which may include a USB chip and an MCU. The MCU is used for data interaction between the USB chip and the protocol switching module.
[0065] In this solution, a USB interface is used as the configuration interface. The configuration interface has wide compatibility and plug-and-play features, and can realize stable and interference-resistant transmission of protocol switching commands.
[0066] Based on any of the aforementioned schemes, in one possible implementation, the encoder includes a protocol switching module, a protocol processing module, and an interface module. The protocol switching module identifies the communication protocol currently used by the encoder and receives protocol switching commands input by the user. The protocol processing module stores processing programs for various protocols and, according to the instructions from the protocol switching module, calls the corresponding protocol processing program to convert the input data according to the format of the selected protocol. The interface module integrates and reuses the configuration interface and communication interface for connecting to the host computer and outputting corresponding data.
[0067] In this solution, the encoder is configured to communicate with the host computer through an interface module. The encoder has a working mode and a protocol switching mode. The user configures and switches protocols through the host computer. When switching protocols, the protocol switching module will first put the protocol processing module into the protocol switching mode, and then send the corresponding protocol switching command to the protocol processing module.
[0068] After receiving the protocol switching command, the protocol processing module modifies the protocol information in its internal storage according to the corresponding command. Then, the host computer controls the exit from the protocol switching mode and returns to the working mode. After that, the protocol processing module initializes the interface module according to the protocol information in its internal storage.
[0069] For example, the encoder originally used the Bissc protocol for communication. When the protocol processing module is in protocol switching mode, it modifies the storage information of the Bissc protocol to T485. When the protocol processing module exits the protocol switching mode and restarts, it will initialize and communicate according to the T485 protocol.
[0070] In this solution, the protocol switching module supports inputting protocol switching commands via USB interface, improving the convenience of operation; the protocol processing module integrates and stores multiple protocol processing programs, achieving multi-protocol compatibility, and accurately converts data according to different protocol formats to ensure the accuracy of data output; the modular design structure facilitates equipment maintenance, upgrades, and expansion.
[0071] The encoder proposed in this solution can quickly switch between multiple protocols to meet diverse usage needs in different scenarios without replacing the entire encoder device, thus reducing hardware costs. It is easy to operate, saving time and manpower and improving production efficiency. The modular design facilitates equipment integration and upgrades, enhancing the equipment's adaptability and competitiveness.
[0072] Example 2
[0073] This embodiment proposes a method for switching between multiple protocols of an encoder, which can be applied to any of the encoders described in Embodiment 1. The encoder includes a protocol processing module and an interface module, and the protocol processing module and the interface module are electrically connected.
[0074] The protocol processing module is configured to receive protocol switching instructions from the interface module, control the switching of communication protocols according to the protocol switching instructions, and configure the interface module according to the current communication protocol to control the interface module to communicate according to the current communication protocol.
[0075] In this solution, the hardware implementation method and beneficial effects of the encoder are the same as those described in Embodiment 1, and the specific details will not be repeated.
[0076] Figure 3 This is a flowchart of the protocol switching method in the embodiment, for reference. Figure 3 Based on any of the aforementioned solutions, in one possible implementation, controlling the protocol processing module to switch communication protocols according to the protocol switching instruction includes:
[0077] S101. The protocol processing module is placed in protocol switching mode. In protocol switching mode, the protocol processing module modifies the protocol information stored internally.
[0078] In this scheme, the protocol processing module receives the protocol switching command received by the configuration interface. After the protocol switching command is verified, the protocol processing module enters the protocol switching mode. After entering this mode, the protocol processing module suspends the data transmission and reception function of the communication interface and prohibits external data interaction to avoid data conflicts during the protocol modification process.
[0079] After entering the protocol switching mode, the protocol processing module configures the protocol parameters according to the target protocol in the protocol switching instruction. If it is a synchronous protocol, it configures parameters such as clock frequency, data frame length, and sampling edge; if it is an asynchronous protocol, it configures parameters such as baud rate, data bits, parity bits, and stop bits.
[0080] S102. After completing the modification of the protocol information, the protocol processing module exits the protocol switching mode. Subsequently, the protocol processing module initializes the interface module according to the current protocol information.
[0081] In this scheme, after modifying the protocol information, the protocol processing module exits the protocol switching mode. Subsequently, the protocol processing module sends an initialization command to the interface module through the GPIO and / or SPI interface to initialize the interface module according to the updated protocol parameters.
[0082] For synchronous protocols such as BISSC and SSI, the control interface module enables dual differential channels for Clock and Data, configures the timer to generate Clock signals of the corresponding frequency, sets the Data channel to synchronous sampling mode, and matches the timing rules of BISSC and SSI.
[0083] For asynchronous protocols such as RS485 and T485, the control interface module should only enable the Data differential channel, disable the Clock channel, and configure peripheral parameters (baud rate, data bits, etc.) for UART, CAN, etc., to match the transmission rules of the asynchronous protocol.
[0084] After the interface module is initialized, the protocol processing module enables the data transmission and reception function of the communication interface, and the encoder works normally according to the newly configured communication protocol.
[0085] Based on any of the aforementioned schemes, in one possible implementation, the protocol switching instruction includes a switching signal control code, which is used to put the protocol processing module into a protocol switching mode; in the protocol switching mode, the current connection state of the control and maintenance interface module is kept unchanged.
[0086] In this solution, under the protocol switching mode, the interface module state locking mechanism decouples the modification of protocol information from the physical connection of the communication interface, so that the communication link is not interrupted and the connection state is not changed during the protocol switching process, and only the background update of the protocol parameters is completed.
[0087] In this scheme, when the protocol processing module enters the protocol switching mode, it disables all control commands targeting the interface module connection (such as interface restart, link disconnection, parameter reset, etc.), maintains the current hardware state of electrical connection, physical link, signal transmission channel, etc., and only grants write permissions to the protocol information storage area. When the communication interface connection is locked, the protocol parameters are configured according to the target protocol in the protocol switching command. Throughout the protocol parameter configuration process, the interface module maintains the connection state before the lockout.
[0088] In this scheme, during the interface module initialization process, the protocol processing module only replaces the protocol parameters based on the existing connection link, without interrupting the current physical connection or changing the connectivity status between the interface module and the host computer. After the protocol parameters are initialized, the interface module retains the updated protocol parameters and the original physical connection status.
[0089] In this solution, after the protocol switch, the interface module initialization only updates the protocol logic parameters and retains the original connection link, which can avoid device abnormalities caused by link interruption.
[0090] Based on any of the aforementioned schemes, in one possible implementation, the protocol processing module is further configured to identify the current communication protocol.
[0091] In this solution, the protocol processing module can be configured to actively identify the current communication protocol. Through accurate identification of the current communication protocol, static protocol information reading and dynamic operation status verification can be achieved, ensuring the accuracy of the identification results.
[0092] In this solution, the protocol processing module can be configured to start the identification process when it receives a protocol query command from the host computer, or to initiate a protocol identification after completing the protocol switching and interface module initialization to verify whether the protocol configuration is consistent with the preset protocol.
[0093] In this solution, the protocol processing module can be configured to collect the real-time operating status of the interface module through the GPIO and SPI interfaces and extract protocol feature parameters. The protocol feature parameters may include the clock signal output frequency (counted by the timer), the sampling edge of the data channel, the data frame length, the baud rate, data bits, stop bits, parity bit configuration, and the differential channel enable status (whether the clock channel is closed).
[0094] The protocol processing module compares the collected protocol feature parameters with templates in the pre-stored protocol feature library one by one, and determines the current communication protocol type based on the matched template.
[0095] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. An encoder supporting multiple protocols, characterized by, include: The protocol processing module and the interface module are electrically connected. The protocol processing module is configured to acquire a protocol switching instruction received through the interface module, control the switching of communication protocols according to the protocol switching instruction, and configure the interface module according to the current communication protocol to control the interface module to communicate according to the current communication protocol. The communication protocols include synchronous communication protocols and asynchronous communication protocols.
2. The multi-protocol supported encoder of claim 1, wherein, The interface module includes a configuration interface and / or a communication interface.
3. The multi-protocol supported encoder of claim 2, wherein, The communication interface includes at least two differential signal ports.
4. The multi-protocol supported encoder of claim 3, wherein, The differential signal port is configured to support multiplexing of two differential signal communications (Clock and Data) and one differential signal communication (Data).
5. The multi-protocol supported encoder of claim 1, wherein, The communication protocol includes at least one of BISSC and SSI, and at least one of RS485, RS422, T485, BUS, PERIOD, CAN, SENT, and AK.
6. The multi-protocol supported encoder of claim 2, wherein, The configuration interface includes a USB interface.
7. A method of switching protocols of an encoder, the method comprising: The encoder is applied to any one of claims 1 to 6, wherein the encoder includes a protocol processing module and an interface module, and the protocol processing module is electrically connected to the interface module; The protocol processing module is configured to acquire a protocol switching instruction received through the interface module, control the switching of communication protocols according to the protocol switching instruction, and configure the interface module according to the current communication protocol to control the interface module to communicate according to the current communication protocol.
8. The method of claim 7, wherein the protocol switching is performed by the encoder. Controlling the switching of communication protocols according to the protocol switching command includes: The protocol processing module is controlled to be placed in protocol switching mode. In protocol switching mode, the protocol processing module modifies the protocol information stored internally. After the protocol information is modified, the protocol processing module is controlled to exit the protocol switching mode. Subsequently, the protocol processing module initializes the interface module according to the current protocol information.
9. The encoder multi-protocol switching method as described in claim 7, characterized in that, The protocol switching instruction includes a switching signal control code, which is used to put the protocol processing module into a protocol switching mode. In the protocol switching mode, the control maintains the current connection state of the interface module unchanged.
10. The encoder multi-protocol switching method as described in claim 7, characterized in that, The protocol processing module is also configured to identify the current communication protocol.