1. Technical Field
Embodiments of the present disclosure relate to systems and methods of data conversion, and more particularly to an electronic device and a method of converting measurement programs of measurement machines.
2. Description of Related Art
Measurement machines can be used to measure physical dimensions and geometric tolerances of a product. For the purpose of measuring physical dimensions and geometric tolerances of a product with high precision and high speed, the measurement machine is programmed using a measurement program. Usually, measurement programs for different measurement machines have different formats. For example, the measurement programs of different measurement machines are programmed in different program languages. Thus, in order to measure the same product by utilizing different measurement machines, a user needs to program for each of the measurement machines. In this way, it is inconvenient and time-consuming for the user to reprogram the measurement machines.
In general, the word “module”, as used herein, refers to logic embodied in hardware or firmware, or to a collection of software instructions, written in a programming language, such as, Java, C, or assembly. One or more software instructions in the modules may be embedded in firmware, such as in an EPROM. The modules described herein may be implemented as either software and/or hardware modules and may be stored in any type of non-transitory computer-readable medium or other storage device. Some non-limiting examples of non-transitory computer-readable media include CDs, DVDs, BLU-RAY, flash memory, and hard disk drives.
In block S1, the measurement program acquiring module 100 acquires a measurement program A of the first measurement machine from the storage medium 11. In one embodiment, the measurement program A includes at least one subprogram. Each subprogram is constituted by one field type or a couple of field types. In one example, the measurement program A may be:
In block S2, the template acquiring module 101 acquires a measurement program template A′ of the first measurement machine from the storage medium 11. In one embodiment, the measurement program template A′ is similar to the measurement program A, but substitutes measurement information in the measurement program A with a special character, like “$Format.” Thus, the measurement program template A′ also includes at least one subprogram, each of which is constituted by one field type or a couple of field types. The measurement program template A′ may be:
In block S3, the measurement program dividing module 102 divides the measurement program A into one or more subprograms according to the field types in the measurement program template A′. According the above example, the measurement program A is divided into three subprograms as follows:
the first subprogram:
In block S4, the data substitution module 103 selects one of the subprograms from the measurement program A. In one embodiment, the selection is in sequence.
In block S5, the data substitution module 103 searches a subprogram, which matches the selected subprogram of the measurement program A, from the measurement program template A′. In one embodiment, the match means the searched subprogram from the measurement program template A′ and the selected subprogram of the measurement program A have the same field type.
In block S6, the data substitution module 103 inserts the measurement information of the selected subprogram of the measurement program A into corresponding positions of the special character “$Format” in the searched subprogram of the measurement program template A′. For example, if the selected subprogram of the measurement program A is:
In block S7, the data substitution module 103 determines if there is any subprogram in the measurement program A that has not been selected, and repeats the operations in blocks S4˜S6 if there is any subprogram in the measurement program A that has not been selected. If all subprograms in the measurement program A have been selected, block S8 is implemented.
In block S8, the integration module 104 integrates the subprograms, the special character “$Format” in which have been substituted, of the measurement program template A1′, to generate a measurement program template A1′.
In block S9, the template acquiring module 101 acquires a measurement program template B′ of the second measurement machine from the storage medium 11. In one embodiment, the measurement program template B′ also includes at least one subprogram, each of which is constituted by one field type or a couple of field types and uses a special character “$Format” to represent measurement information. The measurement program template B′ may be programmed using different program languages with the measurement program template A′. It may be understood that, different program languages have corresponding relations. In one example, the measurement program template B′ of the second measurement machine may be:
In block S10, the measurement program conversation module 105 substitutes the special character “$Format” in the measurement program template B′ using the measurement information in the measurement program template A1′ according to corresponding relation of different program languages, for generating a measurement program B which is usable for the second measurement machine. According to the above examples, the measurement program B may be:
In block S11, the storage module 106 stores the measurement program B into the storage medium 11.
It should be emphasized that the above-described embodiments of the present disclosure, particularly, any embodiments, are merely possible examples of implementations, merely set forth for a clear understanding of the principles of the disclosure. Many variations and modifications may be made to the above-described embodiment(s) of the disclosure without departing substantially from the spirit and principles of the disclosure. All such modifications and variations are intended to be included herein within the scope of this disclosure and the present disclosure and protected by the following claims.
Number | Date | Country | Kind |
---|---|---|---|
201010541521.X | Nov 2010 | CN | national |