MELDAS and MELDASMAGIC are registered trademarks of Mitsubishi Electric
Corporation.
The other company names and product names are trademarks or registered trademarks
of the respective companies.
Introduction
This manual describes the DDB (Direct Data Bus) function used to realize data
input/output with a CNC while running a program developed with an MELDAS 64 Series
and MELDASMAGIC 64 Series user PLC (ladder language).
The methods for reading and writing various NC information using the DDB from a PLC
are described in this manual.
Please read this manual before programming.
Please read the "Precautions for Safety" listed on the following page to ensure safe use
of the MELDAS 64 Series and MELDASMAGIC 64 Series.
Details described in this manual
CAUTION
For items described in "Restrictions" or "Usable State", the instruction manual
issued by the machine maker takes precedence over this manual.
Items not described in this manual must be interpreted as "not possible".
This manual is written on the assumption that all option functions are added.
Refer to the specifications issued by the machine maker before starting use.
Some screens and functions may differ or may not be usable depending on the
NC version.
Setting incorrect values could cause the machine to malfunction or run away.
Take care when programming.
General precautions
The following documents are available as documents related to the contents of this
manual. Refer to these as required.
Always read the specifications issued by the machine maker, this manual, related
manuals and enclosed documents before starting installation, operation, programming,
maintenance or inspections to ensure correct use. Thoroughly understand the basics,
safety information and precautions of this numerical controller before using the unit.
The safety precautions are ranked as "DANGER", "WARNING" and "CAUTION" in this
manual.
DANGER
WARNING
CAUTION
Note that even if the item is ranked as "CAUTION", incorrect handling could lead to
serious results. Important information is described in all cases, so please observe the
items.
Not applicable in this manual
When there is a great risk that the user could be subject to
fatalities or serious injuries if handling is mistaken.
When the user could be subject to fatalities or serious injuries
if handling is mistaken.
When the user could be subject to injuries or when physical
damage could occur if handling is mistaken.
DANGER
WARNING
Not applicable in this manual.
1. Items related to product and manual
For items described as "Restrictions" or "Usable State" in this manual, the
instruction manual issued by the machine maker takes precedence over this
manual.
Items not described in this manual must be interpreted as "not possible".
This manual is written on the assumption that all option functions are added.
Refer to the specifications issued by the machine maker before starting use.
Some screens and functions may differ or may not be usable depending on the
NC version.
Setting incorrect values could cause the machine to malfunction or run away.
2. Usage of DDB Function with Ladder .................................................................2
2.1 Basics of commands ...................................................................................2
2.2 Basic format of control data ........................................................................2
2.2.1 Control signals (Rn or Dn) .................................................................3
2.2.2 Section No. (Rn+1 or Dn+1) ..............................................................3
2.2.3 Sub-section No. (Rn+2, Rn+3 or Dn+2, Dn+3) .................................3
2.2.4 Data size (Rn+4 or Dn+4) .................................................................3
2.2.5 Read/write designated axis (Rn+5 or Dn+5) .....................................4
2.2.6 Read/write data (Rn+6, Rn+7 or Dn+6, Dn+7) ..................................4
3. Section No. List ....................................................................................................5
4. Sub-section No. List ............................................................................................6
5. Explanation of Read/Write Data ......................................................................... 18
5.1 How to refer to the data ............................................................................... 18
5.2 Data unit system ......................................................................................... 19
5.3 Explanation of data details .......................................................................... 20
6. Example of DDB with Ladder Circuit ................................................................. 59
1. Outline
1. Outline
This manual describes the DDB (Direct Data Bus) function used to realize data input/output with a
CNC while running a program developed with the user PLC ladder language.
DDB includes the synchronous type (DDBS) and the asynchronous type (DDBA), but only the
asynchronous type will be explained in this manual.
DDB is a function that allows the PLC to directly read and write the various data in the CNC. By setting
the information required for reading and writing into the buffer and calling out the DDB function, the
PLC can set (write) the designated data into the CNC. Generally, the data is read and written in one
piece units, but data related to the control axis can be processed for the designated number of axes.
Features of this function include that the read data can be referred to in the step immediately following
the execution of the DDBA command. This also applies to the written data. (Note that for the
parameters, they may not be valid immediately after writing.)
This manual is organized in the following manner after the first chapter. Please refer to the required
section for use.
6. Example of
DDB with
5. Explanation of
Read/Write
Data
Ladder Circuit
2. Usage of DDB
Function with
ladder
4. Sub-section
No. List
3. Section No.
List
- 1 -
2. Usage of DDB Function with Ladder
2. Usage of DDB Function with Ladder
2.1 Basics of commands
Set control data with MOV command, etc.
ACT(Note 1)
DDBA Rn/Dn
(Note 1) The file registers (Rn) and data registers (Dn) in the range usable by the user can be
used in the control data buffer of the asynchronous type DDB .
(Note 1) The system designation is used when there is a multi-system specification.
(Note 2) Always secure 4 bytes as the buffer for one read/write data item.
(Note 3) For example, if only the No. 3 axis is designated, the data for the No. 3 axis will be the
read/write data.
- 2 -
2. Usage of DDB Function with Ladder
execution
command
2.2.1 Control signals (Rn or Dn)
F E D C B A 9 8 7 6 5 4 3 2 1 0
Warning output
Error during chopping
(not used)
No option
Size over
Number of axes illegal
Section No. error
Write protect
Error occurrence
∗
2.2.2 Section No. (Rn+1 or Dn+1)
0: Read designation
1: Write designation
0: Direct input
1: Added input
0: Decimal point invalid
1: Decimal point valid
Set by controller at
completion of DDB
∗ Warning output
bit 4 = 1 : Variable data blank
0 : Variable data not blank
bit 5 = 1 : Variable data overflowing
0 : Variable data not overflowing
Set by PLC during
DDB command
Last four digits of the data
during reading/writing of
variables corresponding to
the decimal place
The section No. of the data to be read/written is designated with a binary.
Refer to the "3. Section No. List" for details.
2.2.3 Sub-section No. (Rn+2, Rn+3 or Dn+2, Dn+3)
(LOW HIGH)
The sub-section No. of the data to be read/written is designated with a binary.
Refer to the "4. Sub-section No. List" for details.
2.2.4 Data size (Rn+4 or Dn+4)
The size of the data to be read/written is designated with a binary.
1: 1 byte
2: 2 bytes
4: 4 bytes
(Note)The date size has not been checked, so exercise care when setting.
- 3 -
2. Usage of DDB Function with Ladder
2.2.5 Read/write designated axis (Rn+5 or Dn+5)
When reading or writing data per axis classified with the section No., designate the axis and system.
F E D C B A9876543210
System designation
0: No. 1 system
1: No. 2 system
(Note 1)
No. 1 axis
No. 2 axis
No. 3 axis
No. 4 axis
(Note 1) The system designation is used when there is a multi-system specification.
(Note 2) When reading and writing the axis data, if there is no axis designation or if the
designation exceeds the maximum control axes, the alarm "No. of axes illegal" will occur.
2.2.6 Read/write data (Rn+6, Rn+7 or Dn+6, Dn+7)
(LOW) (HIGH)
When read is designated, the data designated by the PLC will be output by the CNC.
When write is designated, the data to be written will be set by the PLC.
1-byte data2-byte data4-byte data
Rn+6LRn+6LRn+6L
(Dn+6)H (Dn+6)H (Dn+6)H
Rn+7Rn+7Rn+7L
(Dn+7)
Code expansion
(Dn+7)
Code
expansion
(Dn+7)H
L
H
The valid area of the data will differ according to the data size. (Shaded area)
When read is designated, a code will be added to the 1-byte and 2-byte data to create a 4-byte data
size. Thus, even when reading 1-byte or 2-byte data, 4 bytes are required for the buffer size.
15Axis common non-modal information in next blockNot possibleInvalidValid
Axis independent non-modal information in next
16
block
17Axis common modal information in next blockNot possibleInvalidValid
18Axis independent modal information in next blockNot possibleValidValid
19
20Axis common machine control information 1Not possibleInvalidValid
21Axis independent machine control information 1Not possibleValidValid
22Information input from PLC to controllerNot possibleInvalidValid
23Information output from controller to PLCNot possibleInvalidValid
24Cumulative time dataPossibleInvalidInvalid
25
26Axis common machine control information 2Not possibleInvalidValid
27Axis independent machine control information 2Not possibleValidValid
28
29Common variable value 1PossibleInvalidInvalid From #500
30Local variable valuePossibleInvalidValid
31Tool compensation amountPossibleInvalidValid (Note 2)
32Common variable value 2PossibleInvalidValid From #100
DetailsWrite
Possible (partially
not possible)
PossibleValidValid (Note 1)
Not possibleInvalidValid
Not possibleValidValid
Not possibleInvalidValid
Not possibleValidValid
Not possibleValidValid
Axis
designation
InvalidInvalid
System
designation
Remarks
(Note 1) To use the section No. 4 with the MELDASMAGIC 64, the "external workpiece coordinate
system compensation input" option is required.
(Note 2) To use the section No. 31 with the MELDASMAGIC 64, the "external tool compensation
input" option is required.
- 5 -
4. Sub-section No. List
4. Sub-section No. List
The sub-section No. list shows the sub-section No. of each data in correspondence with the section No.
Each data has a search No. To refer to the contents of the data, search for the corresponding data in
"5. Explanation of Read/Write Data" using this search No.
Search No.
4. Sub-section No. List
Section No.1 Parameters common to each axis
Search
No.
1-10
~
~
1 - 10
1-10 Maximum spindle speed (Gear 1st step to gear 4th step)
[Data definition]
This is a parameter for the maximum spindle speed of each gear step.
(This corresponds to the setup parameter, spindle parameter smax1 to 4.)
The CNC creates the spindle gear shift command 1 and 2 based on this value and the
commanded S command.
During tapping, the maximum speed will be the spindle tap speed.
~
~
Data type
Maximum spindle speed (Gear 1st step)
Maximum spindle speed (Gear 2nd step)
Maximum spindle speed (Gear 3rd step)
Maximum spindle speed (Gear 4th step)
No. of searching (Note) This is not the sub-section No.
Section No.
axis121441Possible Invalid/Invalid Designate ASCII code with a decimal
dog 2121324Possible Invalid/Invalid
axis121641Possible Invalid/Invalid Designate ASCII code with a decimal
dog 2121524Possible Invalid/Invalid
axis121841Possible Invalid/Invalid Designate ASCII code with a decimal
dog 2121724Possible Invalid/Invalid
axis122041Possible Invalid/Invalid Designate ASCII code with a decimal
dog 2121924Possible Invalid/Invalid
axis122241Possible Invalid/Invalid Designate ASCII code with a decimal
dog 2122124Possible Invalid/Invalid
axis122441Possible Invalid/Invalid Designate ASCII code with a decimal
dog 2122324Possible Invalid/Invalid
axis122641Possible Invalid/Invalid Designate ASCII code with a decimal
dog 2122524Possible Invalid/Invalid
axis122841Possible Invalid/Invalid Designate ASCII code with a decimal
dog 2122724Possible Invalid/Invalid
Size
(bytes)
Write
System/axis
designation
Remarks
- 9 -
4. Sub-section No. List
Section No.2 Axis independent parameters
Search
No.
No. 1 reference point coordinates
No. 2 reference point coordinates
2-10
No. 3 reference point coordinates
No. 4 reference point coordinates
Stored stroke limit I (+)
2-11
Stored stroke limit I (-)
Movement control parameters
BIT0 :
BIT1 : Inch output
BIT2 : Reference point return direction (-)
BIT3 : Servo OFF error compensation
BIT4 : Rotary axis
BIT5 : Motor CCW
BIT6 :
2-20
BIT7 :
BIT8 :
BIT9 :
BITA : No reference point axis
BITB :
BITC :
BITD : Diameter designated axis
BITE :
BITF :
2-30Reference point return approach speed382PossibleValid/Valid
2-35Reference point return shift amount442PossibleValid/Valid
2-36Rapid traverse backlash amount462PossibleValid/Valid
2-37Cutting feed backlash amount482PossibleValid/Valid
Stored stroke limit II (+)
2-40
Stored stroke limit II (-)
Data type
Subsection No.
272
276
280
284
288
292
202Not possible Valid/Valid
656
660
Size
(bytes)
4
4
4
4
4
4
4
4
Write
Possible
Possible
Possible
Possible
Possible
Possible
Possible
Possible
System/axis
designation
Valid/Valid
Valid/Valid
Valid/Valid
Valid/Valid
Valid/Valid
Valid/Valid
Valid/Valid
Valid/Valid
Remarks
For machine maker
For machine maker
For user
For user
Section No.4 Workpiece coordinate system offset, external workpiece coordinate system offset
Search
No.
4-10G54 workpiece coordinate system offset04PossibleValid/Valid
4-11G55 workpiece coordinate system offset44PossibleValid/Valid
4-12G56 workpiece coordinate system offset84PossibleValid/Valid
4-13G57 workpiece coordinate system offset124PossibleValid/Valid
4-14G58 workpiece coordinate system offset164PossibleValid/Valid
4-15G59 workpiece coordinate system offset204PossibleValid/Valid
4-16External workpiece coordinate system offset244PossibleValid/Valid
Sub 1202Not possibleValid/Invalid
Sub 2222Not possibleValid/Invalid
Main642Not possibleValid/Invalid (Note 1)
Sub 1682Not possibleValid/Invalid
Sub 2702Not possibleValid/Invalid
Main962Not possibleValid/Invalid (Note 1)
Sub 11002Not possibleValid/Invalid
Sub 21022Not possibleValid/Invalid
Main1042Not possibleValid/Invalid (Note 1)
Sub 11082Not possibleValid/Invalid
Sub 21102Not possibleValid/Invalid
Subsection No.
Size
(bytes)
Write
System/axis
designation
Remarks
- 11 -
4. Sub-section No. List
Section No.ACT 11 PCB 15
Search
No.
11/15-10 Interpolation vector length1724Not possible Valid/Invalid
Movement mode gmov
Binary data
0 : Positioning (each axis independent)
1 : Positioning (linear)
2 : Linear interpolation
3 : Circular interpolation (CW)
4 : Circular interpolation (CCW)
5 : Helical interpolation (CW)
6 : Helical interpolation (CCW)
7 :
8 :
9 :
10 :
11 : Time designated dwell
12 :
13 : No. 1 reference point compare
11/15-20
14 : No. 2 reference point compare
15 : No. 3 reference point compare
16 : No. 4 reference point compare
17 : Automatic reference point return
18 : Return from automatic reference point
return
19 : No. 2 reference point return
20 : No. 3 reference point return
21 : No. 4 reference point return
22 : Skip function
23 : Multi-step skip function 1
24 : Multi-step skip function 2
25 : Multi-step skip function 3
26 : Thread cutting
27 :
28 :
29 : Coordinate system setting
Data type
Axis common non-modal information in block being executed
(ACT) and in next block (PCB)
Subsection No.
711Not possible Valid/Invalid
Size
(bytes)
Write
System/axis
designation
Remarks
Axis independent non-modal information in block being
Section No.ACT 12 PCB 16
executed
(ACT) and in next block (PCB)
Search
No.
12/16-10 Axis direction movement amount44Not possibleValid/Valid
Data type
Subsection No.
Size
(bytes)
Write
System/axis
designation
- 12 -
Remarks
4. Sub-section No. List
Section No.ACT 13 PCB 17
Search
No.
13/17-10 G code (group 1)01Not possibleValid/Invalid Interpolation mode
13/17-11 G code (group 2)11Not possibleValid/Invalid Plane selection
13/17-12 G code (group 5)21Not possibleValid/Invalid Feed mode
13/17-13 G code (group 7)31Not possibleValid/Invalid
13/17-14 G code (group 9)41Not possibleValid/Invalid Fixed cycle modal
13/17-15 G code (group 12)51Not possibleValid/Invalid
13/17-16 G code (group 13)61Not possibleValid/Invalid Cutting mode
G code (group 3, 4, 6, 10, 17, 18)
BIT0 : Absolute/incremental mode
BIT1 : Barrier check
BIT2 : Inch/metric mode
13/17-17
13/17-20 Block No.151Not possibleValid/Invalid 0 to 99
13/17-30 Shape compensation No.762Not possibleValid/Invalid
13/17-31 Wear compensation No.782Not possibleValid/Invalid
13/17-40 Miscellaneous function code2084Not possibleValid/Invalid M code (binary)
13/17-41 Spindle function code2124Not possibleValid/Invalid S code (binary)
13/17-42 Tool function code2164Not possibleValid/Invalid T code (binary)
13/17-43 2nd miscellaneous function code2204Not possibleValid/Invalid B code (binary)
13/17-44 Program No.2404Not possibleValid/Invalid O 1 to 99999999
13/17-45 Sequence No.2444Not possibleValid/Invalid N 1 to 99999
BIT3 : Fixed cycle R point return
BIT4 :
BIT5 : Constant surface speed control
BIT6 : Balance cut
BIT7 :
Data type
Axis common modal information in block being executed (ACT)
24-1Power ON time04PossibleInvalid/Invalid
24-2Automatic operation time44PossibleInvalid/Invalid
24-3Automatic start up time84PossibleInvalid/Invalid
24-4External cumulative time 1124PossibleInvalid/Invalid
24-5External cumulative time 2164PossibleInvalid/Invalid
Data type
Subsection No.
Size
(bytes)
Write
System/axis
designation
Section No.26Axis common machine control information 2
Search
No.
26-10Spindle (SR.SF) Motor real speed89924Not possibleInvalid/Invalid
26-20Spindle (SR.SF) Motor load89882Not possibleInvalid/Invalid
Data type
Sub-
section No.
Size
(bytes)
Write
System/axis
designation
- 15 -
Remarks
Remarks
Including
override
4. Sub-section No. List
Section No.27Axis independent machine control information 2
Search
No.
Smoothing status, servo status
BIT0 : Ready ON
BIT1 : Servo ON
BIT2 : In emergency stop
BIT3 : In alarm
BIT4 : Z phase passing
BIT5 :
BIT6 : In-position
27-10
27-20Servo delay amount3084Not possibleValid/Valid
27-30Feed axis motor load A (%)3282Not possibleValid/Valid
27-31Feed axis motor load B (%)3302Not possibleValid/Valid
27-33Feed axis motor speed (rpm)3122Not possibleValid/Valid