Sie sind auf Seite 1von 62

DNC 50 SPECIFICATIONS

CONTENTS

Page

Chapter 1 DOCUMENT PURPOSE.

Chapter 2 REFERENCE DOCUMENTS.

Chapter 3 FUNCTION, CAPABILITIES AND LIMITATIONS.

Chapter 4 MODE OF OPERATION AT THE CNC.

Chapter 5 DNC PROTOCOL.

1 Internal characteristics. 5.1


2 Terminology definition. 5.1
3 Special characters. 5.2
4 Message transmission. 5.5
5 Communication. 5.9

Chapter 6 COMMANDS.

1 Notation. 6.1
2 Text of the header pack. 6.2
3 Text packs. 6.2
4 Send or request. 6.3
5 Command groups. 6.3

6 Group of tables TAB. 6.4


MPG General machine parameters.
MPS Spindle machine parameters.
MP1 Machine parameters for the RS1.
MP2 Machine parameters for the RS2.
PLC PLC machine parameters.
ORG Zero offset table.
MX1-MX5 Machine parameters for the axes(1-5).
TLF Tools.
GEO Geometry table.
TO Tool offset table.
TMZ Tool magazine.
AUM Miscellaneous M function table.
ML1-ML5 Leadscrew compensation table.
MC1 Cross compensation table.
GUP Global user arithmetic parameters.
LP0-LP6 Local user arithmetic parameters.

7 Group of variables VAR. 6.7


Copy of the section of the document "
Specifications of the 8050" regarding variables.

8 Group of PRG programs. 6.8


DEL Delete
TRN Transfer.
DIR Directory.
INF Transfer a part-program from the PC
into the CNC for machining in infinite mode.
DIG Transfer to the PC a part-program
being digitized at the CNC.

9 Group of user defined pages (screens) PAN,


symbols SIM. 6.13

DEL Delete.
TRN Transfer.
DIR Directory.

10 COM Group for machining and maintenance. 6.16

KEYSEQ Keystroke sequence of the CNC


11 PLC Group. 6.17

I Inputs
O Outputs
M Marks
R Registers
T Timers
C Counters

Appendix A CONNECTIONS.

Appendix B CNC MACHINE PARAMETERS.

Appendix C ERRORS.

Appendix D ASCII characters.

Appendix E Complete C-language sample program for CRC-16


calculation.
DNC 50. Specifications Page 1.4
─────────────────────────────────────────────────────────────────

CHAPTER 1 DOCUMENT PURPOSE.

The purpose of this internal document is to define all the


characteristics of the DNC:

Capabilities
Protocols
Commands
Connections
etc ...

09/90
DNC 50. Specifications. Page 2.1
─────────────────────────────────────────────────────────────────

CHAPTER 2 REFERENCE DOCUMENTS.

Specifications of the 8050

9/90
DNC 50. Specifications. Page 3.1
─────────────────────────────────────────────────────────────────

CHAPTER 3 FUNCTION, CAPABILITIES AND LIMITATIONS.

DNC is one of the means available at the CNC to communicate with


a PC via an RS-232 or RS-422 serial line.

OTHER COMMUNICATION METHODS (GENERAL PERIPHERAL):

The CNC can also communicate via its serial lines by means
of simpler protocols such as XON/XOFF or by controlling the
data flow via the RTS and CTS lines of the RS-232; but it
can only transfer part-programs and tables. This
communication mode is called general peripheral mode and can
be used to connect any peripheral device having an RS-232
port and this type of simple protocols such as a printer,
punched-tape reader, teletypes or data storage devices like
floppy drives etc. However, the mode of operation will be
fully manual and both interconnected devices must be "told"
the type of operation to be performed.

THE DNC IS THE IDEAL MEAN IN THESE TWO CASES:

- Computer control of flexible-cell type automated systems.

- Connection with an IBM compatible PC via the


communications software developed by FAGOR. This software
has the advantage that it allows data transfer to be
initiated at either end without operating at the other and
it will also be connected to the various programs such as
editors, PLC program debuggers, graphic part-program
simulation, etc, developed by FAGOR for those computers.

TRANSFERABLE DATA:

- Programs, including that of the PLC.

They can also be transferred in general peripheral mode.


This way, the PC can be used as a massive data storage
device or to edit new programs or generate them via CAD/CAM.
This feature makes it possible to execute programs larger
than the memory space available at the CNC. This is known as
infinite program execution. It is also possible to receive
the program generated when digitizing a part with the CNC
which can also become larger than the memory space available
at the CNC.

9/90
DNC 50. Specifications. Page 3.2
─────────────────────────────────────────────────────────────────

It is also possible to request the directory or delete a


program.

- Tables.
They can also be transferred in general peripheral mode.
It can be used to save machine parameters and other machine
configuration data or in flexible cells, as back-up.

9/90
DNC 50. Specifications. Page 3.3
─────────────────────────────────────────────────────────────────

- Customer-defined screens (pages) and symbols.


They can also be transferred in general peripheral mode.
It can be used to keep back-up copies of the customer
defined screens and symbols in an external device.
These operations (transfer, directory and deletion) can only
be initiated at the CNC.

- Variables.
DNC only.
Basically for cells.

- PLC data.
DNC only.
For cells and PLC program debugging.

- Machining commands
DNC only.
For example, remote start-up of a program execution. For
cells.

FUNCTIONAL CHARACTERISTICS:

- Point to point link between PC and CNC.

- Initiation of the communication process from either end;


PC or CNC.

- Data transfer: half-duplex.


That is, although there are two data lines (one to transmit
and one to receive), it is not possible to receive a message
in one direction while sending another message in the other
direction. However, it is possible to receive
acknowledgement characters sent by the other end.

- Capability to abort communications from any end indicating


it to the other end.

- Two simultaneous DNC lines.


It is possible to execute DNC commands on both lines
simultaneously. For example, one line can be dedicated to
program manipulation: send, receive, etc. and the other to
control functions in automated manufacturing cells.

- Two interfaces:
RS-232 for normal connections.

9/90
DNC 50. Specifications. Page 3.4
─────────────────────────────────────────────────────────────────

RS-422 for "noisy" industrial environments or for


transmitting to great distances.

The technical characteristics are summarized in the first section


of chapter 6.

9/90
DNC 50. Specifications. Page 4.1
─────────────────────────────────────────────────────────────────

CHAPTER 4 MODE OF OPERATION AT THE CNC

The DNC operating mode at the PC depends on the software


developed for that PC, therefore it is beyond the scope of this
manual.

The CNC user, the part-program or the PLC program interact with
the DNC as follows:

CNC STATUS WINDOW.

When DNC communication is in progress, this window will


display the letters DNC followed by a 1 or a 2 or both
indicating the line being used at the time.

MESSAGE WINDOW FOR THE OPERATOR.

The PC can send messages to the operator and they will


appear in this window preceded by the letters DNC. This is
the same window where the part program displays its
messages. Therefore, it will remain on until another one is
received from either the PC or the part-program or it is
deleted using the keyboard of the CNC.

ERROR WINDOW.

The PC can send an error message to the CNC stopping the


execution of the program and displaying it in this window.

OPERATING SYSTEM.

By means of the operating system, the operator can:

- Send or receive programs or tables from the CNC:

Send:
COPY P6 IN SERIAL LINE (1/2) (P6 -> RS)
SAVE IN SERIAL LINE (1/2) (Table -> RS)

Receive:
COPY SERIAL LINE (1/2) IN P6 (RS -> P6)
LOAD SERIAL LINE (1/2) (RS -> Table)

- See the program directory of the PC:

DIRECTORY SERIAL LINE (1/2)

9/90
DNC 50. Specifications. Page 4.2
─────────────────────────────────────────────────────────────────

During communications, it will display the number of packs


being sent or received. It is also possible to abort
communications. The maximum number of characters per pack is
1024. It is possible to use a serial line while machining or
simulating a part.

9/90
DNC 50. Specifications. Page 4.3
─────────────────────────────────────────────────────────────────

MACHINING IN INFINITE MODE

It is possible to machine a part while the program is being


received via serial line. This makes it possible to execute
a program larger than the memory space available at the CNC
such as those generated via CAD/CAM or digitizing. The
screen for the serial lines will display the number of text
characters being received.

DIGITIZING

This feature makes it possible to send to the PC the program


generated by the CNC while digitizing a part with a probe.

SCREEN FOR SERIAL LINES, DNC ON/OFF

This method disconnects the DNC temporarily, thus protecting


the machine against commands sent by a PC via DNC while the
machine is operated manually. If a communication initiated
from the PC is in progress, it will be aborted.

CHAPTER 5 DNC PROTOCOL

This chapter describes the communications protocol between a


FAGOR 8050 CNC and a PC via DNC regardless of the content of the
information wished to transmit. Therefore, it deals with what is
called "the data link level" which guarantees their integrity.

1. INTERNAL CHARACTERISTICS.

The characteristics of this powerful protocol are:

- Asynchronous communications.

- Character oriented protocol.


There are a number of special characters which cannot be
transmitted as data and have a control function.
It is not necessary to use the data control lines: RTS, DTR,
CTS and DSR of an RS-232 line for controlling purposes.

- Powerful transmission error detection system.


Each data pack ends with various check characters following
the CRC-16 algorithm which has an undetected error rate of 1
in a 1,000,000,000 of transmission errors.
9/90
DNC 50. Specifications. Page 4.4
─────────────────────────────────────────────────────────────────

- Automatic error recovery.


On those lines subject to electromagnetic interference, this
protocol automatically resends those packs containing errors
without the need to restart communications.

2. TERMINOLOGY DEFINITION

All along this manual the following terms will be used:

COMMUNICATION: Is the complete transfer of an information between


the elements linked by the DNC.
There can be two types:

- SEND data: Send data to the other element. It requires a


single message to be transferred.
- REQUEST data: Request data from the other other element
and receive the response data sent by the Slave. It requires
the transfer of two messages, one from the Client to the
Server indicating the request and another one from the
Server to the Client with the requested data.

CLIENT: Is the element, CNC or PC, initiating the communication.

SERVER: Is the term opposite to Client.

9/90
DNC 50. Specifications. Page 5.1
─────────────────────────────────────────────────────────────────

MESSAGE: Is any simple information (data) going from a PC to the


CNC or vice versa. See section 3.
Message examples could be:
Request a part-program.
Send a part-program.
Send a remote control command.
...etc.

ORIGIN MESSAGE: Message that the Client sends to the Server.


It can be of two types: Send data or Request data. In a Header
Pack, the first character after SOH indicates whether it is to
request (R) or to send (S).

RESPONSE MESSAGE: Is the one generated by the Server when the


Origin Message is a data request.
When the Server breaks the transmission of the Origin message, it
sends to the Client a Response Message indicating the cause of
the break even when the Origin Message is to send data.

MASTER: Is the element sending a message.


Do not mistake it with the concept of Client.

SLAVE: Is the element opposite to the Master.


Do not mistake it with the concept of Server.

PACK: When a message has more than 1024 characters, it is divided


into packs. Thus, each message could contain one or more packs.

HEADER PACK: Is the first pack of a message and it defines the


command to be executed.

3. SPECIAL CHARACTERS

The DNC protocol uses several ASCII communication characters


which do not represent any letter, number or other normal
keyboard character. In order to show them we use the following
mnemonics:

Mnemonic Meaning

ENQ (Enquiry Character - ASCII character 5)

It has two functions:


a- initiates the DNC protocol in an attempt
to control the communications line, or
b- indicates that the last acknowledgement
has to be resent.
9/90
DNC 50. Specifications. Page 5.2
─────────────────────────────────────────────────────────────────

In the case of a collision, i.e. when the CNC


and the PC try to initiate the communication
at the same time, the PC will have priority.

SOH (Start Of Header Character - ASCII character 1)


Start of the Header Pack.

STX (Start Of Text Character - ASCII character 2)


Start of the text pack.

ETB (End Of Transmission Block - ASCII character 23)


All packs except the last one must end with ETB.

ETX (End Of Text Character - ASCII character 3)


Only the last pack must end with ETX.

CAN (Cancel - ASCII character 24)


Indicates that the data transmission has finished
too soon. After the Server interrupts the
reception of an Origin Message, it sends a message
with the cause of the interruption.

NAK (Negative Acknowledgement - ASCII character 21)


The Server indicates that it has detected an error
when transmitting the previous pack.

EOT (End Of Transmission Character - ASCII character 4)


End of transmission of a message.

The protocol also uses three normal ASCII characters: the ;, the
0 and the 1:

; (ASCII character 59)


Used to indicate that the DNC is active but it is
not ready to receive any packs or to be connected
(whichever the case). When the receiving unit is
ready, it will send the acknowledgement that was
missing.

0 and 1 (ASCII characters 48 and 49)


Used as alternate positive acknowledgements of the
packs.

9/90
DNC 50. Specifications. Page 5.3
─────────────────────────────────────────────────────────────────

Other normal characters are used for the CRC-16:

CRC-16 (Cyclic Redundancy Check characters)


Check characters following the CRC-16 algorithm.
They are four characters transmitted immediately
after the end of pack character whether it is ETB
or ETX.
The calculation of these check characters is based
on the CRC-16 polynomial. The result of the CRC-16
is a 4-digit hexadecimal number (16 bits) which is
transmitted as four ASCII characters carrying out
the following transformation:

HEXADECIMAL DIGIT ASCII CHARACTER

0 0
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
A :
B ;
C <
D =
E >
F ?

To obtain this transformation, just add 48, which


is the ASCII code for 0, to each digit.

First the character corresponding to the least


significant digit is transmitted.
The calculation of the CRC-16 begins with the
first character after SOH or STX and it includes
the ETX or ETB. Appendix B shows a C-language
implementation for the calculation of the CRC-16.

We will use other special characters, comma and line feed. These
are not characters of the protocol but text separators:

, (Comma - ASCII character 44)


Separator character for parameters.
9/90
DNC 50. Specifications. Page 5.4
─────────────────────────────────────────────────────────────────

LF (Line feed - ASCII character 10)


Line feed.

9/90
DNC 50. Specifications. Page 5.5
─────────────────────────────────────────────────────────────────

4. MESSAGE TRANSMISSION

The normal sequences follow the thicker lines. The unusual


sequences or error recovery sequences follow the lighter lines.
The highlighted characters (in "reverse video") are the responses
of the slave and the normal characters (not highlighted) are the
ones sent by the master.

NOTE:
In view that at the first stage of the study of this manual
it could be difficult to understand the diagram, we will
describe an example of errorless communication.

When make references of the point 3 type in this section, it


indicates the positions numbered in fig.?.

9/90
DNC 50. Specifications. Page 5.6
─────────────────────────────────────────────────────────────────

The sequence is as follows:

Master Slave

ENQ Connection stage


0

SOH header text ETB CRC-16 Header Pack


1

STX text ETB CRC-16 Text Packs


0
.
.
.
.
.
.
STX text ETX CRC-16
0 or 1

EOT Disconnection stage

The element on the left wants to transmit a message. To do so it


follows these STAGES:

1st. Connection stage.

The element that wants to be the Master, transmits the ENQ


character. Point 1.
If the second one is ready, it will respond with the 0
character. Point 2.
From this moment on, the first one is the Master and the
second one the Slave.

2nd. Header Pack.

The Master will transmit a Header Pack indicating the


command to be executed. Points 3, 4, 5 and 6.
The Slave will verify the CRC-16 and the meaning of the
command. If everything is correct, it will acknowledge the
pack transmitting the 1 character. Point 2.

9/90
DNC 50. Specifications. Page 5.7
─────────────────────────────────────────────────────────────────

3 Text Packs.

If the current command requires a text transfer such as


program lines or tables lines, it will transmit successive
packs of text. Points 3, 4, 5 and 6.
The Slave will verify the CRC-16 and that no other problems
arise such as memory overflow and if everything is correct,
it will acknowledge each one of the Text Packs transmitting
a 0 or a 1 alternatively. Point 2.

4 Disconnection Stage.

The last pack, ending with ETX, and after been acknowledged
by the Slave, the Master transmits the EOT character as end
of the message transmission. Fig. 1 point 8.

THE FOLLOWING SPECIAL CASES MIGHT COME UP:

a- Negative acknowledgement NAK.

Point 10.
It is possible that due to electromagnetic interference onto
the data transmission line, some characters may arrive
altered to the Slave or, even, not arrive. The Slave will
detect this fact because the CRC-16 that it calculates will
not match the one received. The Slave will ignore the pack
and will warn the master transmitting the NAK character to
it. Next, and if the maximum number of attempts has not been
exceeded (3 at the CNC), the pack will be resent by the
Master.

b- Invalid acknowledgement by the Slave.

Point 16
It is possible that the acknowledgement of a pack by the
Slave (be it a 0, a 1, a NAK or the ; character) is not
properly received by the Master. In this case, the Master
will send an ENQ character indicating to the Slave to resend
its last acknowledgement or the ; in its case.

c- The Master does not receive the acknowledgement or the


; character.

Point 17.
9/90
DNC 50. Specifications. Page 5.8
─────────────────────────────────────────────────────────────────

When the Master transmits a pack or an ENQ, a timer is set


(for 5 seconds in the case of the CNC). If this time is
elapsed without receiving an acknowledgement and the maximum
number of attempts has not been reached, the Master will
transmit an ENQ.

9/90
DNC 50. Specifications. Page 5.9
─────────────────────────────────────────────────────────────────

There could be two cases:


- The Master does not receive the acknowledgement or
the ; because it was lost due to an electromagnetic
interference.
The Slave will respond resending the previous
acknowledgement or ;.
- The Slave has not yet sent the acknowledgement, may
be because it is not done processing the pack or, may
be, because in the disconnection stage it is not ready
to be reconnected.
The Slave will respond with the ; character. Point 13.
It will send the missing acknowledgement when the
condition retaining it is no longer met. Point 2.
The ; characters do not increment the count of
attempts.

d- One of the elements breaks the communication by


transmitting the CAN character.

There are several causes for communications to be broken:

- The Slave will abort when the command or the data is


incorrect. Point 15.

- The Master will abort when a limited number of


consecutive errors occur: NAK, invalid acknowledgements
or not received. Point 12.

- The Slave detects that a maximum time period has


elapsed since the last character was received. Point
15.
At the CNC, this time period is 15 seconds.

- It is also possible to abort by user's choice at any


of the elements.

If a program is being loaded at the time of the communication


break, the CNC will label that program as non-executable
(attribute).

When the Server aborts the reception of the Origin Message,


it automatically sends a message indicating the error.

e- Both ends decide to connect at the same time.

9/90
DNC 50. Specifications. Page 5.10
─────────────────────────────────────────────────────────────────

In this case, they will each send an ENQ character. Since


the computer has priority, it will ignore the receiving ENQ
and the CNC will acknowledge its Slave condition by sending
a 0. Points 19 and 20.

9/90
DNC 50. Specifications. Page 5.11
─────────────────────────────────────────────────────────────────

5. COMMUNICATION

This term has been already defined at the beginning of this


chapter.
A communication to send data only requires the transmission of
one message. A communication to request data requires the
exchange of two messages and it will follow this diagram:

Client Server

Master Slave Origin Message

ENQ
0
SOH R,command, ETX CRC-16
1
EOT

Slave Master Response Message

ENQ
0
SOH S,command, ETB CRC-16
1
STX text ETB CRC-16
0
.
.
.
.
.
.
STX text ETX CRC-16
0 or 1
EOT

Observe that:

a- The first character after SOH in the Header Pack of the


Origin Message is an R which indicates that it is a
communication to Request data. However, in the Response
Message is an S which indicates that this second message is
only to Send data.

b- The command for both messages is the same. See diagram.

9/90
DNC 50. Specifications. Page 5.12
─────────────────────────────────────────────────────────────────

c- The roles of Master and Slave alternate from one stage to


the other but the roles of Client and Server remain the
same. If the Server breaks the transmission of the Origin
Message, it transmits the Response Message, even when the
communication is to send data.

9/90
DNC 50. Specifications. Page 6.1
───────────────────────────────────────────────────────────────

CHAPTER 6 COMMANDS

This chapter describes the commands that can be executed via DNC
and the format required for each of them.

1. NOTATION

All along this chapter, we will use the following terms:

- The comma , is the field separator for the Header Pack.


When sending the PRG TRN, it includes the comment of the
program leaving all its commas out.

- A blank space is indicated by the mnemonic SP.


Whenever it is possible to transmit a blank space in a line
of text, of program or of directory, it will also be
possible to transmit several blank spaces. For example, it
is the same to transmit:
G53 SP X0
as to transmit:
G53 SP SP SP X0

This can make it easier to transmit tables formatted for


editing. As a matter of fact, the CNC always transmits
several blank spaces in order to line up the fields of lines
of text. However, most of the examples in this chapter will
only use one blank space in order to simplify the
explanations.

- The line feed, which will be shown as LF, is the line


separator.

- By means of the SP and LF symbols, we will indicate when


it is necessary to transmit a blank space or a line feed
during transmission.

- To show the special characters of the protocol, we will


use the notation described in the corresponding section of
the chapter dealing with protocol in this manual.

- When a numeric field has a variable length, we will


indicate the maximum number of digits it may have. For
example, we indicate that a zero offset may have a value
between 0 and 99999.99999 or 0 and -99999.99999 by using the
notation 5.5.

9/90
DNC 50. Specifications. Page 6.2
───────────────────────────────────────────────────────────────

- The mnemonics used by the DNC have been defined from the
English initials of their meanings.

- All mnemonics use upper-case (capital) letters.

9/90
DNC 50. Specifications. Page 6.3
───────────────────────────────────────────────────────────────

NOTE REGARDING THE EXAMPLES IN THIS CHAPTER

An information can be sent on one's own initiative or by the


other element's request.
In those examples where the sending of data is originated as
a response to a previous request, if we eliminated the
Request section, they would become examples of data being
sent spontaneously.

2. TEXT OF THE HEADER PACK

This text specifies all necessary data in order to identify the


command to be executed. It contains the following fields ended
with a comma:

- The mnemonic R or S indicating whether it is to Request or


Send data.

- The mnemonic of the Group.


(PRG,TAB,VAR,..etc).

- The mnemonic identifying a subgroup if there is any.


(TRN,DIR,DEL,..etc).

- Various parameters specifying options and other data.

For example, the text of the header pack to delete the part-
program number 016247 would be:

S,PRG,DEL,016247,

Note that the last parameter also ends with a comma.

When not wishing to use an optional parameter, the corresponding


field will be omitted but maintaining the separation comma.
For example, to indicate a transfer of the program number 5
without its comment, with all its attributes MX and overwriting
the old version, it would be:

S,PRG,TRN,000005,D,,MX,

if, on the other hand, it is desired to have an error issued when


program 5 already exists, the command would be:

S,PRG,TRN,000005,,,MX,

9/90
DNC 50. Specifications. Page 6.4
───────────────────────────────────────────────────────────────

3. TEXT PACKS

When a message is of the "Send Data" type, the data can go in the
header pack or, depending on the command (as it is in the case of
a program transfer) in later text packs. A text pack will contain
complete lines and if the last line does not fit completely, it
will be sent in the next pack.

4. SEND OR REQUEST

As seen in the chapter of this manual dealing with protocol, the


communications can be of two types:

Mnemonic Meaning

S Send data.

R Request data.
To request data and receive the response sent by the
other element.

The response is identical to a "Send Data" type


communication initiated at the second element and
trying to transfer the same data.

5. COMMAND GROUPS

The commands are classified into different groups identified by


their mnemonics.

Mnemonics Meaning

TAB Table.

VAR Variable.

PRG Program.

PAN User defined screen (page)

COM Command for machining, etc.

PLC PLC commands.

9/90
DNC 50. Specifications. Page 6.5
───────────────────────────────────────────────────────────────

6 TAB GROUP

Related documentation:
"Specifications of the 8050 CNC"

The CNC sends the tables with their fields lined up using blank
spaces. However, it accepts tables from the PC which are not
formatted this way.

Notation:

The specification of a table line can begin with a letter.


Each table has a different range of lines indicated by two
numbers between dashes (hyphen -). For example, the GUP
table is formed by 100 elements numbered from P100 and P299.
In some tables, it is possible to indicate (by machine
parameter) that there are less than the maximum number of
lines.

Mnemonic Meaning.
Line specification and data format.

GUP Global arithmetic parameters for the user.


P100-299 value.
The value is indicated with 6.5 or in scientific
notation if exceeded.

LP0-6 Local arithmetic parameters for the user.


P0-25 value.
The value is indicated with 6.5 or in scientific
notation if exceeded.

TO Tool Offsets.
M Model
D1-255 R5.5 L5.5 I5.5 K5.5
T Model
D1-255 X5.5 Z5.5 R5.5 F2 I5.5
K5.5

TLF Tool.
T4 D3 F0 N5 R5.2 N/S R/E/A
The fields being:
Tool number
Tool offset number
Family code
9/90
DNC 50. Specifications. Page 6.6
───────────────────────────────────────────────────────────────

Nominal life
Real life
Normal size/special
Status: rejected/worn out/available

9/90
DNC 50. Specifications. Page 6.7
───────────────────────────────────────────────────────────────

TMZ Tool magazine.


P3 T3/SP/**** N/S R/E/A
The fields being, in sequential order:
Position
Tool number
T 1-9999
T SP empty
T **** cancelled
Normal size/special
Status: rejected/worn out/available

GEO Tool geometry table (Lathe)


T0001 NOSEA XXXXX.XXXX NOSEW XXXXX.XXXX
CUTA XXXXX.XXXX LF

ORG Zero Offsets.


G54-59 axis 5.5 axis 5.5 ...
The number of axes depends on the machine. For example,
a machine having the X, Y and Z axes could have the
following values:
G55 X 1.1 Y -10000 Z -0.00001

ML1-5 Leadscrew compensation parameters.


P1-255 X-C 5.5 E5.5
Position value (coordinate) and error at that point.

MC1 Cross compensation table


P1-255 X-C 5.5 E5.5
Position value (coordinate) and error at that point.

The MPG, MX1-5, MPS, MP1-2 and PLC tables have the following
format:
P0-n identifying value.
The maximum number of parameters, n, depends on the
machine and on the software version.
The range of valid values depends on each parameter.
The identifier that comes with each parameter at the
CNC is added to it, but the PC does not have to send
it.

MPG General machine parameters.


MX1-5 Machine parameters for the axes.
MPS Machine parameters for the spindle.
MP1-2 Machine parameters for the serial lines 1 and 2.
PLC Machine parameters for the PLC.

9/90
DNC 50. Specifications. Page 6.8
───────────────────────────────────────────────────────────────

EXAMPLE 6.1: REQUEST FOR FULL TAB.

The CNC requests the zero offset table and it receives the
response that the PC sends.

Let us suppose that the table has the following values:

G54 X 0 Y 0 Z 0 A 0
G55 X 0 Y 0 Z 0 A 0
G56 X 0 Y-99999.99999 Z 0 A 0
G57 X 0 Y 0 Z 0 A 0
G58 X 0 Y 0 Z 0 A 0
G59 X 0 Y 0 Z 0 A 0

Let us also suppose that no blank spaces are transmitted


within the program. The communication would be as follows:

CNC Computer

ENQ
0
SOH R,TAB,ORG, ETX CRC-16 ? calculate the real value
1
EOT
ENQ
0
SOH S,TAB,ORG, ETB CRC-16
1
STX
G54 X0 Y0 Z0 A0 LF
G55 X0 Y0 Z0 A0 LF
G56 X0 Y-99999.99999Z0 A0 LF
G56 X0 Y0 Z0 A0 LF
G57 X0 Y0 Z0 A0 LF
G58 X0 Y0 Z0 A0 LF
G59 X0 Y0 Z0 A0 LF
ETX CRC-16
0
EOT

9/90
DNC 50. Specifications. Page 6.9
───────────────────────────────────────────────────────────────

7. VAR GROUP

The PC can request and sometimes modify the values of the CNC
variables described in this section. The ERRDNC variable is
special because the PC as well as the CNC use it to indicate the
errors occurring while using the DNC.

The definition of the variables that can be read and/or written


is carried out in the chapter of the document named
"Specifications of the 8050 CNC" whose photocopies are attached:

EXAMPLE 7.1 VAR REQUEST.

The PC requests the value of the TOOL variable and it


receives the response.

Let us suppose that it has a value of 10.

The communication would be as follows:

Computer CNC

ENQ
0
SOH R,VAR,TOOL, ETX CRC-16
1
EOT
ENQ
0
SOH S,VAR,TOOL,10, ETX CRC-16
1
EOT

If the Server breaks the Origin Message, it will send next a


message with the value of the ERRDNC variable indicating the
cause of the break. Let us see two example of this case:

EXAMPLE 7.2: BREAK OF HEADER PACK

Let us suppose that the PC tries to modify the PLANE


variable, the CNC would abort and it would send its ERRDNC
variable which has its corresponding code and text to
indicate that this variable cannot be modified.

9/90
DNC 50. Specifications. Page 6.10
───────────────────────────────────────────────────────────────

The communication would be as follows:

Computer CNC

ENQ
0
SOH S,VAR,PLANE,X, ETX CRC-16
CAN
ENQ
0
SOH S,VAR,ERRDNC,XXXX,Variable cannot be modified,ETX
CRC-16
1
EOT

EXAMPLE 7.3: BREAK OF A TEXT PACK.

Let us suppose that the CNC is transmitting the first pack


of text of a program and an error occurs in the PC's disk
drive. The computer would abort and it would send the value
of its ERRDNC variable indicating error when writing a file.

The communication would be as follows:

CNC Computer

ENQ
0
<SOH>S,PRG,TRN,000023,D,example program,MX,<ETB>CRC-16
1
<STX>X11 Y22 Z33 LF X11 Y22 Z33 LF X11 Y22 Z33 LF
X11 Y22 Z33 LF X11 Y22 Z33 LF X11 Y22 Z33 LF
.
.
.
X11 Y22 Z33 LF X11 Y22 Z33 LF X11 Y22 Z33 LF<ETB>CRC-16
CAN
ENQ
0
SOH S,VAR,ERRDNC,XX,Writing Error,<ETX>CRC-16
1
EOT

8. PRG GROUP
9/90
DNC 50. Specifications. Page 6.11
───────────────────────────────────────────────────────────────

They are commands that can be executed from the PC as well as


from the CNC.

It must be borne in mind that the PLC program is treated as any


part-program.

Mnemonic Meaning.
Parameters.

DEL Delete a program


P6
These command can only be used as a "Send data" type S.

TRN File transfer.


The text of the header pack contains the following
fields separated by commas:
No. Program number.
D If it already exists, delete it.
20 A comment with up to 20 characters which
appears in the program directory and can be
used to clarify the function of the program.
The text must not contain commas.
MX These are program attributes (permissions) at
the CNC. Each attribute is cancelled with a
dash (-).
M The program can be modified.
X The program can be executed.

The program blocks are transferred in the next packs of


text.

INF Transferring of a PC file into the CNC to run it in


infinite mode.
If when trying to input a pack of text there is no
available room at the memory assigned to the infinite
mode, it is not considered an error and it waits until
the necessary free memory is created as the blocks
being executed are eliminated.

The text of the header pack has the following


parameters:

CNC requests infinite program.


P6 Program number.
9/90
DNC 50. Specifications. Page 6.12
───────────────────────────────────────────────────────────────

No. Number of program block to start execution or


zero to start from the beginning.

PC sends infinite program.


P6 Program number

The program blocks are transferred in the next packs of


text.

9/90
DNC 50. Specifications. Page 6.13
───────────────────────────────────────────────────────────────

DIG Transferring to the PC of a file being generated by the


CNC when digitizing a part.
Since, in general, the digitizing process is slower
than the transmission, it will happen that in many
instances there will be no data to transmit. In this
case the CNC will not consider the transmission
finished and it will wait for more data to be generated
or until the digitizing process is ended.

The text of the header pack contains the following


fields separated by commas:
No. Program number.
A/D A. If it exists already, append after it.
It can be used to resume the digitizing
operation.
D. If it exists already, delete it.
Should a parameter be empty, it will return
an error if the file already exists at the
PC.
20 A comment with up to 20 characters which
appears at the program directory and it can
be used to clarify the function of the
program. The text must not contain commas.

The program blocks will be transferred in the next


packs of text.

DIR Directory.
The text of the header pack contains the following
fields separated by commas:
P/S Program P or subroutine S directory. The
subroutine directory can only be transferred from
the CNC (future feature).
First line
Indicates the line of the directory from which the
directory transfer will start.
The directory data are transmitted in a pack of text,
starting with a character which indicates whether the
last line of the directory is transmitted in this pack
(indicated with an L) or not (indicated with the an M).
The directory lines will follow with these fields
separated by commas:
P6 Program number.
20 A comment with up to 20 characters which
appears in the program directory and it can

9/90
DNC 50. Specifications. Page 6.14
───────────────────────────────────────────────────────────────

be used to clarify the function of the


program.
L6/8 indicates the length of the program. It
can have up to 6 digits at the CNC and 8 at
the PC.

9/90
DNC 50. Specifications. Page 6.15
───────────────────────────────────────────────────────────────

Date
Depending on the language, it will be:
Spanish
dd/mm/yy
English
mm/dd/yy
where
dd is the day
mm is the month
yy is the year
hh:mm:ss
hh hour
mm minutes
ss seconds

MX These are program attributes (permissions) at


the CNC. Each attribute is cancelled with a
dash (-).
M The program can be modified.
X The program can be executed.

Only one pack of text will be sent; therefore, it will


transmit the lines until the end of the directory or
until the pack is full.

EXAMPLE 8.1: TRN. PROGRAM TRANSFER.

The PC sends a program to the CNC.


Option D is used to overwrite (delete) the old program if it
already exists.
The program comment is "example for DNC".
Let us suppose that this program contains 150 lines
identical to:
X11 Y22 Z33 LF
and no blank space is transmitted.
We want it to be executable but not modifiable.

9/90
DNC 50. Specifications. Page 6.16
───────────────────────────────────────────────────────────────

The communication would be as follows:

Computer CNC

ENQ
0
SOH S,PRG,TRN,000023,D,example for DNC,-X, ETB CRC-16
1
STX
X11 Y22 Z33 LF
X11 Y22 Z33 LF
.
.
.
X11 Y22 Z33 LF
ETB CRC-16
0
STX
X11 Y22 Z33 LF
X11 Y22 Z33 LF
.
.
.
X11 Y22 Z33 LF
ETX CRC-16
1
EOT

The first pack of text would have 101 lines and 1016
characters including STX, ETB and the four of the CRC-16.
The second pack would have 49 lines, 496 characters and it
ends with ETX. Each line has 10 characters.

EXAMPLE 8.2: DIR. PROGRAM DIRECTORY.

The CNC requests lines of the PC directory starting from


line 0.

Let us suppose that the PC has only three programs with the
following characteristics:

number comment length date time attribute


P000001 Peter 00000100 21/07/90 10:15:00 MX
P000020 Paul 00000200 21/07/90 10:20:00 MX
P100000 Mary 00000300 21/07/90 10:30:00 MX

9/90
DNC 50. Specifications. Page 6.17
───────────────────────────────────────────────────────────────

Since the whole directory fits in a pack of text, this will


include the last line and, therefore, it will start with the
letter L.

9/90
DNC 50. Specifications. Page 6.18
───────────────────────────────────────────────────────────────

The communication would be as follows:

CNC Computer

<ENQ>
0
<SOH>R,PRG,DIR,P,0,<ETX>CRC-16
1
<EOT>
<ENQ>
0
<SOH>S,PRG,DIR,P,<ETB>CRC-16
1
<STX>
L
P000001 SP Peter SP 00000100 SP 21/07/90 SP
10:15:00 SP MX LF
P000020 SP Paul SP 00000200 SP 21/07/90 SP
10:20:00 SP MX LF
P100000 SP Mary SP 00000300 SP 21/07/90 SP
10:30:00 SP MX LF
<ETX>CRC-16
0
<EOT>

9. PAN GROUP

They are commands which can be executed only at the CNC.


Therefore, the PC will not be able to initiate a read command,
but only respond to the CNC's requests.

Mnemonic Meaning.
Parameters.

DEL Delete a screen (page)/symbol.


This command can only be executed as a "Send Data" type
S.
The header pack will indicate the following fields
separated by commas.
P/S To indicate whether it is a Page (screen) or
a Symbol.
No. 3 digits indicating the Page or Symbol
number.

9/90
DNC 50. Specifications. Page 6.19
───────────────────────────────────────────────────────────────

TRN Transfer of a Page/Symbol


The text of the header pack contains the following
fields separated by commas:
P/S Page (Screen) or Symbol.
No. Page or Symbol number (3 digits).
D If it already exists, delete it.
20 Comment with up to 20 characters sent by the
CNC which will have to be written in the PC
as first line of the page preceded by the %
character for its identification. This field
will be used whenever the CNC requests a
directory of pages (screens).

The page blocks will be transferred in the next packs


of text.

DIR Directory.
The text of the header pack contains the fields
separated by commas:
P/S Directory of pages P or symbols S.
Line number
Indicates the directory line from which the
directory transfer starts.

The data of the page directory will be transmitted in a


single pack of text starting with a character which
indicates whether the last line of the directory is
included (indicated with an L) in this pack or not
(indicated with an M). The directory lines will follow
with these fields separated with blank spaces:
No. Page/symbol number (3 digits).
4dig Size (4 digits).
20ch Comment with up to 20 characters to
identify the page.

Only one pack of text is sent as response for each


directory request.

9/90
DNC 50. Specifications. Page 6.20
───────────────────────────────────────────────────────────────

EXAMPLE 9.1: TRN. PAGE (SCREEN) TRANSFER.

The CNC sends a page (screen) to the PC.


To delete the already existing screen, the D option is used.
The comment of the program is "screen example".
Let us suppose that this screen (page) takes 2Ks of the
object code.

The communication would be as follows:

CNC Computer

<ENQ>
0
<SOH>S,PAN,TRN,P,025,D,screen example,<ETB><CRC-16>
1
<STX>
Screen object code 025
Screen object code 025
.
.
.
<ETB><CRC-16>
0
<STX>
Screen object code 025
Screen object code 025
.
.
.
<ETX><CRC-16>
1
EOT

Each line of the screen object code contains 200 characters


and ends with an LF (Line Feed) character.

EXAMPLE 9.2: DIR. PAGE (SCREEN) DIRECTORY.

The CNC requests PC directory lines starting from line 0.

Let us suppose that the PC only has three pages with the
following characteristics:

No. size comment


001 3500 logo
9/90
DNC 50. Specifications. Page 6.21
───────────────────────────────────────────────────────────────

020 4100 animation


105 2700 models

Since the whole directory fits in a Pack of Text, this pack


will include the last line and, therefore, it will start
with the letter L.

9/90
DNC 50. Specifications. Page 6.22
───────────────────────────────────────────────────────────────

The communication would be as follows:

CNC Computer

<ENQ>
0
<SOH>R,PAN,DIR,P,0,<ETX>CRC-16
1
<EOT>
<ENQ>
0
<SOH>S,PAN,DIR,P,<ETB>CRC-16
1
<STX>
L001 3500 logo LF
020 4100 animation LF
105 2700 models LF
<ETX>CRC-16
0
<EOT>

10 COM GROUP

All machining commands belong to this group and can only be sent
from the PC.

Mnemonic Meaning
Parameters

KEYSEQ Send a keystroke sequence to be


executed at the CNC as if they were pressed by the
operator on the CNC keyboard.
This command only contains the header pack since
the parameters are the keys to be executed (as if
pressed).

The codes for the CNC keys must be sent separated


by commas. See the Key code appendix.

Example of keystroke sequence transmission:

Computer CNC

<ENQ>
0
9/90
DNC 50. Specifications. Page 6.23
───────────────────────────────────────────────────────────────

<SOH>S,COM,KEYSEQ,key-code,key-code,.....,<ETX>CRC-16
1
<EOT>

9/90
DNC 50. Specifications. Page 6.24
───────────────────────────────────────────────────────────────

PLC GROUP

The PC has access to the resources of the integrated PLC of the


CNC.

These resources are: Inputs (I), Outputs (O), Marks (M),


Registers (R), Timers (T) and Counters (C).

I, O, M.

Reading and writing of inputs I, outputs O and marks M.

They are resources which can be requested or sent as a range


although they cannot be sent as a range from the PC.

EXAMPLE 1: REQUEST OF INPUTS.

Let us suppose that the PC wants to know the status of


inputs 1 thru 100 and that all of them are low (0) except
those between 90 and 100 which are high (1).
The communication would be as follows:

Computer CNC
<ENQ>
0
<SOH>R,PLC,I1.100,<ETX>CRC-16
1
<EOT>
<ENQ>
0
<SOH>S,PLC,I1.100=
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1
<ETX>CRC-16
0
<EOT>

R, T, C.

Reading and writing of registers R, timers T and Counters C.

These are variables requested and sent one by one indicating


which it is by means of a number.
9/90
DNC 50. Specifications. Page 6.25
───────────────────────────────────────────────────────────────

9/90
DNC 50. Specifications. Page 6.26
───────────────────────────────────────────────────────────────

EXAMPLE 2: MODIFICATION OF A REGISTER.

Let us suppose that we want to set, from the PC, the PLC
register R15 to a value of 20.
The communication would be as follows:

Computer CNC

<ENQ>
0
<SOH>S,PLC,R15=20,<ETX>CRC-16
1
<EOT>

EXAMPLE 3: READING A TIMER.

Let us suppose that we want to read the status and contents


of the PLC timer T100.
The communication would be as follows:

Computer CNC

<ENQ>
0
<SOH>R,PLC,T100,<ETX>CRC-16
1
<EOT>

<ENQ>
0
<SOH>S,PLC,T100=G=0 M=S E=0 R=0 T=0 ET=000000000
TO=0000000000<ETX>CRC_16
1
<EOT>

9/90
DNC 50. Specifications. Page A.1
─────────────────────────────────────────────────────────────────

APPENDIX A CONNECTIONS.

9/90
DNC 50. Specifications. Page B.1
─────────────────────────────────────────────────────────────────

APPENDIX B CNC MACHINE PARAMETERS.

See "Specifications of the FAGOR 8050 CNC"

BAUDRATE
P0 0-12 [7] baud:
0- 110
1- 150
2- 300
3- 600
4- 1200
5- 2400
6- 4800
7- 9600
8-19200
9-reserved
10-reserved
11-reserved
12-13714

NBITSCHR (Number of BITS per CHaRacter)


P1 1/0 [1] 8/7 bits per character

PARITY
P2 0-2 [0] parity:
0-NO
1-ODD
2-EVEN

STOPBITS
P3 1/0 [0] 2/1 stop bits

PROTOCOL
P4 0-2 [0] Protocol:
0- general peripheral device
1- DNC
2- FAGOR floppy disc drive

PWONDNC (PoWer-ON DNC)


P5 yes/no [no] Active on power-up

DNCDEBUG
P6 yes/no [no] Testing of a transmission program.
It cancels the time-out alarm.

ABORTCHR (ABORT CHaRacter)


P7 1/0 [0] in general peripheral mode:
9/90
DNC 50. Specifications. Page B.2
─────────────────────────────────────────────────────────────────

0-CAN
1-EOT

9/90
DNC 50. Specifications. Page B.3
─────────────────────────────────────────────────────────────────

EOLCHR (End Of Line CHaRacter)


P8 0-3 [0] In general peripheral mode:
0-LF
1-CR
2-LF-CR
3-CR-LF

EOFCHR (End Of File CHaRacter)


P9 0-2 [0] In general peripheral mode:
0-EOT
1-ESC
2-SUB

XONXOFF
P10 on/off [on] Communication control via software

9/90
DNC 50. Specifications. Page C.1
─────────────────────────────────────────────────────────────────

APPENDIX C ERRORS

1 Time-out Error when sending a pack.


2 Time-out Error when receiving a pack.
3 CAN received.
4 Communication cancelled from keyboard.
5 Computer requesting communication.
6 Unexpected header pack.
7 Header pack not received.
8 Overflow error.
9 Maximum number of attempts.
10 The command is not multi-pack.

20 Wrong command.
21 Wrong text.

30 File does not exist.


31 File opening error.
32 File writing error.
33 File deleting error.
34 Empty Directory.
35 Full memory.

40 Variable does not exist.


41 Invalid value.
42 Variable cannot be modified.

9/90
DNC 50. Specifications. Page D.1
─────────────────────────────────────────────────────────────────

APPENDIX D ASCII CHARACTERS.

The symbols associated to each code can be defined by the user.


The chart below shows the ASCII characters whose codes go from 0
to 127 and then the extension chosen for codes between 128 and
255.

ASCII CHARACTER VALUE CHARACTER


VALUE 000 NULL 032 (space) 001
SOH 033 ! 002 STX 034
" 003 ETX 035 # 004
EOT 036 $ 005 ENQ 037
% 006 ACK 038 \& 007
BEL 039 ' 008 BS
040 ( 009 HT 041 ) 010
LF 042 * 011 VT 043
+ 012 FF 044 , 013
CR 045 - 014 SO 046
. 015 SI 047 / 016
DLE 048 0 017 DC1 049
1 018 DC2 050 2 019
DC3 051 3 020 DC4 052
4 021 NAK 053 5 022
SYN 054 6 023 ETB 055
7 024 CAN 056 8 025
EM 057 9 026 SUB 058
: 027 ESC 059 ; 028
FS 060 < 029 GS 061
= 030 RS 062 > 031
US 063 ? 064 \ 096
` 065 A 097 a 066
B 098 b 067 C 099
c 068 D 100 d 069
E 101 e 070 F 102
f 071 G 103 g 072
H 104 h 073 I 105
i 074 J 106 j 075
K 107 k 076 L 108
l 077 M 109 m 078
N 110 n 079 O 111
o 080 P 112 p 081
Q 113 q 082 R 114
r 083 S 115 s 084
T 116 t 085 U 117
u 086 V 118 v 087
W 119 w 088 X 120
9/90
DNC 50. Specifications. Page D.2
─────────────────────────────────────────────────────────────────

x 089 Y 121 y 090


Z 122 z 091 [ 123
{ 092 \ 124 | 093
] 125 } 094 ^ 126
~ 095 _ 127 DEL

9/90
DNC 50. Specifications. Page E.1
─────────────────────────────────────────────────────────────────

APPENDIX E Complete C-language sample program for CRC-16


calculation.

The CRC-16 is a very powerful error detecting method. Just study


the following table:

Errors in a single bit: 100 %


Errors in two bits: 100 %
Errors in an odd number of bits: 100 %
Pulse errors of less than 16 bits: 100 %
Pulse errors of exactly 17 bits: 99,9969 %
All other pulse errors: 99,9984 %

As it can be seen, it is adequate for detecting all types of


errors but especially those derived from pulses over relatively
long time periods.

The generator polynomial being used is the following:


X16+X15+X2+1

The program below uses a table to calculate the CRC-16.


This method is much faster than the classic algorithm with shifts
and additions.

9/90
DNC 50. Specifications. Page E.2
─────────────────────────────────────────────────────────────────

main()
{

#define SOH 1
#define ETX 3
#define ETB 23

char *pointer;
unsigned short crc16;

unsigned short crc16_tab[256] =


{
/* See CRC-16 calculation table in appendix E */
}

unsigned char sample_pack[25] =


{SOH, 'S,VAR,TOOL,10,' , ETX }

/* calculate the CRC-16 of the sample_pack */

crc16 = 0;
pointer = sample_pack;

do
{
pointer++;
/* Since the SOH or STX is not included in the
calculation of the CRC-16, the first pass through the
loop skips this character.
*/

crc16 =
(crc16 >> 8) ^
crc16_tab[(crc16 ^ *pointer) &0x00ff];
}
while ((*pointer != ETX)
||
(*pointer != ETB))

/* Put the crc16 in transmission format and place the


resulting 4 characters at the end of the pack*/

for (i=0 , i++, i<4)


{
*(++pointer) = ((crc16 >> (4*i)) & 0x00ff) + '0';

9/90
DNC 50. Specifications. Page E.3
─────────────────────────────────────────────────────────────────

}
}

9/90
DNC 50. Specifications. Page E.4
─────────────────────────────────────────────────────────────────

The crc16 variable will assume the following values when


calculating the CRC-16 for each one of the characters of the
sample_pack:

CHARACTER DECIMAL VALUE crc16

0000
S 83
, 44 ?
V 86
A 65
R 82
, 44
T 84
O 79
O 79
L 76
, 44
1 49
0 48
, 44
ETX 3

The conversion of the CRC-16 into four characters for


transmission results in:

First character to be transmitted:


Second character to be transmitted:
Third character to be transmitted:
Fourth character to be transmitted:

9/90

Das könnte Ihnen auch gefallen