ISO/EIA CODE CONVERSION METHOD

Abstract: An ISO/EIA code conversion method capable of producing NC data with the ISO code or the EIA code irrespective of the code system of the NC data that are input. The NC data input via a serial interface (4) are converted into predetermined internal codes using a conversion table (EIT), and are stored in a floppy disk (FDI). When the NC data that are stored are to be produced, the internal code NC data read out from the floppy disk (FDI) are converted into ISO codes or ECT codes using a conversion table (ICT) or (ECT) that is selected depending upon the setting of the ISO/EIA setting switch (CSW).

Description: This invention relates to an ISO/EIA code conversion apparatus and, more particularly, to an ISO/EIA code conversion method in an NC data input/output unit capable of using an ISO code and an EIA code. In an automatic programming apparatus which automatically creates NC data, the NC data are created in either an ISO code or EIA code system and stored on an external storage medium such as a hard disk. At the time of use, the desired NC data are read out of the external storage medium to perform NC control. Conventionally, the NC data created by such an automatic programming apparatus are inputted to or outputted from the external storage medium through any of the methods (1) - (3) below. (1) The code system of the NC data to be inputted is designated and only the NC data of the designated code system are inputted to the external storage medium. At the time of output, the NC data of the inputted code system are outputted as is. For example, since an ISO code is an eight-bit code of even parity and an EIA code is an eight-bit code of odd parity, the code system of the inputted NC data is identified by the parity, the identified code system and a code system designated in advance are compared, only the NC data of the designated code system are stored on the external storage medium, and these data are outputted in response to a request. (2) The code system of the NC data to be inputted are discriminated automatically, only data such as character or numeral data in which both the ISO and EIA codes are used while having the same meaning are converted into an internal code and stored, whereas data (referred to as a characteristic code) in which the ISO and EIA codes are used while having their own meanings, and which include undefined codes, are neglected without being converted into an internal code. At the time of output, the data converted into the internal code are outputted upon being converted into data of the code system designated at output time. (3) The characteristic code neglected and not converted in method (2) is registered separately, and if the code system of the data outputted in (2) and the registered code system are the same, the data are outputted. However, with the input/output processing of NC data in method (1), a problem encountered is that the method cannot be used in a case where input code system and output code system differ. With the input/output processing of NC data in method (2), the characteristic code is neglected without relation to the input code system and output code system. Therefore, all of the data at the time of input cannot be stored in the external storage medium. With the input/output processing of NC data in method (3), the characteristic code must be separately registered and the registration operation is very troublesome. A method for converting NC data from ISO or EIA format to standard format is shown in JP 62-75809. Accordingly, an object of the present invention is to provide an ISO/EIA code conversion method in which storage is possible irrespective of the code system, inputted data can be outputted as is in a case where the input code system and output code system are the same, and an undefined code can be neglected and outputted in a designated code system in a case where the code systems differ. According to the present invention there is provided an NC data input/output apparatus capable of using an ISO code and an EIA code and being operable to receive inputted NC data in ISO and EIA code format and to output that NC data in either ISO or EIA code format, employing an ISO/EIA code conversion method between the inputted NC data and the outputted NC data which is characterised by steps of: providing a first conversion table for converting NC data inputted in either an ISO code or an EIA code into an internal code, and a second conversion table for converting an internal code into an ISO code or an EIA code; converting inputted NC data characters and numerals, each of which occurs in both the ISO code and EIA code, into the same internal code using the first conversion table, and converting characters and numerals which occur in only one of the ISO code and EIA code into respective separate internal codes using the first conversion table, and storing the same; designating, at the time of NC data output, in which of the ISO code and EIA code an NC data output is to be made; and converting the internal code into the designated code system for NC data output using said second conversion table. Brief Description of the Drawings Fig. 1 is a block diagram of a system for practicing the method of the invention; Fig. 2 is an explanatory view for describing conversion of ISO/EIA codes into internal codes; Fig. 3 is a flowchart of input conversion processing in the present invention; and Fig. 4 is a flowchart of output conversion processing in the present invention. Fig. 1 is a block diagram of a system (program file system) for practicing the present invention. Numeral 1 denotes a processor and numeral 2 a ROM storing a control program, a conversion table EIT for converting an eight-bit ISO or EIA code into an internal code, a conversion table ICT for converting an internal code into an ISO code, and a conversion table ECT for converting an internal code into an EIA code. Numeral 3 denotes a RAM for storing the results of processing and the like, 4 an interface (e.g., a serial I/F conforming to RS-232-C) for a bit-serial data exchange with a host (automatic programming apparatus) or the like, 5 an operator's panel, 6 a display unit (CRT), 7 a floppy disk controller (FDC), 8 a floppy disk drive (FDD), and FD1, FD2 floppy disks. An ISO/EIA setting switch CSW is disposed on the operator's panel 5. The conversion table EIT is for converting an eight-bit code, namely an ISO code (eight-bit even parity) and an EIA code (eight-bit odd parity) into respective internal codes. Characters, numerals and symbols sharing ISO and EIA codes are converted into the same internal code, and codes peculiar to ISO and EIA codes which include undefined codes are converted into respective separate internal codes. Fig. 2 is an explanatory view for describing conversion of an ISO/EIA code into respective internal codes by the conversion table EIT. Numeral 11 denotes a group of NC data (the area in the circle indicated by the solid line) in which an ISO code has been converted into an internal code. Numeral 12 denotes a group of NC data (the area in the circle indicated by the broken line) in which an EIA code has been converted into an internal code. MDT represents a portion of NC data in which characters, numerals and the like wherein ISO and EIA codes both are used while having the same meaning are converted into the same internal codes, SDT represents a portion of NC data in which special symbols, undefined codes and the like wherein only ISO codes of a specific meaning are used are converted into internal codes, and EDT represents a portion of NC data in which special symbols, undefined codes and the like wherein only EIA codes of a specific meaning are used are converted into internal codes. The conversion table ICT is for converting an internal code into an ISO code. Internal codes (MDT, SDT in Fig. 2) corresponding to characters, numerals and symbols (defined codes) used in an ISO code system are converted into a predetermined ISO code, and internal codes (EDT in Fig. 2) corresponding to symbols (undefined codes) not used in an ISO code system are all converted into the same special code. The conversion table ECT is for converting an internal code into an EIA code. Internal codes (MDT, EDT in Fig. 2) corresponding to characters, numerals and symbols (defined codes) used in an EIA code system are converted into a predetermined EIA code, and internal codes (SDT in Fig. 2) corresponding to symbols (undefined codes) not used in an EIA code system are all converted into the same special code. INPUT CONVERSION PROCESSING Fig. 3 is a flowchart of input conversion processing according to the present invention. Input conversion processing for storing NC data, which is received from the host, in a floppy disk will now be described in accordance with the flowchart of Fig. 3. First, when NC data arrive from the host via the serial interface 4, the processor 1 reads one character (code) of the NC data (step 101). Next, it is determined whether the read code is a code indicating the end of the NC data (step 102). If the read code is an end code, an internal code indicative of end is stored on the floppy disk FD1 and input processing is terminated. If the read code is not an end code, on the other hand, the read code is converted into a predetermined internal code (step 103) using the conversion table EIT and is then stored on the floppy disk FD1 (step 104). The next character is then read and processing from step 102 onward is repeated. More specifically, in input conversion processing, the input code is converted into an internal code (see Fig. 2) using the conversion table EIT irrespective of whether the NC data is an ISO code or EIA code. Output Conversion Processing Fig. 4 is a flowchart of output conversion processing according to the present invention. Output conversion processing for converting an internal code stored on a floppy disk into NC data of a predetermined code system and then outputting the same will now be described in accordance with the flowchart of Fig. 4. First, the operator sets the output code system before the conversion is made. That is, by operating the ISO/EIA setting switch CSW on the operator's panel 5, a setting is made indicating whether the conversion is to be made to the ISO code or EIA code. Thereafter, when an NC program number is designated and output conversion processing is started, the processor 1 reads one character (code) of the designated NC program out of the floppy disk FD1 (step 201), checks to see whether the code is one indicative of end of the NC data (step 202) and, if the code indicates end of data, terminates the output conversion processing (step 202). If the code is not one indicating the end of NC data, the processor 1 determines whether the code system set by the ISO/EIA setting switch CSW is an ISO code or EIA code (step 203). If the set code is the ISO code, the internal code is converted into the ISO code using the conversion table ICT (step 204). If the set code is the EIA code, the internal code is converted into the EIA code using the conversion table ECT (step 205). In should be noted that the internal code EDT (see Fig. 2) is converted into a special code if the code system set by the switch CSW is an ISO code, and that the internal code SDT is converted into a special code if the code system set by the switch CSW is an EIA code. Next, the processor 1 determines whether the result of conversion is a special code (step 206). If it is a special code, no output is made and one character of the next internal code data is read out of the floppy disk FD1 (step 207) and processing from step 202 onward is repeated. If the result of conversion is not a special code, the code obtained by conversion is outputted and transferred to the host (step 208) via the serial interface 4, by way of example, one character of the next internal code data is read out of the floppy disk FD1 (step 207), and processing from step 202 onward is repeated. Since the present invention is constructed as described above, inputted data can be outputted as is, inclusive of characteristic codes, in a case where the input code system and output code system are the same. If the input code and output code differ, a code (characteristic code) not used in the output code system can be ignored and outputted.

Claims: An NC data input/output apparatus capable of using an ISO code and an EIA code and being operable to receive inputted NC data in ISO and EIA code format and to output that NC data in either ISO or EIA code format, employing an ISO/EIA code conversion method between the inputted NC data and the outputted NC data which is characterised by steps of: providing a first conversion table (EIT) for converting NC data inputted in either an ISO code or an EIA code into an internal code, and a second conversion table (ECT,ICT) for coverting an internal code into an ISO code or an EIA code; converting inputted NC data characters and numerals, each of which occurs in both the ISO code and EIA code, into the same internal code using the first conversion table (EIT), and converting characters and numerals which occur in only one of the ISO code and EIA code into respective separate internal codes using the first conversion table (EIT), and storing the same; designating, at the time of NC data output, in which of the ISO code and EIA code an NC data output is to be made; and converting the internal code into the designated code system for NC data output using said second conversion table (ECT,ICT). An NC data input/output apparatus according to claim 1, characterized in that said second conversion table has a first internal code conversion table (ECT) for converting an internal code into an EIA code and a second internal code conversion table (ICT) for converting an internal code into an ISO code, an internal code being converted into a designated code system using whichever one of said first and second internal code conversion tables (ECT,ICT) is appropriate in dependence upon said designated code system. An NC data input/output apparatus according to claim 2, characterized in that an undefined code is not outputted in said designated code system. An NC data input/output apparatus according to claim 3, characterized in that said first internal code conversion table (ECT) converts an internal code corresponding to an undefined code in the ISO code system into a special code, said second internal code conversion table (ICT) converts an internal code corresponding to an undefined code in the EIA code system into a special code, and an undefined code is not outputted in a designated code system by not outputting said special codes.

Inventors: SEKI MASAKI, TAKEGAHARA TAKASHI, YAMAKI KATSUNOBU, SEKI, MASAKI, TAKEGAHARA, TAKASHI, YAMAKI, KATSUNOBU, YAMAKI, KATSUNOBU FANUC DAI-3 VIRA-KARAMATSU
Applicants: FANUC LTD, FANUC LTD.
Application year: 1989
Main classification: G05B19
IPC codes: G05B19