CN117908461A - Product detection method and device, terminal equipment and storage medium - Google Patents

Product detection method and device, terminal equipment and storage medium Download PDF

Info

Publication number
CN117908461A
CN117908461A CN202311861534.9A CN202311861534A CN117908461A CN 117908461 A CN117908461 A CN 117908461A CN 202311861534 A CN202311861534 A CN 202311861534A CN 117908461 A CN117908461 A CN 117908461A
Authority
CN
China
Prior art keywords
plc
module
function
ladder diagram
product
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311861534.9A
Other languages
Chinese (zh)
Inventor
胡途
杨怀印
赵文诗
陈萌
王雨
陈志勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Unimat Automation Technology Co ltd
Original Assignee
Shenzhen Unimat Automation Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Unimat Automation Technology Co ltd filed Critical Shenzhen Unimat Automation Technology Co ltd
Priority to CN202311861534.9A priority Critical patent/CN117908461A/en
Publication of CN117908461A publication Critical patent/CN117908461A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • G05B19/058Safety, monitoring
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/10Plc systems
    • G05B2219/14Plc safety
    • G05B2219/14006Safety, monitoring in general

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Programmable Controllers (AREA)

Abstract

The application discloses a product detection method, a device, terminal equipment and a storage medium, wherein the method comprises the following steps: the PLC program of the PLC module is obtained by connecting the PLC module with a PLC bus; detecting a PLC module to run a PLC program, acquiring a current PLC function, judging whether the current PLC function is a PLC expansion function, wherein the current PLC function is a current PLC program function, and the PLC expansion function is a PLC program expansion function; if the current function of the PLC is judged to be the PLC expansion function, acquiring a ladder diagram code corresponding to the PLC expansion function, wherein the ladder diagram code is a code corresponding to a graphic symbol in a ladder diagram; setting a ladder diagram code corresponding to the PLC expansion function as a target ladder diagram code corresponding to the current function of the PLC, and sending the target ladder diagram code and an instruction to the PLC module; and receiving a product detection result returned by the PLC module in response to the instruction through the PLC bus, wherein the product detection result is a result of the PLC module executing detection operation corresponding to the PLC expansion function on the product. The application is beneficial to improving the efficiency of product detection.

Description

Product detection method and device, terminal equipment and storage medium
Technical Field
The present application relates to the field of internet technologies, and in particular, to a product detection method, a device, a terminal device, and a storage medium.
Background
In recent years, products are continuously and iteratively updated, and performance indexes are gradually improved. To ensure the quality of the product, personnel in the factory will check the product before it leaves the factory to control the quality of the product.
However, the product detection process of the existing terminal equipment is complicated, and the improvement of the product detection efficiency is not facilitated. The PLC program running by the existing terminal equipment does not have the PLC expansion function, so that the PLC module cannot be controlled to execute detection operation corresponding to the PLC expansion function on products, and products of factories are large, if the detection operation is executed on the products manually, the workload can be huge, and the detection time of the products can be long, so that human resources and time resources are consumed, and therefore, the product detection process of the existing terminal equipment is complex, and the improvement of the detection efficiency of the products is not facilitated.
Disclosure of Invention
The embodiment of the application provides a product detection method, a device, terminal equipment and a storage medium, which are used for solving the technical problems that the product detection process of the conventional terminal equipment is complicated and the detection efficiency of the product is not improved.
In a first aspect, an embodiment of the present application provides a product detection method, applied to a terminal device, where the product detection method includes:
the PLC is connected with a PLC module through a PLC bus of a programmable logic controller to acquire a PLC program of the PLC module;
detecting the PLC module to run the PLC program, acquiring a current PLC function, and judging whether the current PLC function is a PLC expansion function or not, wherein the current PLC function is the current PLC function of the PLC program, and the PLC expansion function is the expansion function of the PLC program;
if the current function of the PLC is judged to be the PLC expansion function, acquiring a ladder diagram code corresponding to the PLC expansion function, wherein the ladder diagram code is a code corresponding to a graphic symbol in a ladder diagram;
Setting the ladder diagram code corresponding to the PLC expansion function as a target ladder diagram code corresponding to the current function of the PLC, and sending the target ladder diagram code and an instruction to the PLC module, wherein the instruction is used for instructing the PLC module to execute detection operation corresponding to the PLC expansion function on a product according to the target ladder diagram code;
And receiving a product detection result returned by the PLC module in response to the instruction through the PLC bus, wherein the product detection result is a result of the PLC module executing the detection operation corresponding to the PLC expansion function on the product.
Illustratively, before the PLC module is connected to the PLC bus through the programmable logic controller, and the PLC program of the PLC module is obtained, the product detection method includes:
Acquiring a PLC expansion function and an expansion object from a PLC programming interface, acquiring a ladder diagram identifier contained in the PLC expansion function, and inquiring whether the ladder diagram identifier exists in a local file;
If the ladder diagram identifier exists in the local file, calling the preset expansion position corresponding to the predefined ladder diagram in the corresponding relation between the pre-established ladder diagram identifier and the preset expansion position;
setting the preset expansion position corresponding to the predefined ladder diagram as a target position corresponding to the ladder diagram identifier;
Acquiring a ladder diagram of a PLC program, adding an expansion object corresponding to the PLC expansion function at the target position of the ladder diagram, and displaying the PLC program added with the PLC expansion function on the PLC programming interface.
Illustratively, the extended object includes a plurality of extended programming elements and a connection manner of the plurality of programming elements.
In a possible implementation manner of the first aspect, the connecting the PLC module through the PLC bus of the programmable logic controller, and obtaining a PLC program of the PLC module includes:
the PLC bus is connected with a PLC module to obtain a module to be tested of the PLC module;
judging whether the module to be tested is a preset product or not;
and if the module to be tested is the product, acquiring the PLC program.
In a possible implementation manner of the first aspect, if the module to be tested is the product, the acquiring the PLC program includes:
If the module to be tested is the product, acquiring a target file corresponding to the product;
and acquiring the PLC program from the target file.
In one possible implementation manner of the first aspect,
And if the module to be tested is the product, acquiring the PLC program, wherein the method comprises the following steps:
If the module to be tested is the product, a control interface of the PLC program is obtained, and a PLC programming window positioned at the top layer in the control interface is obtained;
and acquiring the PLC program written by the user currently through the PLC programming window.
In a possible implementation manner of the first aspect, if the current PLC function is determined to be the PLC extension function, the acquiring a ladder diagram code corresponding to the PLC extension function includes:
If the current function of the PLC is judged to be the PLC expansion function, acquiring a ladder diagram set of the PLC module;
And in the ladder diagram set, acquiring the ladder diagram code corresponding to the PLC expansion function according to the pre-established corresponding relation between the PLC expansion function and the ladder diagram code.
In one possible implementation manner of the first aspect,
Setting the ladder diagram code corresponding to the PLC expansion function as a target ladder diagram code corresponding to the current PLC function, and sending the target ladder diagram code and an instruction to the PLC module, wherein the method comprises the following steps:
Setting the ladder diagram code corresponding to the PLC expansion function as a target ladder diagram code corresponding to the current function of the PLC;
And sending the target ladder diagram code and the instruction to the PLC module through the PLC bus.
In a possible implementation manner of the first aspect, after the receiving, through the PLC bus, a product detection result returned by the PLC module in response to the instruction, the method includes:
And sending the product detection result to a preset screen, and controlling the screen to display the product detection result.
In a second aspect, an embodiment of the present application provides a product detection apparatus, applied to a terminal device, including:
the first acquisition module is used for connecting a Programmable Logic Controller (PLC) module through a PLC bus to acquire a PLC program of the PLC module;
The judging module is used for detecting the PLC module to run the PLC program, acquiring the current function of the PLC, judging whether the current function of the PLC is a PLC expansion function, wherein the current function of the PLC is the current function of the PLC program, and the PLC expansion function is the expansion function of the PLC program;
The second acquisition module is used for acquiring a ladder diagram code corresponding to the PLC expansion function if the current function of the PLC is judged to be the PLC expansion function, wherein the ladder diagram code is a code corresponding to a graphic symbol in a ladder diagram;
The indication module is used for setting the ladder diagram code corresponding to the PLC expansion function as a target ladder diagram code corresponding to the current function of the PLC, sending the target ladder diagram code and an indication instruction to the PLC module, wherein the indication instruction is used for indicating the PLC module to execute detection operation corresponding to the PLC expansion function on a product according to the target ladder diagram code;
The receiving module is used for receiving a product detection result returned by the PLC module in response to the instruction through the PLC bus, wherein the product detection result is a result of the PLC module executing the detection operation corresponding to the PLC expansion function on the product.
In a third aspect, an embodiment of the present application provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the product detection method of any one of the first aspects when the processor executes the computer program.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium storing a computer program which, when executed by a processor, implements the product detection method of any one of the first aspects.
In a fifth aspect, an embodiment of the present application provides a computer program product for, when run on a terminal device, causing the terminal device to perform the product detection method according to any one of the first aspects.
It will be appreciated that the advantages of the second to fifth aspects may be found in the relevant description of the first aspect, and are not described here again.
Compared with the prior art, the embodiment of the application has the beneficial effects that:
The method has the advantages that on one hand, the product detection result returned by the PLC module in response to the indication instruction is received through the PLC bus, and the product detection result is the result of the detection operation corresponding to the PLC expansion function of the product executed by the PLC module, so that the terminal equipment can control the PLC module to execute the detection operation corresponding to the PLC expansion function of the product, the detection process of the product is simplified, and the detection efficiency of the product is improved; on the other hand, the user can expand the detection operation needed by the function configuration through the PLC, and the user experience is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is an application scenario diagram of a product detection method provided by an embodiment of the present application;
FIG. 2 is a schematic flow chart of a method for detecting a product according to an embodiment of the present application;
FIG. 3 is a flowchart for obtaining a PLC program according to an embodiment of the present application;
FIG. 4 is a schematic block diagram of a product detection device provided by an embodiment of the present application;
Fig. 5 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It should be understood that the term "comprises/comprising" when used in this specification and the appended claims is taken to specify the presence of stated features, integers, steps, detection operations, elements, and/or components, but does not preclude the presence or addition of one or more other features, integers, steps, detection operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in the present description and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
Furthermore, the terms "first," "second," "third," and the like in the description of the present specification and in the appended claims, are used for distinguishing between descriptions and not necessarily for indicating or implying a relative importance.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
In addition, the technical solutions of the embodiments may be combined with each other, but it is necessary to base that the technical solutions can be realized by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, the combination of the technical solutions should be considered to be absent and not within the scope of protection claimed in the present application.
The flow diagrams depicted in the figures are merely exemplary, and do not necessarily include all of the elements and detection operations/steps, nor are they necessarily performed in the order described. For example, some of the detection operations/steps may also be split, combined, or partially combined, so that the order of actual execution may be changed according to the actual situation.
The product detection method provided by the embodiment of the application can be applied to terminal equipment such as mobile phones, tablet computers, wearable equipment, vehicle-mounted equipment, augmented reality (augmented reality, AR)/Virtual Reality (VR) equipment, notebook computers, ultra-mobile personal computer (UMPC), netbooks, personal digital assistants (personal DIGITAL ASSISTANT, PDA) and the like, and the embodiment of the application does not limit the specific types of the terminal equipment.
For example, the terminal device may be a Station (ST) in a WLAN, a cellular telephone, a cordless telephone, a session initiation protocol (session InitiationProtocol, SIP) telephone, a wireless local loop (Wireless Local Loop, WLL) station, a personal digital assistant (personal DIGITAL ASSISTANT, PDA) device, a handheld device with wireless communication capabilities, a computing device or other processing device connected to a wireless modem, an in-vehicle device, a car networking terminal, a computer, a laptop computer, a handheld communication device, a handheld computing device, a satellite radio, a wireless modem card, a television Set Top Box (STB), a customer premise equipment (customer premise equipment, CPE) and/or other devices for communicating over a wireless system as well as next generation communication systems, such as a mobile terminal in a 5G network or a mobile terminal in a future evolved public land mobile network (Public Land Mobile Network, PLMN) network, etc.
By way of example, and not limitation, when the terminal device is a computer. The computer is not only a hardware device, but also realizes a powerful function through software support and data interaction and cloud interaction.
As an example, but not limited to, taking the terminal device as a computer example, taking the detection operation as an example of a calibration test operation, please refer to fig. 1, fig. 1 is an application scenario diagram of a product detection method provided by an embodiment of the present application, which is described in detail below:
The terminal equipment is connected with the PLC module through the PLC bus, and the terminal equipment establishes communication with the upper computer.
Connecting a process calibrator with a communication interface to a computer, connecting an expansion module needing auxiliary production work with a module to be tested, and configuring the expansion module to a PLC module of the company;
The PLC module is communicated with the computer through the Ethernet; writing a calibration test program through a computer; and the computer and the upper computer control the operation of a calibration test program in the PLC module, and meanwhile, the returned data can be utilized to check the calibration test progress, the returned parameters and the module state information. The module status information includes success or failure information.
By way of example, and not limitation, taking a PLC module as an example of the UN smart series product, examples are as follows:
(1) The simplified flow: after the upper computer software of the computer starts to run the calibration test program, the process calibrator with the communication interface is controlled, and the process calibrator is communicated to the PLC through the Ethernet, a set of control logic written by utilizing the special library file used by the invention is run in the PLC, and the PLC module and the expansion module are connected in a normal configuration mode. The expansion module comprises a finished product module which passes the calibration test and a module to be tested which does not pass the calibration test. Taking a module to be tested as an analog product for example, the analog product comprises an input module and an output module, and the modules are respectively used for detecting voltage and current, various sensor signals and the like.
(2) Calibration input: if only the input signal is calibrated, we can simplify the flow according to the above (1), and the expansion module only needs one input module to be tested, and the other connections are unchanged. After the ladder diagram program is written, the relay terminal of the PLC module is connected in series between the output port of the process calibrator and the input port of the input module. The upper computer is used for opening a calibration function, the upper computer sends a calibration command to the PLC module through the Ethernet, and the PLC module forwards the command to an input module to be tested after receiving the calibration command; and after receiving the input module to be tested, executing a corresponding calibration function, and finishing the feedback completion mark, wherein the PLC also assists in switching the relay according to different commands. The calibration input is relatively simple, an input module with input calibration completed is obtained, and other output modules can be padded.
(3) Calibration output: after knowing the method of (2) calibration input, calibrating output; the input module after calibration in (2) and the output module to be tested can be configured together. Connecting the output terminal to be calibrated to the input terminal of the calibrated input module; the input precision and consistency of the calibrated input module are quite high, and the input precision and consistency of the calibrated input module are far higher than the output precision requirement of the output module; therefore, after the physical connection is completed, a corresponding calibration program is used, the value of the output module is read through the input module, and is fed back to the output module through the bus, so that the output module is calibrated.
(4) Calibration input/output: the same applies to modules with both inputs and outputs; only the requirements of (2) and (3) are needed to be combined; the actual physical connection of this calibration mode is shown in fig. 1. Different from the step (2), the process calibrator is connected in series through a relay of the PLC and then is connected to an input terminal of a module to be tested; the input module used as the calibration aid is responsible for calibrating the output terminal of the module to be tested. Thus, a module with input and output functions can be completed.
(5) And (3) testing: after calibration, the PLC program is also provided with a test program, and the test function is realized by additionally installing an input module and an output module with additional accuracy and consistency and matching with an I/O output module with a relay. After the test program in the PLC runs automatically; the module to be tested is controlled to switch different functions, the I/O output module with the relay is controlled to switch signals to different input modules and output modules for auxiliary test, and the PLC is matched with the input modules and the output modules for auxiliary test to complete the test function.
(6) After-sales testing: after-sales products can also detect problems through the calibration test jig made by the logic, and factory information of some factories, such as version numbers, can be read; is convenient for anti-counterfeiting and version control.
(7) Others: the front process check meter can also be controlled by a serial port of the PLC, the process check meter in the example is controlled by a computer or an upper computer, the two are not in conflict, and the upper computer is used only for controlling more conveniently and more visually; similarly, the whole process can be realized by adopting a PLC ladder diagram and a calibrator. In addition, the output is equally feasible if it is desired to use a process calibrator to perform calibration tests with greater accuracy. The degrees of freedom are quite high and the solutions presented here are only illustrative.
In the embodiment of the application, the calibration step can be completed by connecting the standard product module, the PLC, the module to be tested, the process calibrator and the like which are subjected to the calibration test together and matching the connection structure, so that the calibration test process in the production process is simplified.
Referring to fig. 2, fig. 2 is a flow chart of a product detection method according to an embodiment of the present application, and the method can be applied to a terminal device. The terminal device may be any one of a mobile phone, a camera, a tablet computer, a wearable terminal device, a vehicle-mounted terminal device, an Augmented Reality (AR)/Virtual Reality (VR) terminal device, a notebook computer, a personal computer (personal computer, PC), a netbook, and a Personal Digital Assistant (PDA), which is not limited in the embodiment of the present application.
As shown in fig. 2, the method for detecting a product provided by the embodiment of the application includes the following steps, which are described in detail as follows:
S201, connecting a Programmable Logic Controller (PLC) bus with a PLC module to obtain a PLC program of the PLC module;
illustratively, the PLC bus includes a serial communication interface and a network interface, and the communication protocol of the network interface includes one of an ethernet protocol, a WIFI protocol, a bluetooth protocol, a 3G protocol, a 4G protocol, a 5G protocol, or a combination thereof.
Exemplary communication protocols of the serial communication protocol include one of RS485 protocol, CAN protocol, BUS protocol, USB protocol, I2C protocol, SPI protocol, or a combination thereof.
Illustratively, before the PLC module is connected to the PLC bus through the programmable logic controller, and the PLC program of the PLC module is obtained, the product detection method includes:
Acquiring a PLC expansion function and an expansion object from a PLC programming interface, acquiring a ladder diagram identifier contained in the PLC expansion function, and inquiring whether the ladder diagram identifier exists in a local file;
If the ladder diagram identifier exists in the local file, calling the preset expansion position corresponding to the predefined ladder diagram in the corresponding relation between the pre-established ladder diagram identifier and the preset expansion position;
setting the preset expansion position corresponding to the predefined ladder diagram as a target position corresponding to the ladder diagram identifier;
Acquiring a ladder diagram of a PLC program, adding an expansion object corresponding to the PLC expansion function at the target position of the ladder diagram, and displaying the PLC program added with the PLC expansion function on the PLC programming interface.
Illustratively, the extended object includes a plurality of extended programming elements and a connection manner of the plurality of programming elements.
Among them, a programmable logic controller (PLC, programmable Logic Controller) is an electronic device that is designed specifically for digital arithmetic operations for application in an industrial environment.
S202, detecting the PLC module to run the PLC program, acquiring the current function of the PLC, and judging whether the current function of the PLC is a PLC expansion function, wherein the current function of the PLC is the current function of the PLC program, and the PLC expansion function is the expansion function of the PLC program;
S203, if the current function of the PLC is judged to be the PLC expansion function, acquiring a ladder diagram code corresponding to the PLC expansion function, wherein the ladder diagram code is a code corresponding to a graphic symbol in a ladder diagram;
If the current function of the PLC is judged to be the PLC expansion function, acquiring a ladder diagram code corresponding to the PLC expansion function, wherein the ladder diagram code comprises the following steps:
If the current function of the PLC is judged to be the PLC expansion function, acquiring a ladder diagram set of the PLC module;
And in the ladder diagram set, acquiring the ladder diagram code corresponding to the PLC expansion function according to the pre-established corresponding relation between the PLC expansion function and the ladder diagram code.
S204, setting the ladder diagram code corresponding to the PLC expansion function as a target ladder diagram code corresponding to the current function of the PLC, and sending the target ladder diagram code and an instruction to the PLC module, wherein the instruction is used for instructing the PLC module to execute detection operation corresponding to the PLC expansion function on a product according to the target ladder diagram code;
The step of setting the ladder diagram code corresponding to the PLC expansion function as a target ladder diagram code corresponding to the current PLC function, and sending the target ladder diagram code and an instruction to the PLC module includes:
Setting the ladder diagram code corresponding to the PLC expansion function as a target ladder diagram code corresponding to the current function of the PLC;
And sending the target ladder diagram code and the instruction to the PLC module through the PLC bus.
S205, receiving a product detection result returned by the PLC module in response to the instruction through the PLC bus, wherein the product detection result is a result of the PLC module executing detection operation corresponding to the PLC expansion function on the product.
The detection operation comprises one or a combination of calibration test operation, function switching operation, self-checking operation and factory information detection operation.
After receiving a product detection result returned by the PLC module in response to the indication instruction through the PLC bus, the method comprises the following steps:
And sending the product detection result to a preset screen, and controlling the screen to display the product detection result.
The method has the advantages that on one hand, the product detection result returned by the PLC module in response to the indication instruction is received through the PLC bus, and the product detection result is the result of the detection operation corresponding to the PLC expansion function of the product executed by the PLC module, so that the terminal equipment can control the PLC module to execute the detection operation corresponding to the PLC expansion function of the product, the detection process of the product is simplified, and the detection efficiency of the product is improved; on the other hand, the user can expand the detection operation needed by the function configuration through the PLC, and the user experience is improved.
Referring to fig. 3, fig. 3 is a flowchart of acquiring a PLC program according to an embodiment of the present application, which is described in detail below:
S301, connecting a PLC module through the PLC bus to obtain a module to be tested of the PLC module;
S302, judging whether the module to be tested is a preset product or not;
s303, if the module to be tested is the product, the PLC program is obtained.
If the module to be tested is the product, the PLC program is obtained, which comprises the following steps:
If the module to be tested is the product, acquiring a target file corresponding to the product;
and acquiring the PLC program from the target file.
If the module to be tested is the product, the PLC program is obtained, which comprises the following steps:
If the module to be tested is the product, a control interface of the PLC program is obtained, and a PLC programming window positioned at the top layer in the control interface is obtained;
and acquiring the PLC program written by the user currently through the PLC programming window.
In the embodiment of the application, if the module to be tested is a product, the PLC program is acquired, so that the product can be detected by the PLC program quickly and timely.
Referring to fig. 4, fig. 4 is a schematic block diagram of a product detection apparatus according to an embodiment of the present application, where the product detection apparatus 400 shown in fig. 4 may be applied to a terminal device in an application scenario diagram shown in fig. 1, and the product detection apparatus 400 shown in fig. 4 is described in detail below by taking the terminal device as an example, where the product detection apparatus 400 may include a first obtaining module 401, a judging module 402, a second obtaining module 403, an indicating module 404, and a receiving module 405.
The first obtaining module 401 is configured to connect to a PLC module through a PLC bus of a programmable logic controller, and obtain a PLC program of the PLC module;
The judging module 402 is configured to detect that the PLC module runs the PLC program, obtain a PLC current function, and judge whether the PLC current function is a PLC expansion function, where the PLC current function is a current function of the PLC program, and the PLC expansion function is an expansion function of the PLC program;
a second obtaining module 403, configured to obtain a ladder diagram code corresponding to the PLC extension function if the PLC current function is determined to be the PLC extension function, where the ladder diagram code is a code corresponding to a graphic symbol in a ladder diagram;
The instruction module 404 is configured to set the ladder diagram code corresponding to the PLC expansion function as a target ladder diagram code corresponding to the PLC current function, and send the target ladder diagram code and an instruction to the PLC module, where the instruction is used to instruct the PLC module to execute a detection operation corresponding to the PLC expansion function on a product according to the target ladder diagram code;
And the receiving module 405 is configured to receive, through the PLC bus, a product detection result returned by the PLC module in response to the instruction, where the product detection result is a result of the PLC module executing, on the product, a detection operation corresponding to the PLC expansion function.
It should be noted that, in the present specification, each embodiment is described in a progressive manner, and each embodiment is mainly described as different from other embodiments, and identical and similar parts between the embodiments are all enough to be referred to each other.
The method has the advantages that on one hand, the product detection result returned by the PLC module in response to the indication instruction is received through the PLC bus, and the product detection result is the result of the detection operation corresponding to the PLC expansion function of the product executed by the PLC module, so that the terminal equipment can control the PLC module to execute the detection operation corresponding to the PLC expansion function of the product, the detection process of the product is simplified, and the detection efficiency of the product is improved; on the other hand, the user can expand the detection operation needed by the function configuration through the PLC, and the user experience is improved.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
As shown in fig. 5, the terminal device 2 of fig. 5 includes: at least one processor 20, a memory 21 and a computer program 22 stored in the memory 21 and executable on the at least one processor 20, the processor 20 implementing the steps of any of the various method embodiments described above when executing the computer program 22.
The terminal device 2 may include, but is not limited to, a processor 20, a memory 21. It will be appreciated by those skilled in the art that fig. 5 is merely an example of the terminal device 2 and does not constitute a limitation of the terminal device 2, and may include more or less components than illustrated, or may combine certain components, or different components, such as may also include input-output devices, network access devices, etc.
The processor 20 may be a central processing unit (Central Processing Unit, CPU), the processor 20 may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL processors, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), off-the-shelf programmable gate array (field-programmable GATE ARRAY, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 21 may in some embodiments be an internal storage unit of the terminal device 2, such as a hard disk or a memory of the terminal device 2. The memory 21 may in other embodiments also be an external storage device of the terminal device 2, such as a plug-in hard disk provided on the terminal device 2, a smart memory card (SMART MEDIA CARD, SMC), a Secure Digital (SD) card, a flash memory card (FLASH CARD) or the like. Further, the memory 21 may also include both an internal storage unit and an external storage device of the terminal device 2. The memory 21 is used for storing a detection operating system, an application program, a Boot Loader (Boot Loader), data, other programs, etc., such as program codes of the computer program. The memory 21 may also be used for temporarily storing data that has been output or is to be output.
It should be noted that, because the content of information interaction and execution process between the above devices/units is based on the same concept as the method embodiment of the present application, specific functions and technical effects thereof may be referred to in the method embodiment section, and will not be described herein.
Embodiments of the present application provide a computer readable storage medium storing a computer program which, when executed by a processor, implements steps for implementing the various method embodiments described above.
The computer readable storage medium has stored therein program code that is callable by the processor to perform the product detection method described in the above method embodiments.
The computer readable storage medium has a storage space for program code.
The program code includes code for any of the steps in the product detection method described in the method embodiments described above.
For example, the program code is invoked by the processor, and may perform the steps of:
the PLC is connected with a PLC module through a PLC bus of a programmable logic controller to acquire a PLC program of the PLC module;
detecting the PLC module to run the PLC program, acquiring a current PLC function, and judging whether the current PLC function is a PLC expansion function or not, wherein the current PLC function is the current PLC function of the PLC program, and the PLC expansion function is the expansion function of the PLC program;
if the current function of the PLC is judged to be the PLC expansion function, acquiring a ladder diagram code corresponding to the PLC expansion function, wherein the ladder diagram code is a code corresponding to a graphic symbol in a ladder diagram;
Setting the ladder diagram code corresponding to the PLC expansion function as a target ladder diagram code corresponding to the current function of the PLC, and sending the target ladder diagram code and an instruction to the PLC module, wherein the instruction is used for instructing the PLC module to execute detection operation corresponding to the PLC expansion function on a product according to the target ladder diagram code;
And receiving a product detection result returned by the PLC module in response to the instruction through the PLC bus, wherein the product detection result is a result of the PLC module executing the detection operation corresponding to the PLC expansion function on the product.
The specific implementation of each detection operation can be referred to the previous embodiments, and will not be described herein.
The method has the advantages that on one hand, the product detection result returned by the PLC module in response to the indication instruction is received through the PLC bus, and the product detection result is the result of the detection operation corresponding to the PLC expansion function of the product executed by the PLC module, so that the terminal equipment can control the PLC module to execute the detection operation corresponding to the PLC expansion function of the product, the detection process of the product is simplified, and the detection efficiency of the product is improved; on the other hand, the user can expand the detection operation needed by the function configuration through the PLC, and the user experience is improved.
Embodiments of the present application provide a computer program product enabling a terminal device to carry out the steps of the method embodiments described above when the computer program product is run on the terminal device.
The computer program product is loaded by the terminal device and can perform the steps of:
the PLC is connected with a PLC module through a PLC bus of a programmable logic controller to acquire a PLC program of the PLC module;
detecting the PLC module to run the PLC program, acquiring a current PLC function, and judging whether the current PLC function is a PLC expansion function or not, wherein the current PLC function is the current PLC function of the PLC program, and the PLC expansion function is the expansion function of the PLC program;
if the current function of the PLC is judged to be the PLC expansion function, acquiring a ladder diagram code corresponding to the PLC expansion function, wherein the ladder diagram code is a code corresponding to a graphic symbol in a ladder diagram;
Setting the ladder diagram code corresponding to the PLC expansion function as a target ladder diagram code corresponding to the current function of the PLC, and sending the target ladder diagram code and an instruction to the PLC module, wherein the instruction is used for instructing the PLC module to execute detection operation corresponding to the PLC expansion function on a product according to the target ladder diagram code;
And receiving a product detection result returned by the PLC module in response to the instruction through the PLC bus, wherein the product detection result is a result of the PLC module executing the detection operation corresponding to the PLC expansion function on the product.
The method has the advantages that on one hand, the product detection result returned by the PLC module in response to the indication instruction is received through the PLC bus, and the product detection result is the result of the detection operation corresponding to the PLC expansion function of the product executed by the PLC module, so that the terminal equipment can control the PLC module to execute the detection operation corresponding to the PLC expansion function of the product, the detection process of the product is simplified, and the detection efficiency of the product is improved; on the other hand, the user can expand the detection operation needed by the function configuration through the PLC, and the user experience is improved.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional units and modules are only for distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiments, and may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include at least: any entity or device capable of carrying computer program code to a photographing device/terminal apparatus, recording medium, computer memory, read-only memory (ROM), random access memory (RAM, random Access Memory), electrical carrier signals, telecommunications signals, and software distribution media. Such as a U-disk, removable hard disk, magnetic or optical disk, etc. In some jurisdictions, computer readable media may not be electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/network device and method may be implemented in other manners. For example, the apparatus/network device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions in actual implementation, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (10)

1. A product detection method, characterized in that it is applied to a terminal device, the product detection method comprising:
the PLC is connected with a PLC module through a PLC bus of a programmable logic controller to acquire a PLC program of the PLC module;
detecting the PLC module to run the PLC program, acquiring a current PLC function, and judging whether the current PLC function is a PLC expansion function or not, wherein the current PLC function is the current PLC function of the PLC program, and the PLC expansion function is the expansion function of the PLC program;
if the current function of the PLC is judged to be the PLC expansion function, acquiring a ladder diagram code corresponding to the PLC expansion function, wherein the ladder diagram code is a code corresponding to a graphic symbol in a ladder diagram;
Setting the ladder diagram code corresponding to the PLC expansion function as a target ladder diagram code corresponding to the current function of the PLC, and sending the target ladder diagram code and an instruction to the PLC module, wherein the instruction is used for instructing the PLC module to execute detection operation corresponding to the PLC expansion function on a product according to the target ladder diagram code;
And receiving a product detection result returned by the PLC module in response to the instruction through the PLC bus, wherein the product detection result is a result of the PLC module executing the detection operation corresponding to the PLC expansion function on the product.
2. The method for detecting a product according to claim 1, wherein the connecting the PLC module through the PLC bus of the programmable logic controller, obtaining the PLC program of the PLC module, comprises:
the PLC bus is connected with a PLC module to obtain a module to be tested of the PLC module;
judging whether the module to be tested is a preset product or not;
and if the module to be tested is the product, acquiring the PLC program.
3. The method for detecting a product according to claim 2, wherein if the module to be detected is the product, the PLC program is acquired, comprising:
If the module to be tested is the product, acquiring a target file corresponding to the product;
and acquiring the PLC program from the target file.
4. The method for detecting a product according to claim 2, wherein if the module to be detected is the product, the PLC program is acquired, comprising:
If the module to be tested is the product, a control interface of the PLC program is obtained, and a PLC programming window positioned at the top layer in the control interface is obtained;
and acquiring the PLC program written by the user currently through the PLC programming window.
5. The product detection method according to claim 1, wherein if the PLC current function is determined to be the PLC extension function, acquiring a ladder diagram code corresponding to the PLC extension function includes:
If the current function of the PLC is judged to be the PLC expansion function, acquiring a ladder diagram set of the PLC module;
And in the ladder diagram set, acquiring the ladder diagram code corresponding to the PLC expansion function according to the pre-established corresponding relation between the PLC expansion function and the ladder diagram code.
6. The product detection method according to claim 1, wherein the setting the ladder diagram code corresponding to the PLC extension function as a target ladder diagram code corresponding to the PLC current function, and sending the target ladder diagram code and an instruction to the PLC module, includes:
Setting the ladder diagram code corresponding to the PLC expansion function as a target ladder diagram code corresponding to the current function of the PLC;
And sending the target ladder diagram code and the instruction to the PLC module through the PLC bus.
7. The product detection method according to any one of claims 1 to 6, wherein after the receiving, via the PLC bus, a product detection result returned by the PLC module in response to the instruction, the method comprises:
And sending the product detection result to a preset screen, and controlling the screen to display the product detection result.
8. A product detection device, characterized in that it is applied to a terminal device, comprising:
the first acquisition module is used for connecting a Programmable Logic Controller (PLC) module through a PLC bus to acquire a PLC program of the PLC module;
The judging module is used for detecting the PLC module to run the PLC program, acquiring the current function of the PLC, judging whether the current function of the PLC is a PLC expansion function, wherein the current function of the PLC is the current function of the PLC program, and the PLC expansion function is the expansion function of the PLC program;
The second acquisition module is used for acquiring a ladder diagram code corresponding to the PLC expansion function if the current function of the PLC is judged to be the PLC expansion function, wherein the ladder diagram code is a code corresponding to a graphic symbol in a ladder diagram;
The indication module is used for setting the ladder diagram code corresponding to the PLC expansion function as a target ladder diagram code corresponding to the current function of the PLC, sending the target ladder diagram code and an indication instruction to the PLC module, wherein the indication instruction is used for indicating the PLC module to execute detection operation corresponding to the PLC expansion function on a product according to the target ladder diagram code;
The receiving module is used for receiving a product detection result returned by the PLC module in response to the instruction through the PLC bus, wherein the product detection result is a result of the PLC module executing the detection operation corresponding to the PLC expansion function on the product.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the product detection method according to any of claims 1 to 7 when executing the computer program.
10. A computer readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the product detection method according to any one of claims 1 to 7.
CN202311861534.9A 2023-12-29 2023-12-29 Product detection method and device, terminal equipment and storage medium Pending CN117908461A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311861534.9A CN117908461A (en) 2023-12-29 2023-12-29 Product detection method and device, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311861534.9A CN117908461A (en) 2023-12-29 2023-12-29 Product detection method and device, terminal equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117908461A true CN117908461A (en) 2024-04-19

Family

ID=90693122

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311861534.9A Pending CN117908461A (en) 2023-12-29 2023-12-29 Product detection method and device, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117908461A (en)

Similar Documents

Publication Publication Date Title
US8402321B2 (en) System and method of providing driver software to test controller to facilitate testing by wireless transceiver tester of a device under test
CN112019279A (en) Line loss calibration method, device and system and computer readable storage medium
CN108039921B (en) Calibration method of mobile terminal, terminal equipment and storage medium
CN108156623B (en) Method and terminal for determining performance abnormity of wifi antenna
US8964610B2 (en) System and method of reducing factory program time for wireless devices
CN112996020B (en) Bluetooth-based automatic test method and device and Bluetooth test terminal
CN113485918B (en) Test method, test device, electronic equipment and storage medium
US20170208637A1 (en) Method and Apparatus for Interconnecting Smart Terminal and In-Vehicle Terminal
CN104468260A (en) Recognition method, device and system for mobile terminal device
CN109164310A (en) Anti-interference test system, monitoring device, anti-interference test method and terminal device
CN107402856B (en) USB port testing method and device and readable storage medium
CN117908461A (en) Product detection method and device, terminal equipment and storage medium
CN111786852A (en) Test method and related equipment
CN108039928B (en) Received signal strength testing method, device and system and electronic equipment
CN114116358A (en) Device debugging method and device, electronic device and computer readable storage medium
CN108199788B (en) Transmission power testing method, device and system and electronic equipment
CN113766406A (en) Method, system and device for testing earphone
CN103795857A (en) Information processing method and electronic equipment
CN113472611A (en) Method and device for acquiring WiFi signal strength and readable storage medium
CN112948013B (en) Application probe configuration method and device, terminal equipment and storage medium
CN113721961A (en) Equipment upgrading method and device, storage medium and electronic equipment
CN109286972B (en) Wireless communication method, system, equipment and computer readable storage medium
CN113407392A (en) Floating point arithmetic unit testing method and device, centralized control equipment and storage medium
CN111182153A (en) System language setting method and device, storage medium and mobile terminal
CN118093444B (en) Test method, test device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination