Beruflich Dokumente
Kultur Dokumente
CONTENTS
Page
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
DEL Delete.
TRN Transfer.
DIR Directory.
I Inputs
O Outputs
M Marks
R Registers
T Timers
C Counters
Appendix A CONNECTIONS.
Appendix C ERRORS.
Capabilities
Protocols
Commands
Connections
etc ...
09/90
DNC 50. Specifications. Page 2.1
─────────────────────────────────────────────────────────────────
9/90
DNC 50. Specifications. Page 3.1
─────────────────────────────────────────────────────────────────
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.
TRANSFERABLE DATA:
9/90
DNC 50. Specifications. Page 3.2
─────────────────────────────────────────────────────────────────
- 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
─────────────────────────────────────────────────────────────────
- 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:
- Two interfaces:
RS-232 for normal connections.
9/90
DNC 50. Specifications. Page 3.4
─────────────────────────────────────────────────────────────────
9/90
DNC 50. Specifications. Page 4.1
─────────────────────────────────────────────────────────────────
The CNC user, the part-program or the PLC program interact with
the DNC as follows:
ERROR WINDOW.
OPERATING SYSTEM.
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)
9/90
DNC 50. Specifications. Page 4.2
─────────────────────────────────────────────────────────────────
9/90
DNC 50. Specifications. Page 4.3
─────────────────────────────────────────────────────────────────
DIGITIZING
1. INTERNAL CHARACTERISTICS.
- Asynchronous communications.
2. TERMINOLOGY DEFINITION
9/90
DNC 50. Specifications. Page 5.1
─────────────────────────────────────────────────────────────────
3. SPECIAL CHARACTERS
Mnemonic Meaning
The protocol also uses three normal ASCII characters: the ;, the
0 and the 1:
9/90
DNC 50. Specifications. Page 5.3
─────────────────────────────────────────────────────────────────
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 ?
We will use other special characters, comma and line feed. These
are not characters of the protocol but text separators:
9/90
DNC 50. Specifications. Page 5.5
─────────────────────────────────────────────────────────────────
4. MESSAGE TRANSMISSION
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.
9/90
DNC 50. Specifications. Page 5.6
─────────────────────────────────────────────────────────────────
Master Slave
9/90
DNC 50. Specifications. Page 5.7
─────────────────────────────────────────────────────────────────
3 Text Packs.
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.
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.
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.
Point 17.
9/90
DNC 50. Specifications. Page 5.8
─────────────────────────────────────────────────────────────────
9/90
DNC 50. Specifications. Page 5.9
─────────────────────────────────────────────────────────────────
9/90
DNC 50. Specifications. Page 5.10
─────────────────────────────────────────────────────────────────
9/90
DNC 50. Specifications. Page 5.11
─────────────────────────────────────────────────────────────────
5. COMMUNICATION
Client Server
ENQ
0
SOH R,command, ETX CRC-16
1
EOT
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:
9/90
DNC 50. Specifications. Page 5.12
─────────────────────────────────────────────────────────────────
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
9/90
DNC 50. Specifications. Page 6.2
───────────────────────────────────────────────────────────────
- The mnemonics used by the DNC have been defined from the
English initials of their meanings.
9/90
DNC 50. Specifications. Page 6.3
───────────────────────────────────────────────────────────────
For example, the text of the header pack to delete the part-
program number 016247 would be:
S,PRG,DEL,016247,
S,PRG,TRN,000005,D,,MX,
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
Mnemonic Meaning
S Send data.
R Request data.
To request data and receive the response sent by the
other element.
5. COMMAND GROUPS
Mnemonics Meaning
TAB Table.
VAR Variable.
PRG Program.
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:
Mnemonic Meaning.
Line specification and data format.
TO Tool Offsets.
M Model
D1-255 R5.5 L5.5 I5.5 K5.5
T Model
D1-255 X5.5 Z5.5 R5.5 F2 I5.5
K5.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
───────────────────────────────────────────────────────────────
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.
9/90
DNC 50. Specifications. Page 6.8
───────────────────────────────────────────────────────────────
The CNC requests the zero offset table and it receives the
response that the PC sends.
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
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.
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
9/90
DNC 50. Specifications. Page 6.10
───────────────────────────────────────────────────────────────
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
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
───────────────────────────────────────────────────────────────
Mnemonic Meaning.
Parameters.
9/90
DNC 50. Specifications. Page 6.13
───────────────────────────────────────────────────────────────
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
───────────────────────────────────────────────────────────────
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
9/90
DNC 50. Specifications. Page 6.16
───────────────────────────────────────────────────────────────
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.
Let us suppose that the PC has only three programs with the
following characteristics:
9/90
DNC 50. Specifications. Page 6.17
───────────────────────────────────────────────────────────────
9/90
DNC 50. Specifications. Page 6.18
───────────────────────────────────────────────────────────────
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
Mnemonic Meaning.
Parameters.
9/90
DNC 50. Specifications. Page 6.19
───────────────────────────────────────────────────────────────
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.
9/90
DNC 50. Specifications. Page 6.20
───────────────────────────────────────────────────────────────
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
Let us suppose that the PC only has three pages with the
following characteristics:
9/90
DNC 50. Specifications. Page 6.22
───────────────────────────────────────────────────────────────
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
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
I, O, M.
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.
9/90
DNC 50. Specifications. Page 6.26
───────────────────────────────────────────────────────────────
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>
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
─────────────────────────────────────────────────────────────────
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
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
DNCDEBUG
P6 yes/no [no] Testing of a transmission program.
It cancels the time-out alarm.
0-CAN
1-EOT
9/90
DNC 50. Specifications. Page B.3
─────────────────────────────────────────────────────────────────
XONXOFF
P10 on/off [on] Communication control via software
9/90
DNC 50. Specifications. Page C.1
─────────────────────────────────────────────────────────────────
APPENDIX C ERRORS
20 Wrong command.
21 Wrong text.
9/90
DNC 50. Specifications. Page D.1
─────────────────────────────────────────────────────────────────
9/90
DNC 50. Specifications. Page E.1
─────────────────────────────────────────────────────────────────
9/90
DNC 50. Specifications. Page E.2
─────────────────────────────────────────────────────────────────
main()
{
#define SOH 1
#define ETX 3
#define ETB 23
char *pointer;
unsigned short crc16;
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))
9/90
DNC 50. Specifications. Page E.3
─────────────────────────────────────────────────────────────────
}
}
9/90
DNC 50. Specifications. Page E.4
─────────────────────────────────────────────────────────────────
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
9/90