You are on page 1of 13

IMPORT Program 1

IMPORT PROGRAM OF ISO TEXT

Inport program of ISO text is a special tool, which is supplied apart from CNC90 Installation disks.

Import program installation is realised on the following files :

IMPORT.EXE software file


IMPORT.LNG messages file in national language.

Software file IMPORT.EXE is generally installed in CNC90 working directory, defined by environment
ROOT variable.
Message file IMPORT.LNG should be installed in CNC90 message directory, defined by environment
DIRLING variable (generally is : DIRLING=C:\CNC90\LINGUE).

Software file is generally started :

1 by "External Program" available in CNC90 menu (see appendix C). Batch file IMP.BAT is available for
such process, installed in CNC90 system directory.

2 directly by operating system.

IMPORT.EXE program can't be started in shell to DOS.

IMPORT.EXE program can be started with or without argument. In the first case when the process is ended
control returns to operating system.
In the second case, argument should input return modes, on a complete path name. Assume following starting
example :
IMPORT E :\UTILI\TOOL.EXE <--'

Exit mode is executed as follows :


a) eventual disk change, if different from current one (in the example : E:)
b) eventual directory change, if different from current one (in the example : E:\UTILI)
c) TOOL.EXE procedure starting Import program can execute two types of operations :
1 files import in ISO format, available on any disk unity or
directory, in CNC90 files;
2 programs erasure from CNC90 files.
2 IMPORT Program APPENDIX F

Import program working modes are assigned to a commands file : IMPORT.CMD.


Commands file should be copied in the directory where IMPORT.EXE software file is installed.

IMPORT.EXE program is able to work if the following conditions are fulfilled :

a IMPORT.CMD command file existing;


b IMPORT.LNG message file existing (found on environ DIRLING);
c full setting of CNC90 environment variables;
d NAVETTA.CMD CNC90 command file existing, (found on environ ROOT).

COMMAND FILE STRUCTURE : IMPORT.CMD

IMPORT.CMD file is in ASCII format, with established fields length.


Each file record :
- is headed by '<' character
- is ended by characters sequence : '>' + CR + LF.

First 6 records head the file : define working general modes, without assigning executing files.

Records numbered from 7° till file end are definition records of operating command : either import or erasure
program.

1° RECORD

<78 CHAR>
Program import directory of ISO source.
If all spaces are defined : current directory is considered valid.
If defined, directory must exist.
Setting example :
<A:\EXAMPLE >

2° RECORD

<78 CHAR>
Writing directory of IMPORT.ERR error file.
If all spaces are defined : current directory is considered valid.
If defined, directory must exist.
Setting example :
<A:\EXAMPLE\ERRORS >
IMPORT Program 3

3° RECORD

<4 CHAR> (<RRCC>)


RR = messages display line
CC = messages display column
RR and CC should be defined by two characters each.
RR valid values : from "01" to "25";
CC valid values : from "01" to "80".

If RR=" " (spaces) : IMPORT.EXE program does not execute displays.

Setting examples :
<1004> define : RR=10, CC=4
< 00> define : display not present.

4° RECORD

<4 CHAR> (<C1C2>)


C1 and C2 are significant only if 3° record defines display line and column.
C1 = blackground colour
C2 = text colour.

C1 and C2 should be defined by two figures each, with values valid from "00" to "15".
In case of C1 and C2 value equal or not correct, default value are assumed : C1="00" (black)
and C2="07' (white), with white writings on black background display.

Setting examples :
<1201> define : C1=12 (colour : light red), C2=1 (colour : blue).
<1212> define C1=C2=12 : in this case default values are set C1="00" e C2="07".
4 IMPORT Program APPENDIX F

5° RECORD

<20 CHAR> :

1° CHAR Defines video mode set when calling import program :


0 = video text mode on 80 columns
1 = graphic mode VGA.
2° CHAR Defines if mother programs should be found in an external directory or
in CNC90 files :
0 = external mother program
1 = mother program in CNC90 file

In case of program from external directory: record 1 imposes research


directory.
In case of program from CNC90 file : research takes place according to
environment variable DIRSOR set.
3° CHAR Defines working mode of Editor-CNC90 program :
0 = Editor-CNC90 non interactive
1 = Editor-CNC90 interactive
Non interactive editor setting allows to start automatic setting procedure.
Interactive editor setting is available for import procedures tests.
4° CHAR Characters font selection for VGA video mode :
0 = default Font selection
1 = Font 1-TPA
3 = Font 3-TPA
5°- 20° CHAR Reserved for future developments. Characters from 5° to 20° must be
defined by space character, or figures from "0" to "9".

6° RECORD

<3 CHAR>
extension of all mother programs. Extension is significant only in case of mother programs
loading from external directory.
Setting examples :
<SRG> all mother programs should have extension "SRG".
< > mother programs have no extension
IMPORT Program 5

from 7° to'N RECORD

<NNN PrgSONS PrgMATHER DimL DimH DimS Comment Command/answer>

field description format

NNN progressive number of command record : 3 CHAR


"001" on first command record
"002" on second command record
and so on.
PrgSON program name from : 12 CHAR
a) enter CNC90 file (if import command)
b) delete from CNC90 file (if erasure command)
PrgMOTHER ISO program name to be defined 12 CHAR

DimL significant only on import command : defines son program length 8 CHAR
dimension. Related Unity measure : [mm] or [inch], as 4.3 or 5.2
programmed on mother program.
Non significant if defined by spaces.
DimH significant only on import command : defines eight dimension of 8 CHAR
son program. Related Unity of measure : [mm] or [inch], as 4.3 or 5.2
programmed in mother program.
Non significant if defined by spaces.
DimS significant only on import command : defines thickness 8 CHAR
dimension of son program. Related Unit of measure : [mm] or 4.3 or 5.2
[inch], as programmed on mother program.
Non significant if defined by spaces.
Comment significant only on import command : defines son program 25 CHAR
comment.
Non significant if defined by spaces.
Command character of command definition or response of command 1 CHAR
Answer execution:
C = import command
G = import command + compiling
K = erasure command

c = correct setting
g = correct setting + compiling
k = correct erasure
6 IMPORT Program APPENDIX F

IMPORT.CMD file EXAMPLE

<A:\EXAMPLE >
<C:\CNC90\MOD1\TEMPOR >
<1010>
<0015>
<1000 >
<SRG>
<001PROOF K>
<002 NOME 1000.0001000.000 30.000 IMPORTATION n.1 C>
<003PR1 NOME 1000000800.000 IMPORTATION n.2 G>

IMPORT.EXE PROGRAM PROCESSING

1 IMPORT.CMD file should be in the same starting directory of import program.


Suppose IMPORT.EXE is installed in C:\CNC90 directory: command program too should be in C:\CNC90.
Errors conditions found in this first stage cause :
a) video setting in text way on 80 columns;
b) warning message display;
c) import program exit.

Possible error conditions are :

(1) ERROR : environ ... not found


environment variables used by CNC90 program have not been set.

(2) ERROR : TASK 2 IMPORT procedure can't be started


procedure loaded on CNC90 secondary task, when a procedure is already running on main task.

(3) TASK 1 IMPORT procedure can't be started


Procedure loaded on CNC90 main task, when a procedure is already running on secondary task.

(4) IMPORT.LNG file not found


IMPORT.LNG message file can't be read. Remember that messages file is in the directory of DIRLING
environment variable
(normally : DIRLING=C:\CNC90\LINGUE).

(5) NAVETTA file backup not allowed


(7) NAVETTA file backup not allowed
(6) NAVETTA file not found
CNC90 navetta file can't be read and/or written. Navetta file is recorded on working disk when starting
CNC90 and deleted when quitting operating system.
IMPORT Program 7

(9) IMPORT.CMD file can't be loaded


IMPORT.CMD command file can't be read. Remember that command file is recorded in the directory
where IMPORT.EXE software program is installed: generally it is in CNC90 working directory.

2 first 6 heading records are read by command file : in case of non significant data processing is aborted
and a warning message is displayed.
Error conditions found in this first stage cause :
a) video setting in text way on 80 columns;
b) warning message display;
c) import program exit.

Possible error conditions are :

(21) Syntax ERROR record n° ...


Format error of displayed record. Message can correspond to :
a) bad record length;
b) bad heading ("<") or record exit (">") character;
c) bad format in record 1 or 2 field , respectively : mother program and errors file recording directories.

(23) ERROR : directory of reading out programs not found


Selected directory does not exist. Error refers to check of record number 1.

(24) ERROR : deposit directory for errors files not found


Selected directory does not exist. Error refers to check of record number 2.

(25)line and/or column ERROR : wrong visualisation


Bad value in defined line and/or column for displaying. Error refers to check of record number 3.

(26) Colour ERROR : bad background and/or text colour


Bad value in selected colour for displaying. Error refers to check of record number 4.

(27) Not significant value/s ERROR record n° ...


Error refers to check of displayed record.
On record number 5, message may mean :
a) 1° character defined different from "0" and "1"
b) 2° character defined different from "0" and "1"
c) 3° character defined different from "0" and "1"
d) 4° character defined different from "0" and "1" and "3".
8 IMPORT Program APPENDIX F

(29) ERROR : video mode can't be set different than starting one
Error refers to record number 5 checking and means a discordance between video mode setting and
setting defined on the 1° character of the field introduced in the record.

(28) ERROR : IMPORT.CMD file not full


IMPORT.CMD file is defined by a records number smaller than 6.

3 reading of first command record (record number 7) is started:


Command is interpretated and the corresponding procedure is started. Commands can be three :

command C
requires mother program import, with eventual reintroduction of :
name (field data : PrgSUN)
dimension/s (fields data : DimL, DimH, DimS)
comment (field data : Comment).

Each reintroduction can be input in a independent way..


PrgMOTHER program import in PrgSUN is done calling Editor-CNC90 program, with interactive or
non interactive mode as defined in record 5.

Import procedure requires PrgSUN introduction in CNC90 program file, updating programs directory
file. In particular : PrgSUN program is not compiled. Used CNC90 environment should be defined on
set environment variables.
Import procedure may cause error situations; in general, the following errors can be found: ISO text
format, ISO text incongruency with machine parameters, working disk entering.

command G
requires mother program import on PrgSON, with the same modes examined for command C :
PrgSON is also compiled.

command K
requires erasure of PrgSUN program found in CNC90 file..
IMPORT Program 9

4 when the command is ended as explained in preceding point 3, command character written in current
record :

a) is substituted with correspondent character of small letter, if import/erasure has not found error situation;
b) on the contrary it is not changed.

Procedure checks following record, and starts again processing.

Procedure goes on in this way untill defined commands on IMPORT.CMD file are fulfilled.

When reading and processing commands listed in IMPORT.CMD file current operating mode and warning
messages are displayed only if IMPORT.CMD file allocates a video position messages management (record
number 3).
On the contrary video messages are not displayed.

Warning messages display lasts 2 seconds and a beep is heard : during visualisation, current processing can
be interrupted; press ESC to abort IMPORT.EXE program processing.

In case of imports/erasure programs procedures wrong, such conditions are stored on an error file. The file is
IMPORT.ERR and it is recorded on the second record of command file directory. In the above example :
C:\CNC90\MOD1\TEMPOR.
Error file format is explained in the following paragraph.
10 IMPORT Program APPENDIX F

Assume again the preceding example on IMPORT.CMD command file.

<A:\EXAMPLE >
<C:\CNC90\MOD1\TEMPOR >
<1010>
<0015>
<1000 >
<SRG>
<001PROOF K>
<002 NOME 1000.0001000.000 30.000 IMPORTATION n.1 C>
<003PR1 NOME 1000000800.000 IMPORTAZION n.2 G>

Suppose to start IMPORT.EXE program from CNC90 working directory, located on environ
ROOT=C:\CNC90.

IMPORT.CMD command file should be available in the directory : C:\CNC90.

IMPORT.CMD file is defined by 9 record : the first 6 for heading and the following 3 for commands.
Directory for IMPORT.ERR error file recording is : C:\CNC90\TEMPOR.
Mother program allocation are :
a) read out from external tracks;
b) reading directory : A:\EXAMPLE;
c) common extension : SRG.

When IMPORT.EXE program is started video is set in VGA graphic mode.


Display are addressed to line 10 and column 10, with colour setting : black background (colour : 0) and light
white writings (colour : 15).

Editor-CNC90 program is called in not interactive mode.

Assume now 3 commands record, each displayed here below.

<001PROOF K>

it is an erasure command on PROOF command, found in CNC90 files.

<002 NOME 1000.0001000.000 30.000 IMPORT n.1 C>

it is an import command NAME mother program. Mother program is read as follows :


A:\EXAMPLE\NAME.SRG
IMPORT Program 11

Son program is loaded with the same name : NAME.


Dimensions defined for son program are :
length =1000 mm
height =1000 mm
thickness =30 mm.
Comment assigned to son program is : "IMPORT n. 1".

<003PR1 NAME 1000000800.000 IMPORT n.2 G>

it is an import and compiling command on NAME mother program. Mother program is read :
A:\EXAMPLE\NAME.SRG

Son program is imported with name : PR1.


Dimensions defined for son program are :
length =1000 mm
height =1000 mm
thickness =same as previous one
Comment assigned to son program is : "IMPORT n. 2".

DIAGNOSTIC MESSAGES WHEN READING AND EXECUTING A COMMAND


Error situations that can be found, when reading or executing a command, are here examined, as defined on
IMPORT.CMD file.
Errors display is listed here after : indicating error number and message.

(50) Syntax error


Bad format in command record read by IMPORT.CMD file. Possible errors are: unvalid record heading ("<")
or losing (">") character.

(51)Bad numeric expressions


Possible errors :
b) field NNN non numeric;
c) piece dimension fields (DimL, DimH, DimS) non numeric and non defined with spaces.

(52) Bad record length


Record is defined by a bad characters number.

(53) Bad command field


Bad character in command field.

(54) Processing cannot be performed


An error is found in import or erasure processing : it is an error checked in Editor or CNC90 compiler
mode.
12 IMPORT Program APPENDIX F

When calling Editor-CNC90 module in non interactive mode, diagnostic error is recorded on
CNC90.ERR error file, with queuing mode of following diagnostic messages.
CNC90.ERR file is recorded in directory defined by DIRTMP environment variable.

Diagnostic situations may correspond to :


a) bad working disk access;
b) bad ISO text format;
c) bad geometric or technological expressions, in ISO format programming;
d) bad program compiling..

(55)NAVETTA file not found or not modifiable


Displays an error situation in CNC90 navetta file :
a) file not found, or
b) disk error when reading and/or writing.

(56) Communication file cannot be opened


An error is checked when recording an auxiliary file on working disk.
Current file is named AUX2 and it is recorded in case of import command.

(57 IMPORT.CMD file not found or not modifiable


Displays an error situation in IMPORT.CMD command file :
a) file not found, or
b) disk error when reading and/or writing.

(58) Program name not specified


Displays that mother program name has not been defined in import command.
Displays that son program name has not been defined in erasure command.

(59) Mother program not found


Displays mother program not found with import command.

(60) Bad IMPORT.CMD file structure


Command record read by IMPORT.CMD file is defined by an empty string.

(61) Non progressive record number


Record NNN field is not progressive with reference to current number of command record.

(62) Records number exceeding 200


IMPORT.CMD file is defined by a number of commands record greater than 200. Import program
processing is quitted by this message.
IMPORT Program 13

ERROR FILE STRUCTURE : IMPORT.ERR

IMPORT.ERR file is in ASCII format, with established length fields.


Each file record ends with the following sequence of characters : CR + LF, and has the following format :

<NNN ERROR description of COMMAND code>

field description format

NNN record progressive number (corresponds to NNN 3 CHAR


field in IMPORT.CMD commands file record)
ERROR description message explaining error : displays error number 50 CHAR
and a part of the description
COMMAND code command cede, as defined in IMPORT.CMD 1 CHAR
command file

Current records number is defined by errors number found.

You might also like