Optical communication-based photoelectric sensor parameter reading and writing system and method
By using optical communication technology to enable bidirectional optical signal communication during the working interval of the photoelectric sensor, the limitations of traditional photoelectric sensor parameter setting methods are overcome, enabling wireless parameter reading and writing, and improving operational convenience and work efficiency.
Patent Information
- Application Number
- CN202510985511.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-17
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2045-07-17
AI Technical Summary
Traditional photoelectric sensor parameter setting methods rely on physical contact, involve complex wiring, are costly and lack flexibility, making it difficult to meet the convenience and adaptability requirements of modern intelligent scenarios.
A photoelectric sensor parameter reading and writing system based on optical communication is adopted. The optical transmitting module and the optical receiving module conduct bidirectional optical signal communication during the working interval of the photoelectric sensor. The main control module performs encoding and decoding to realize wireless parameter reading and writing. Only the software part of the photoelectric sensor needs to be configured.
It enables wireless reading and writing of photoelectric sensor parameters, saving costs and size, and improving the efficiency and convenience of parameter reading and writing. Users can set and adjust parameters anytime and anywhere, enhancing operational convenience and work efficiency.
Smart Images

Figure CN120489206B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of optical communication, in particular to an optical-electricity sensor parameter reading and writing system and method based on optical communication. BACKGROUND
[0002] With the rapid development of industrial automation and intelligent equipment, the application demand of optical-electricity sensors in various scenes is increasing. The parameter setting of traditional optical-electricity sensors mainly relies on potentiometer, mechanical key, wired communication and other technical means, but these methods have significant limitations in practical application. The potentiometer adjustment method is single in function and needs physical contact, and it is difficult to realize flexible configuration of multiple parameters; although the mechanical key can expand the function through software logic, it has problems such as complex operation, limited service life, and certain limitations on the design of the equipment appearance; the wired communication needs to rely on cable connection, resulting in high wiring cost and poor flexibility, which cannot meet the parameter management demand in mobile or complex environment.
[0003] Although traditional optical communication uses light wave as carrier, it needs to rely on special transmission medium (such as optical fiber) and complex modulation and demodulation equipment (such as optical modem), which has high overall cost and system complexity, and it is more suitable for long-distance and high-speed scenes, and it is difficult to adapt to the low-cost, small-size and short-distance demand of optical-electricity sensors.
[0004] The above two existing schemes are difficult to meet the higher requirements of modern intelligent scenes on the convenience, reliability and scene adaptability of sensors. Therefore, a new technical scheme is needed to optimize the communication mode and interaction mechanism, so as to break through the technical bottleneck and realize efficient management of optical-electricity sensor parameters. SUMMARY
[0005] In view of the above problems, the present application provides an optical-electricity sensor parameter reading and writing system and method based on optical communication to solve the above technical problems.
[0006] In a first aspect, the present application provides an optical-electricity sensor parameter reading and writing system based on optical communication, which is used for transmitting configuration parameters to an optical-electricity sensor and obtaining corresponding parameters indicated by the configuration parameters fed back by the optical-electricity sensor, the configuration parameters being used to indicate writing parameters to the optical-electricity sensor or reading parameters from the optical-electricity sensor, the optical-electricity sensor being configured to support optical communication in a preset encoding format, and the optical-electricity sensor parameter reading and writing system based on optical communication comprising:
[0007] An optical emission module is configured to emit a first optical signal in a preset encoding format to the optical-electricity sensor in a communication gap between two adjacent times of receiving a first optical pulse by the optical-electricity sensor, the first optical pulse being a light signal reflected from a target area and received by the optical-electricity sensor during operation;
[0008] a light receiving module, configured to receive the second light signal of the preset encoding format fed back by the photoelectric sensor in a communication gap between two adjacent times of emitting the second light pulse, and convert the second light signal into an electrical signal of the preset encoding format, the second light pulse being a light signal emitted by the photoelectric sensor to a target area during operation of the photoelectric sensor;
[0009] a master module, configured to encode the configuration parameters in the preset encoding format, control the light emitting module to generate the first light signal according to an encoding result, and decode the electrical signal of the preset encoding format to obtain the corresponding parameter indicated by the configuration parameters fed back by the photoelectric sensor;
[0010] a power module, configured to supply power to the photoelectric sensor parameter reading and writing system based on optical communication.
[0011] In some embodiments, the light emitting module is configured to emit a first light signal of a preset encoding format to the photoelectric sensor in a communication gap between two adjacent times of receiving the first light pulse by the photoelectric sensor, and the first light signal includes:
[0012] The light receiving module receives the second light pulse emitted by the photoelectric sensor, the light emitting module delays for a first time, and emits the first light signal to the photoelectric sensor before the photoelectric sensor emits the second light pulse next time.
[0013] In some embodiments, the photoelectric sensor parameter reading and writing system based on optical communication further includes:
[0014] at least one instruction output module, each of the instruction output modules being configured to output a preset instruction to the master module, and the preset instruction output by each of the instruction output modules corresponding to a preset configuration parameter;
[0015] The master module is further configured to receive the preset instruction, encode the configuration parameter corresponding to the preset instruction in the preset encoding format, and control the light emitting module to generate the first light signal according to an encoding result.
[0016] In some embodiments, the photoelectric sensor parameter reading and writing system based on optical communication further includes:
[0017] a display module, configured to be connected with the master module, and display the corresponding parameter indicated by the configuration parameters fed back by the photoelectric sensor.
[0018] In some embodiments, the preset encoding format is a Manchester encoding format.
[0019] In some embodiments, the master module is configured to decode the electrical signal of the preset encoding format, including:
[0020] detecting a jump edge of the electrical signal, generating an interrupt each time a jump edge is identified;
[0021] performing a timing operation on the electrical signal for a preset time, reading a level state of the electrical signal after timing, the preset time being any time not exceeding a bit period of the electrical signal;
[0022] converting the electrical signal into a logic value according to a preset decoding rule, the preset decoding rule being that when the level state of the electrical signal is a low level, the low level is decoded into one of a logic value 1 or a logic value 0, and when the level state is a high level, the high level is decoded into the other of the logic value 0 or the logic value 1 that is different from the low level.
[0023] In some embodiments, the configuration parameters corresponding to the first optical signal emitted each time by the optical transmitting module at least include a first check parameter and a first flag parameter, the first check parameter being used to check the parameters corresponding to the first optical signal, and the first flag parameter being used to indicate whether the parameters corresponding to the first optical signal are the last parameters in the configuration parameters;
[0024] the corresponding parameters indicated by the configuration parameters corresponding to the second optical signal received each time by the optical receiving module at least include a second check parameter and a second flag parameter, the second check parameter being used to check the parameters corresponding to the second optical signal, and the second flag parameter being used to indicate whether the parameters corresponding to the second optical signal are the last parameters in the corresponding parameters.
[0025] In a second aspect, the present application provides a method for reading and writing parameters of an optoelectronic sensor based on optical communication, applied to the system for reading and writing parameters of an optoelectronic sensor based on optical communication in the first aspect, for transmitting configuration parameters to the optoelectronic sensor and obtaining corresponding parameters indicated by the configuration parameters fed back by the optoelectronic sensor, the configuration parameters being used to indicate writing parameters to the optoelectronic sensor or reading parameters from the optoelectronic sensor, the optoelectronic sensor being configured to support optical communication in a preset encoding format, the method comprising:
[0026] cyclically executing a first strategy until the configuration parameters are completely output in the form of first optical signals, the first strategy comprising: transmitting first optical signals in a preset encoding format to the optoelectronic sensor in a communication gap between two adjacent times of receiving first optical pulses by the optoelectronic sensor;
[0027] The second strategy is executed cyclically until the parameter fed back by the optoelectronic sensor is completely received in the form of the second optical signal, the second strategy comprising: receiving the second optical signal of the preset coding format fed back by the optoelectronic sensor in a communication gap between two adjacent times of sending the second optical pulse, converting the second optical signal into an electrical signal of the preset coding format, and decoding the electrical signal of the preset coding format to obtain the corresponding parameter indicated by the configuration parameter fed back by the optoelectronic sensor.
[0028] In some embodiments, the emitting of the first optical signal of the preset coding format to the optoelectronic sensor in the communication gap between two adjacent times of receiving the first optical pulse by the optoelectronic sensor comprises:
[0029] After the first optical pulse emitted by the optoelectronic sensor is identified, the first optical signal is emitted to the optoelectronic sensor after a first time delay and before the next time of emitting the first optical pulse by the optoelectronic sensor.
[0030] In a third aspect, the present application provides an optoelectronic sensor parameter reading and writing method based on optical communication, applied to an optoelectronic sensor, for receiving a configuration parameter transmitted by an optoelectronic sensor parameter reading and writing system based on optical communication, and feeding back a corresponding parameter indicated by the configuration parameter to the optoelectronic sensor parameter reading and writing system based on optical communication, the optoelectronic sensor being configured to support optical communication of a preset coding format, the optoelectronic sensor parameter reading and writing method based on optical communication comprising:
[0031] The third strategy is executed cyclically until the configuration parameter is completely received in the form of the first optical signal, the third strategy comprising: after emitting the second optical pulse, delaying for a second time and receiving the first optical signal before the next time of emitting the second optical pulse, converting the first optical signal into a first electrical signal of the preset coding format, and decoding the first electrical signal of the preset coding format to obtain the configuration parameter.
[0032] The fourth strategy is executed cyclically until the corresponding parameter indicated by the configuration parameter is completely output in the form of the second optical signal, the fourth strategy comprising: after emitting the first optical pulse, delaying for a third time and emitting the second optical signal before the next time of emitting the first optical pulse.
[0033] The application provides a photoelectric sensor parameter reading and writing system and method based on optical communication. The photoelectric sensor parameter reading and writing system based on optical communication can solve the problems of the traditional parameter setting mode, such as dependence on physical contact, complex wiring, high cost and poor flexibility, by realizing bidirectional communication of optical signals by using the hardware of the photoelectric sensor during the normal working gap of the photoelectric sensor. Specifically, the system uses an optical transmitting module to transmit a first optical signal of a preset encoding format to the photoelectric sensor during the communication gap between the photoelectric sensor receiving the first optical pulse (i.e., the optical signal reflected by the target area when the photoelectric sensor is working) for two adjacent times. At the same time, an optical receiving module receives a second optical signal of the preset encoding format fed back by the photoelectric sensor during the communication gap between the photoelectric sensor transmitting the second optical pulse (i.e., the optical signal emitted by the photoelectric sensor to the target area when the photoelectric sensor is working) for two adjacent times, and converts the second optical signal into an electrical signal of the preset encoding format. A main control module is responsible for encoding the configuration parameters according to the preset encoding format, controlling the optical transmitting module to generate the first optical signal according to the encoding result, and decoding the received electrical signal of the preset encoding format to obtain the related parameters fed back by the photoelectric sensor. A power module ensures the power supply of the entire system. The system realizes wireless reading and writing of the parameters of the photoelectric sensor, and only needs to configure the software part of the photoelectric sensor during the reading and writing process, without the need to modify the hardware level of the photoelectric sensor, thereby saving the cost and volume of the sensor, and improving the efficiency and convenience of parameter reading and writing. In addition, the design of the system enables users to set and adjust the parameters of the photoelectric sensor at any time and anywhere, which is convenient to move and carry, and can be used and taken at any time, thereby greatly improving the operation convenience of the users and maintainers of the sensor. In industrial automation fields or application scenarios such as environmental monitoring, users can easily complete parameter configuration and adjustment without disassembling the sensor or connecting cumbersome cables, thereby significantly improving work efficiency and user experience.
[0034] These aspects or other aspects of the application will be more apparent in the following description of the embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.
[0036] Figure 1 A schematic diagram of a photoelectric sensor parameter reading and writing system based on optical communication is shown.
[0037] Figure 2 A timing diagram of the emission and reception of optical pulses when the photoelectric sensor is working normally is shown.
[0038] Figure 3 A timing diagram of the optical communication between the photoelectric sensor and the photoelectric sensor parameter reading and writing system based on optical communication is shown.
[0039] Figure 4 Another schematic diagram of the photoelectric sensor parameter reading and writing system based on optical communication is shown.
[0040] Figure 5 Still another schematic diagram of the photoelectric sensor parameter reading and writing system based on optical communication is shown. DETAILED DESCRIPTION
[0041] In order to make the persons skilled in the art better understand the scheme of the present application, the technical scheme in the embodiments of the present application will be described clearly and completely in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by the persons skilled in the art without creative labor fall within the scope of protection of the present application.
[0042] In the embodiments of the present application, it should be noted that, in this document, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between the entities or operations.
[0043] Moreover, the term "comprising" or "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes the elements inherent to such process, method, article or equipment. Without more limitation, the element defined by the statement "including a" does not exclude the presence of another identical element in the process, method, article or equipment including the element.
[0044] It should be noted that, in the embodiments of the present application, "connection" can be understood as electrical connection, and the connection between two electrical elements can be direct or indirect connection between the two electrical elements. For example, A is connected to B, which can be direct connection between A and B, or indirect connection between A and B through one or more other electrical elements.
[0045] The embodiment of the present application provides a photoelectric sensor parameter reading and writing system based on optical communication, and particularly, the system is used for transmitting configuration parameters to a photoelectric sensor and acquiring corresponding parameters indicated by configuration parameters fed back by the photoelectric sensor, the configuration parameters are used for indicating writing specific parameters into the photoelectric sensor to configure the photoelectric sensor or reading existing parameters from the photoelectric sensor, for example, when the configuration parameters indicate that the system needs to read some parameters of the photoelectric sensor, the corresponding parameters indicated by the configuration parameters fed back by the photoelectric sensor are the parameters that the system needs to read; when the configuration parameters indicate that the system needs to write some parameters into the photoelectric sensor to configure the photoelectric sensor, the corresponding parameters indicated by the configuration parameters fed back by the photoelectric sensor are confirmation information, which is used for indicating whether the photoelectric sensor completes corresponding configuration according to the configuration parameters. The photoelectric sensor in communication with the system is configured to support optical communication of a preset encoding format, which means that the photoelectric sensor does not need to make any modification on the hardware structure, and only needs to configure the software part to adapt to the communication protocol and interaction logic of the corresponding encoding format.
[0046] Figure 1 A schematic diagram of the photoelectric sensor parameter reading and writing system based on optical communication provided by the embodiment of the present application is shown, as shown in Figure 1 The photoelectric sensor parameter reading and writing system based on optical communication provided by the embodiment of the present application comprises:
[0047] The light emitting module is used for emitting a first optical signal of a preset encoding format to the photoelectric sensor in a communication gap between two adjacent times of receiving the first optical pulse by the photoelectric sensor, and the first optical pulse is a light signal reflected by a target area and received by the photoelectric sensor during working. Optionally, the communication gap between the two first optical pulses refers to a time interval of receiving the light signal reflected by the target area in the external environment twice by the photoelectric sensor in a normal working process, and the emission time of the light emitting module is controlled, so that data transmission in an idle period in a normal working cycle of the photoelectric sensor is realized, thereby ensuring that the normal detection task of the photoelectric sensor is not disturbed. This design enables the parameter reading and writing operation to be completed without affecting the sensor function. In addition, the optical signal of the specific encoding format can ensure that the data transmission is not disturbed by the optical pulse received by the photoelectric sensor during normal working, thereby improving the accuracy and reliability of the data.
[0048] The light receiving module is configured to receive a second optical signal of a preset encoding format fed back by the photoelectric sensor in a communication gap between two adjacent second light pulse transmissions, and convert the second optical signal into an electrical signal of the preset encoding format, the second light pulse being an optical signal emitted by the photoelectric sensor to the target area during operation. Optionally, the communication gap between two adjacent second light pulse transmissions is a time period during which the emission end of the photoelectric sensor stops emitting the optical signal to the target area. After receiving the first optical signal in an idle period within a normal operation cycle of the photoelectric sensor, the photoelectric sensor performs photoelectric conversion and decoding on the first optical signal to obtain the configuration parameters. If the configuration parameters are parameters indicating that the photoelectric sensor needs to write, the photoelectric sensor updates the corresponding parameter values in the internal memory. If the configuration parameters are parameters indicating that the photoelectric sensor needs to read existing parameters, the photoelectric sensor retrieves the corresponding parameter values from the internal memory and emits a corresponding second optical signal in an idle period within a normal operation cycle of the photoelectric sensor. The light receiving module receives the second optical signal in an idle period within a normal operation cycle of the photoelectric sensor and converts the optical signal into an electrical signal, completing the conversion from optical communication to electrical signal processing. The selection of the receiving opportunity also follows the principle of not interfering with the normal emission operation of the sensor, ensuring the orderliness of the bidirectional communication.
[0049] The master control module is configured to encode the configuration parameters in a preset encoding format, control the light emitting module to generate the first optical signal according to the encoding result, and decode the electrical signal of the preset encoding format to obtain the corresponding parameters indicated by the configuration parameters fed back by the photoelectric sensor. Optionally, the master control module serves as the core control unit of the system. In the encoding process, the configuration parameters are converted into a first optical signal waveform matching the preset encoding format. In the decoding process, the electrical signal output by the light receiving module is analyzed to extract the valid parameter information. Through the cooperation of encoding and decoding, the master control module realizes the issuance of instructions and the feedback of information between the photoelectric sensor. The encoding format adopted by the master control module needs to match the software configuration of the photoelectric sensor, so that bidirectional data interaction can be completed without modifying the sensor hardware, ensuring the accuracy and compatibility of the communication.
[0050] The power module is configured to supply power to the photoelectric sensor parameter reading and writing system based on optical communication. Optionally, the power module is configured to meet the power supply requirements of each module of the system, and ensure the power supply reliability of the system in different working states.
[0051] It can be understood that the specific circuit structure of the light emitting module, the light receiving module, the master control module and the power module is not limited in the embodiments of the present application. The implementation of each module can adopt mature circuit design and component selection in the prior art in the field, as long as the functional requirements of optical signal transmission, reception, signal processing and power supply can be met. For example, these modules already exist in photoelectric sensors and constitute the emission end, the receiving end, the control end and the power supply part of the photoelectric sensor.
[0052] Exemplarily, the light emitting module can be configured as a laser diode or other light emitting diode and its corresponding driving circuit, the laser diode as a light source, providing high brightness and stable light output, suitable for short distance wireless communication. The driving circuit is responsible for modulating the light emitting intensity of the laser diode according to the encoded data provided by the master module, thereby realizing the optical signal transmission of data. The light receiving module can be configured as any type of photodiode (PD) and its signal processing circuit, the photodiode as a photosensitive element, which can efficiently convert the received optical signal into an electrical signal, and the signal processing circuit amplifies and filters the electrical signal. The master module can be configured as a micro control unit (MCU) as the core processing element, which decodes the received electrical signal by loading the set encoding and decoding algorithm, and extracts the parameter information fed back by the photoelectric sensor; at the same time, the master module also generates a first optical signal of a preset encoding format according to the configuration parameters, and controls the light emitting module to complete external communication.
[0053] It can be understood that in the embodiment of the application, the photoelectric sensor in communication with the system should include a light emitting end, a light receiving end, a photoelectric conversion end and a control end, so as to emit a second optical signal through the light emitting end, receive a first optical signal through the light receiving end, photoelectrically convert the first optical signal through the photoelectric conversion end, decode the electrical signal corresponding to the first optical signal through the control end, and encode the parameters to be fed back through the control end and control the emitting end to complete emission. The above-mentioned light emitting end, light receiving end, photoelectric conversion end and control end are all function modules commonly configured in the field of photoelectric sensors, and the photoelectric sensor parameter reading and writing system based on optical communication provided by the embodiment of the application only needs to configure the control end of the photoelectric sensor through software to support the same encoding format and communication timing as the system.
[0054] Figure 2 The timing diagram of emitting and receiving optical pulses when the photoelectric sensor is working normally is shown, Figure 3 The optical communication timing diagram of the photoelectric sensor and the photoelectric sensor parameter reading and writing system based on optical communication provided by the embodiment of the application is shown, as shown in Figure 2 And Figure 3 The embodiment of the application transmits the first optical signal and the second optical signal in the gap (t11, t12, t13, t21, t22, t23) between two works of the photoelectric sensor.
[0055] The photoelectric sensor parameter reading and writing system based on optical communication provided by the embodiments of the present application adopts a light emitting module to emit a first optical signal of a preset encoding format to a photoelectric sensor in a communication gap between two adjacent times of receiving a first optical pulse by the photoelectric sensor; meanwhile, a light receiving module receives a second optical signal of the preset encoding format fed back by the photoelectric sensor in a communication gap between two adjacent times of emitting a second optical pulse by the photoelectric sensor, and converts the second optical signal into an electrical signal of the preset encoding format. A master control module is responsible for encoding configuration parameters in the preset encoding format, controlling the light emitting module to generate the first optical signal according to the encoding result, and decoding the received electrical signal of the preset encoding format to obtain related parameters fed back by the photoelectric sensor. A power module ensures the power supply requirement of the entire system. The wireless reading and writing of the parameters of the photoelectric sensor are realized, and the reading and writing process only needs to configure the software part of the photoelectric sensor, without the need to modify the hardware level of the photoelectric sensor, thereby saving the cost and volume of the sensor, and improving the efficiency and convenience of parameter reading and writing.
[0056] In addition, the design of the system enables users to set and adjust the parameters of the photoelectric sensor anytime and anywhere, is convenient to move and carry, and can be taken as needed, thereby greatly improving the operation convenience of the sensor users and maintainers. Whether in an industrial automation field or an application scene such as environmental monitoring, users can easily complete parameter configuration and adjustment without disassembling the sensor or connecting cumbersome cables, thereby significantly enhancing the work efficiency and user experience.
[0057] In some embodiments, in the photoelectric sensor parameter reading and writing system based on optical communication provided by the embodiments of the present application, the light emitting module is configured to emit a first optical signal of a preset encoding format to a photoelectric sensor in a communication gap between two adjacent times of receiving a first optical pulse by the photoelectric sensor, and includes:
[0058] The light receiving module receives the second light pulse emitted by the photosensor, and the light emitting module delays for a first time and emits the first light signal to the photosensor before the photosensor next emits the second light pulse. Optionally, the communication gap between the photosensor receiving the first light pulse twice in succession is consistent with the communication gap between the photosensor emitting the second light pulse twice in succession, so that whether the photosensor is in the communication gap between receiving the first light pulse twice in succession is determined by receiving the second light pulse by the light receiving module. Specifically, the light receiving module receives the second light pulse to convert the second light pulse into an electrical signal and transmit it to the host module, so that the host module can detect that the photosensor is currently in an idle period, and then control the light emitting module to emit the first light signal. The first time delay is used to ensure that the light emitting module can transmit data in the idle period of the photosensor, so as to avoid interference with the normal working process of the sensor due to communication operation occupying the working time of the sensor. In the embodiment of the application, the specific value of the first time is not limited, which can be flexibly configured according to the working period, communication rate and environmental conditions of different types of photosensors, so as to adapt to various application scenarios, thereby improving the versatility and compatibility of the system.
[0059] In some embodiments, Figure 4 Another schematic diagram of the light communication-based photosensor parameter reading and writing system provided by the embodiment of the application is shown, as shown in Figure 4 The light communication-based photosensor parameter reading and writing system provided by the embodiment of the application further comprises:
[0060] At least one instruction output module, each instruction output module is used to output a preset instruction to the host module, and the preset instruction output by each instruction output module corresponds to a preset configuration parameter. For example, a certain instruction output module is used to trigger the "set detection sensitivity" operation, and the corresponding configuration parameter is a specified sensitivity value; another instruction output module is used to trigger the "read current working mode" operation, and the corresponding configuration parameter is a read command frame. Through the setting of multiple instruction output modules, the user can quickly select and execute different parameter operation tasks, thereby improving the operation convenience and response efficiency. Optionally, the instruction output module can be a physical key, a touch screen button or a remote control interface, etc. The output preset instruction of the input device is transmitted to the host module in the form of a digital signal for identification and processing by the host module.
[0061] The master control module is further configured to receive a preset instruction, encode configuration parameters corresponding to the preset instruction according to a preset encoding format, and control the light emitting module to generate a first light signal according to an encoding result. The first light signal is transmitted to the photosensor through the light emitting module, so as to realize parameter writing or reading request of the photosensor. Optionally, an instruction mapping table can be arranged in the master control module, which is configured to bind preset instructions triggered by different instruction output modules and corresponding configuration parameters, so as to ensure one-to-one correspondence between the instructions and the parameters.
[0062] In some embodiments, Figure 5 Another schematic diagram of the photosensor parameter reading and writing system based on optical communication provided by the embodiments of the present application is shown in FIG. 6. As shown in FIG. 6, the photosensor parameter reading and writing system based on optical communication provided by the embodiments of the present application further comprises: Figure 5
[0063] The display module is configured to be connected with the master control module, and display corresponding parameters indicated by the configuration parameters fed back by the photosensor. The display module can present parameter information read by the user from the photosensor in real time, such as detection distance, sensitivity, working mode, etc., so as to facilitate the user to intuitively understand the current configuration state of the sensor and make adjustment. Optionally, the display module is a liquid crystal display (LCD) or an organic light-emitting diode display (OLED), which is connected with the master control module through a serial communication interface (such as I2C, SPI or UART), receives parameter data analyzed by the master control module and performs visual display. In addition, the display module can also support multi-level menu interface design, and realize interactive functions such as parameter browsing and setting option switching in cooperation with the instruction output module, so as to further improve the operation convenience and user experience.
[0064] In some embodiments, the preset encoding format in the photosensor parameter reading and writing system based on optical communication provided by the embodiments of the present application is a Manchester encoding format. Optionally, Manchester encoding is adopted, so that each data bit has a transition edge in the middle, thereby realizing clock synchronization between the sending end and the receiving end, ensuring data integrity and accuracy in the communication process without additional transmission of clock signals, and being suitable for optical communication of "single line" mechanism.
[0065] In some embodiments, the process of decoding the electrical signal of the preset encoding format by the master control module in the photosensor parameter reading and writing system based on optical communication provided by the embodiments of the present application comprises:
[0066] detecting a transition edge of the electrical signal, and generating an interruption once the transition edge is identified;
[0067] performing timing operation on the electrical signal for a preset time, reading the level state of the electrical signal after timing, and the preset time is any time not more than the bit period of the electrical signal;
[0068] The electrical signal is converted into a logic value according to a preset decoding rule, and the preset decoding rule is that when the level state of the electrical signal is a low level, the low level is decoded into one of a logic value 1 or a logic value 0, and when the level state is a high level, the high level is decoded into the other one of the logic value 0 or the logic value 1 different from the low level.
[0069] Optionally, in the embodiment of the present application, the master module adopts a decoding mechanism based on a jump edge trigger and timing sampling, specifically, when the rising edge or the falling edge of the electrical signal is detected, an interrupt is triggered, and a timer is started for timing, the timing time is any time not exceeding the bit period of the electrical signal, and the timing time is usually set to 30% to 40% of the bit period of the electrical signal to maintain subsequent reading; after the timing ends, the level state of the current signal is read; if a low level is read, it is decoded as logic 1; if a high level is read, it is decoded as logic 0 (it can also be set that a low level is read to decode as logic 0, and a high level is read to decode as logic 1). The decoding mode matches the Manchester encoding rule, in which a jump edge must exist in the middle of each bit period, and the level changes in the first half period and the second half period are used to represent different logic values (such as high in the front and low in the back to represent logic 1, and low in the front and high in the back to represent logic 0). The master module integrates the received N-bit data according to the preset frame structure, and verifies the data integrity in combination with the even check or the frame structure identification bit, to judge whether the current communication is successful, so as to improve the decoding accuracy and the anti-interference ability of the system.
[0070] In some embodiments, the optical communication-based photoelectric sensor parameter reading and writing system provided by the embodiment of the present application comprises a master module, a plurality of optical transmitting modules and a plurality of optical receiving modules.
[0071] The configuration parameters corresponding to the first optical signal emitted by the optical transmitting module each time at least include a first check parameter and a first flag parameter, the first check parameter is used to check the parameters corresponding to the first optical signal, and the first flag parameter is used to indicate whether the parameters corresponding to the first optical signal are the last parameters in the configuration parameters.
[0072] The corresponding parameters indicated by the configuration parameters corresponding to the second optical signal received by the optical receiving module each time at least include a second check parameter and a second flag parameter, the second check parameter is used to check the parameters corresponding to the second optical signal, and the second flag parameter is used to indicate whether the parameters corresponding to the second optical signal are the last parameters in the corresponding parameters.
[0073] For example, the optical transmitting module / optical receiving module can emit / receive the first optical signal / second optical signal containing 10-bit data each time, the first flag parameter / second flag parameter can be set to the first bit data, and the first check parameter / second check parameter can be set to the tenth bit data, so that the master module / photoelectric sensor can judge whether there is a subsequent optical signal and whether the currently received data is correct.
[0074] It can be understood that the optical communication-based photoelectric sensor parameter reading and writing system provided by the embodiments of the present application is used for communication with a photoelectric sensor, and only the optical communication implementation principle between the optical emission module, the optical receiving module, the main control module and other components in the system is described herein. Although the structure of the photoelectric sensor itself is not described in detail, it should be clear that the photoelectric sensor also includes an optical emission end, an optical receiving end, an optical-electric conversion end and a main control end for processing communication data. The functions and communication mechanisms thereof in the photoelectric sensor correspond to the system modules described in the embodiments of the present application, and the communication principles are consistent, and therefore will not be described herein.
[0075] The embodiments of the present application also provide an optical communication-based photoelectric sensor parameter reading and writing method, applied to the optical communication-based photoelectric sensor parameter reading and writing system described in the above embodiments. The method is used for transmitting configuration parameters to a photoelectric sensor, and obtaining corresponding parameters indicated by configuration parameters fed back by the photoelectric sensor. The configuration parameters are used for indicating writing parameters to the photoelectric sensor or reading parameters from the photoelectric sensor. The photoelectric sensor is configured to support optical communication in a preset encoding format.
[0076] The optical communication-based photoelectric sensor parameter reading and writing method provided by the embodiments of the present application includes:
[0077] The first strategy is cyclically executed until the configuration parameters are completely output in the form of the first optical signal. The first strategy includes: in a communication gap in which the photoelectric sensor receives the first optical pulse twice successively, emitting the first optical signal in the preset encoding format to the photoelectric sensor.
[0078] The second strategy is cyclically executed until the parameters fed back by the photoelectric sensor are completely received in the form of the second optical signal. The second strategy includes: receiving the second optical signal in the preset encoding format fed back by the photoelectric sensor in a communication gap in which the photoelectric sensor transmits the second optical pulse twice successively, converting the second optical signal into an electrical signal in the preset encoding format, and decoding the electrical signal in the preset encoding format to obtain corresponding parameters indicated by the configuration parameters fed back by the photoelectric sensor.
[0079] In some embodiments, the preset encoding format is a Manchester encoding format.
[0080] For other details of the optical communication-based photoelectric sensor parameter reading and writing method provided by the above embodiments for implementing the above technical solutions, reference can be made to the description of the optical communication-based photoelectric sensor parameter reading and writing system provided in the above embodiments of the present application, which will not be described herein.
[0081] In some embodiments, the step of emitting the first optical signal in the preset encoding format to the photoelectric sensor in a communication gap in which the photoelectric sensor receives the first optical pulse twice successively includes:
[0082] After the first light pulse emitted by the photoelectric sensor is identified, the first light signal is transmitted to the photoelectric sensor after a first time delay and before the photoelectric sensor next time emits the first light pulse. Optionally, the communication gap between the photoelectric sensor receiving the first light pulse for two adjacent times is consistent with the communication gap between the photoelectric sensor emitting the second light pulse for two adjacent times, so that whether the photoelectric sensor is in the communication gap between the photoelectric sensor receiving the first light pulse for two adjacent times is determined by identifying the second light pulse.
[0083] For other details of the above technical solutions of the photoelectric sensor parameter reading and writing method based on optical communication provided in the above embodiments, refer to the description of the photoelectric sensor parameter reading and writing system based on optical communication provided in the above embodiments, which will not be repeated here.
[0084] The application further provides a photoelectric sensor parameter reading and writing method based on optical communication, applied to a photoelectric sensor, for receiving configuration parameters transmitted by a photoelectric sensor parameter reading and writing system based on optical communication, and feeding back corresponding parameters indicated by the configuration parameters to the photoelectric sensor parameter reading and writing system based on optical communication, the photoelectric sensor being configured to support optical communication of a preset encoding format.
[0085] The photoelectric sensor parameter reading and writing method based on optical communication provided by the application realizes wireless reading and writing of photoelectric sensor parameters, and only the software part of the photoelectric sensor needs to be configured in the reading and writing process, without the need to modify the hardware level of the photoelectric sensor, thereby saving the cost and volume of the sensor and improving the efficiency and convenience of parameter reading and writing.
[0086] The photoelectric sensor parameter reading and writing method based on optical communication provided by the application includes:
[0087] The third strategy is repeatedly executed until the configuration parameters are completely received in the form of the first light signal, and the third strategy includes: after the second light pulse is emitted, a second time delay is performed and the first light signal is received before the next time the second light pulse is emitted, the first light signal is converted into a first electrical signal of a preset encoding format, and the first electrical signal of the preset encoding format is decoded to obtain the configuration parameters.
[0088] The fourth strategy is repeatedly executed until the corresponding parameters indicated by the configuration parameters are completely output in the form of the second light signal, and the fourth strategy includes: after the first light pulse is emitted, a third time delay is performed and the second light signal is emitted before the next time the first light pulse is emitted.
[0089] In some embodiments, the preset encoding format is a Manchester encoding format.
[0090] The above description is further detailed in combination with specific embodiments of the present application, and cannot be deemed as limiting the specific implementation of the present application to these descriptions. For those skilled in the art to which the present application belongs, without departing from the concept of the present application, a number of simple deductions or replacements can be made, and all should be considered as the protection scope of the present application.
Claims
1. An optical communication based photo-sensor parameter read-write system characterized by, The application relates to a light communication-based photoelectric sensor parameter read-write system for transmitting configuration parameters to a photoelectric sensor and acquiring corresponding parameters indicated by the configuration parameters fed back by the photoelectric sensor, wherein the configuration parameters are used for indicating parameters written to or read from the photoelectric sensor, the photoelectric sensor is configured to support light communication of a preset coding format, and the light communication-based photoelectric sensor parameter read-write system comprises the following modules. A light emitting module is used for emitting a first light signal of a preset coding format to the photoelectric sensor in a communication interval between two adjacent times when the photoelectric sensor receives a first light pulse, wherein the first light pulse is a light signal reflected from a target area and received by the photoelectric sensor during operation. A light receiving module is used for receiving a second light signal of the preset coding format fed back by the photoelectric sensor in a communication interval between two adjacent times when the photoelectric sensor emits a second light pulse, and converting the second light signal into an electrical signal of the preset coding format. A master control module is used for encoding the configuration parameters according to the preset coding format, controlling the light emitting module to generate the first light signal according to an encoding result, and decoding the electrical signal of the preset coding format to acquire corresponding parameters indicated by the configuration parameters fed back by the photoelectric sensor. At least one instruction output module is used for outputting a preset instruction to the master control module, and the preset instruction output by each instruction output module corresponds to a preset configuration parameter. The master control module is further used for receiving the preset instruction, encoding a configuration parameter corresponding to the preset instruction according to the preset coding format, and controlling the light emitting module to generate the first light signal according to an encoding result. A power module is used for supplying power to the light communication-based photoelectric sensor parameter read-write system. The configuration parameter corresponding to the first light signal emitted by the light emitting module each time at least comprises a first check parameter and a first flag parameter, the first check parameter is used for checking parameters corresponding to the first light signal, and the first flag parameter is used for indicating whether the parameters corresponding to the first light signal are the last parameters in the configuration parameters. The corresponding parameters indicated by the configuration parameter corresponding to the second light signal received by the light receiving module each time at least comprise a second check parameter and a second flag parameter, the second check parameter is used for checking parameters corresponding to the second light signal, and the second flag parameter is used for indicating whether the parameters corresponding to the second light signal are the last parameters in the corresponding parameters.
2. The optical communication based photo-sensor parameter read-write system as claimed in claim 1, wherein, The light emitting module is used for emitting a first light signal of a preset coding format to the photoelectric sensor in a communication interval between two adjacent times when the photoelectric sensor receives a first light pulse. The light emitting module emits the first light signal to the photoelectric sensor after a first time delay and before the photoelectric sensor emits the second light pulse next time.
3. The optical communication based photo-sensor parameter read-write system as claimed in claim 1, wherein, The light communication-based photoelectric sensor parameter read-write system further comprises the following modules. A display module is connected with the master module to display the corresponding parameter indicated by the configuration parameter fed back by the photoelectric sensor.
4. The optical communication based photo-sensor parameter read-write system as claimed in claim 1, wherein, The preset encoding format is a Manchester encoding format.
5. The optical communication based photo-sensor parameter read-write system as claimed in claim 4, wherein, The master module is configured to decode the electrical signal in the preset encoding format, including: detecting a transition edge of the electrical signal, and generating an interrupt each time a transition edge is identified; performing a timing operation on the electrical signal for a preset time, reading a level state of the electrical signal after timing, and the preset time is any time not exceeding a bit period of the electrical signal; converting the electrical signal into a logic value according to a preset decoding rule, and the preset decoding rule is that when the level state of the electrical signal is a low level, the low level is decoded into one of a logic value 1 or a logic value 0, and when the level state is a high level, the high level is decoded into the other of the logic value 0 or the logic value 1 different from the low level.
6. An optical communication based photoelectric sensor parameter reading and writing method applied to the optical communication based photoelectric sensor parameter reading and writing system of any one of claims 1 to 5, for transmitting a configuration parameter to a photoelectric sensor, and obtaining a corresponding parameter indicated by the configuration parameter fed back by the photoelectric sensor, the configuration parameter being used to indicate writing a parameter to the photoelectric sensor or reading a parameter from the photoelectric sensor, the photoelectric sensor being configured to support optical communication in a preset encoding format, characterized in that, The photoelectric sensor parameter reading and writing method based on optical communication includes: cyclically executing a first strategy until the configuration parameter is completely output in the form of a first optical signal, and the first strategy includes: in a communication gap between two adjacent times when the photoelectric sensor receives a first optical pulse, emitting a first optical signal in a preset encoding format to the photoelectric sensor; cyclically executing a second strategy until the parameter fed back by the photoelectric sensor is completely received in the form of a second optical signal, and the second strategy includes: receiving the second optical signal in the preset encoding format fed back by the photoelectric sensor in a communication gap between two adjacent times when the photoelectric sensor transmits a second optical pulse, converting the second optical signal into an electrical signal in the preset encoding format, decoding the electrical signal in the preset encoding format to obtain the corresponding parameter indicated by the configuration parameter fed back by the photoelectric sensor.
7. The optical communication based photo-sensor parameter read-write method as claimed in claim 6, wherein, In a communication gap between two adjacent times when the photoelectric sensor receives a first optical pulse, emitting a first optical signal in a preset encoding format to the photoelectric sensor includes: after identifying the second optical pulse emitted by the photoelectric sensor, delaying for a first time and emitting the first optical signal to the photoelectric sensor before the photoelectric sensor next time emits the second optical pulse. 8.A method for reading and writing parameters of a photoelectric sensor based on optical communication, applied to the photoelectric sensor, for receiving configuration parameters transmitted by a photoelectric sensor parameter reading and writing system based on optical communication, and feeding back corresponding parameters indicated by the configuration parameters to the photoelectric sensor parameter reading and writing system based on optical communication, wherein the photoelectric sensor is configured to support optical communication in a preset encoding format. The photoelectric sensor parameter reading and writing method based on optical communication includes: cyclically executing a third strategy until the configuration parameter is completely received in the form of a first optical signal, and the third strategy includes: after emitting a second optical pulse, delaying for a second time and receiving a first optical signal before next time emitting the second optical pulse, converting the first optical signal into a first electrical signal in the preset encoding format, and decoding the first electrical signal in the preset encoding format to obtain the configuration parameter; cyclically executing a fourth strategy until the corresponding parameter indicated by the configuration parameter is completely output in the form of a second optical signal, and the fourth strategy includes: after emitting a first optical pulse, delaying for a third time and emitting the second optical signal before next time emitting the first optical pulse.
Citation Information
Patent Citations
Optical transmission network
CN106998228A
Single-loop absolute type photoelectric shaft angle encoder based on m sequence codes and design method of single-loop absolute type photoelectric shaft angle encoder
CN118129806A