Automatic programming method and system

Through automatic programming methods and systems, the host computer is used to generate logic programming information, which solves the problem of professional programmers required for single-chip microcomputer control solutions, improves stability and versatility, and is suitable for automated control of fixtures and other equipment.

CN118796169APending Publication Date: 2024-10-18SHENZHEN QIANGRUI ELECTRONICS
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202310409172.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-13
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

In the current manufacturing of clamping and fixture equipment, flexible single-chip microcomputer control solutions require professional programmers to operate, resulting in unstable product quality, high maintenance costs, and a lack of versatile control solutions.

Method used

Automatic programming methods and systems are used to generate logical programming information through the visual programming interface of the host computer, send it to the underlying firmware of the programmable hardware, and parse it into hardware operation steps to control the hardware device, lower the programming threshold and improve stability.

Benefits of technology

It realizes automated control that can be operated without advanced programming qualifications, improves control system stability and development efficiency, reduces maintenance costs, and is suitable for different hardware devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118796169A_ABST
    Figure CN118796169A_ABST
Patent Text Reader

Abstract

The invention provides an automatic programming method and a system thereof, the automatic programming system comprises an upper computer, programmable hardware underlying firmware and hardware equipment needing to be automatically controlled; the input end of the programmable hardware bottom layer firmware is electrically connected with the output end of the upper computer, and the output end of the programmable hardware bottom layer firmware is electrically connected with the input end of the hardware equipment. The upper computer controls hardware working logic through a software programming platform, and after responding to logic programming information of the visual programming interface, the upper computer sends the logic programming information to the single-chip microcomputer; the single-chip microcomputer analyzes the logic programming information into a hardware operation normalization underlying framework program, namely logic operation steps of hardware equipment; and finally, the single-chip microcomputer sends the logic operation steps to hardware equipment through wiring so as to control the operation of the hardware of the platform equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of small-scale general automation control, and in particular relates to an automatic programming method and a system thereof. Background Art

[0002] With the rapid development of the entire automation industry, fixture equipment manufacturers are required to provide more efficient, stable, flexible and intelligent products. In the production and manufacturing of electronic products, in addition to many large-scale equipment and production lines, more fixtures, platforms and small equipment are also needed. These fixture platform equipment are limited by functional requirements, product volume, cost factors, etc., and often use more flexible single-chip microcomputer control solutions instead of more versatile PLC, PAC and other control solutions.

[0003] On the other hand, flexible MCU control solutions, due to their openness and flexibility, often require more professional programmers to complete related work. Moreover, due to the large differences in the qualifications and abilities of programmers, the quality of the products produced is uneven, and the stability and fault-tolerant mechanisms vary greatly, which greatly increases the maintenance costs. Summary of the invention

[0004] The object of the present invention is to provide an automatic programming method and system thereof, so as to improve the stability of the control system and lower the threshold of product programming.

[0005] The first aspect of the present invention discloses a programming method for a host computer, which is applied to the host computer and comprises:

[0006] When receiving the connection instruction of the underlying firmware of the programmable hardware, a visual programming interface is output;

[0007] In response to the logic programming information triggered by the interface, the logic programming information is sent to the underlying firmware of the programmable hardware; wherein the logic programming information is used by the underlying firmware of the programmable hardware to parse into corresponding logic operation steps and issue control instructions to the hardware device.

[0008] Preferably, after outputting the visual programming interface, the method further comprises:

[0009] Send a hardware resource debugging instruction to the programmable hardware underlying firmware; wherein the hardware resource debugging instruction is used to perform IO debugging, motor debugging and analog sampling on the hardware device through the programmable hardware underlying firmware.

[0010] Preferably, the visual programming interface includes a programming execution table, which includes vertical columns and horizontal rows. The vertical column represents the number of steps, and the horizontal row units represent the operation functions respectively. When programming, the horizontal row units are filled in one by one in the order of the vertical columns to obtain the logic programming information.

[0011] Preferably, the operating functions of the horizontal row units include a process step function area, an operation type function area, a calculation type function area, a status identification function area, a register group function area and an annotation function area; the vertical columns include an add step function area, a delete step function area, an insert step function area, a delete specified row function area, a process template insert function area and a clear button function area.

[0012] Preferably, the operation types include input, output, motor, D register and embedded program; the operation types include AND, OR, addition, subtraction, multiplication, division, assignment and comparison; the status identification is divided into 12 categories: yes, no, greater than, less than, greater than or equal to, less than or equal to, delay, u16, s16, u32, s32, float; the annotation is used to manually input notes to explain the current process step function and related parameters.

[0013] Preferably, the horizontal row unit further includes a debugging function area and a debugging status display function area.

[0014] The second aspect of the present invention discloses a programming method for programmable hardware bottom-layer firmware, which is applied to programmable hardware bottom-layer firmware and includes:

[0015] Establish connections with the host computer and hardware devices respectively;

[0016] Receiving logic programming information sent by the host computer, wherein the logic programming information is obtained by the host computer in triggering a visual programming interface;

[0017] Parsing the logic programming information into corresponding logic operation steps and saving them;

[0018] When an instruction to perform a logical operation on a hardware device is received, the corresponding logical operation steps are sent to the hardware device so that the hardware device executes the logical operation steps.

[0019] Preferably, the method for programming the underlying firmware of the programmable hardware further comprises:

[0020] In response to the hardware resource debugging instruction sent by the host computer, IO debugging, motor debugging and simulation sampling are performed on the hardware device.

[0021] Preferably, the programmable hardware bottom-layer firmware pre-configures a universal control interface, and the standards implemented by the universal control interface include a compatibility hardware resource standard, a compatibility register definition standard, and a compatibility communication protocol standard.

[0022] The third aspect of the present invention discloses an automatic programming system, including a host computer, programmable hardware underlying firmware and hardware equipment to be automatically controlled; the host computer is used to obtain logic programming information through the programming method of the above-mentioned host computer and send it to the programmable hardware underlying firmware, and the programmable hardware underlying firmware parses logical operation steps through the programming method of the above-mentioned programmable hardware underlying firmware to control the hardware equipment.

[0023] Compared with the prior art, the present invention has the following beneficial effects:

[0024] The automatic programming method of this scheme includes a programming method of the host computer and a programming method of the underlying firmware of the programmable hardware. The operator edits the logic programming information through the visual programming interface of the host computer, and then sends the logic programming information to the underlying firmware of the programmable hardware. The underlying firmware of the programmable hardware parses the logic programming information into corresponding logic operation steps for storage. When receiving an instruction to perform a logic operation on the hardware device, the corresponding logic operation steps are sent to the hardware so that the hardware can execute the logic operation steps. The underlying firmware of the programmable hardware in this scheme can be a general-purpose single-chip microcomputer, which can be compatible with and support different hardware devices. The operator simply writes different logic programming information in the visual programming interface according to the different hardware devices connected to the single-chip microcomputer, so as to realize the logic operation steps of different hardware devices entered into different single-chip microcomputers. The interface operation of the visual programming of the host computer of this scheme is stable, and the operator only needs simple training to get started, without high requirements for programming qualifications. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 This is the principle block diagram of the automatic programming system;

[0026] Figure 2 This is the application framework diagram of the automatic programming system;

[0027] Figure 3 It is a flowchart of the programming method of the host computer;

[0028] Figure 4 A schematic diagram of the interface for visual programming;

[0029] Figure 5 A flowchart of a method for programming underlying firmware of programmable hardware;

[0030] Figure 6 This is a schematic diagram of the programming operation of Example 1;

[0031] Figure 7 This is a schematic diagram of programming operation of Example 2;

[0032] Figure 8 This is a schematic diagram of the programming operation of Example 3;

[0033] Fig. 9 This is a schematic diagram of programming operation of Example 4;

[0034] Fig.10 This is a schematic diagram of the programming operation of Example 5;

[0035] Fig.11 This is a schematic diagram of the programming operation of Example 6;

[0036] Fig.12 This is a diagram of the programming operation of Example 7. Figure 1 ;

[0037] Fig.13 This is a diagram of the programming operation of Example 7. Figure 2 . DETAILED DESCRIPTION

[0038] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0039] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "front", "rear", "vertical", "horizontal", "inside", "outside" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings, which are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention; the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance; in addition, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be directly connected, or indirectly connected through an intermediate medium, or it can be a connection between the two components. For ordinary technicians in this field, the specific meanings of the terms in the present invention can be understood according to specific circumstances.

[0040] Aiming at the relevant needs and pain points of the automation industry, Qiangrui Technology has proposed a project plan for a small universal automatic programming system after years of research. The control system proposed in this plan aims to improve the stability of the control system, lower the threshold of product programming, and improve the efficiency of product debugging, thereby greatly improving development efficiency and reducing maintenance costs.

[0041] The platform framework of the automatic programming system disclosed in the present invention mainly includes three parts. The first part defines the protocol specifications and related definitions between the platform software and the underlying framework program. The second part standardizes the framework program of the underlying hardware tool board. The third part is the platform operating software, which is used to connect, debug, configure, and program the underlying hardware.

[0042] The platform software mainly includes three functions: hardware debugging, hardware configuration, and software programming. The hardware debugging function can be used to debug and monitor the hardware resource status, confirm the hardware wiring, or debug hardware function indicators. The hardware configuration function is mainly used to configure the motor pin parameters and AD sampling parameters.

[0043] The host computer generally uses a PLC or PC terminal, the underlying firmware of the programmable hardware is a general-purpose single-chip microcomputer, and the hardware equipment is the fixtures, platforms, and small equipment that appear in the production and manufacturing of electronic products. These hardware equipment such as fixtures and platforms are limited by functional requirements, product volume, and cost factors, and often use more flexible single-chip microcomputer control solutions.

[0044] See also Figure 1-2 The automatic programming system disclosed in the present invention includes a host computer, a programmable hardware underlying firmware, and a hardware device to be automatically controlled; the input end of the programmable hardware underlying firmware is electrically connected to the output end of the host computer, and the output end of the programmable hardware underlying firmware is electrically connected to the input end of the hardware device. The host computer is used to obtain logic programming information through the programming method of the host computer and send it to the programmable hardware underlying firmware, and the programmable hardware underlying firmware parses the logic operation steps through the programming method of the programmable hardware underlying firmware to control the hardware device.

[0045] The host computer in this scheme controls the hardware working logic through the software programming platform. After the host computer responds to the logic programming information of the visual programming interface, it sends the logic programming information to the single-chip microcomputer; the single-chip microcomputer parses the logic programming information into a normalized underlying framework program for hardware operation, that is, the logic operation steps of the hardware device; finally, the single-chip microcomputer sends the logic operation steps to the hardware device through wiring to realize the operation of the control platform device hardware.

[0046] See also Figure 3 The host computer programming method of the present invention is applied to the host computer and includes:

[0047] S110, when receiving a connection instruction from the underlying firmware of the programmable hardware, outputting a visual programming interface;

[0048] S120, in response to the logic programming information triggered by the interface, sending the logic programming information to the underlying firmware of the programmable hardware; wherein the logic programming information is used by the underlying firmware of the programmable hardware to parse into corresponding logic operation steps and issue control instructions to the hardware device;

[0049] S130, sending a hardware resource debugging instruction to the programmable hardware underlying firmware; wherein the hardware resource debugging instruction is used to perform IO debugging, motor debugging, and analog sampling on the hardware device through the programmable hardware underlying firmware.

[0050] The hardware debugging function includes IO debugging, motor debugging and analog sampling.

[0051] The configuration function is mainly used to configure the motor supporting output pin mapping and analog sampling related parameters.

[0052] The motor pin mapping includes four port mappings: motion direction, origin sensing, and positive and negative limit sensing. The motion direction is the output mapping, and other sensing signals are the input mapping. The motion direction mapping can only be mapped to the relevant ports planned as motor direction pins at the bottom layer, and the IO output pins cannot be mapped arbitrarily.

[0053] The relevant parameters of analog sampling include sampling magnification, sampling rate, sampling type and calibration type. The magnification and sampling rate are related to the sampled original data, while the sampling type and calibration type are related to the original AD data conversion.

[0054] Please see further Figure 4 The visual programming interface includes a programming execution table, which includes vertical columns and horizontal rows. The vertical column represents the number of steps, and the horizontal row units represent the operation functions respectively. When programming, the horizontal row units are filled in one by one according to the vertical column order to obtain the logic programming information.

[0055] Preferably, the operation functions of the horizontal row units include a process step function area, an operation type function area, a calculation type function area, a status identification function area, a register group function area, a debugging function area, a debugging status display function area and an annotation function area.

[0056] The process step function area includes the total number of steps in the entire process, the number of steps currently running, process debugging and debugging status, download process, upload process, import process and export process and other functions.

[0057] ①The number of process steps is synchronously recorded as the total number of steps in the entire process.

[0058] ② The current number of steps will be refreshed and displayed only when the process debugging is turned on.

[0059] ③Flow debugging is used to debug the running status of the entire process on the hardware device side online. In the flow debugging state, the program starts running from step 1. If the step execution completion condition is met, the jump step will be executed. If it is not met, the current step will be executed. The debugging status of the executed step is displayed in green, and the steps that have not been repeatedly executed are displayed in red and green flashing status.

[0060] ④ The download process is used to download the currently edited process to the device hardware tool board. Only after the process is downloaded can it run independently in the hardware tool board and can the process be debugged online.

[0061] ⑤The upload process is used to upload the running process in the hardware tool board to the programming platform software.

[0062] ⑥The import and export process is used to import and export process files into the programming computer and store them as program files in the database file format.

[0063] The operation type functions are divided into five categories: input, output, motor, D register and embedded programming.

[0064] ① Input is the input signal judgment, including IO input signal X-bit judgment and M-bit judgment.

[0065] ②Output is output signal control, which is used to control the Y-bit state of IO output signal.

[0066] ③The motor is controlled by motor signals, which are used to control the motor to move to a specified position or return to the origin.

[0067] ④D register is a D register operation, which can perform D register comparison, calculation and assignment, etc.

[0068] ⑤Embedded programming.

[0069] The operation type functions are divided into 8 categories: AND, OR, addition, subtraction, multiplication, division, assignment, and comparison.

[0070] ① AND is usually used for input operation types, and output operation types also need to set operations

[0071] The type is AND operation.

[0072] ②Or is usually used to input the operation type for OR operation judgment.

[0073] ③Addition is usually used for addition operations on D registers.

[0074] ④ Subtraction is usually used for subtraction operations on D registers.

[0075] ⑤Multiplication is usually used for D register multiplication operations.

[0076] ⑥ Division is usually used for division operations with D registers. Float type multiplication and division operations are shown below. The float type operation is to multiply and divide the data of float type register group 2 with the data of integer register groups 3 and 4 and then assign the value to the float type register of register 1. Float type can only be multiplied and divided with integers.

[0077] ⑦Assignment is usually used for assignment operations on D registers.

[0078] ⑧Comparison is usually used for D registers to perform comparison operations such as >, <, >=, <=, etc.

[0079] The functions of status identifiers 1-4 are divided into 12 categories, namely, yes, no, greater than, less than, greater than or equal to, less than or equal to, delay, u16, s16, u32, s32, and float.

[0080] ① is usually used for positive judgment of input operation type or motor running to a specified position.

[0081] ② Negative judgment of the input operation type or motor operation returning to the original state is not usually used.

[0082] ③ Greater than is usually used for D register comparison operation type greater than judgment.

[0083] ④Less than is usually used for D register comparison operation type less than judgment.

[0084] ⑤ Greater than or equal to is usually used for D register comparison operation type greater than or equal to judgment.

[0085] ⑥Less than or equal to is usually used for D register comparison operation type less than or equal to judgment.

[0086] ⑦ Delay is usually used for delay judgment of input operation type, and the delay time unit is 100ms.

[0087] ⑧u16 is usually used for D register operations, and the data type is an unsigned 16-bit integer.

[0088] ⑨s16 is usually used for D register operations, and the data type is a signed 16-bit integer.

[0089] ⑩u32 is usually used for D register operations, and the data type is an unsigned 32-bit integer.

[0090] s32 is usually used for D register operations, and the data type is a signed 32-bit integer.

[0091] float is usually used for D register operations, and the data type is float single-precision floating point type.

[0092] Register groups 1-4 are 4 register groups, each register group supports a maximum of 3 register operations, such as X1, X2, and X3, separated by commas.

[0093] Single-step debugging is used to test the execution of the current process step. If the execution is completed, the green light will be on. Otherwise, the red and green lights will flash alternately. Note that single-step debugging of D register addition, subtraction, multiplication and division operation steps is not currently supported.

[0094] The debugging status is used to display the single-step debugging result status or the process debugging status. The debugging status can be used to determine the single-step debugging execution result or the running status of the process debugging.

[0095] Annotations are used to manually input notes to explain the main functions and related parameters of the current process step. They can be saved in the exported process for easy reference.

[0096] like Figure 5 As shown, the programming method of the programmable hardware bottom firmware corresponding to the upper computer is applied to the programmable hardware bottom firmware, including:

[0097] S210, establishing connections with the host computer and the hardware device respectively;

[0098] S220, receiving logic programming information sent by the host computer, wherein the logic programming information is obtained by the host computer in triggering a visual programming interface;

[0099] S230, parsing the logic programming information into corresponding logic operation steps and saving them;

[0100] S240, when receiving an instruction to perform a logical operation on a hardware device, sending corresponding logical operation steps to the hardware so that the hardware executes the logical operation steps;

[0101] S250, in response to the hardware resource debugging instruction sent by the host computer, perform IO debugging, motor debugging and analog sampling on the hardware device.

[0102] Specifically, the programmable hardware bottom-layer firmware pre-configures a universal control interface, and the standards implemented by the universal control interface include a compatibility hardware resource standard, a compatibility register definition standard, and a compatibility communication protocol standard.

[0103] The hardware resource standards include: quantity definition and register address allocation of commonly used hardware control interfaces such as IO input resources, IO output resources, motor control interface, analog sampling interface, etc.

[0104] In addition to the register address allocation standards corresponding to hardware resources, the register definition standards also include register definition standards for motor operation, AD sampling configuration, and communication interface configuration.

[0105] The communication protocol standard adopts the standard modbus rtu industrial control protocol standard.

[0106] The programmable hardware bottom firmware of this solution is a general bottom-level single-chip control program that can be adapted to our mainstream control boards through simple configuration. First of all, it is a general program, that is, all mainstream control boards adapted by our company can be burned with this program, and then the hardware resources corresponding to the control board can be adapted through simple configuration. This firmware meets the general online logic programming control of all matching hardware functions, and through the normalization of the bottom-level firmware, it gets rid of the bottom-level program writing and dilutes the programming threshold.

[0107] Specific programming application examples are as follows:

[0108] Example 1: IO input signal determination

[0109] See also Figure 6 The process step shown is an example of IO input judgment. First, the operation type is selected as "input". Here, the operation type uses "and", which means that the register groups perform the AND operation judgment. The state identifier 1 selects "yes", which means that the IO input signal of register group 1 performs a positive judgment. The state identifier 2 selects "no", which indicates that the IO input signal of register group 2 performs a negative judgment. Here, register groups 3 and 4 are not used. The usage rules are the same as group 1 and group 2. Each register group can set up to 3 registers. If the judgment is successfully executed, jump to step 2, otherwise execute step 1.

[0110] The execution effect of the entire statement is similar to that of the C statement as follows:

[0111] If(X1&&X3&&(!X2))

[0112] Step = 2;

[0113] else

[0114] Step = 1;

[0115] Example 2: M-bit status determination

[0116] See also Figure 7 The M-bit status determination rules are consistent with the IO input signal. Note that in order to avoid usage conflicts and touch screen compatibility issues, the M-bit used by users starts from M20480.

[0117] Example 3: IO input delay determination

[0118] See also Figure 8As shown in the figure, a delay judgment is added to the IO input signal judgment. The rules for using the delay judgment are as follows. First, select "input" for the operation type. The operation type is consistent with the IO input signal judgment or M-bit state judgment rules. Here, the operation type is selected as "and", and the state identifier 1 is selected as "delay". Register group 1 is a value of 50. Because the unit of delay judgment is 100ms, it means that the delay is 50*100ms=5S. The state identifier 2 is selected as "not", and the identifier register group 2M3, M4 performs a negative judgment. Delay judgment can be used alone or in combination with other judgments. If the judgment is successfully executed, jump to step 2, otherwise execute step 1.

[0119] The execution effect of the entire statement is similar to that of the C statement as follows:

[0120] If(delay(50)&&(!M3)&&(!M4))

[0121] Step = 2;

[0122] else

[0123] Step = 1;

[0124] Example 4: IO output signal execution

[0125] See also Fig. 9 , the process step shown in the figure is a typical process step for IO output signal execution. First, select "output" for the operation type, and "and" must be selected for the operation type, otherwise it is regarded as invalid output control. Here, the state identifier 1 selects "yes", indicating that the output ports Y1 and Y2 of register group 1 perform a set operation, and the state identifier 2 selects "no", indicating that the output ports Y3 and Y4 of register group 2 perform a clear operation. Register groups 3 and 4 are not used here, and the usage rules are the same as those of groups 1 and 2. Each register group can set up to 3 registers. If the execution is successful, jump to step 2, otherwise execute step 1. The execution result here is always 1, so it will jump to step 2 after execution.

[0126] The execution effect type of the entire statement is the same as that of the C statement as follows:

[0127] Y1=1;

[0128] Y2=1;

[0129] Y3=0;

[0130] Y4=0;

[0131] Step = 2;

[0132] Example 5: M-bit state setting

[0133] See also Fig.10, the M-bit state setting rules are the same as the IO output signal execution rules. Note that setting some specific M-bit states can achieve some quick control effects, such as controlling the M-bit of the motor forward and reverse rotation.

[0134] Example 6: Motor Control

[0135] See also Fig.11 , the process steps shown in the figure are typical process steps for motor control. First, select "Motor" for the operation type. Select "AND" for the operation type, which means that the next step will be executed only after the motor has been determined to be in place. If "OR" is selected, it will not be determined whether the motor has been in place and the next step will be executed directly. Select "Yes" for status identifier 1, which means moving to the specified position. If "No" is selected, it means executing the return to origin operation. Register group 1 indicates the motor axis number. Just fill in the value. The axis number starts counting from 0. Status identifiers 2-4 identify the data type corresponding to register groups 2-4. Here, the value of register group 2 indicates the speed of the motor, the value of register group 3 indicates the position to which it has moved, and the value of register group 4 indicates the acceleration and deceleration time. When executing the return to origin operation, the position data is invalid.

[0136] Example 7: D register operation

[0137] See also Fig.12 , the process step shown in the figure is the operation step of D register operation. First, select "D register" as the operation type, select "addition" as the operation type, or select other operation types to perform different operations, including "subtraction", "multiplication" and "division". The state identifier 1-4 identifies the data type of register group 1-4. For example, the data type here is u16. Register group 1 writes the D register that needs to be operated. Register groups 2-4 can write the D register or operation value that needs to participate in the operation. After the step is executed, jump to step 2.

[0138] The execution effect type of the entire statement here is the same as that of the C statement as follows:

[0139] D1280=10+D1282+5;

[0140] Step = 2;

[0141] The same is true for other operation types, such as D1280 = 10 * D1282 * 5; etc. If D1280 itself needs to participate in the operation, D1280 needs to be written into the following register group. The operation rule of the assignment operation type is to assign the value of register group 2 to the D register corresponding to register group 1.

[0142] For example: D1280 = 10;

[0143] The operation rules of the comparison operation type are slightly different. When the comparison operation type is selected, we perform a D register comparison operation. At this time, the state identifier 1 indicates that the data we are comparing is similar. Register group 1 is the D register to be compared. State identifiers 2-4 are the comparison types corresponding to register groups 2-4, including "yes", "not", "greater than", "less than", "greater than or equal to", and "less than or equal to". "Yes" here means equal to judgment, and "not" here means not equal to judgment. Register groups 2-4 are the D registers or values ​​to be compared and judged. Fig.13 As shown, an action judgment is made on D1280 being greater than 10, less than D1282, and not equal to 5.

[0144] The execution effect type of the entire statement is the same as that of the C statement as follows:

[0145] If((D1280>10)&&(D1280 <D1282)&&(D1280!=5))

[0146] Step = 2;

[0147] else

[0148] Step = 1;

[0149] Note that the operation of D registers must pay attention to the type. Operations on data with large data type differences may result in abnormal data conversion. It is recommended not to perform operations on mixed data types.

[0150] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A host computer programming method, applied to the host computer, It is characterized in that include: When receiving the connection instruction of the underlying firmware of the programmable hardware, a visual programming interface is output; In response to the logic programming information triggered by the interface, the logic programming information is sent to the underlying firmware of the programmable hardware; wherein the logic programming information is used by the underlying firmware of the programmable hardware to parse into corresponding logic operation steps and issue control instructions to the hardware device.

2. The programming method of the host computer according to claim 1, It is characterized in that After outputting the visual programming interface, it also includes: Send a hardware resource debugging instruction to the programmable hardware underlying firmware; wherein the hardware resource debugging instruction is used to perform IO debugging, motor debugging and analog sampling on the hardware device through the programmable hardware underlying firmware.

3. The programming method of the host computer according to claim 2, It is characterized in that The visual programming interface includes a programming execution table, which includes vertical columns and horizontal rows. The vertical column represents the number of steps, and the horizontal row units represent the operation functions respectively. When programming, the horizontal row units are filled in one by one according to the vertical column order to obtain the logic programming information.

4. The programming method of the host computer according to claim 3, It is characterized in that The horizontal row unit includes a process step function area, an operation type function area, a calculation type function area, a status identification function area, a register group function area and an annotation function area; the vertical column includes an add step function area, a delete step function area, an insert step function area, a delete specified row function area, a process template insert function area and a clear button function area.

5. The programming method of the host computer according to claim 4, It is characterized in that The operation types include input, output, motor, D register and embedded program; the operation types include AND, OR, addition, subtraction, multiplication, division, assignment and comparison; the status identification is divided into 12 categories: yes, no, greater than, less than, greater than or equal to, less than or equal to, delay, u16, s16, u32, s32, float; the annotation is used to manually input notes to explain the current process step function and related parameters.

6. The programming method of the host computer according to claim 3, It is characterized in that The horizontal row unit also includes a debugging function area and a debugging status display function area.

7. A programming method for programmable hardware bottom-layer firmware, applied to programmable hardware bottom-layer firmware, It is characterized in that include: Establish connections with the host computer and hardware devices respectively; Receiving logic programming information sent by the host computer, wherein the logic programming information is obtained by the host computer in triggering a visual programming interface; Parsing the logic programming information into corresponding logic operation steps and saving them; When an instruction to perform a logical operation on a hardware device is received, the corresponding logical operation steps are sent to the hardware device so that the hardware device executes the logical operation steps.

8. The method for programming the underlying firmware of programmable hardware according to claim 7, It is characterized in that The programming method of the programmable hardware bottom firmware also includes: In response to the hardware resource debugging instruction sent by the host computer, IO debugging, motor debugging and simulation sampling are performed on the hardware device.

9. The programming method of the host computer according to claim 7, It is characterized in that The programmable hardware bottom firmware pre-configures a universal control interface, and the standards implemented by the universal control interface include a compatibility hardware resource standard, a compatibility register definition standard, and a compatibility communication protocol standard.

10. An automatic programming system, It is characterized in that It includes a host computer, programmable hardware underlying firmware and hardware equipment that needs to be automatically controlled; the host computer is used to obtain logical programming information through the programming method of the host computer as described in any one of claims 1-6 and send it to the programmable hardware underlying firmware; the programmable hardware underlying firmware parses logical operation steps through the programming method of the programmable hardware underlying firmware as described in any one of claims 7-9 to control the hardware equipment.

Citation Information

Cited By

  • Control platform, control system and control method of automation equipment

    CN119963133A