MITSUBISHI CNC EZSocket Reference Manual

INTRODUCTION

Always read through this manual before use and fully understand the EZSocket function to ensure correct use.
TRADEMARKS
Windows, Windows NT, Visual C++ and Visual Basic are either trademarks or registered trademarks of Microsoft Corporation. EZSocket is a registered trademark of Mitsubishi Electric Corporation. Other brands and product names throughout this manual are trademarks or registered trademarks of the respective company.

SAFETY PRECAUTIONS

(Read these precautions before using.)
When using this product, thoroughly read this manual and the associated manuals. Pay careful attention to safety and handle the product properly. The safety precautions described here are in relation to this product. Get acquainted with this CNC unit and thoroughly study the safety information and precautions before use. These SAFETY PRECAUTIONS classify the safety precautions into two categories: "DANGER" and "CAUTION".
DANGER
!
Indicates that incorrect handling may cause hazardous conditions, resulting in death or severe injury.
CAUTION
!
Note that the items under " situation. Please follow all items listed in "Safety Precautions" as they are equally important. Keep this manual handy for your future reference.
Indicates that incorrect handling may cause hazardous conditions, resulting in medium or slight personal injury or physical damage.
!
CAUTION" could lead to serious consequences as well depending on the
[DESIGN PRECAUTIONS]
DANGER
!
• When connecting with NC unit, install an external safety circuit so that the entire system performs on the safe side when malfunction occurs in the external power supply or personal computer body.
• Incorrect input or incorrect operation may cause an accident.
• Writing function to NC unit directly affects to machine control.
• An unexpected operation may be resulted due to incorrect parameter setting. (EX. Setup)
• Execute after careful check.
[SETUP and MAINTENANCE PRECAUTIONS]
CAUTION
!
• Operation error could result in damage to machine or accident.
• Some functions may be different or may not be available depending on the version of NC unit.

CONTENTS

1. OVERVIEW ................................................................................................................................................ 1-1
1.1 Features .......................................................................................................................................................... 1-1
1.2 Supported Products ........................................................................................................................................ 1-1
1.3 Connection Configuration ............................................................................................................................... 1-2
1.3.1 Connection with MELDASMAGIC Series................................................................................................. 1-2
1.3.2 Connection with MELDAS600 Series....................................................................................................... 1-2
1.3.3 Connection with MELDAS C6/C64 Series ............................................................................................... 1-3
1.3.4 Connection with Mitsubishi CNC700 Series............................................................................................. 1-3
1.3.5 Connection with Mitsubishi CNC C70 Series ........................................................................................... 1-4
1.4 Development Environment.............................................................................................................................. 1-5
1.5 Installing EZSocket ......................................................................................................................................... 1-6
1.6 Using EZSocket .............................................................................................................................................. 1-6
1.7 EZSocket Interface ......................................................................................................................................... 1-7
1.7.1 EZSocket custom interface ...................................................................................................................... 1-7
1.7.2 EZSocket automation interface ................................................................................................................ 1-8
1.8 EZSocket Programming Procedure ................................................................................................................ 1-9
1.8.1 Programming procedure with VC++ (1) ................................................................................................... 1-9
1.8.2 Programming procedure with VC++ (2) ................................................................................................. 1-10
1.8.3 Programming procedure with VB (1).......................................................................................................1-11
1.8.4 Programming procedure with VB (2)...................................................................................................... 1-12
2. DETAILS OF I/F SPECIFICATION ............................................................................................................. 2-1
2.1 Common Items................................................................................................................................................ 2-1
2.2 Method List...................................................................................................................................................... 2-4
2.3 IEZNcCommunication3 Interface .................................................................................................................... 2-9
2.4 IEZNcSystem Interface ................................................................................................................................. 2-24
2.5 IEZNcPosition Interface ................................................................................................................................ 2-28
2.6 IEZNcCommand2 Interface .......................................................................................................................... 2-36
2.7 IEZNcProgram2 Interface ............................................................................................................................. 2-42
2.8 IEZNcTime Interface ..................................................................................................................................... 2-48
2.9 IEZNcAxisMonitor Interface .......................................................................................................................... 2-58
2.10 IEZNcRunStatus Interface .......................................................................................................................... 2-79
2.11 IEZNcFile5 Interface.................................................................................................................................... 2-85
2.12 IEZNcCommonVariable2 Interface ............................................................................................................ 2-111
2.13 IEZNcLocalVariable2 Interface ..................................................................................................................2-117
2.14 IEZNcTool3 Interface ................................................................................................................................ 2-120
2.15 IEZNcATC2 Interface ................................................................................................................................ 2-155
2.16 IEZNcParameter2 Interface ...................................................................................................................... 2-167
2.17 IEZNcOperation Interface ......................................................................................................................... 2-171
2.18 IEZNcDevice Interface .............................................................................................................................. 2-174
2.19 IEZNcGeneric2 Interface .......................................................................................................................... 2-182
2.20 IEZNcSubFunction2 Interface................................................................................................................... 2-190
3. ERROR CODE LIST................................................................................................................................... 3-1
4. HOW TO USE API ...................................................................................................................................... 4-1
4.1 EZSocketAPI Operation Procedure ................................................................................................................ 4-1
4.2 Initialization for OLE/COM Interface Use........................................................................................................ 4-2
4.3 Create EZSocket Object ................................................................................................................................. 4-3
4.4 EZSocket Include Files ................................................................................................................................... 4-3
4.5 Programming EZSocket Automation Interface by VB..................................................................................... 4-4
4.5.1 How to use EZSocket OLE automation interface by VB .......................................................................... 4-4
4.5.2 How to program by VB (1)........................................................................................................................ 4-6
4.5.3 How to program by VB (2)........................................................................................................................ 4-7
5. APPLICATION INSTALLATION PROCEDURE .......................................................................................... 5-1
5.1 Overview ......................................................................................................................................................... 5-1
5.2 Redistribution by Using EZSocket Installer for Redistribution ........................................................................ 5-1
5.2.1 Path to the folder in which EZSocket installer for redistribution is saved................................................. 5-1
5.2.2 Specification and processing of the EZSocket installer for redistribution ................................................ 5-2
5.2.3 Troubleshooting........................................................................................................................................ 5-4
5.3 Rules on EZSocket Redistribution .................................................................................................................. 5-5
5.3.1 Redistributable module group .................................................................................................................. 5-5
5.3.2 Redistributable files of EZSocket ............................................................................................................. 5-5
5.4 Installation ....................................................................................................................................................... 5-6
5.4.1 Upgrading redistributable files.................................................................................................................. 5-6
5.4.2 Install destination directory of EZSocket files........................................................................................... 5-6
5.5 Structure of the Install Destination Directory................................................................................................... 5-7
5.6 Registry Setting............................................................................................................................................... 5-8
5.6.1 Renewing EZSocket registry .................................................................................................................... 5-8
5.7 System Environment Variable Setting............................................................................................................. 5-8
5.8 COM Information Registry Setting .................................................................................................................. 5-9
5.9 Precaution for Uninstalling .............................................................................................................................. 5-9
6. SAMPLE APPLICATION............................................................................................................................. 6-1
6.1 Overview of Sample Application ..................................................................................................................... 6-1
6.2 Position Data Display Application ................................................................................................................... 6-1
6.2.1 Performance environment ........................................................................................................................ 6-1
6.2.2 Installation and uninstallation ................................................................................................................... 6-1
6.2.3 Executing sample application................................................................................................................... 6-1
6.2.4 Function list .............................................................................................................................................. 6-2
6.2.5 Screen configuration and functions.......................................................................................................... 6-2
6.2.6 Set project work space ............................................................................................................................. 6-4
6.2.7 IEZNcCommunication object3.................................................................................................................. 6-5
6.2.8 IEZNcPosition object ................................................................................................................................ 6-5
6.3 Monitoring Application..................................................................................................................................... 6-5
6.3.1 Performance environment ........................................................................................................................ 6-5
6.3.2 Installation and uninstallation ................................................................................................................... 6-6
6.3.3 Executing sample application................................................................................................................... 6-6
6.3.4 Function list .............................................................................................................................................. 6-6
6.3.5 Screen configuration and functions.......................................................................................................... 6-7
6.3.6 Setting project work space ....................................................................................................................... 6-8
6.4 Macro Sample Program .................................................................................................................................. 6-8
6.4.1 Performance environment ........................................................................................................................ 6-8
6.4.2 Installation and uninstallation ................................................................................................................... 6-8
6.4.3 Executing sample program....................................................................................................................... 6-8
7. CONSOLE PROGRAM SAMPLE............................................................................................................... 7-1
7.1 The Console Program to Connect to CNC C70 (Via Ethernet) ...................................................................... 7-1
7.2 The Console Program which Runs on the Computer on which MELDASMAGIC64 is Mounted ................... 7-4
7.3 The Console Program which Runs MELDASMAGIC64 From the Remote Personal Computer Connected by
Ethernet................................................................................................................................................................. 7-5
7.4 The Macro Sample Program that Uses EZSocketOLE Interface Macro ........................................................ 7-7
8. RESCTRICTION ........................................................................................................................................8-1
8.1 Restriction in Performance on EZSocket Server ............................................................................................ 8-1

1. OVERVIEW

EZSocket (CNC edition) is the middleware product that enables programming applications with Windows interface for MITSUBISHI numerical control unit, including CNC700 series, MELDAS 600 series, MELDAS C6/C64 series, MITSUBISHI CNC C70 series and MELDASMAGIC series. Development efficiency can be improved with EZSocket, by using the OLE interface with our MELDAS series, development is possible without knowing internal processes in the numerical controllers.

1.1 Features

The functions of MITSUBISHI CNC700 series, MELDAS 600 series, MELDAS C6/C64 series, MITSUBISHI
CNC C70 series and MELDASMAGIC64 can be easily used on Windows applications by Visual C ++, Visual Basic, and Visual Basic for Applications.
Complicated processes such as communication protocol between PC and MITSUBISHI CNC700 series,
MELDAS 600 series, MELDAS C6/C64 series, MITSUBISHI CNC C70 series or MELMAGIC are done in EZSocket. Thus, solution providers can develop highly functional application very quickly.
EZSocket also has variations that enable application programs on Windows PC to communicate with the
MITSUBISHI FA products other than MITSUBISHI CNC700 series, MELDAS 600 series, MELDAS C6/C64 series, MITSUBISHI CNC C70 series and MELDASMAGIC (including MELSEC sequencer, MELFA manufacturing robot, motion controller, and MELSERVO servo drive unit). Thus, the workload of solution providers can be drastically decreased by using API in the same way.
Immediately after our new products are released, corresponding new version of EZSocket will be released. By
using new version of EZSocket, solution providers can timely and easily develop or enhance application programs that support new products.

1.2 Supported Products

EZSocket supports the products mentioned below.
Table 1-1 Numerical control unit supported by EZSocket
Series Product name MITSUBISHI CNC700 series (hereinafter called "CNC700") M720M730M750
M70AM70B
MELDAS 600 series (hereinafter called "M6x5") M615M, M635M, M655M, M615L, M635L MELDASMAGIC series (hereinafter called "Magic64") MELDASMAGIC64* MELDAS C6/C64 series (hereinafter called "C64") MELDAS C6, MELDAS C64 MITSUBISHI CNC C70 series (hereinafter called "C70") C70
* EZSocket supports both PCI bus and ISA bus connection.
MELDASMAGIC64 products via PCI bus connection and those via ISA bus connection are hereinafter called, respectively, "PCI NC card" and "ISA NC card". For details such as model name, refer to BNP-B2191 ”MELDASMAGIC64 Setup Instruction Manual”.
1-1

1.3 Connection Configuration

This chapter explains the connection configuration between Mitsubishi CNC and PC. In order to carry out communication between CNC and PC using EZSocket, prepare necessary devices, such as CNC, PC, cable, etc. For details how to connect the deivces, refer to each CNC’s instruction manual.

1.3.1 Connection with MELDASMAGIC Series

PCI bus or ISA bus
Windows PC MELDASMAGIC64
Fig. 1-1 Conn

1.3.2 Connection with MELDAS600 Series

Windows PC M6x5M/L
Fig. 1-2 Conn
with MELDASMAGIC Series
ection
with MELDAS600 Series
ection
Ethernet
To use ME LDAS600 S eri es, setup of
MELDAS 600 S eries is n ecess ary. For details of setup, refer to
BAD-80 1Q048
1-2

1.3.3 Connection with MELDAS C6/C64 Series

Ethernet
Windows PC
Fig. 1-3 Conn

1.3.4 Connection with Mitsubishi CNC700 Series

ection
Windows PC
MELDAS C6/C64
with MELDAS C6/C64 Series
Ethernet
CNC 700M/L
Fig. 1-4 Conn
with Mitsubishi CNC700 Series
ection
1-3

1.3.5 Connection with Mitsubishi CNC C70 Series

The connection path between Mitsubishi CNC C70 Series and PC is as follows.
Model Connection path Connected module Figure No.
CNC C70
Ethernet connection CNC C70 Fig. 1-5 Ethernet connection via QJ71E71 QJ71E71 Fig. 1-5 Ethernet connection via QnUDE QnUDE Fig. 1-5 USB connection via QnUD QnUD Fig. 1-6 RS-232C connection via QnUD QnUD Fig. 1-6 USB connection via QnUDE QnUDE Fig. 1-6 GOT transparent
Base unit Fig. 1-7 (USB connection) GOT transparent
Base unit Fig. 1-7 (RS-232C connection)
Table 1-1 Connection path with Mitsubishi CNC C70 Series
Ethernet
C on ne ct t h e Et he r n et cable to CNC C70 or QJ71E71 or QnUD E.
Windows PC
CNC C70
Fig. 1-5 Ethernet connection with Mitsubishi CNC C70 Series
USB or RS-232C
Connect the USB c able
to QnU D o r QnUD E,
and th e RS-232C cable
to QnUD.
Windows PC CNC C 70
Fig. 1-6 Connection with Mitsubishi CNC C70 Series via QnUD
1-4
GOT1575
GOT1000
USB o r RS-23 2C
Windows PC
Bus connection
CNC C70
Fig. 1-7 GOT transparent with Mitsubishi CNC C70 Series

1.4 Development Environment

The required environment for development with EZSocket is as follows.
Table 1-2 Development and operation environment
Items Spec. Personal computer IBM PC / AT compatible (x86 processor)
CPU Intel Pentium90MHz or more (Pentium 133MHz or more is recommended) Bus ISA bus or PCI bus when mounting MELDASMAGIC64 OS Microsoft WindowsXP Home Edition, Japanese edition/English edition (*3)
Microsoft WindowsXP Professional, Japanese edition/English edition (*3) Microsoft Windows2000 SP3 and later, Japanese edition/English edition (*3) Microsoft Windows NT Ver4.0 SP4 and later, Japanese edition/English edition (*1) (*6) (*7) Microsoft WindowsMe, Japanese edition/English edition (*1) (*3) (*6) (*7) Microsoft Windows98SE, Japanese edition/English edition (*1) (*3) (*6) Microsoft Windows 95OSR2 and later, Japanese edition/English edition (*1) (*4) (*6) (*7) In development 96MB or more (128MB or more is recommended) Memory
In operation 32MB or more (64MB or more is recommended) Disk space 42MB or more (60MB or more is recommended) Peripheral device Floppy disk drive corresponding to 3.5 inches / 1.44MB format
CD-ROM drive Programming language Microsoft Visual C++.NET 2003 (*2)
Microsoft Visual C++ Ver.5.0, 6.0
Microsoft Visual Basic Ver.5.0 (*5), 6.0
Microsoft Visual Basic for Applications Ver.5.0 (Equivalent to Excel97VBA) (*5),
Ver.6.0 (Equivalent to Excel2000VBA) Remark (*1) Development unavailable with Microsoft Visual C++.NET 2003.
(*2) Development must be done by the native code (VC++). Manage code is not
available. (*3) Not supported by MELDASMAGIC64 (ISA NC card). (*4) Not supported by MELDAS C6/C64. (*5) As VB5.0 and VBA Ver.5.0 don’t support DCOM, they cannot be used for MELDAS M600 series. (*6) Not supported by MITSUBISHI CNC 700 Series and MITSUBISHI CNC C70 series. (*7) Not supported by MELDASMAGIC64(PCI NC card).
1-5

1.5 Installing EZSocket

EZSocket Dynamic Link Library (DLL) is necessary to use EZSocket. Please refer to "Release note" that shows how to install EZSocket.

1.6 Using EZSocket

When creating applications with VC++, VB, or VBA by using EZSocket, the following include file or module is necessary. Table 1-3 shows the folder and file names when the CD-ROM, EZSocketNc, is installed on C drive.
Table 1-3 List of include files for each development language
VC++ VB, VBA Install folder C:\EZSocket\EZSoketNc\include\Vc C:\EZSocket\EZSoketNc\include\Vb
File EZSocketNc.h
EZSocketNcStr.h EZSocketNc_i.c EZSocketNcDef.h EZSocketNcErr.h
EZSocketCommonErr.h In order to use EZSocket with Mitsubishi CNC C70 Series, following installation and inclusion are required beforehand; installing EZSocket for MELSEC PLC (EZSocketPc), and including EasysocketDef.h. For redistributable files of EZSocket for MELSEC PLC (EZSocketPc), and how to install, refer to User's Manual of EZSocket for MELSEC PLC.
EZNcDef.bas EZNcErr.bas EZComErr.bas
1-6

1.7 EZSocket Interface

EZSocket provides 2 kinds of interfaces as DLL type inprocess server, EZSocket custom interface and EZSocket automation interface. The both interfaces have nearly the same functions as for the data access. EZSocket custom interface is fit for programming with VC++, and EZSocket automation interface is fit for programming with VB or VBA. Please choose one of them depending on the programming language you use. EZSocket interface is based on Microsoft COM (Compact Object Model). When using EZSocket, general knowledge of COM is essential though this manual is not explaining COM.

1.7.1 EZSocket custom interface

T
able 1-4 i
Interface name has to be "IEZNcXxxx", meaning it is EZSocket custom interface for MELDAS CNC.
Table 1-4 EZSocket custom interface list
(Note 1) Due to upgrade of EZSocket, the interface name may be changed. However, as the new interface succeeds
(Note 2) Mitsubishi CNC C70 Series doesn't support the automation interface.
s EZSocket custom interface list.
Component Interface Classification
EZNcCommunication IEZNcCommunication3 Communication IEZNcSystem NC system IEZNcPosition Position IEZNcCommand2 Command (Command value) IEZNcProgram2 Program IEZNcTime Time IEZNcAxisMonitor Axis monitor IEZNcStatus Status IEZNcFile5 File IEZNcCommonVariable2 Common variable IEZNcLocalVariable2 Local variable IEZNcTool3 Tool IEZNcATC2 ATC IEZNcParameter2 Parameters IEZNcOperation Operation IEZNcDevice PLC device IEZNcGeneric2 Generic (for general purpose) EZNcSubFunction IEZNcSubFunction2 Sub function
the old interface, the old one remains available. E.g.) IEZNCFile4→IEZNcFile5
In addition, as the old interface is for backward compatibility, when newly introducing EZSocket, use the new interface.
1-7

1.7.2 EZSocket automation interface

Table 1-5 i
s EZSocket automation interface list. EZSocket automation interface includes all the functions in one interface, and it makes programming with VB easier. Interface name has to be "IDispEZNcXxxxx", meaning it is EZSocket automation interface for MELDAS CNC.
Table 1-5 EZSocket automation interface list
Component Interface Classification
DispEZNcCommunication IDispEZNcCommunication Communication NC system Position Command (Command value) Program Time Axis monitor Status File Common variable Local variable Tool ATC Parameters PLC device Operation Generic (for general purpose) DispEZNcSubFunction IDispEZNcSubFunction Sub function
(Note) Mitsubhisi CNC C70 Series doesn’t support the automation interface.
1-8

1.8 EZSocket Programming Procedure

1.8.1 Programming procedure with VC++ (1)

The following flowchart shows the programming procedure with EZSocket custom interface with VC++ in creating an application that works with the PCs with MELDASMAGIC64 and an application for Mitsubishi CNC 700 Series, MELDAS C6/64 Series, and Mitsubishi CNC C70 Series.
Initialize COM library
Create the communication object
Create the query object
Open the communication line
lret = CoInitialize(NULL); *1
IEZNcCommunication3* m_pezComm;
IEZNcPosition* m_pezPos;
CLSID clsid;
CLSIDFromProgID(L"EZSocketNc.EZNcCommu nication",&clsid); *2
lret =CoCreateInstance(clsid,
NULL,
CLSCTX_INPROC_SERVER,
IID_IEZNcCommunication3,
(void**)&m_pezComm);
lret = m_pezCommÆQueryInt erface(IID_ IEZNcPos ition,
(void**)&m_pezPos);
lret = m_pezCommÆ SetTCPIPProtocol(...); *3
lret=m_pezCommÆOpen2(...);
Various processing lret=m_ pezComm ÆSetHead(...)
lret=m_pezPosÆGetMachinePsition(...);
lret=m_pezPosÆGetCurre ntPsition(...);
lret=m_pezPosÆGetWorkPosition(...);
Close the communication line
Release the object
Release COM library
m_pezCommÆClose(...);
m_pezCommÆRelease ( );
m_pezComm = NULL;
m_pezPosÆRelease( );
m_pezPos = NULL;
CoUninitialized( ); *1
*1 When using EZSocket in the thread, call COM library variable CoInitialize( ) before using EZSocket, and then call CoUninitialize( ) after using EZSocket. After using each object of EZSocket, call Release( ) to release the object (decrement of reference count). *2 In the case of a program to be connected to MELDAS600 Series, match PROGID with EZSocket embedded in
the body of MELDAS600 Series . When designating PROGID, explicitly designate the interface version, too. E.g.: "EZSocketNc.EZNcCommunication.7" As for PROGID of EZSocket embedded in the body of MELDAS600 Series, contact us via your seller of MELDAS600 Series. *3 When creating an application for CNC700 or C64 Series, call SetTCPIPProtocol before Open. However, when
creating an application for C70, do not call SetTCPIPProtocol but SetMelsecProtocol.
1-9

1.8.2 Programming procedure with VC++ (2)

The following
flowchart shows the programming procedure with EZSocket custom interface with VC++ in creating an application remote-controlled by a PC connected by Ethernet. However, in the case of CNC700, C64 Series or C70, follow the procedure in 1.7.1. even when connected by Ethernet. To perform this procedure, EZSocket must be installed in the PC connected by Ethernet.
Initialize COM library lret = CoInitialize(NULL); *1 IEZNcCo mmunication3 * m_pezComm;
IEZNcPosition* m_pezPos; MULTI_QI qi; qi.hr = 0; qi.pIID = &IID_IUnknown; qi.pItf = 0; COSERVERINFO csi = { 0,L"10.20.123.12",NULL,0}; CLSID clsid; CLSIDFromProgID(L"EZSocketNc.EZNcCommunication",&clsid); *2 Connect with target remote machine lret=CoCreateInstanceEx(clsid, NULL, CLSCTX_RE MOTE_ SERVER, &csi, 1, &qi ); Create the c ommunication object lret = qi.pItfÆQueryInterface(IID_IEZNcCommunication3, (void**)&m_pezComm ); Create the query object lret = m_pezCommÆQueryInterface(IID_IEZNcPosition, (void**)&m_pezPos);
IP address, domain name, etc.
Open the communication line lret = m_pezCommÆ Open2(...);
lret = m_pezCommÆSetHead(...);
Various processing lret = m_pezPosÆGetMachinePosition(...);
lret = m_pezPosÆGetCurrentPosition(...);
lret = m_pezPosÆGetWorkPosition( ...);
Close the communication line
Release the object
Release COM library
m_pezCommÆClose(...);
m_pezCommÆRelease( );
m_pezComm = NULL;
m_pe zPos ÆReleas e( );
m_pezPos = NULL;
qi.pItfÆRelease( );
CoUninitialized( ); *1
*1 Refer to *1 of 1.8.1. *2 Refer to *2 of 1.8.1.
1-10

1.8.3 Programming procedure with VB (1)

The following
flowchart shows the programming procedure with EZSocket automation interface with VB in creating
an application that works with the PCs with MELDASMAGIC64 or an application for CNC700 or C64 Series.
(1) How to call EZSocket by early binding
For early binging, reference setting is necessary for the type library of EZSocket automation interface in advance.
Create the EZSocket object Dim EZNcCom As New DispEZNcCommunication
lret = EZNcCom.SetTCPIPProtcol(...) *1
Open the communication line lret = EZNcCom.Open2(..., "EZNC_LOCALHOST")
Means local host designation
Iret = EZNcCom.SetHead(...)
Various processing Iret = EZNcCom.Position_GetMachinePosition(...)
Iret = EZNcCom.Position_GetCurrentPosition(...)
Iret = EZNcCom.Position_GetWorkPosition(...)
Close the communication line lret = EZNcCom.Close(...)
Release the object Set EZNcCom= Nothing
(2) How to call EZSocket by late binding
In late binding, reference setting is not necessary. However, VB’s object browser function cannot be used.
Declare the EZSocket object Dim EZNcCom As Object Create the EZSocket object Set EZNcCom=CreateObject(“EZNcAut.DispEZNcCommunication.5”) *2
Means local host designation
lret = EZNcCom.SetTCPIPProtcol(...) *1
Open the communication line lret = EZNcCom.Open2(..., "EZNC_LOCALHOST")
lret = EZNcCom.SetHead(...)
Various processing lret = EZNcCom.Position_GetMachinePosition(...)
lret = EZNcCom.Position_GetCurrentPosition(...)
lret = EZNcCom.Position_GetWorkPosition(...)
Close the communication line lret = EZNcCom.Close(...)
Release the object Set EZNcCom= Nothing
*1 Only when creating an application for CNC700 or C64 Series, call SetTCPIPProtocol before Open. *2 Refer to *2 of 1.8.1.
1-11

1.8.4 Programming procedure with VB (2)

The following
flowchart shows the programming procedure with EZSocket automation interface with VC++ in
creating an application remote-controlled by a PC connected by Ethernet.
(1) How to call EZSocket by early binding
For early binging, reference setting is necessary for the type library of EZSocket automation interface in advance.
Create the EZSocket object Dim EZNcCom As New DispEZNcCommunication
Open the communication line lret = EZNcCom.Open2(..., "10.20.123.12")
IP address, domain name, etc.
Iret = EZNcCom.SetHead(...)
Various processing Iret = EZNcCom.Position_GetMachinePosition(...)
Iret = EZNcCom.Position_GetCurrentPosition(...)
Iret = EZNcCom.Position_GetWorkPosition(...)
Close the communication line lret = EZNcCom.Close(...)
Release the object Set EZNcCom= Nothing
(2) How to call EZSocket by late binding
In late binding, reference setting is not necessary. However, VB's object browser function cannot be used.
Declare the EZSocket object Dim EZNcCom As Object Create the EZSocket object Set EZNcCom=CreateObject("EZNcAut.DispEZNcCommunication.7")*1
IP address, domain name, etc.
Open the communication line lret = EZNcCom.Open2(..., "10.20.123.12")
lret = EZNcCom.SetHead(...)
Various processing lret = EZNcCom.Position_GetMachinePosition(...)
lret = EZNcCom.Position_GetCurrentPosition(...)
lret = EZNcCom.Position_GetWorkPosition(...)
Close the communication line lret = EZNcCom.Close(...)
Release the object Set EZNcCom = Nothing
*1 Refer to *2 of 1.8.1.
1-12

2. DETAILS OF I/F SPECIFICATION

2.1 Common Items

(1) Character Code UNICODE is used for all character string parameter of EZSocket interface.
(2) How to treat character code When using character string data, EZSocket allocates the memory when returning the character string data to an application. Make the application release the memory of disused character string data, or it causes memory leak. When programming application by using EZSocket custom interface with VC++, release the memory of character string region explicitly with CoTaskMemFree( ). When programming application by using EZSocket automation interface with VC++, release the memory of character string region explicitly with SysFreeString( )
(3) How to treat error code Method returns 2 types of return value, (S_OK) and (S_FALSE). (S_OK) is returned when exited normally. (S_FALSE) is returned when failed. The detailed error code is returned as argument. The common error messages are below.
EZ_ERR_NOT_OPEN: Communication line is not opened EZ_ERR_DOUBLE_OPEN: Double open error EZ_ERR_DATA_TYPE: Data type of the argument is illegal EZ_ERR_DATA_RANGE: Data range of the argument is illegal EZ_ERR_NOT_SUPPORT: Not supported EZ_ERR_NULLPTR: Argument is NULL pointer
(4) How to treat errors when calling the interface that is not supported by the model When calling the interface that is not supported by the model, EZ_ERR_NOT_SUPPORT is output.
(5) Descriptions of section 2.3 and later Detailed specifications of each method are shown in section 2.3 and later with following Items and contents.
Argument”: Describes the argument specifications for the method. “Return value: Describes the return values to the method. “Functions”: Describes the function outline of the method. “Reference”: Describes the related methods. “Designation”: Describes any required designations of part system #, PLC axis part system # or axis #.
Unless the method is used with the described designations, the operation is not guaranteed. Required designations are described as follows. System: Designation of part system # is required. Use SetHead() for the designation. PLC axis: Designation of PLC axis part system # is required. Use SetHead() for the designation. Axis: Designation of axis # is required.
Some methods, such as the one in 2.12.1, may not require the part system designation due to the argument value, although System is shown in the column. See the complements at “Designation” column of each method.
(6) Restriction in the method that requires part system designation The result is uncertain when the method is executed with the invalid part system designated. Please confirm that the designated part system is valid before the execution. In addition, after opening the EZSocket line open, part system 1 is designated.
2-1
(7) Designation of a file name EZSocket treats NC system(*1) as a drive, and treats various kinds of data (including machining programs and tool offsets) on NC system as files. Unless any exceptions are provided, EZSocket uses the following designation of a file name to access a file on NC system: Drive name+”:”+\Directory name+\File name Always use the absolute path to designate a file name. *2 The correspondence of drive names to NC system #s is as follows.
NC system # Drive name (NC memory)
01 M01 02 M02 03 M03 : : : : FF MFF
*1 Described as “NC card” from next section in this EZSocket manual. “NC card” is referred to as “NC control unit” in
other manuals of NC series except Magic64.
*2 Use capital letters to designate a file name.
(8) Restriction in calling from more than one thread of Mitsubishi CNC C70 Series In the case of Mitsubishi CNC C70 Series, if the number of threads using EZSocket exceeds 1000, error codes may not be output correctly. In creating an application for Mitsubishi CNC C70 Series, pay attention to the number of threads using EZSocket.
2-2
(9) Precaution when connecting to multiple CNCs
Personal computer
Objects
An object cannot communicate with multiple CNCs. Use several different objects to communicate with multiple CNCs.
NC1 (IP address: XX.YY.ZZ.AAA)
NC system # (Card #): 01
Drive name: M01
NC system # (Card #): 02
Drive name: M02
NC Memory
Programs: M01:\PRG\USER\
: :
NC2 (IP address: XX.YY.ZZ.BBB)
NC Memory
Programs: M02:\PRG\USER\
: :
Parameters: M01:\PRM\
Variables: M01:\DATA\
Parameters: M02:\PRM\
Variables: M02:\DATA\
CF card
M01:\IC1\
CF Card
M02:\IC1\
NC (IP address: XX.YY.ZZ.***)” stands for NC #
NC system # (Card #): 0
Drive name: M0
NC Memory
Programs: M0:\PRG\USER\
:
Parameters: M0:\PRM\
Variables: M0:\DATA\
CF Card
M0:\IC1\
:
2-3

2.2 Method List

Table 2-1 Interface list A: Available, L: Available with limitation, U: Unavailable
No Function class Interface (Operation) Function Availability
Magic64
M6x5M
M6x5L
C64
C70
*1
CNC700
2.3.1 IEZNc- Open2 Opening NC card system line A A A A
2.3.2 Communication3 Close Closing NC card system line A A A A
2.3.3 (Communication) SetHead Setting part system A A A A
2.3.4 GetHead Getting the part system A A A A
2.3.5 SetTCPIPProtocol Setting TCPIP communication U U U A
2.3.6 SetMelsecProtocol Setting MELSEC communication
2.3.7 SetModalCondition Setting modal communication condition U U U A
2.3.8
2.4.1 IEZNcSystem
2.4.2 GetSystemInformation Getting the NC system information A A A A
2.4.3 GetAlarm Getting the alarm information A A A A A A
2.5.1 IEZNcPosition
2.5.2 GetMachinePosition Getting the machine position
2.5.3 GetCurrentPosition Getting the current position A A A A
2.5.4 GetDistance Getting the remaining distance
2.5.5 GetNextDistance Getting the next travel distance A A A A
2.5.6 GetFeedSpeed Getting the feedrate A A A A
2.5.7 GetManualOverlap Getting the manual interruption amount A A A A
2.5.8 GetProgramPosition Getting the program position U A A A
2.6.1 IEZNcCommand2
2.6.2 GetToolCommand Getting the tool offset # A A U A
2.6.3 GetFeedCommand Getting the feedrate command value A A A A
2.6.4 GetCommand2 Getting the M/S/T/B modal command
2.6.5 SetCommand2 Setting manual command (M, S, T, B) L A A L
2.7.1 IEZNcProgram2 CurrentBlockRead Reading the current block A A A A
2.7.2 (Program) GetProgramNumber2 Getting the program # (main, sub) A A A A
2.7.3 GetSequenceNumber Getting the sequence # (main, sub) A A A A
2.7.4 GetBlockNumber Getting the block # (main, sub) A A A A
2.7.5 GetSubProLevel Getting the sub program calling level A A A A
2.7.6 GetInformation Getting the program information A A U A
2.8.1 IEZNcTime GetClockData Getting the date/time A A L A
2.8.2 (Time) SetClockData Setting date/time A A A A
2.8.3 GetAliveTime Getting the power ON time A A A A
2.8.4 SetAliveTime Setting power ON time A A A A
2.8.5 GetRunTime Getting the automatic operation time A A A A
2.8.6 SetRunTime Setting automatic operation time A A A A
2.8.7 GetStartTime Getting the automatic start time A A A A
2.8.8 SetStartTime Setting automatic start time A A A A
2.8.9 GetEstimateTime Getting the external elapsed time (1, 2) A A A A
2.8.10 SetEstimateTime Setting external elapsed time (1, 2) A A A A
(NC system)
(Position)
(Command)
GetModalCondition Getting modal communication
condition
GetVersion Getting the system #, name and control
S/W version
GetWorkPosition Getting the workpiece coordinate
position (Skip ON supported)
(Skip ON supported)
(Skip ON supported)
GetGCodeCommand Getting the G-code modal command
value
value
U U U
U
U U U A
L A A A
A A A A
A A A A
A A A A
A A A A
A A A A
A
A
A
A
U AU
U
U
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
U
U
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
2-4
No Function class Interface (Operation) Function Availability
Magic64
M6x5M
M6x5L
C64
C70
*1
CNC700
2.9.1 IEZNcAxisMonitor GetServoMonitor Servo monitor L A A A
2.9.2 (Axis monitor) GetServoVersion Getting the servo information U A A A
2.9.3 GetServoDiagnosis Getting the servo diagnosis information U A A A
2.9.4 GetPowerVersion Getting the power supply version
U A A A
U
U
U
U
information
2.9.5 GetPowerDiagnosis Getting the power supply diagnosis
U A A A
U
information
2.9.6 GetSpindleMonitor Spindle monitor
L A A A
U
(Function limited for Magic64)
2.9.7 GetSpindleVersion Getting the spindle version information U A A A
2.9.8 GetSpindleDiagnosis Getting the spindle diagnosis
U A A A
U
U
information
2.9.9 GetAbsPositionMonitor Getting the absolute position monitor
U A A A
U
information
2.9.10 GetAuxAxisMonitor Getting the auxiliary axis monitor
U A U A
U
information
2.9.11 GetAuxAxisDiagnosis Getting the auxiliary axis diagnosis
U A U A
U
information
2.9.12 GetAuxAxisVersion Getting the auxiliary axis version
U A U A
U
information
2.9.13 GetDowelTime Getting the remaining dwell time A A A A
2.10.1 IEZNcRunStatus GetInvalidStatus Getting the invalid status A A A A
2.10.2 (Status) GetCommandStatus Getting the operation command status A
U
U
2.10.3 GetCuttingMode Getting the cutting mode A A A A
2.10.4 GetAxisStatus Getting the axis status A A A A
2.10.5 GetRunStatus Getting the operation status A A A A
U
A
A
A
A
A
A
2.11.1 IEZNcFile5 FindDir Finding directory A A A A A A
2.11.2 (File) FindNextDir Finding the next directory A A A A
2.11.3 ResetDir Finishing the directory search A A A A
2.11.4 Copy2 *2 File copy A A A A
2.11.5 Delete2 *2 Deleting file A A A A
2.11.6 Rename2 *2 Renaming file A A A A
2.11.7 GetDriveInformation Getting the drive information A A A A
2.11.8 GetDriveSize Getting the drive free capacity A A A A
2.11.9 OpenFile3 *3 Opening file A A A A
2.11.10 CloseFile2
*2*3
Closing file A A A A
2.11.11 AbortFile2 *2 Closing file compulsorily A A A A
2.11.12 ReadFile2 *2 Reading the file A A A A
2.11.13 WriteFile Writing file A A A A
2.11.14 OpenNCFile2 *2 Opening NC program file A A A A
2.11.15 CloseNCFile2 *2 Closing NC program file A A A A
2.11.16 AbortNCFile2 *2 Closing NC program file compulsorily A A A A
2.11.17 ReadNCFile2 *2 Writing NC program file A A A A
2.11.18 WriteNCFile Reading the NC program file A A A A
A
A
A
A
A
A
A
A
A
A
A
A
U
U
U
U
U
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
2-5
No Function class Interface (Operation) Function Availability
Magic64
M6x5M
M6x5L
C64
C70
*1
CNC700
2.12.1 IEZNcCommon­Variable2
2.12.2 (Common variable)
2.12.3 GetSize Getting the the number of common
2.12.4 GetName Getting the common variable name
2.12.5 SetName Setting common variable name
2.12.6 GetCVNullData Getting the common variable null data A U A A
2.13.1 IEZNcLocalVar­iable2
2.13.2 (Local variable) GetMacroLevel Getting the macro sub program
2.13.3 GetLVNullData Getting the local variable null data A U A A
2.14.1 IEZNcTool3 GetToolSetSize Getting the the number of tool offset sets A A A A
2.14.2 (Tool) GetType Getting the tool offset type A A A A
2.14.3 GetOffset Getting the tool offset value data A A A A
2.14.4 SetOffset Setting tool offset value data A A A A
2.14.5 GetToolWorkOffset Getting the workpiece coordinate
2.14.6 SetToolWorkOffset Setting workpiece coordinate system
2.14.7 GetSurface Getting the reference surface level A A U A
2.14.8 SetSurface Setting reference surface level A A U A
2.14.9 GetToolLifeType2 Getting the tool life management type 2 U A A A
2.14.10 SetToolLifeType2 Setting tool life management type 2 U A A A
2.14.11 GetToolLifeGroupList Getting the tool life management group
2.14.12 AddToolLifeGroup Adding tool life management group # U A U U
2.14.13 ChangeToolLifeGroup Changing tool life management group # U A U A
2.14.14 DeleteToolLifeGroup Deleting tool life management group # U A U A
2.14.15 GetToolLifeToolNoList Getting the tool list in the tool life
2.14.16 AddToolLifeToolNo Adding tool # in the tool life
2.14.17 ChangeToolLifeToolNo Changing tool # of tool life management U A U A
2.14.18 DeleteToolLifeToolNo Deleting tool # of tool life management U A U A
2.14.19 GetToolLifeValue Getting the tool life management data U A A A
2.14.20 SetToolLifeValue Respective setting of tool life
2.14.21 SetToolLifeValue2 Setting tool life management data U A A A
2.14.22 GetSpareTool Getting the spare tool for tool life
2.14.23 SetSpareTool Setting spare tool for tool life
CommonVRead Reading the common variables
(#100, #500)
CommonVWrite Writing common variables (#100, #500) A A A A
variable sets (#100, #500)
(#500 to #519)
(#500 to #519)
LocalVRead Reading the local variable A A A A
execution level (Level 0 to 4)
system offset (#54 to 60)
offset (#54 to 60)
# list
management group
management group
management data
management
management
A A A A
A A A A
A A A A
A A A A
A A A A
A A A A
A A A A
U A U A
U A U A
U A U A
U A A A
U U A U
U U A U
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
A
U
A
U
A
U
A
U
A
U
A
U
A
U
A
U
A
U
A
U
A
U
U
U
A
U
A
U
A
U
A
U
A
U
A
U
A
U
A
U
A
U
U
U
U
U
2-6
No Function class Interface (Operation) Function Availability
Magic64
M6x5M
M6x5L
C64
C70
*1
CNC700
2.15.1 IEZNcATC2 (ATC)
2.15.2 GetMGNSize Getting the total number of the ATC
GetMGNControl Getting the control parameter for ATC
tool register
A A U A
A A U A
magazine pot sets
2.15.3 GetMGNSize2 Getting the number of pots of each ATC
U A U A
magazine
2.15.4 GetMGNReady Getting the ATC ready tool # A A U A
2.15.5 GetMGNPot Getting the tool # of the ATC magazine
A A U A
pot
2.15.6 GetMGNPot3 *4 Getting the tool # of each ATC
U A U A
magazine pot
2.15.7 SetMGNPot Setting tool # of the ATC magazine pot A A U A
2.15.8 SetMGNPot3 *4 Setting tool # of the pot of each ATC
U A U A
magazine
2.15.9 GetMGNPotEx Getting the tool # of the ATC extended
A U U U
magazine pot
2.15.10 SetMGNPotEx Setting tool # of the ATC extended
A U U U
magazine pot
2.15.11 GetMGNAux Getting the ATC user PLC interface A A U A
2.15.12 SetMGNAux Setting ATC user PLC interface A A U A
2.16.1 IEZNcParameter2 GetParameterData Getting the parameter L*5 A A A
2.16.2 (Parameter) SetParameterData Setting parameter L*5 A A A
2.17.1 IEZNcOperation Search Search A A A A
2.17.2 (Operation) Run Starting PLC program A A A A
2.17.3 Stop Stopping PLC program A A A A
2.18.1 IEZNcDevice SetDevice Setting device A A A A
2.18.2 (Device) DeleteDeviceAll Deleting all device setting A A A A
2.18.3 ReadDevice Reading the device A A A A
2.18.4 WriteDevice Writing device A A A A
2.19.1 IEZNcGeneric2 ReadData Reading the generic data A A A A
2.19.2 (Generic) WriteData Writing generic data A A A A
2.19.3 SetData Setting data A A A A
2.19.4 DeleteDataAll Deleting all data setting A A A A
2.19.5 ReadBlockData Batch reading of data A A A A
2.19.6 WriteBlockData Batch writing of data A A A A
2.20.1 IEZNcSubFunction ChangeInit Initializing sub function A A A A
2.20.2 2(Sub function) GetToolLifeValueOfFile Getting the tool life management data of
U A A U
tool life management file
2.20.3 SetToolLifeValueOfFile Setting the tool life management data of
U A A U
tool life management file
2.20.4 GetToolLifeValueOfFile2 Getting tool life management data of
U A A A
tool life management file
2.20.5 SetToolLifeValueOfFile2 Setting tool life management data of tool
U A A A
life management file
2.20.6 GetSpareToolOfFile Getting tool exchange data of tool life
U U A U
management tile
2.20.7 SetSpareToolOfFile Setting tool exchange data of tool life
U U A U
management tile
2.20.8 GetToolWorkOffsetOfFile Getting the workpiece coordinate
A A A A system offset data of workpiece offset file
2.20.9 SetToolWorkOffsetOfFile Setting workpiece coordinate system
A A A A offset data of workpiece offset file
2-7
A
U
A
U
A
U
A
U
A
U
A
U
A
U
A
U
U
U
U
U
A
U
A
U
A
A
A
A
A
A
A
A
A
A
A
U
A
U
A
U
A
U
*6
A
U
*6
A
U
A
A
A
A
A
A
A
A
A
U
U
U
U
U
U
U
U
U
U
U
U
U
A
U
A
U
*1) Mitsubishi CNC C70 Series doesn’t support the automation interface. *2) In this method, modifications have been added to the functions supporting MELDASC6/C64 Series.
Conventional method is available to get the backward compatilibity.
*3) In this method, a file overwrite function has been added for Mitsubishi CNC700 Series. Conventional method
remains available to get the backward compatilibity.).
*4) In this method, modifications have been added to the functions supporting Mitsubishi CNC 700 Series.
Conventional method is available to get the backward compatilibity. *5) Unavailable with PCI NC card. ISA NC card limits the function. Contact MITSUBISHI before using the card. *6) Mitsubishi CNC C70 Series doesn't support this method, but reading and writing general-purpose data is enabled
by use of ReadBlockData and WriteBlockData.
2-8

2.3 IEZNcCommunication3 Interface

Magic64 M6x5M M6x5L C64 C70 CNC700
2.3.1 IEZNcCommunication3::Open2 Opening line
Calling procedure (Custom interface) HRESULT Open2 (
LONG lSystemType, // (I) Setting NC system type LONG lMachine, // (I) Setting NC card LONG lTimeOut // (I) Setting communication timeout period LONG* plRet // (O) Error code
) Calling procedure (Automation interface) Open2(
lSystemType As LONG // (I) Setting NC system type lMachine As LONG // (I) Setting NC card lTimeOut As LONG // (I) Setting communication timeout period bstrHostName As STRING // (I) Host name
) As LONG // (O) Error code Argument
lSystemType: Set NC system type
Value Meaning
EZNC_SYS_MELDAS6x5M Starts connecting with M6x5M EZNC_SYS_MELDAS6x5L Starts connecting with M6x5L EZNC_SYS_MAGICBOARD64 Starts connecting with Magic64 EZNC_SYS_MELDASC6C64 Starts connecting with C64 EZNC_SYS_MELDASC70 Starts connecting with C70
EZNC_SYS_MELDAS700M Starts connecting with CNC700M EZNC_SYS_MELDAS700L Starts connecting with CNC700L
lMachine: Set NC card #
When connecting to more than one NC, designate different NC card No. for each NC.
(Number: 1 to 255)
lTimeOut: Set communication timeout period. However, with Magic64 and C70, this value is
invalid. Magic64 communication timeout period is 180 seconds fixed.Set C70's communication timeout period with lTimeOut of SetMelsecProtocol().
Value Meaning
1 to 3000 Timeout amount (Unit: 100ms)
(With C64 or CNC700, set the timeout value to 10 or higher. If timeout error occurs, increase the value.)
bstrHostName: Set the host name of the NC system to connect. IP address setting is available.
To connect to the local host, set "EZNC_LOCALHOST" as a character string. In the case of C64 or CNC700, always set "EZNC_LOCALHOST".
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZ_ERR_DATA_TYPE: Data type of the argument is illegal EZNC_SYSFUNC_IOCTL_ADDR_: NC card # is illegal EZNC_SYSFUNC_IOCTL_NOTOPEN: Device not open EZNC_SYSFUNC_IOCTL_DATA: Open parameter data range is illegal EZNC_COMM_NOTSETUP_PROTOCOL: TCP/IP communication has not been set
(Only in the case of C64 or CNC700.)
EZNC_COMM_NOTMODULE: Submodules don’t exist EZNC_COMM_CREATEPC: Impossible to create an EZSocketPc object
(Only in the case of C70)
2-9
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This starts connecting the line of IEZNcCmmunication3 object. In the case of C64 or CNC700, make sure to perform communication setting by executing SetTCPIPProtocol() before Open. In addition, in the case of C70, before carrying out Open, make sure to execute SetMelsecProtocol() for communication setting. If not, an error occurs at executing Open2().
(Note 1) Mitsubishi CNC C70 Series doesn’t support the automation interface. (Note 2) The existing interface IEZNcCommunication2::Open() continues to be available for backward compatibility. When newly introducing EZSocket, use this method.
Reference Close(),
SetTCPIPProtocol(), SetMelsecProtocol()
Designation
2-10
Magic64 M6x5M M6x5L C64 C70 CNC700
2.3.2 IEZNcCommunication3::Close Closing line
Calling procedure (Custom interface) HRESULT Close(
LONG* plRet // (O) Error code
) Calling procedure (Automation interface) Close( ) As LONG // (O) Error code
Argument plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK : Normal termination EZNC_SYSFUNC_IOCTL_NOTOPEN: Device not open
Return
Return value Meaning
value
S_OK Normal termination S_FALSE Communication failure Functions
This closes the IEZNcCmmunication object line that was opened by Open2(). In the case of C64 or CNC700, the setting of SetTCPIPProtocol() can be held, so Open2() is possible repeatedly. Open2() is possible repeatedly.
In the case of C70, the setting of SetMelsecProtocol() can be held, so
Reference Open2(),
SetTCPIPProtocol(), SetMelsecProtocol()
Designation
2-11
Magic64 M6x5M M6x5L C64 C70 CNC700
2.3.3 IEZNcCommunication3::SetHead Setting part system
Calling procedure (Custom interface) HRESULT SetHead(
LONG lHead,
LONG* plRet
// (I) Setting part system // (O) Error code
)
Calling procedure (Automation interface) SetHead(
lHead As LONG
)As LONG
// (I) Setting part system // (O) Error code
Argument lHead: Set part system or PLC axis part system. Value: The range of value depends on NC
specifications (or options) and the values (for parameters) set by the machine tool builder. When the value is 0, it means that no part system is designated. To set PLC axis part system, set EZNC_PLCAXIS. In the case of M6x5M/L and Magic64, PLC axes are invalid.
plRet: Returns an error code. (When using automation interface, it returns a return value instead.)
S_OK : Normal termination
Return
Return value Meaning
value
S_OK Normal termination S_FALSE Communication failure Functions
This sets the part system of NC axis or PLC axis. Set part system before executing the method that requires the part system setting. The part system set here will be valid until it is changed. After opening the EZSocket line, part system 1 is designated.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference GetHead()
Designation
2-12
Magic64 M6x5M M6x5L C64 C70 CNC700
2.3.4 IEZNcCommunication3::GetHead Getting the part system
Calling procedure (Custom interface) HRESULT GetHead(
LONG* plHead,
LONG* plRet
// (O) Getting the part system // (O) Error code
)
Calling procedure (Automation interface) GetHead(
plHead As LONG*
)As LONG
// (O) Getting the part system // (O) Error code
Argument plHead: Returns the part system number or the PLC axis part system. Value: The range of the
value depends on NC specifications (or options) and the values (for parameters) set by the machine tool builder. In the case of PLC axis part system, EZNC_PLCAXIS is returned. In the case of M6x5M/L and Magic64, PLC axes are invalid.
plRet: Returns an error code. (When using automation interface, it returns a return value instead.)
S_OK : Normal termination
Return
Return value Meaning
value
S_OK Normal termination S_FALSE Communication failure Functions
This gets the part system of NC axis or PLC axis. In the case of PLC axis part system, EZNC_PLCAXIS is got.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference SetHead()
Designation
2-13
C64 CNC700
2.3.5 IEZNcCommunication3::SetTCPIPProtocol Setting TCP/IP communication
Calling procedure (Custom interface) HRESULT SetTCPIPProtocol (
LPCOLESTR lpcwszIPAddress,
LONG lPort, LONG* plRet
// (I) IP address // (I) Port # // (O) Error code
)
Calling procedure (Automation interface) SetTCPIPProtocol (
lpcwszIPAddress As STRING
lPort As LONG
)As LONG
// (I) IP address // (I) Port # // (O) Error code
Argument lpcwszIPAddress: Set the IP address or host name of C64 or CNC700 to connect
(E.g. "192.168.1.1", "host123")
lPort: Set the port # of C64 or CNC700 to connect. To determine the port #, check the setting of
the NC system. Port # 64758 is set for C64 and 683 is set for CNC700.
plRet: Returns an error code. (When using automation interface, it returns a return value instead.)
S_OK: Normal termination EZNC_COMM_ALREADYOPENED: Setting impossible as the line is already open EZ_ERR_DATA_RANGE: Data range of the argument is illegal
EZ_ERR_NOT_SUPPORT: Not supported
Return
Return value Meaning
value
S_OK Normal termination S_FALSE Communication failure Functions
This is for setting TCP/IP communication. With C64 or CNC700, call this before Open2(). If not, an error occurs at executing Open2(). The setting set here will be held until the object is released by Release(). Once Open2() is executed, resetting by SetTCPIPProtocol() is impossible until Close(), an error occurs.
Reference Open2(), Close()
Designation
2-14
C70
2.3.6 IEZNcCommunication3::SetMelsecProtocol Setting Melsec communication
Calling procedure (Custom interface) HRESULT SetMelsecProtocol (
EZNCST_OPEN* pstOpen,
LONG* plRet
// (I) Sets line // (O) Error code
)
Argument pstOpen
Pointer for indicating the EZNCST_OPEN structure which specifies the opening
parameters. Refer below for members of the EZNCST_OPEN structure.
(Note) The structure supports other communications than Ethernet communication and serial communication. For unnecessary parts in the following explanation on the structure members, set “0”.
lNetworkNumber:Set the network number on MELSECNET/H. Set "0x00" to set the host
station. Set as described below for Qn multidropping (via serial communication/CC-Link unit). Value Meaning
0x00 Set the host network 0x01 Set
the other network at multidrop destination
lStationNumber:Set the station number on MELSECNET or CC-Link. Set "0xFF" to set the
host station. The station is handled as a host station when access to the CPU connected with the CPU board or AF board is made. Set as described below for Qn multidropping (via serial communication/CC-Link unit) Value Meaning
0x00 Set the host network 0x01 Set
the other network at multidrop destination
lUnitNumber:Set the unit number of the computer link (serial communication) unit or the
station number when the target is the Qn communication series intelligent special unit. Set "0x00" to set the QnA series host station (unit loaded to the host station CPU). This number is invalid for other than computer link communication (serial communication) or when the target is not the Qn intelligent special unit. For multidrop link, set the unit number of the destination computer link (serial communication) unit station.
lConnectUnitNumber:Set the unit number of the computer link (serial communication) unit or
QnA/Qn Ethernet unit. For multidrop link, set the unit number of the request source computer link (serial communication) unit station. For multidrop via the directly connected CPU, however, the unit number of the request source station is not needed (set "0x00"). Set "0x00" for other than multidrop link. Set the relay destination station number for the QnA/Qn Ethernet unit. (The number is fixed to "0x00" for access within the host network.) For access to the other network via MELSECNET/10, set the station number set in the parameter of the
connected Ethernet unit.
2-15
lIONumber:Set the unit I/O number. In this parameter, set the actual I/O number (first I/O
number÷16) of the destination serial communication unit or intelligent special unit for multidrop link execution or access to the intelligent special unit. (For multidrop link, set the I/O number of the relayed station:request source station.) Set any of 0x3F0 to 0x3FF for access to another station via the host station CPU or network. Value Destination
0 to 1FFh Communication series intelligent special unit (first I/O number÷16) 200 to 3CFh Reserved 3D0h 3D1h 3D2h 3D3h 3D4h
Control system CPU unit Standby system CPU unit System A CPU unit System B CPU unit Other System CPU unit
3D5h to 3DBh Reserved 3DCh 3DDh 3DEh 3DFh
System A peripheral device1 System B peripheral device1 System A peripheral device2 System B peripheral device2
3E0 to 3E3h Each CPU unit in multi-CPU (1 to 4) 3F0h 3FCh 3FDh 3FEh 3FFh
Global unit for multi-CPU CPU-adjacent card Peripheral device 2 Peripheral device 1 CPU unit (including LM)
lCpuType:Set the CPU to communicate with
Value Destination Value Destination
CPU_A0J2HCPU A0J2H, FR-C500 CPU_Q02CPU Q02HCPU CPU_A1FXCPU A1FX CPU_Q06CPU Q06HCPU CPU_A1SCPU A1S, A1SJ CPU_Q12CPU Q12HCPU CPU_A1SHCPU A1SH, A1SJH CPU_Q25CPU Q25HCPU CPU_A1NCPU A1(N) CPU_A2CCPU A2C, A2CJ CPU_Q00JCPU Q00JCPU CPU_A2NCPU A2(N), A2S CPU_Q00CPU Q00CPU CPU_A2SHCPU A2SH CPU_Q01CPU Q01CPU CPU_A3NCPU A3(N) CPU_Q12PHCPU Q12PHCPU CPU_A3HCPU A3H CPU_Q25PHCPU Q25PHCPU CPU_A2ACPU A2A CPU_Q12PRHCPU Q12PR H CPU_A3ACPU A3A CPU_Q25PRHCPU Q25PRH CPU_A2UCPU A2U, A2US CPU_Q02UCPU Q02UCPU CPU_A2USHS1CPU A2USH-S1 CPU_Q03UDCPU Q03UDCPU CPU_A3UCPU A3U CPU_Q04UDHCPU Q04UDHCPU CPU_A4UCPU A4U CPU_Q06UDHCPU Q06UDHCPU CPU_Q2ACPU Q2A CPU_Q2AS1CPU Q2A-S1 CPU_Q17NNCCPU Q172NCCPU CPU_Q3ACPU Q3A Q173NCCPU CPU_Q4ACPU Q4A, C64 CPU_Q02CPU_A Q02(H) A mode CPU_FX0CPU FX0, FX0S CPU_Q06CPU_A Q06H A mode CPU_FX0NCPU FX0N CPU_ CPU_FX1CPU FX1 CPU_Q25CPU_A Q25H A mode CPU_FX2CPU FX2FX2C CPU_P25 P25/R25 CPU_FX2NCPU FX2N, FX2NC CPU_LP25 LP25/BR15 CPU_FX1SCPU FX1S CPU_QLP25 QLP25/QBR15 CPU_FX1NCPU FX1N, FX1NC CPU_QJ72LP25 QJ72LP25/BR15 CPU_FX3UCCPU FX3UC, FX3U CPU_A900GOT GOT900/1000 CPU_A171SHCPU A171SH CPU_BOARD Host board CPU_A172SHCPU A172SH CPU_PC Personal computer (LM) CPU_A273UHCPU A273UH CPU_OTHER General CPU_A173UHCPU A173UH
CPU_A Q12H A mode
Q12
2-16
lUnitTypeSet the unit connected with the physical port of the computer
Value Meaning
UNIT_ACPU ACPU-RS422 port direct connection UNIT_QCPU QnACPU-RS422
port direct connection
UNIT_QNCPU QnCPU (Q mode) RS232C port direct connection UNIT_QNCPU_A QnCPU (A mode) RS232C direct connection UNIT_QNUSB QnCPU (Q mode) USB port direct connection UNIT_QNUSB_A QnCPU (A mode) USB port direct connection UNIT_QNMOTION Q motion-RS232C port direct connection UNIT_QNMOTIONUSB Q motion-USB port direct connection UNIT_FXCPU FXCPU-RS422 port direct connection UNIT_C24 UNIT_UC24 UNIT_QC24 UNIT_QJ71C24
C24 unit direct connection for A UC24 unit direct connection for A QC24 unit direct connection for QnA C24 unit direct connection for Q
UNIT_FXENET_ADP Ethernet adaptor connection for FX UNIT_FX232BD FXCPU computer link (RS232C) connection UNIT_FX485BD FXCPU computer link (RS485) connection UNIT_E71 UNIT_QE71 UNIT_QJ71E71 UNIT_G4ACPU UNIT_G4QCPU UNIT_G4QNCPU
Ethernet LAN connection for A Ethernet LAN connection for QnA Ethernet LAN connection for Q AJ65BT-G4 (-S3) unit direct connection (ACPU access) AJ65BT-G4 (-S3) unit direct connection (QnA access) AJ65BT-G4-S3 unit direct connection (Qn access)
UNIT_MNET2BOARD MNET2 board connection UNIT_MNET10BOARD MNET/10 board connection UNIT_MNETHBOARD MNET/H board connection UNIT_MNETGBOARD MNET/G board connection UNIT_CCLINKBOARD CC-Link board connection UNIT_MSPANUBOARD CPU board connection UNIT_AFBOARD AF board connection UNIT_EMEDBOARD EmEd board connection UNIT_SIMULATOR Simulator (GX Simulator) connection UNIT_QBF Personal computer CPU connection for Q UNIT_SSCBOARD
SSC network board connection
UNIT_A900GOT GOT900 series connection UNIT_OTHER General connection
lPacketTypeSet the packet message format of computer link or Ethernet. Set either of the
following formats in this parameter.
Value Meaning
PACKET_BINARY1 Dedicated protocol format (for AJ71QC24/UC24 series) PACKET_ASCII1
Dedicated protocol format (for AJ71(U)C24, AJ71E71/AJ71QE71 series)
PACKET_PLC1 CPU protocol format (for other than AJ71E7/AJ71QE71 series)
2-17
lProtocolType:Set the communication protocol type of the connected unit (board). When
selecting communication via AJ71QC24N/QJ71C24+modem, select “Via serial port and modem”. (When directly connecting to AJ71QC24N/QJ71C24, select “Via serial port”.)Select “Via shared memory server” only when connecting a simulator. Value Meaning
PROTOCOL_MNET2 Via MNET II board PROTOCOL_MNET10 Via MNET/10 board PROTOCOL_MNETH Via MNET/10H or MNET/25H baord PROTOCOL_MNETG Via MNET/G board PROTOCOL_EMED Via EmEd board PROTOCOL_SERIAL Via serial port PROTOCOL_USB Via USB port PROTOCOL_TCPIP Via TCP/IP PROTOCOL_UDPIP Via UDP/IP PROTOCOL_SHAREDMEMORY Via shared memory server PROTOCOL_CCLINK Via CC-Link board PROTOCOL_MSPANU Via CPU board PROTOCOL_AF Via AF board PROTOCOL_SSC Via SSC net PROTOCOL_TEL Via Q6TEL or A6TEL PROTOCOL_SERIALMODEM Via serial port and modem
PROTOCOL_QBF Via Q bus PROTOCOL_USBGOT Via GOT1000 USB port
lPortNumberSet the port number for connection of the physical port of the computer and the
unit specified in IUnitType. For the port connectable with the connection unit, refer to the connectable ports in Remarks. For Ethernet connection, set any value as the port number of the request source (personal computer). When setting "=0" as the port number, use the automatic response system as the MNET/10 routing system. When selecting other than the automatic response system via the QE71 series or E71/QE71’s TCP/IP designation, set the
fixed value of "5001".
Value Meaning
PORT_1 Communication port 1 PORT_2 Communication port 2 PORT_3 Communication port 3 PORT_4 Communication port 4 PORT_5 Communication port 5 PORT_6 Communication port 6 PORT_7 Communication port 7 PORT_8 Communication port 8 PORT_9 Communication port 9
PORT_10 Communication port 10
For Ethernet connection, set as follows.
Model Protocol Port No.
QJ71E71 AJ71QE71 (UDP)
UDP
Other than automatic response system Automatic response system
Fixed to 5001
0: Free port in personal computer is automatically allocated Other than 0: Designated port is used to create socket
TCP - Fixed to 0: Free port in personal computer is
automatically allocated AJ71QE71 (TCP) AJ71E71
UDP Designate according to the port No. designated by sequence TCP
When designated by sequence: Designate according to the designated port No. When not designated by sequence: Designate any free port in personal conputer
2-18
lBaudRate:Set the baudrate for serial communication. Set any of the following values in this
parameter.
Value Meaning
CBR_2400 2400bps CBR_4800 4800bps CBR_9600 9600bps CBR_14400 14400bps CBR_19200 19200bps CBR_38400 38400bps CBR_56000 56000bps CBR_57600 57600bps CBR_115200 115200bps CBR_128000 128000bps CBR_256000 256000bps
lDataBitsSet the bit count (6 to 8) of the byte data to be sent or received. lParitySet the used parity system. Set any of the following values in this parameter. This
parameter is valid for serial communication only. Value Meaning
EVENPARITY Even ODDPARITY Odd MARKPARITY Mark
NOPARITY No parity
lStopBitsSet the number of stop bits used. Set any of the following values in this parameter.
This parameter is valid for serial communication only.
Value Meaning
ONESTOPBIT 1 stop bit ONE5STOPBITS 1.5 stop bits TWOSTOPBITS 2 stop bits
lControlSet the control setting of the signal line. Set any of the following values in this
parameter. This parameter is valid for serial communication only. Value Meaning
TRC_NONE No flow control TRC_DTR DTR control TRC_RTS RTS control TRC_DTR_OR_RTS DTR or RTS control TRC_DTR_CD DTR control (with CD control) TRC_RTS_CD RTS control (with CD control) TRC_DTR_OR_RTS_CD DTR or RTS control (with CD control)
lpcwszHostAddressSet the host name (IP address) of Ethernet as a UNICODE character
string. Set NULL for other than Ethernet communication.
lCpuTimeOut:Set the CPU monitoring timer for Ethernet communication in increments of
*250ms (defaults to 4).
lTimeOut:Set the time-out value of communication in increments of 1ms (defaults to 1000ms).
*Time-out is counted from when data send or receive has stopped.
2-19
lSumCheck:Set whether sumcheck will be made or not. Set either of the following values in
this parameter. This parameter is valid only for communication made via the computer link unit
or A series Ethernet unit (TCP/IP).
Value Meaning
TRUE With sumcheck FALSE Without sumcheck
lSourceNetworkNumberSet the request source network number when QnA/Qn Ethernet is
specified. Set the same network number (network number specified in the network parameter) as that for connected QnA/Qn Ethernet.
lSourceStationNumber:Set the request source station number (personal computer side station
number) when QnA/Qn Ethernet is specified. Set the station number so that it does not
overlap the station number of the QE71 set within the same Ethernet loop.
lDestinationPortNumber: Set the port number of the destination unit when Ethernet is
specified. For access to another network, set the relayed port number. Set the following for other than the automatic response system/E71/QE71 (TCP/IP).
・QnA(UDP/IP) :Fixed to "5001" ・Qn(TCP/IP) :Fixed to "5002" ・Qn(UDP/IP) :Fixed to "5001"
lDestinationIONumber:Set the actual I/O number (first I/O number÷16) of the last accessed
station for Qn multidropping (via serial communication/CC-Link). (When the destination is the intelligent special unit) When the destination is the CPU unit, set any of 0x3F0 to 0x3FF. (Refer to "lIONumber".)
lConnectChannelNumber:Set the connected channel number (Ch1/Ch2) when Qn serial
communication unit connection is specified. As this parameter is reserved for the system, set
no value in this parameter. (Set 0x00.)
lMultiDropChannelNumber : Set the multidropping channel number (Ch1/Ch2) for Qn
multidropping. This parameter is invalid when any other connection is specified.
Value Meaning
0x01 Channel 1 connection 0x02 Channel 2 connection
lThroughNetworkTypeSet whether or not the MNET/10 mode is included in the relayed
network for access to another station via MELSECNET/10H.
Value Meaning
0x00 MNET/10 mode not included 0x01 MNET/10 mode included
lIntelligentPreferenceBitSet whether or not the network at the multidrop link destination will
be relayed for Qn multidropping (via serial communication/CC-Link). (This setting is made to differentiate the host network unit.) Value Meaning
0x00 No access to another network at multidrop destination
0x01 Access to another network at multidrop destination
2-20
lDidPropertyBit:You need not set "lUnitNumber" by making the following setting invalid for
access to the Qn series host station's intelligent special unit (intelligent special unit loaded to the host station CPU). (Use only the unit I/O number "llONumber" to specify.) Value Meaning
0x00 Unit number is made valid
0x01 Unit number is made invalid
lDsidPropertyBitYou need not set "lDestinationIONumber" by making the following setting
invalid for Qn multidropping. Note that "lDidPropertyBit" must be made valid when the following setting is made invalid. (Use "lUnitNumber" to specify.) Value Meaning
0x00 I/O number of last accessed station is made valid 0x01 I/O number of last accessed station is made invalid
plRetReturns an error code
S_OKNormal termination EZNC_COMM_ALREADYOPENED: Setting impossible as the line is already open EZ_ERR_DATA_TYPE:Data type of the argument is illegal EZ_ERR_DATA_RANGE:Data range of the argument is illegal
EZ_ERR_NOT_SUPPORTNot supported
Return
Return value Meaning
value
S_OK Normal termination S_FALSE Communication failure Functions
This is for setting MELSEC communication. Call this before Open2(). If not, an error occurs at executing Open2(). The setting set here will be held until the object is released by Release(). Once Open2() is executed, resetting by SetMelsecProcotol() is impossible until Close() is executed. An eror occurs. If an error occurs at SetMelsecProcotol(), setting before the error is held. Setting that caused the error is not held. For argument of pointer designation as “lpcwszHostAddress”, set NULL if you don’t use this argument.
(Note) This method doesn’t support automation interface. It is limited to custom interface
Reference Open2(), Close()
Designation
2-21
C64
2.3.7 IEZNcCommunication3::SetModalCondition Setting modal communication condition
Calling procedure (Custom interface) HRESULT SetModalCondition (
LONG lRegistTime,
LONG lCancelTime, LONG lIntervalTime, LONG* plRet
// (I)Setting modal communication register time // (I)Setting modal communication cancel time // (I)Setting modal communication interval time // (O) Error code
)
Calling procedure (Automation interface) SetModalCondition (
lRegistTime As LONG
lCancelTime As LONG lIntervalTime As LONG
)As LONG
// (I)Setting modal communication register time // (I) Setting modal communication cancel time // (I)Setting modal communication interval time // (O) Error code
Argument lRegistTime: Set modal communication register time [ms] (0 to 600000 [ms])
When 0ms is set, register for the modal communication won’t be performed. Default value: 2000 [ms]
lCanceltTime: Set modal communication cancel time [ms] (0 to 600000 [ms])
When 0ms is set, the modal communication will be canceled immediately at the next communication cycle. Default value: 4000 [ms]
lIntervalTime: Set modal communication interval time [ms] (10 to 600000 [ms])
Default value: 20 [ms]
plRet: Returns an error code. (When using automation interface, it returns a return value instead.)
S_OK: Normal termination EZNC_SYSFUNC_IOCTL_ADDR: NC card # illegal
EZNC_SYSFUNC_IOCTL_NOTOPEN: Device not open
Return
Return value Meaning
value
S_OK Normal termination S_FALSE Communication failure Functions
This sets modal communication condition. Modal communication is a communication method to collect data from the NC regularly. After collecting data regularly in the setting range of the modal communication setting, the normal transient communication is switched to modal communication. After switched to modal communication, the target data is taken into the PC regularly to be read. However, if you perform reading with a faster cycle than the cycle of taking data from the NC, you cannot read the newest data.
Reference Close(), GetModalCondition()
Designation
2-22
C64
2.3.8 IEZNcCommunication3::GetModalCondition Getting modal communication condition
Calling procedure (Custom interface) HRESULT GetModalCondition (
LONG* plRegistTime,
LONG* plCancelTime, LONG* plIntervalTime, LONG* plRet
// (O) Getting the modal communication register time // (O) Getting the modal communication cancel time // (O) Getting the modal communication interval time // (O) Error code
)
Calling procedure (Automation interface) GetModalCondition (
plRegistTime As LONG*,
plCancelTime As LONG*, plIntervalTime As LONG*
)As LONG
// (O) Getting the modal communication register time // (O) Getting the modal communication cancel time // (O) Getting the modal communication interval time // (O) Error code
Argument plRegistTime: Returns the modal communication register time [ms] (0 to 600000 [ms])
Default value: 2000 [ms]
plCanceltTime: Returns the modal communication cancel time [ms] (0 to 600000 [ms])
Default value: 4000 [ms]
plIntervalTime: Returns the modal communication interval time [ms] (10 to 600000 [ms])
Default value: 20 [ms]
plRet: Returns an error code. (When using automation interface, it returns a return value instead.)
S_OK: Normal termination EZNC_SYSFUNC_IOCTL_ADDR: NC card # illegal
EZNC_SYSFUNC_IOCTL_NOTOPEN: Device not open
Return
Return value Meaning
value
S_OK Normal termination S_FALSE Communication failure Functions
This gets the modal communication condition
that has been set.
Reference Close(), SetModalCondition()
Designation
2-23

2.4 IEZNcSystem Interface

2.4.1 IEZNcSystem::GetVersion Getting NC System # and name
Calling procedure (Custom interface) HRESULT GetVersion(
LONG lAxisNo,
LONG lIndex, LPOLESTR* lppwszBuffer, LONG* plRet
) Calling procedure (Automation interface) System_GetVersion(
lAxisNo As LONG
lIndex As LONG lppwszBuffer As STRING*
)As LONG
Argument lAxisNo: Set axis # (“1” or later) (Not used)
lIndex: Set parameter # (Refer to the table below.)
lppwszBuffer: Returns the system #, system name and control S/W version as UNICODE
character strings.
plRet: Returns an error code. (When using automation interface, it returns a return value instead.)
S_OK : Normal termination EZ_ERR_DATA_TYPE: Argument data type is illegal EZNC_DATA_READ_DATASIZE: Too much data for the buffer prepared by the application EZNC_DATA_READ_READ: Impossible to read the data
lIndex Meaning Data range Magic64
0 System #, name, control
PLC version
1 Control unit, extended unit Depends on the
2 RIO unit, terminal RIO unit
Axis designation is necessary. (Excluding CNC700)
Return
Return value Meaning
value
S_OK Normal termination S_FALSE Communication failure
Magic64
Limited
M6x5M M6x5L C64 C70 CNC700
// (I) Axis designation // (I) Parameter # // (O) NC system # and system name // (O) Error code
// (I) Axis designation // (I) Parameter # // (O) NC system # and system name // (O) Error code
Depends on the system specifications
system specifications Depends on the system specifications
Available
Unavailable
Unavailable
2-24
Functions This gets various information on each version of NC system as UNICODE.
0: This gets NC system #, system name, and control PLC version.
The data format of the character string is as below. NC system number\tNC system name\tPLC system number\0 Do not fail to add TAB code between the NC system # and NC system name. The data have to be ended with NULL code. Output example: "BND-353W000-A0\tMELDASMAGIC64\tBND-400W000-A0" TAB code comes next if there is no item. TAB code is followed by NULL code if there is no item for termination. In the case of M6x5M, System model\tS/W vertion\0
1: This gets versions of the NC system’s control unit and extended units.
The data format of the character string is as below. Control unit number\tExtended unit number\0 Do not fail to add TAB code between the control unit # and extended unit #. The data have to be ended with NULL code. In the case of M6x5M, Control unit\tExtended unit1\tExteded unit2…\0
2: This gets versions of the NC system's RIO and terminal RIO unit.
The data format of the character string is as below. RIO unit number\tTerminal RIO unit number\0 In the case of M6x5M or CNC700, 24 units. (RIO unit 1\tRIO unit 2\t…\0) Do not fail to add TAB code between the RIO unit # and terminal RIO unit #. The data have to be ended with NULL code.
For RIO unit and terminal RIO unit, axis designation is necessary. Memory area for character strings is saved inside of EZSocket. If your client is a VC++ client, it is necessary to release the memory area explicitly by using CoTaskMemFree().
With MELDASMAGIC64, only 0 is available for lIndex. If 1 or 2 is designated, EZ_ERR_DATA_TYPE will be returned in plRet.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference
Designation
2-25
Magic64 M6x5M M6x5L C64 C70 CNC700
2.4.2 IEZNcSystem::GetSystemInformation Getting NC system information
Calling procedure (Custom interface) HRESULT GetSystemInformation(
LONG lType,
LONG* plSystem, LONG* plRet
// (I) Information type // (O) System information // (O) Error code
)
Calling procedure (Automation interface) System_GetSystemInformation(
lType As LONG
plSystem As LONG*
)As LONG
// (I) Information type // (O) System information // (O) Error code
Argument lType: Set NC system information type (Refer to the table below.)
plSystem: Returns the NC system information
plRet: Returns an error code. (When using automation interface, it returns a return value instead.)
S_OK : Normal termination
EZ_ERR_DATA_TYPE: Data type of the argument is illegal
EZNC_DATA_READ_READ: Impossible to read the data
lType Meaning Data range
0 Validity of the part system. 0: Invalid part system
1: Valid part system
1 The number of the axes in the part system More than 1
(Depends on each NC system)
Return
Return value Meaning
value
S_OK Normal termination S_FALSE Communication failure Functions
This gets the information on NC part system.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference Designation System
2-26
Magic64 M6x5M M6x5L C64 C70 CNC700
2.4.3 IEZNcSystem::GetAlarm Getting alarm information
Calling procedure (Custom interface) HRESULT GetAlarm(
LONG lMessageNumber,
LONG lAlarmType, LPOLESTR* lppwszBuffer, LONG* plRet
// (I) The number of alarm messages to get // (I) Alarm types to get // (O) Message character strings // (O) Error code
)
Calling procedure (Automation interface) System_GetAlarm(
lMessageNumber As LONG
lAlarmType As LONG lppwszBuffer As STRING*
)As LONG
// (I) The number of alarm messages to get // (I) Alarm types to get // (O) Message character strings // (O) Error code
Argument
lMessageNumber: Set the number of messages to get. Number: 1 to 10 (Max.)
lAlarmType: Set alarm types to get Error code Meaning
M_ALM_NC_ALARM M_ALM_STOP_CODE M_ALM_PLC_ALARM M_ALM_OPE_MSG M_ALM_ALL_ALARM M_ALM_WARNING
NC alarm Stop code (Invalid with M6x5M) PLC alarm messages Operator messages All kinds of alarm (Invalid with M6x5M) Warnings (Valid only with M6x5M)
lppwszBuffer: Gets alarm messages as UNICODE character strings. Messages are marked off by
CR or LF code. Messages are ended with NULL.
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_OPE_CURRALM_ADDR: Part system designation, or axis designation is illegal EZNC_OPE_CURRALM_ALMTYPE: Alarm type is illegal EZNC_OPE_CURRALM_DATAERR: Communication data errors between NC and PC EZNC_OPE_CURRALM_DATASIZE: Too much data for the buffer prepared by the application EZNC_OPE_CURRALM_NOS: The number of messages is illegal
Return
Return value Meaning
value
S_OK Normal termination S_FALSE Communication failure Functions
This gets the alarm messages currently occurring in the designated NC card. The language of alarm messages depends on the NC parameter (#1043 lang). Messages are taken in order of importance. Memory area for character strings is saved inside of EZSocket. If your client is a VC++ client, it is necessary to release the memory area explicitly by using CoTaskMemFree().
Reference Designation System When set to 0, all the part systems are designated.
2-27

2.5 IEZNcPosition Interface

Magic64 M6x5M M6x5L C64 C70 CNC700
2.5.1 IEZNcPosition::GetWorkPosition Getting the workpiece coordinate position
Calling procedure (Custom interface) HRESULT GetWorkPosition(
LONG lAxisNo,
DOUBLE* pdPosition, LONG lSkipOn, LONG* plRet
) Calling procedure (Automation interface) Position_GetWorkPosition(
lAxisNo As LONG
pdPosition As DOUBLE* lSkipOn As LONG
)As LONG
Argument
lAxisNo: Set axis # (“1” or later)
pdPosition: Returns the workpiece coordinate position of the designated axes in the designated
part system Data range : -99999.9999 to 99999.9999 [mm] (other than CNC700) 8 digits from the leftmost are
displayed for integer and decimal parts in total.
: -999999.999999 to 999999.999999 [mm] (CNC700) 10 digits from the leftmost are
displayed for integer and decimal parts in total. Each number of digits for each part depends on the NC specifications (or options) and the values (for parameters) set by the machine tool builder.
lSkipOn: Set skip on flag
Value Meaning 1 At skip ON (Invalid with M6x5L) 0 In normal operation
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK : Normal termination
EZ_ERR_DATA_TYPE: Data type of the argument is illegal EZNC_DATA_READ_ADDR: Part system designation or axis designation is illegal EZNC_DATA_READ_READ: Impossible to read the data
Return
Return value Meaning
value
S_OK Normal termination S_FALSE Communication failure Functions
This gets the workpiece coordinate position of the designated axis part system and axis. When skip ON flag is 1, it gets the workpiece coordinate position at the moment that skip ON signal turns on.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference
Designation System, Axis
// (I) Axis designation // (O) Workpiece coordinate position // (I) Skip ON flag // (O) Error code
// (I) Axis designation // (O) Workpiece coordinate position // (I) Skip ON flag // (O) Error code
2-28
Magic64 M6x5M M6x5L C64 C70 CNC700
2.5.2 IEZNcPosition::GetMachinePosition Getting the machine position
Calling procedure (Custom interface) HRESULT GetMachinePosition(
LONG lAxisNo,
DOUBLE* pdPosition, LONG lSkipOn, LONG* plRet
// (I) Axis designation // (O) Machine position // (I) Skip ON flag // (O) Error code
)
Calling procedure (Automation interface) Position_GetMachinePosition(
lAxisNo As LONG
pdPosition As DOUBLE* lSkipOn As LONG
)As LONG
// (I) Axis designation // (O) Machine position // (I) Skip ON flag // (O) Error code
Argument
lAxisNo: Set axis # (“1” or later)
pdPosition: Returns the machine position of the designated axes in the designated part system
Data range: -99999.9999 to 99999.9999 [mm] (other than CNC700) 8 digits from the leftmost are
displayed for integer and decimal parts in total.
: -999999.999999 to 999999.999999 [mm] (CNC700)10 digits from the leftmost are
displayed for integer and decimal parts in total. Each number of digits for each part depends on the NC specifications (or options) and the values (for parameters) set by the machine tool builder.
lSkipOn: Set the skip ON flag
Value Meaning 1 At skip ON (Invalid with M6x5M/L) 0 In normal operation
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK : Normal termination EZNC_DATA_READ_ADDR: Part system designation or axis designation is illegal EZNC_DATA_READ_READ: Impossible to read the data
Return
Return value Meaning
value
S_OK Normal termination S_FALSE Communication failure Functions
This gets the machine coordinate position (coordinate position in the base machine coordinate system) of the designated part system and axis. When skip ON flag is 1, it gets the machine coordinate position at the moment that skip ON signal turns on.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference
Designation System, Axis
2-29
Magic64 M6x5M M6x5L C64 C70 CNC700
2.5.3 IEZNcPosition::GetCurrentPosition Getting the current position
Calling procedure (Custom interface) HRESULT GetCurrentPosition(
LONG lAxisNo,
DOUBLE* pdPosition, LONG* plRet
// (I) Axis designation // (O) Current position // (O) Error code
)
Calling procedure (Automation interface) Position_GetCurrentPosition(
lAxisNo As LONG
pdPosition As DOUBLE*
)As LONG
// (I) Axis designation // (O) Current position // (O) Error code
Argument lAxisNo: Set axis # (“1” or later)
pdPosition: Returns the designated axis of the designated part system's relative position at the
dog-type origin return complete or the relative position from preset point in G92/Origin set/Counter set Data range: -99999.9999 to 99999.9999 [mm] (other than CNC700) 8 digits from the leftmost are
displayed for integer and decimal parts in total.
: -999999.999999 to 999999.999999 [mm] (CNC700)10 digits from the leftmost are
displayed for integer and decimal parts in total.
Each number of digits for each part depends on the NC specifications (or options)
and the values (for parameters) set by the machine tool builder.
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_READ_ADDR: Part system designation or axis designation is illegal EZNC_DATA_READ_READ: Impossible to read the data
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This gets the current coordinate position (relative position at the dog-type origin return complete or the relative position from preset point in G92/Origin set/Counter set) for the designated part system and axis.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference
Designation System, Axis
2-30
Magic64 M6x5M M6x5L C64 C70 CNC700
2.5.4 IEZNcPosition::GetDistance Getting the remaining distance
Calling procedure (Custom interface) HRESULT GetDistance(
LONG lAxisNo,
DOUBLE* pdDistance, LONG lSkipOn, LONG* plRet
// (I) Axis designation // (O) Remaining command distance // (I) Skip ON flag // (O) Error code
)
Calling procedure (Automation interface) Position_GetDistance(
lAxisNo As LONG
pdDistance As DOUBLE* lSkipOn As LONG
)As LONG
// (I) Axis designation // (O) Remaining command distance // (I) Skip ON flag // (O) Error code
Argument
lAxisNo: Set axis # (“1” or later)
pdDistance: Returns the remaining distance of the current travel command of the designated axis
in the designated part system. Data range: -99999.9999 to 99999.9999 [mm] (other than CNC700) 8 digits from the leftmost are
displayed for integer and decimal parts in total.
: -999999.999999 to 999999.999999 [mm] (CNC700) 10 digits from the leftmost are
displayed for integer and decimal parts in total.
Each number of digits for each part depends on the NC specifications (or options)
and the values (for parameters) set by the machine tool builder.
lSkipOn: Set the skip ON flag
Value Meaning 1 At skip ON (Invalid with M6x5M/L) 0 In normal operation
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination
EZ_ERR_DATA_TYPE: Data type of the argument is illegal EZNC_DATA_READ_ADDR: Part system designation or axis designation is illegal EZNC_DATA_READ_READ: Impossible to read the data
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This gets the remaining distance of the current travel command of the designated part system and axis. When skip ON flag is 1, it gets the machine coordinate position at the moment that skip ON signal turns on.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference
Designation System, Axis
2-31
Magic64 M6x5M M6x5L C64 C70 CNC700
2.5.5 IEZNcPosition::GetNextDistance Getting the next travel distance
Calling procedure (Custom interface) HRESULT GetNextDistance(
LONG lAxisNo,
DOUBLE* pdDistance, LONG* plRet
// (I) Axis designation // (O) Next travel distance // (O) Error code
)
Calling procedure (Automation interface) Position_GetNextDistance(
lAxisNo As LONG
pdDistance As DOUBLE*
)As LONG
// (I) Axis designation // (O) Next travel distance // (O) Error code
Argument
lAxisNo: Set axis # (“1” or later)
pdDistance: Returns the travel distance in the next block of the designated axis in the designated
part system Data range: -99999.9999 to 99999.9999 [mm] (other than CNC700) 8 digits from the leftmost are
displayed for integer and decimal parts in total.
: -999999.999999 to 999999.999999 [mm] (CNC700)10 digits from the leftmost are
displayed for integer and decimal parts in total. Each number of digits for each part depends on the NC specifications (or options) and the values (for parameters) set by the machine tool builder.
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_READ_ADDR: Part system designation or axis designation is illegal EZNC_DATA_READ_READ: Impossible to read the data
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This gets the travel distance in the next block of the designated part system and axis.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference
Designation System, Axis
2-32
Magic64 M6x5M M6x5L C64 C70 CNC700
2.5.6 IEZNcPosition::GetFeedSpeed Getting the feedrate
Calling procedure (Custom interface) HRESULT GetFeedSpeed(
LONG lFeedType,
DOUBLE* pdSpeed, LONG* plRet
// (I) Feedrate type // (O) Feedrate // (O) Error code
)
Calling procedure (Automation interface) Position_Get FeedSpeed(
lFeedType As LONG
pdSpeed As DOUBLE*
)As LONG
// (I) Feedrate type // (O) Feedrate // (O) Error code
Argument
lFeedType: Set feedrate type to get
In the case of M6x5M, the value of synchronous federate and screw lead are the same as that of effective federate in automatic operation. Value Meaning 0 F programming feedrate (FA) 1 Effective feedrate in manual feed (FM) 2 Synchronous feedrate (FS) 3 Effective feedrate in automatic operation (Fc) 4 Screw lead feedrate (FE)
pdSpeed: Returns the feedrate of the designated part system
Feedrate type
Other than CNC C70 CNC C70
Data range
FA 0.000 to 240000.000 [mm/min] 0.000 to 1000000.000 [mm/min] FM 0.000 to 240000.000 [mm/min] 0.000 to 1000000.000 [mm/min] FS 0.000 to 240000.000 [mm/min] 0.000 to 999.999 [mm/rev] Fc 0.000 to 240000.000 [mm/min] 0.000 to 1000000.000 [mm/min] FE 0.000 to 240000.000 [mm]
0.000 to 999.999 [mm/rev]
(Different unit)
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK : Normal termination
EZ_ERR_DATA_TYPE: Data type of the argument is illegal EZNC_DATA_READ_ADDR: Part system designation or axis designation is illegal EZNC_DATA_READ_READ: Impossible to read the data
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This gets the feedrate of the designated part system.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference
Designation System
2-33
Magic64 M6x5M M6x5L C64 C70 CNC700
2.5.7 IEZNcPosition::GetManualOverlap Getting the manual interruption amount
Calling procedure (Custom interface) HRESULT GetManualOverlap(
LONG lAxisNo,
LONG lType, DOUBLE* pdLength, LONG* plRet
// (I) Axis designation // (I) Type // (O) Manual interruption amount // (O) Error code
)
Calling procedure (Automation interface) Position_GetManualOverlap (
lAxisNo As LONG
lType As LONG pdLength As DOUBLE*
)As LONG
// (I) Axis designation // (I) Type // (O) Manual interruption amount. // (O) Error code
Argument
lAxisNo: Set axis # (“1” or later)
lType: Set the type of the manual interruption amount
Value Meaning 0 To get the manual interruption amount while manual ABS switch is OFF 1 To get the manual interruption amount while manual ABS switch is ON (Invalid with M6x5M/L)
pdLength: Returns the manual interruption amount of the designated axis of the designated part
system. With M6x5M, accumulation of the manual interruption amount With M6x5L, the interruption amount of the current status of the manual ABS switch Data range: -99999.999 to 99999.999 [mm]
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZ_ERR_DATA_TYPE: Data type of the argument is illegal
EZNC_DATA_READ_ADDR: Part system designation or axis designation is illegal EZNC_DATA_READ_READ: Impossible to read the data
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure.
Functions
This returns the manual interruption amount of the designated axis of the designated part system and axis.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference
Designation System, Axis
2-34
M6x5M M6x5L C64 C70 CNC700
2.5.8 IEZNcPosition::GetProgramPosition Getting the program position
Calling procedure (Custom interface) HRESULT GetProgramPosition(
LONG lAxisNo,
DOUBLE* pdPosition, LONG* plRet
// (I) Axis designation // (O) Program position // (O) Error code
)
Calling procedure (Automation interface) Position_GetProgramPosition(
lAxisNo As LONG
pdPosition As DOUBLE*
)As LONG
// (I) Axis designation // (O) Program position // (O) Error code
Argument lAxisNo: Set axis # (“1” or later)
pdPosition: Returns the program position
Data range: -99999.999 to 99999.999 [mm]
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK : Normal termination EZNC_DATA_READ_ADDR: Part system designation or axis designation is illegal EZNC_DATA_READ_READ: Impossible to read the data
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This gets the program position. Invalid with MELDASMAGIC64.
(Note 1) CNC C70 doesn’t support PLC axis sytem’s program position. (Note 2) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference
Designation System, Axis
2-35

2.6 IEZNcCommand2 Interface

Magic64 M6x5M M6x5L C64 C70 CNC700
2.6.1 IEZNcCommand2::GetGCodeCommand Getting the G-code modal command value
Calling procedure (Custom interface) HRESULT GetGCodeCommand(
LONG lType,
DOUBLE* pdValue, LONG* plRet
) Calling procedure (Automation interface) Command_GetGCodeCommand(
lType As LONG
pdValue As DOUBLE*
) As LONG
Argument
lType: Set the type of G-code modal command value to get
Value Meaning
1 Group 1 (Interpolation mode). G00, G01 G02, G03, and G33 command modal. 2 Group 2 (Plane selection). G17, G18, and G19 command modal. 3 Group3 (Absolute) G90 and (Incremental) G91 command modal.
4 Group 4 (Chuck barrier) G22 and G23 command modal.
5 Group 5 (Feed mode) G94 and G95 command modal.
6 Group 6 (Inch) G20 and (mm) G21 command modal.
7 Group 7 (Tool nose R compensation mode) G40, G41, and G42 command modal.
8 Group 8 (Tool length compensation mode) G43, G44 and G49 command modal.
9 Group 9 (Fixed cycle mode) G70, G71, G72, G73, G74, G75, G76, G77, G78, G79, G80,
G81, G82, G83, G84, G85, G86, G87, G88, and G89 command modal.
10 Group 10 (Initial return) G98, (Reference point return) G99 command modal.
11 Group 11 G50.2 and G51.2 command modal. (Invalid with M6x5L and C64) 12 Group 12 (Workpiece coordinate system modal) G54, G55, G56, G57, G58, and G59
command modal.
13 Group 13 (Cutting mode) G61, G62, G63, and G64 command modal. 14 Group 14 (Modal call) G66, G66.1, and G67 command modal. 15 Group 15 (Normal line control) G40.1, G41.1 and G42.1 command modal. (Valid only with
M6x5M or CNC700M) (Mirror image for facing tool posts) G68 and G69 modal (For C64L)
16
Group 16 (Coordinate system rotation) G68 and G69 (Valid only with CNC700M) 17 Group 17 (Constant peripheral speed control) G96 and G97 command modal. 18 Group 18 (Balance cut/polar coordinate command) G14, G15 and G16 command modal. 19 Group 19 (G command mirror image) G50.1 and G51.1 command modal.
20 Group 20 (Spindle selection) G43.1, G44.1 and G47.1 command modal. (Invalid with
M6x5M/L)
21
Group 21(Cylindrical interpolation/polar coordinate interpolation) G07.1, G107, G12.1,
G112, G13.1, G113 (Valid only with CNC700M)
pdValue: Returns the current G-code modal command value of the designated part system
Value (Example) Meaning 2 G02 17 G17
50.2 G50.2
// (I) Type // (O) Command value // (O) Error code
// (I) Type // (O) Command value // (O) Error code
2-36
Argument plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination
EZ_ERR_DATA_TYPE: Data type of the argument is illegal EZNC_DATA_READ_ADDR: Part system designation is illegal EZNC_DATA_READ_READ: Impossible to read the data
Return value Return value Meaning S_OK Normal termination S_FALSE Communication failure
Functions
This gets the G-code modal value of the designated part system. For the lists of each model’s G command and group, refer to each model’s Programming
manual. By using G code macro call, operation different from the one specified with the original G command may be incorporated in the machine. Refer to the manual issued by the machine tool builder.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference
Designation System
2-37
Magic64 M6x5M C64 C70 CNC700
2.6.2 IEZNcCommand2::GetToolCommand Getting the tool offset #
Calling procedure (Custom interface) HRESULT GetToolCommand(
LONG lAxisNo,
LONG lType, LONG* plValue, LONG* plRet
// (I) Axis designation // (I) Type // (O) Tool offset # // (O) Error code
)
Calling procedure (Automation interface) Command_GetToolCommand(
lAxisNo As LONG
lType As LONG plValue As LONG*
) As LONG
// (I) Axis designation // (I) Type // (O) Tool offset # // (O) Error code
Argument
lAxisNo: Set axis in getting the tool length offset # (Axis #1 or later)
IType: Set type of tool offset to get
Value Meaning
0 1 2
D value of the tool shape offset # D value of the tool wear offset # H value of the tool length offset # (Axis designation required.)
plValue: Returns the tool shape and offset # of the designated part system, and the tool length
offset # of the designated axis of the designated part system Data range: 1 to 200 (The range depends on the number of the tool offset sets.) Meaning of value: 1=D1, 1=H1
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination
EZ_ERR_DATA_TYPE: Data type of the argument is illegal EZNC_DATA_READ_ADDR: Part system designation and axis designation is illegal EZNC_DATA_READ_READ: Impossible to read the data
Return
Return value Meaning
value
S_OK Normal termination S_FALSE Communication failure
Functions
This gets the tool shape and offset # of the designated part system, and the tool length offset # of the designated axis of the designated part system.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference
Designation System, Axis
2-38
Magic64 M6x5M M6x5L C64 C70 CNC700
2.6.3 IEZNcCommand2::GetFeedCommand Getting the feedrate command value
Calling procedure (Custom interface) HRESULT GetFeedCommand(
LONG lType,
DOUBLE* pdValue, LONG* plRet
// (I) Type // (O) Command value // (O) Error code
)
Calling procedure (Automation interface) Command_GetFeedCommand(
lType As LONG
pdValue As DOUBLE*
) As LONG
// (I) Type // (O) Command value // (O) Error code
Argument
lType: Set command value types to get
Value Meaning M6x5M M6x5L 0 F programming feedrate
F programming feedrate (FA)
(FA)
1 Synchronous feedrate
Synchronous feedrate (FS)
(FS)
2 Screw lead feedrate (FE) Screw lead feedrate (FE)
3 Peripheral speed -
4 - -
Value Meaning MELDASMAGIC64, MELDASC6/C64, CNC C70, CNC 700M/L 0 F programming feedrate (FA) 1 Effective feedrate in manual feed (FM)
2 Synchronous feedrate(FS) 3 Effective feedrate in automatic operation(FC) 4 Screw lead feedrate(FE)
pdValue: Returns the current feedrate of the designated part system
Feedrate type
Other than CNC C70 CNC C70
Data range
FA 0.000 to 240000.000 [mm/min] 0.000 to 1000000.000 [mm/min]
FM 0.000 to 240000.000 [mm/min] 0.000 to 1000000.000 [mm/min]
FS 0.000 to 240000.000 [mm/min] 0.000 to 999.999 [mm/rev]
Fc 0.000 to 240000.000 [mm/min] 0.000 to 1000000.000 [mm/min]
FE 0.000 to 240000.000 [mm]
(Different unit)
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination
EZ_ERR_DATA_TYPE: Data type of the argument is illegal EZNC_DATA_READ_ADDR: Part system designation is illegal EZNC_DATA_READ_READ: Impossible to read the data
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This gets the current feedrate of the designated part system.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference Designation System
0.000 to 999.999 [mm/rev]
2-39
Magic64 M6x5M M6x5L C64 C70 CNC700
2.6.4 IEZNcCommand2::GetCommand2 Getting the M/S/T/B command modal value
Calling procedure (Custom interface) HRESULT GetCommand2(
LONG lType,
LONG lIndex LONG* plValue, LONG* plRet
// (I) Command type // (I) Command No. // (O) Command value // (O) Error code
)
Calling procedure (Automation interface) Command_GetCommand2(
lType As LONG
lIndex As LONG plValue As LONG*
) As LONG
// (I) Command type // (I) Command No. // (O) Command value // (O) Error code
Argument
lType: Set command value types to get
Value Meaning
EZNC_M EZNC_S EZNC_T EZNC_B
M programming 1 (Miscellaneous M value) S programming (Spindle speed function S value) T programming (Tool exchange T value) B programming (Second auxiliary function for indexing table position, etc.)
lIndex: Set command No.
Example) When lType=EZNC_M, lIndex=1, M command will be 1.
Command
M
S T B
Model
Magic64 M6x5M M6x5L C64 CNC C70 CNC700M/L
1 1 1
1
1 to 4 1 to 4 1 to 2
1 to 4
1 1 1 1
1 to 4 1 to 7 1 to 4
1 to 4
1 to 4 1 to 7 1 to 4
1 to 4
1 to 4 1 to 4
1
1 to 4
plValue: Returns the current command value of the designated part system.
Data range: 0 to 99999999 (Maximum)
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK : Normal termination
EZ_ERR_DATA_TYPE: Data type of the argument is illegal EZNC_DATA_READ_READ: Impossible to read the data
EZNC_DATA_READ_ADDR: Part system designation is illegal
Return
Return value Meaning
value
S_OK Normal termination S_FALSE Communication failure
Functions
This gets the current M/S/T/B command modal value of the designated part system.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference SetCommand2()
Designation System (PLC axis part system cannot be designated.)
2-40
Magic64
Limited
M6x5M M6x5L
C64
Limited
C70 CNC700
2.6.5 IEZNcCommand2::SetCommand2 Setting manual command (M/S/T/B)
Calling procedure (Custom interface) HRESULT SetCommand2(
LONG lType,
LONG lIndex LONG lValue, LONG* plRet
// (I) Type // (I) Command No. // (I) Command value // (O) Error code
)
Calling procedure (Automation interface) Command_SetCommand2(
lType As LONG
lIndex As LONG lValue As LONG
) As LONG
// (I) Type // (I) Command No. // (I) Command value // (O) Error code
Argument
lType: Set command value types to get
Value Meaning
EZNC_M EZNC_S EZNC_T EZNC_B
M programming (Miscellaneous M value) S programming (Spindle speed function S value) T programming (Tool exchange T value) B programming (Second auxiliary function value for indexing table position, etc.)
lIndex: Specified No. is specified.
EX) M command 1 when lType=EZNC_M, lIndex=1
Command
M
S T B
Model
Magic64 M6x5M M6x5L C64 CNC C70 CNC700M/L
1 1 1
1
1 to 4 1 to 4 1 to 2
1 to 4
1 1 1 1
lValue: Set command value of the designated axis or the designated part system
Data range: 0 to 99999999 (Maximum value) 0 to 9999 (Maximum value) (CNC C70 M command)
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination
EZ_ERR_DATA_TYPE: Data type of the argument is illegal EZNC_DATA_WRITE_WRITE: Impossible to write the data EZNC_DATA_WRITE_ADDR: Part system designation is illegal
Return
Return value Meaning
value
S_OK Normal termination S_FALSE Communication failure
Functions
This sets the manual command value of M/S/T/B function of the designated axis or designated part system. The target command of M6x5M/L is only the first command.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference GetCommand2()
Designation System (PLC axis part system cannot be designated.)
1 to 4 1 to 7 1 to 4
1 to 4
1
1 to 7
1
1
1 to 4 1 to 4
1
1 to 4
2-41

2.7 IEZNcProgram2 Interface

Magic64 M6x5M M6x5L C64 C70 CNC700
2.7.1 IEZNcProgram2::CurrentBlockRead Reading the current block
Calling procedure (Custom interface) HRESULT CurrentBlockRead(
LONG lBlockNumber,
LPOLESTR* lppwszProgramData, LONG* plCurrentBlockNo, LONG* plRet
) Calling procedure (Automation interface) Program_CurrentBlockRead(
lBlockNumber As LONG
lppwszProgramData As STRING* plCurrentBlockNo As LONG*
) As LONG
Argument
lBlockNumber: Set the number of the blocks to get. Value: 1 to 10
lppwszProgramData: Gets the program blocks as UNICODE character strings. Programs are
marked off by CR or LF code. Programs are ended with NULL.
plCurrentBlockNo: Returns the block # currently executed
Value Meaning
0 1 2
Out of operation 1st block 2nd block
// (I) The number of blocks // (O) Storing program // (O) Block # being executed // (O) Error code
// (I) The number of blocks // (O) Storing program // (O) Block # being executed // (O) Error code
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK : Normal termination EZNC_OPE_GETPRGBLK_ADDR: Part system designation is illegal EZNC_OPE_GETPRGBLK_DATAERR: Communication data errors between NC and PC EZNC_OPE_GETPRGBLK_DATASIZE: Too much data for the buffer prepared by the
application EZNC_OPE_GETPRGBLK_NOS: The designation of the number of blocks illegal
Return
Return value Meaning
value
S_OK Normal termination S_FALSE Communication failure
Functions
This gets the program which is after the operation search execution or is currently executed. This reads the program after the operation search execution or the current program block in the designated part system. When out of operation search, it shows
lppwszProgramData="\0" plCurrentBlockNo=0
Memory area for character strings is saved inside of EZSocket. Memory area for character strings is saved inside of EZSocket. If your client is a VC++ client, it is necessary to release the memory area explicitly by using CoTaskMemFree(). Even though it is out of operation search, it is necessary to release the memory area.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference IEZNcOperation::Search( )
Designation System
2-42
Magic64 M6x5M M6x5L C64 C70 CNC700
2.7.2 IEZNcProgram2::GetProgramNumber2 Getting the program #
Calling procedure (Custom interface) HRESULT GetProgramNumber2(
LONG lProgramType,
LPOLESTR* lppwszProgramNo, LONG* plRet
// (I) Program type // (O) Program # // (O) Error code
)
Calling procedure (Automation interface) Program_GetProgramNumber2(
lProgramType As LONG
lppwszProgramNo As STRING*
) As LONG
// (I) Program type // (O) Program # // (O) Error code
Argument
lProgramType: Set program type
Value Meaning
EZNC_MAINPRG EZNC_SUBPRG
Main program Sub program
lppwszProgramNo: Returns the program # which has already finished being searched, or which
is automatically operated as UNICODE character strings. With CNC700, program # is gotton as the program file name.
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK : Normal termination
EZ_ERR_DATA_TYPE: Data type of the argument is illegal EZNC_DATA_READ_ADDR: Part system designation is illegal EZNC_DATA_READ_READ: Impossible to read the data
Return
Return value Meaning
value
S_OK Normal termination S_FALSE Communication failure
Functions
This returns the program # which has already finished being searched, or which is automatically operated. Memory area for character strings is saved inside of EZSocket. If your client is a VC++ client, it is
necessary to release the memory area explicitly by using CoTaskMemFree().
(Note 1) Mitsubishi CNC C70 Series doesn’t support the automation interface. (Note 2) The existing interface IEZNcProgram::GetProgramNumber() continues to be available for backward compatibility. When newly introducing EZSocket, use this method.
Reference GetSequenceNumber(), GetBlockNumber(), GetSubProLevel()
Designation System
2-43
Magic64 M6x5M M6x5L C64 C70 CNC700
2.7.3 IEZNcProgram2::GetSequenceNumber Reading the sequence #
Calling procedure (Custom interface) HRESULT GetSequenceNumber(
LONG lProgramType,
LONG* plSequenceNo, LONG* plRet
// (I) Program type // (O) Sequence # // (O) Error code
)
Calling procedure (Automation interface) Program_GetSequenceNumber(
lProgramType As LONG
plSequenceNo As LONG*
) As LONG
// (I) Program type // (O) Sequence # // (O) Error code
Argument
lProgramType: Set program type
Value Meaning
EZNC_MAINPRG EZNC_SUBPRG
Main program Sub program
plSequenceNo: Returns the sequence # which has already finished being searched, or which is
automatically operated Data range: 0 to 99999 (other than CNC700)
0 to 999999 (CNC700)
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination
EZ_ERR_DATA_TYPE: Data type of the argument is illegal EZNC_DATA_READ_ADDR: Part system designation is illegal EZNC_DATA_READ_READ: Impossible to read the data
Return
Return value Meaning
value
S_OK Normal termination S_FALSE Communication failure
Functions
This returns the sequence # which has already finished being searched, or which is automatically operated.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference GetProgramNumber2(), GetBlockNumber(), GetSubProLevel()
Designation System
2-44
Magic64 M6x5M M6x5L C64 C70 CNC700
2.7.4 IEZNcProgram2::GetBlockNumber Reading the block #
Calling procedure (Custom interface) HRESULT GetBlockNumber(
LONG lProgramType,
LONG* plBlockNo, LONG* plRet
// (I) Program type // (O) Block # // (O) Error code
)
Calling procedure (Automation interface) Program_GetBlockNumber(
lProgramType As LONG
plBlockNo As LONG*
) As LONG
// (I) Program type // (O) Block # // (O) Error code
Argument
lProgramType: Set program type
Value Meaning
EZNC_MAINPRG EZNC_SUBPRG
Main program Sub program
plBlockNo: Returns the block # which has already finished being searched, or which is
automatically operated Data range: 0 to 99 (other than CNC700)
0 to 99999 (CNC700)
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination
EZ_ERR_DATA_TYPE: Data type of the argument is illegal EZNC_DATA_READ_ADDR: Part system designation is illegal EZNC_DATA_READ_READ: Impossible to read the data
Return
Return value Meaning
value
S_OK Normal termination S_FALSE Communication failure
Functions
This returns the block # which has already finished being searched, or which is automatically operated.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference GetSequenceNumber2(), GetSequenceNumber(), GetSubProLevel()
Designation System
2-45
Magic64 M6x5M M6x5L C64 C70 CNC700
2.7.5 IEZNcProgram2::GetSubProLevel Getting the subprogram level
Calling procedure (Custom interface) HRESULT GetSubProLevel(
LONG* plLevel,
LONG* plRet
// (O) Level // (O) Error code
)
Calling procedure (Automation interface) Program_GetSubProLevel(
plLevel As LONG*
) As LONG
// (O) Level // (O) Error code
Argument
plLevel: Returns the subprogram calling level
Value: 0 to 8
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_READ_ADDR: Part system designation is illegal EZNC_DATA_READ_READ: Impossible to read the data
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This gets the subprogram level of the designated part system.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference GetProgramNumber2, GetSequenceNumber()
Designation System
2-46
Magic64 M6x5M C64 C70 CNC700
2.7.6 IEZNcProgram2::GetInformation Getting the program information
Calling procedure (Custom interface) HRESULT GetInformation(
LONG lInfoType,
LONG* plInfoData, LONG* plRet
// (I) Information type // (O) User machining program information // (O) Error code
)
Calling procedure (Automation interface) Program_GetInformation(
lInfoType As LONG
plInfoData As LONG*
) As LONG
// (I) Information type // (O) User machining program information // (O) Error code
Argument
lInfoType: Set information type to get
Value Meaning
EZNC_PRG_MAXNUM EZNC_PRG_CURNUM EZNC_PRG_RESTNUM EZNC_PRG_CHARNUM EZNC_PRG_RESTCHARNUM
The maximum number of pieces of information to register The number of the current registrations How many more pieces of information can be registered The number of the registered characters How many more characters can be registered (unit: 250 characters)
plInfoData: Returns the program information designated by IInfoType When designating EZNC_PRG_MAXNUM, lpInfoData shows
1: 200 pieces of information. The data range and the value depend on the NC card’s specifications.
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination
EZ_ERR_DATA_TYPE: Data type of the argument is illegal EZNC_DATA_READ_READ: Impossible to read the data
EZ_ERR_NOT_SUPPORT: Not suported
Return
Return Value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This gets the program information.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference Designation
2-47

2.8 IEZNcTime Interface

Magic64 M6x5M
2.8.1 IEZNcTime::GetClockData Getting the date/time
Calling procedure (Custom interface) HRESULT GetClockData(
LONG* plDate,
LONG* plTime, LONG* plRet
// (O) Year, month and day // (O) Hour, minute and second // (O) Error code
)
Calling procedure (Automation interface) Time_GetClockData(
plDate As LONG*
plTime As LONG*
) As LONG
// (O) Year, month and day // (O) Hour, minute and second // (O) Error code
Argument plDate: Returns the date; year, month, and day
Example: 1998/12/25=19981205
plTime: Returns the hour, minute and second of the NC internal clock
Value: 0 to 235959
Example: 23 : 59 : 59 = 235959
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_READ_READ: Impossible to read the data.
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This gets the date and time from the NC internal clock.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference SetClockData()
Designation
M6x5L Limited
C64 C70 CNC700
2-48
Magic64 M6x5M M6x5L C64 C70 CNC700
2.8.2 IEZNcTime::SetClockData Setting date and time
Calling procedure (Custom interface) HRESULT SetClockData(
LONG lDate,
LONG lTime, LONG* plRet
// (I) Year, month and day // (I) Hour, minute and second // (O) Error code
)
Calling procedure (Automation interface) Time_SetClockData(
lDate As LONG
lTime As LONG
) As LONG
// (I) Year, month and day // (I) Hour, minute and second // (O) Error code
Argument lDate: Set date; year, month, and day
Example: 1998/12/25=19981205
lTime: Set hour, minute and second of the NC internal clock
Value: 0 to 235959
Example: 23 : 59 : 59 = 235959
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_WRITE_WRITE: Impossible to write the data
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
For setting the date and time of the NC internal clock.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference GetClockData()
Designation
2-49
Magic64 M6x5M M6x5L C64 C70 CNC700
2.8.3 IEZNcTime::GetAliveTime Getting the power ON time
Calling procedure (Custom interface) HRESULT GetAliveTime(
LONG* plTime,
LONG* plRet
// (O) Power ON time // (O) Error code
)
Calling procedure (Automation interface) Time_GetAliveTime(
plTime As LONG*
) As LONG
// (O) Power ON time // (O) Error code
Argument plTime: This gets the total power ON time (in hour, minute and second format) from the power
ON to OFF of the control unit. Value: 0 to 99995959 (0 to 599995959 when CNC700 is used) Exmple: 9999 : 59 : 59 = 99995959 (59999 : 59 : 59 = 599995959 when CNC700 is used)
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_READ_READ: Impossible to read the data
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This gets the total power ON time (in hour, minute and second format) from the power ON to OFF of the control unit. When the total time reaches the maximum, the system stops counting and holds the maximum amount of time.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference SetAliveTime()
Designation
2-50
Magic64 M6x5M M6x5L C64 C70 CNC700
2.8.4 IEZNcTime::SetAliveTime Setting power ON time
Calling procedure (Custom interface) HRESULT SetAliveTime(
LONG lTime,
LONG* plRet
// (I) Power ON time // (O) Error code
)
Calling procedure (Automation interface) Time_SetAliveTime(
lTime As LONG
) As LONG
// (I) Power ON time // (O) Error code
Argument lTime: Set the total power ON time (in hour, minute and second format) from the power ON to
OFF of the control unit. Value: 0 to 99995959 (0 to 599995959 when CNC700 is used) Example: 9999 : 59 : 59 = 99995959 (59999 : 59 : 59 = 599995959 when CNC700 is used)
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_WRITE_WRITE: Impossible to write the data
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This compulsory sets the total power ON time (in hour, minute and second format) from the power ON to OFF of the control unit.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference GetAliveTime()
Designation
2-51
Magic64 M6x5M M6x5L C64 C70 CNC700
2.8.5 IEZNcTime::GetRunTime Getting the automatic operation time
Calling procedure (Custom interface) HRESULT GetRunTime(
LONG* plTime,
LONG* plRet
// (O) Automatic operation time // (O) Error code
)
Calling procedure (Automation interface) Time_GetRunTime(
plTime As LONG*
) As LONG
// (O) Automatic operation time // (O) Error code
Argument plTime: Returns the total machining time (in hour, minute and second format) from the automatic
operation is started in the memory (tape) or MDI mode until it is stopped by M02/M30 or reset. Value: 0 to 99995959 (0 to 599995959 when CNC700 is used) Example: 9999 : 59 : 59 = 99995959 (59999 : 59 : 59 = 599995959 when CNC700 is used)
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_READ_READ: Impossible to read the data
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This gets the total machining time (in hour, minute and second format) from the automatic operation is started in the memory (tape) or MDI mode until it is stopped by M02/M30 or reset. When the total time reaches the maximum, the system stops counting and holds the maximum amount of time.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference SetRunTime()
Designation
2-52
Magic64 M6x5M M6x5L C64 C70 CNC700
2.8.6 IEZNcTime::SetRunTime Setting automatic operation time
Calling procedure (Custom interface) HRESULT SetRunTime(
LONG lTime,
LONG* plRet
// (I) Automatic operation time // (O) Error code
)
Calling procedure (Automation interface) Time_SetRunTime(
lTime As LONG
) As LONG
// (I) Automatic operation time // (O) Error code
Argument lTime: Set the total machining time (in hour, minute and second format) from the automatic
operation is started in the memory (tape) or MDI mode until it is stopped by M02/M30 or reset. Value: 0 to 99995959 (0 to 599995959 when CNC700 is used) Example: 9999 : 59 : 59 = 99995959 (59999 : 59 : 59 = 599995959 when CNC700 is used)
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_WRITE_WRITE: Impossible to write the data
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This compulsory sets the total machining time (in hour, minute and second format) from the automatic operation is started in the memory (tape) or MDI mode until it is stopped by M02/M30 or reset.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference GetRunTime()
Designation
2-53
Magic64 M6x5M M6x5L C64 C70 CNC700
2.8.7 IEZNcTime::GetStartTime Getting the automatic start time
Calling procedure (Custom interface) HRESULT GetStartTime(
LONG* plTime,
LONG* plRet
// (O) Automatic start time // (O) Error code
)
Calling procedure (Automation interface) Time_GetStartTime(
plTime As LONG*
) As LONG
// (O) Automatic start time // (O) Error code
Argument plTime: Returns the total automatic start time (in hour, minute and second format) from the
automatic operation is started in the memory (tape) or MDI mode until it is stopped by feed hold, block stop, or reset. Value: 0 to 99995959 (0 to 599995959 when CNC700 is used) Exmple: 9999 : 59 : 59 = 99995959 (59999 : 59 : 59 = 599995959 when CNC700 is used)
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_READ_READ: Impossible to read the data.
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This gets the total automatic start time (in hour, minute and second format) from the automatic operation is started in the memory (tape) or MDI mode until it is stopped by feed hold, block stop, or reset.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference SetStartTime()
Designation
2-54
Magic64 M6x5M M6x5L C64 C70 CNC700
2.8.8 IEZNcTime::SetStartTime Setting the automatic start time
Calling procedure (Custom interface) HRESULT SetStartTime(
LONG lTime,
LONG* plRet
// (I) Automatic start time // (O) Error code
)
Calling procedure (Automation interface) Time_SetStartTime(
lTime As LONG
) As LONG
// (I) Automatic start time // (O) Error code
Argument lTime: Set the total automatic start time (in hour, minute and second format) from the automatic
operation is started in the memory (tape) or MDI mode until it is stopped by feed hold, block stop, or reset. Value: 0 to 99995959 (0 to 599995959 when CNC700 is used) Exmple: 9999 : 59 : 59 = 99995959 (59999 : 59 : 59 = 599995959 when CNC700 is used)
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_WRITE_WRITE: Impossible to write the data
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This sets the total automatic start time (in hour, minute and second format) from the automatic operation is started in the memory (tape) or MDI mode until it is stopped by feed hold, block stop, or reset.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference GetStartTime()
Designation
2-55
Magic64 M6x5M M6x5L C64 C70 CNC700
2.8.9 IEZNcTime::GetEstimateTime Getting the external elapsed time
Calling procedure (Custom interface) HRESULT GetEstimateTime(
LONG lKind,
LONG* plTime, LONG* plRet
// (I) Type of external elapsed time // (O) External elapsed time // (O) Error code
)
Calling procedure (Automation interface) Time_GetEstimateTime(
lKind As LONG
plTime As LONG*
) As LONG
// (I) Type of external elapsed time // (O) External elapsed time // (O) Error code
Argument
lKind: Set type of external elapsed time
Value Meaning
0 Counted when PLC device Y234 is ON (Y344 for M6x5M; Y704 for CNC700) 1 Counted when PLC device Y235 is ON (Y345 for M6x5M; Y705 for CNC700)
plTime: Returns the time managed by PLC. It is expressed with hour, minute, and second.
When the elapsed time gets to the maximum, 9999:59:59, it stops counting. The display keeps showing the maximum time. Value: 0 to 99995959 Example: 9999 : 59 : 59 = 99995959
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_READ_READ: Impossible to read the data
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This returns the time managed by PLC. It is expressed with hour, minute, and second. It starts counting when user PLC device turns ON. Device # differs according to the model. Check the device # with the respective PLC interface manual.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference SetEstimateTime()
Designation
2-56
Magic64 M6x5M M6x5L C64 C70 CNC700
2.8.10 IEZNcTime::SetEstimateTime Setting external elapsed time
Calling procedure (Custom interface) HRESULT SetEstimateTime(
LONG lKind,
LONG lTime, LONG* plRet
// (I) Type of external elapsed time // (I) External elapsed time // (O) Error code
)
Calling procedure (Automation interface) Time_SetEstimateTime(
lKind As LONG
lTime As LONG
) As LONG
// (I) Type of external elapsed time // (I) External elapsed time // (O) Error code
Argument
lKind: Set type of external elapsed time
Value Meaning
0 Counted when PLC device Y234 is ON (Y344 for M6x5M; Y704 for CNC700) 1 Counted when PLC device Y235 is ON (Y345 for M6x5M; Y705 for CNC700)
lTime: Returns the time managed by PLC. It is expressed with hour, minute, and second.
When the elapsed time gets to the maximum, 9999:59:59, it stops counting. The display keeps showing the maximum time. Value: 0 to 99995959
Example: 9999 : 59 : 59 = 99995959
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_WRITE_WRITE: Impossible to write the data
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This sets the time managed by PLC. It is expressed with hour, minute, and second. It starts counting when user PLC device turns ON. Device # differs according to the model. Check the device # with the respective PLC interface manual.
(Note) Mitsubishi CNC C70 Series doesn’t support the automation interface.
Reference GetEstimateTime()
Designation
2-57

2.9 IEZNcAxisMonitor Interface

2.9.1 IEZNcAxisMonitor::GetServoMinitor Servo monitor
Calling procedure (Custom interface) HRESULT GetServoMonitor(
LONG lAxisNo,
LONG lIndex, LONG* plData, LPOLESTR* lppwszBuffer, LONG* plRet
) Calling procedure (Automation interface) Monitor_GetServoMonitor(
lAxisNo As LONG
lIndex As LONG plData As LONG* lppwszBuffer As STRING*
) As LONG
Argument lAxisNo: Set axis # (“1” or later)
lIndex: Set parameter # of the designated axis of the designated part system
(With M6x5L, remaining command, manual interpolation amount and alarm 4 are not supported.)
plData: Returns the axis condition
lppwszBuffer: Outputs the data (return value) with UNICODE character strings to the designated
value 100 to 104 in IIndex. With CNC700, outputs the data (return value) with UNICODE character strings to the designated value 11 to 15, 18 to 20 or 100 to 104 in IIndex.
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_READ_READ: Impossible to read the data EZNC_DATA_READ_DATASIZE: Too much data for the buffer prepared by the application EZNC_DATA_READ_DATATYPE: Data type (parameter #) illegal EZNC_DATA_READ_ADDR: Part system designation or axis designation is illegal
lIndex Description Data range Magic64 Remark
0 GAIN. Status of position loop gain Unit: 1/sec Unavailable 1 DROOP. (Tracking delay) Unit: i Unavailable 2 SPEED. The actual speed of revolutions. 0 and above [rpm] Available
CURRENT. Load current. Current of
3
motors. (When stalling, displays the result of
consecutive current conversion.) 4 MAXCUR1. MAX current I. Unit: % Unavailable 5 MAXCUR2. MAX current II. Unit: % Unavailable 6 OVER LOAD. Overload. Unit: % Unavailable 7 OVER REG. Regenerative load. Unit: % Unavailable 10 CYC CNT. Cycle counter. Unit: Pulse Unavailable
Magic64
Limited
M6x5M M6x5L C64 CNC700
// (I) Axis designation // (I) Designation of monitor data // (O) Monitor data // (O) Monitor data character strings // (O) Error code
// (I) Axis designation // (I) Designation of monitor data // (O) Monitor data // (O) Monitor data character strings // (O) Error code
0 and above [%] Available
2-58
Argument
11 GRIDSP. Grid interval (space). Unit: Command unit Unavailable 12 GRID. Grid amount. Unit: Command unit Unavailable 13 MACPOS. Machine position. Unit: Command unit Unavailable 14 MOT POS. Motor end FB. Unit: Command unit Unavailable 15 SCA POS. Machine end FB. Unit: Command unit Unavailable 16 FB ERROR. FB error. Unit: i Unavailable 17 DFB COMP. DFB compensation amount. Unavailable 18 Remaining command Unit: Command unit Unavailable 19 Current value Unit: Command unit Unavailable 20 Manual interruption amount Unit: Command unit Unavailable
100
AMP DISP. Amplifier (drive unit) display.
7 segment LED display.
"00\0" to "FF\0" This is output as 3
Available
character string.
101
Alarm 1 This is output as 3
character string.
Unavailable
102 Alarm 2 Ditto Unavailable 103 Alarm 3 Ditto Unavailable 104 Alarm 4 Ditto Unavailable
*In the case of CNC700, gets the value converted according to the command unit (actual value)
as character string.
Return
Return value Meaning
value
S_OK Normal termination
S_FALSE Communication failure
Functions
This gets the servo monitor information of the designated axis of the designated part system.
When the data range in the lIndex table is "Unit: Command unit", it is necessary to convert the values which are got according to the command unit set in the NC. For command units, check the specifications of the NC. <In the case of linear axis>
Metric system Conversion rate (LONG 1=) 10 micron spec -999999.99 to 999999.99 1=1/200(mm) 1 micron spec -99999.999 to 99999.999 1=1/2000(mm)
0.1 micron spec -9999.9999 to 9999.9999 1=1/20000(mm)
Inch system Conversion rate (LONG 1=) 10 micron spec -99999.999 to 99999.999 1=1/2000(inch) 1 micron spec -9999.9999 to 9999.9999 1=1/20000(inch)
0.1 micron spec -999.99999 to 999.99999 1=1/200000(inch)
<In the case of rotary axis>
Metric system Conversion rate (LONG 1=) 10 micron spec -999999.99 to 999999.99 1=1/200(mm) 1 micron spec -99999.999 to 99999.999 1=1/2000(mm)
0.1 micron spec -9999.9999 to 9999.9999 1=1/20000(mm)
Inch system Conversion rate (LONG 1=) 10 micron spec -999999.99 to 999999.99 1=1/200(inch) 1 micron spec -99999.999 to 99999.999 1=1/2000(inch)
0.1 micron spec -9999.9999 to 9999.9999 1=1/20000(Inch)
2-59
Functions E.g. of conversion) In the case of a linear axis, 1 micron spec and the metric system. If the LONG
value you got is 710001,
710001/2000 = 355.0005, then rounded down to 355.000. Data dealt with a 0.5 micron (1/2000mm) increment are rounded down to the minus side to display. Thus, +0.5 miscon is rounded downt to 0, -0.5 micron is rounded down to –1 micron.
Memory area for character strings is saved inside of EZSocket. If your client is a VC++ client, it is necessary to release the memory area explicitly by using CoTaskMemFree().
Reference GetServoVersion(), GetServoDiagnosis()
Designation System, PLC axis, Axis
2-60
M6x5M M6x5L C64 CNC700
2.9.2 IEZNcAxisMonitor::GetServoVersion Getting the servo information
Calling procedure (Custom interface) HRESULT GetServoVersion(
LONG lAxisNo,
LONG lIndex, LPOLESTR* lppwszBuffer, LONG* plRet
// (I) Axis designation // (I) Designation of servo information // (O) Servo information // (O) Error code
)
Calling procedure (Automation interface) Monitor_GetServoVersion(
lAxisNo As LONG
lIndex As LONG lppwszBuffer As STRING*
) As LONG
// (I) Axis designation // (I) Designation of servo information // (O) Servo information // (O) Error code
Argument
lAxisNo: Set axis # (“1” or later)
lIndex: Set Servo information. Refer to the table below.
lppwszBuffer: Gets the servo information as UNICODE character strings
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_READ_READ: Impossible to read the data EZNC_DATA_READ_ADDR: Part system designation or the axis designation is illegal
lIndex Description Data range
0 Drive unit model name Character string within 17 letters 1 Drive unit serial # Character string within 9 letters 2 S/W version Character string within 17 letters 3 Control method Character string within 7 letters 4 Motor end detector Character string within 9 letters 5 Machine end detector Character string within 9 letters 6 Motor model name Character string within 9 letters
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This gets the servo’s version information. Memory area for character strings is saved inside of EZSocket. If your client is a VC++ client, it is necessary to release the memory area explicitly by using CoTaskMemFree().
Reference GetServoMonitor(), GetServoDiagnosis()
Designation System, PLC axis, Axis
2-61
M6x5M M6x5L C64 CNC700
2.9.3 IEZNcAxisMonitor::GetServoDiagnosis Getting the servo diagnosis information
Calling procedure (Custom interface) HRESULT GetServoDiagnosis(
LONG lAxisNo,
LONG lIndex, LONG* plData,
LPOLESTR*
lppwszBuffer,
// (I) Axis designation // (I) Designation of the diagnosis information // (O) Diagnosis information value // (O) Diagnosis information character strings // (O) Error code
LONG* plRet
) Calling procedure (Automation interface) Monitor_GetServoDiagnosis(
lAxisNo As LONG
lIndex As LONG plData As LONG* lppwszBuffer As STRING*
) As LONG
// (I) Axis designation // (I) Designation of the diagnosis information // (O) Diagnosis information value // (O) Diagnosis information character strings // (O) Error code
Argument
lAxisNo: Set axis # (“1” or later)
lIndex: Set the servo diagnosis information. Refer to the table below.
plData: Returns the value of the servo diagnosis information
lppwszBuffer: Gets the diagnosis information as UNICODE character strings. Outputs character
strings to the designated value 21 to 30 in IIndex.
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_READ_READ: Impossible to read the data EZNC_DATA_READ_ADDR: Part system designation or the axis designation is illegal
lInde
Description Data range
x
0 Accumulated time of Ready ON 1 Alarm history 1 (#) Servo alarm # that occurred in the past 2 Alarm history 2 (#) Ditto 3 Alarm history 3 (#) Ditto 4 Alarm history 4 (#) Ditto 5 Alarm history 5 (#) Ditto 6 Alarm history 6 (#) Ditto 7 Alarm history 7 (#) Ditto 8 Alarm history 8 (#) Ditto 11 Alarm history 1 (Time) Servo alarm time that occurred in the past 12 Alarm history 2 (Time) Ditto 13 Alarm history 3 (Time) Ditto 14 Alarm history 4 (Time) Ditto 15 Alarm history 5 (Time) Ditto 16 Alarm history 6 (Time) Ditto 17 Alarm history 7 (Time) Ditto 18 Alarm history 8 (Time) Ditto
2-62
Argument
21 MNT (1) Character string within 3 letters 22 MNT (2) Ditto 23 MNT (3) Ditto 24 MNT (4) Ditto 30 SYS Character string within 2 letters
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This gets the servo diagnosis information. Memory area for character strings is saved inside of EZSocket. If your client is a VC++ client, it is necessary to release the memory area explicitly by using CoTaskMemFree().
Reference GetServoMonitor(), GetServoVersion()
Designation System, PLC axis, Axis
2-63
M6x5M M6x5L C64 CNC700
2.9.4 IEZNcAxisMonitor::GetPowerVersion Getting the power supply version information
Calling procedure (Custom interface) HRESULT GetPowerVersion(
LONG lAxisNo,
LONG lIndex, LPOLESTR* lppwszBuffer, LONG* plRet
// (I) Axis designation // (I) Designation of the version information // (O) Version information character string // (O) Error code
)
Calling procedure (Automation interface) Monitor_GetPowerVersion(
lAxisNo As LONG
lIndex As LONG lppwszBuffer As STRING*
) As LONG
// (I) Axis designation // (I) Designation of the version information // (O) Version information character string // (O) Error code
Argument
lAxisNo: Set axis # (“1” or later)
lIndex: Set the version information. Refer to the table below.
lppwszBuffer: Gets the version information as UNICODE character strings
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_READ_READ: Impossible to read the data EZNC_DATA_READ_ADDR: Part system designation or the axis designation is illegal
lIndex Description Data range
0 Unit model name Character string within 17 letters 1 Unit serial # Character string within 9 letters 2 S/W version Character string within 17 letters 3 Connection drive 1 letter
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This gets the power supply’s version information. Memory area for character strings is saved inside of EZSocket. If your client is a VC++ client, it is necessary to release the memory area explicitly by using CoTaskMemFree().
Reference GetPowerDiagnosis()
Designation Axis
2-64
M6x5M M6x5L C64 CNC700
2.9.5 IEZNcAxisMonitor::GetPowerDiagnosis Getting the power supply diagnosis information
Calling procedure (Custom interface) HRESULT GetPowerDiagnosis(
LONG lAxisNo,
LONG lIndex, LONG* plData,
LPOLESTR*
lppwszBuffer,
// (I) Axis designation // (I) Designation of the diagnosis information // (O) Diagnosis information value // (O) Diagnosis information character strings // (O) Error code
LONG* plRet
) Calling procedure (Automation interface) Monitor_GetPowerDiagnosis(
lAxisNo As LONG
lIndex As LONG plData As LONG* lppwszBuffer As STRING*
) As LONG
// (I) Axis designation // (I) Designation of the diagnosis information // (O) Diagnosis information value // (O) Diagnosis information character strings // (O) Error code
Argument
lAxisNo: Set axis # (“1” or later)
lIndex: Set the diagnosis information. Refer to the table below.
plData: Returns the value of the diagnosis information
lppwszBuffer: Gets the diagnosis information as UNICODE character strings
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_READ_READ: Impossible to read the data EZNC_DATA_READ_ADDR: Part system designation or the axis designation is illegal
lIndex Description Data range
0 Accumulated time of Ready ON 1 Alarm history 1 (#) Power supply alarm # that occurred in the past 2 Alarm history 2 (#) Ditto 3 Alarm history 3 (#) Ditto 4 Alarm history 4 (#) Ditto 5 Alarm history 5 (#) Ditto 6 Alarm history 6 (#) Ditto 7 Alarm history 7 (#) Ditto 8 Alarm history 8 (#) Ditto
11
Alarm history 1 (Time) Power supply alarm time that occurred in the
past 12 Alarm history 2 (Time) Ditto 13 Alarm history 3 (Time) Ditto 14 Alarm history 4 (Time) Ditto 15 Alarm history 5 (Time) Ditto 16 Alarm history 6 (Time) Ditto 17 Alarm history 7 (Time) Ditto 18 Alarm history 8 (Time) Ditto
2-65
Argument
21 MNT (1) Character string within 3 letters 22 MNT (2) Ditto 23 MNT (3) Ditto 24 MNT (4) Ditto 30 SYS Character string within 2 letters
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This gets the power supply diagnosis information. Memory area for character strings is saved inside of EZSocket. If your client is a VC++ client, it is necessary to release the memory area explicitly by using CoTaskMemFree().
Reference GetPowerVersion()
Designation Axis
2-66
Magic64
Limited
M6x5M M6x5L C64 CNC700
2.9.6 IEZNcAxisMonitor::GetSpindleMonitor Spindle monitor
Calling procedure (Custom interface) HRESULT GetSpindleMonitor(
LONG lIndex,
LONG lSpindle, LONG* plData, LPOLESTR* lppwszBuffer, LONG* plRet
// (I) Designation of monitor data // (I) Spindle # // (O) Monitor data value // (O) Monitor data character strings // (O) Error code
)
Calling procedure (Automation interface) Monitor_GetSpindleMonitor(
lIndex As LONG
lSpindle As LONG plData As LONG* lppwszBuffer As STRING*
) As LONG
// (I) Designation of monitor data // (I) Spindle # // (O) Monitor data value // (O) Monitor data character strings // (O) Error code
Argument
lIndex: Set parameter # of the designated spindle
lSpindle: Set spindle #
plData: Returns the spindle status
lppwszBuffer: Outputs the spindle information as UNICODE character strings
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_READ_READ: Impossible to read the data EZNC_DATA_READ_ADDR: Part system designation or the axis designation is illegal
lIndex Description Data range Magic64 Remark
0 Gain. Spindle position loop gain. Unit: 1/sec Unavailable 1 Droop. Position error amount. Unit: i Unavailable
Spindle speed (SR, SF). The
2
actual speed of the spindle motor.
0 and above [rpm] Available
Override included.
3 Load. Load of the spindle motor. 0 and above [%] Available
4
Amplifier (drive unit) display. 7 segment LED display.
"00\0" to "FF\0" This is output as 3
Available
character string.
5
Alarm 1 Character string within 3
letters
Unavailable
6 Alarm 2 Ditto Unavailable 7 Alarm 3 Ditto Unavailable 10 Cycle counter Unavailable 11 Control input 1 Unavailable 12 Control input 2 Unavailable 13 Control input 3 Unavailable 14 Control input 4 Unavailable 15 Control output 1 Unavailable 16 Control output 2 Unavailable 17 Control output 3 Unavailable 18 Control output 4 Unavailable
2-67
Return value S_OK Normal termination S_FALSE Communication failure
Functions
Reference GetSpindleVersion(), GetSpindleDiagnosis()
Designation
Return value Meaning
This gets the status of the designated spindle.
2-68
M6x5M M6x5L C64 CNC700
2.9.7 IEZNcAxisMonitor::GetSpindleVersion Getting the spindle version information
Calling procedure (Custom interface) HRESULT GetSpindleVersion(
LONG lAxisNo,
LONG lIndex, LPOLESTR* lppwszBuffer, LONG* plRet
// (I) Axis designation // (I) Designation of the version information // (O) Version information character string // (O) Error code
)
Calling procedure (Automation interface) Monitor_GetSpindleVersion(
lAxisNo As LONG
lIndex As LONG lppwszBuffer As STRING*
) As LONG
// (I) Axis designation // (I) Designation of the version information // (O) Version information character string // (O) Error code
Argument
lAxisNo: Set axis # (“1” or later)
lIndex: Set the version information. Refer to the table below.
lppwszBuffer: Gets the version information as UNICODE character strings
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_READ_READ: Impossible to read the data EZNC_DATA_READ_ADDR: Part system designation or the axis designation is illegal
lIndex Description Data range
0 Drive unit model name Character string within 17 letters 1 Drive unit serial # Character string within 9 letters 2 S/W version Character string within 17 letters
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This gets the spindle’s version information. Memory area for character strings is saved inside of EZSocket. If your client is a VC++ client, it is necessary to release the memory area explicitly by using CoTaskMemFree().
Reference GetSpindleMonitor(), GetSpindleDiagnosis()
Designation Axis
2-69
M6x5M M6x5L C64 CNC700
2.9.8 IEZNcAxisMonitor::GetSpindleDiagnosis Getting the spindle diagnosis information
Calling procedure (Custom interface) HRESULT GetSpindleDiagnosis(
LONG lAxisNo,
LONG lIndex, LONG* plData, LPOLESTR* lppwszBuffer, LONG* plRet
// (I) Axis designation // (I) Designation of the diagnosis information // (O) Diagnosis information value // (O) Diagnosis information character strings // (O) Error code
)
Calling procedure (Automation interface) Monitor_GetSpindleDiagnosis(
lAxisNo As LONG
lIndex As LONG plData As LONG* lppwszBuffer As STRING*
) As LONG
// (I) Axis designation // (I) Designation of the diagnosis information // (O) Diagnosis information value // (O) Diagnosis information character strings // (O) Error code
Argument
lAxisNo: Set axis # (“1” or later)
lIndex: Set the diagnosis information
plData: Returns the value of the diagnosis information
lppwszBuffer: Gets the diagnosis information as UNICODE character strings
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_READ_READ: Impossible to read the data EZNC_DATA_READ_ADDR: Part system designation or the axis designation is illegal
lIndex Description Data range
0 Accumulated time of Ready ON 1 Alarm history 1 (#) Spindle alarm # that occurred in the past 2 Alarm history 2 (#) Ditto 3 Alarm history 3 (#) Ditto 4 Alarm history 4 (#) Ditto 5 Alarm history 5 (#) Ditto 6 Alarm history 6 (#) Ditto 7 Alarm history 7 (#) Ditto 8 Alarm history 8 (#) Ditto 11 Alarm history 1 (Time) Spindle alarm time that occurred in the past 12 Alarm history 2 (Time) Ditto 13 Alarm history 3 (Time) Ditto 14 Alarm history 4 (Time) Ditto 15 Alarm history 5 (Time) Ditto 16 Alarm history 6 (Time) Ditto 17 Alarm history 7 (Time) Ditto 18 Alarm history 8 (Time) Ditto 21 MNT (1) Character string within 3 letters 22 MNT (2) Ditto 23 MNT (3) Ditto 24 MNT (4) Ditto 30 SYS Character string within 2 letters
2-70
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This gets the spindle diagnosis information. Memory area for character strings is saved inside of EZSocket. If your client is a VC++ client, it is necessary to release the memory area explicitly by using CoTaskMemFree().
Reference GetSpindleMonitor(), GetSpindleVersion()
Designation Axis
2-71
M6x5M M6x5L C64 CNC700
2.9.9 IEZNcAxisMonitor::GetAbsPositionMonitor Getting the absolute position monitor information
Calling procedure (Custom interface) HRESULT GetAbsPositionMonitor(
LONG lAxisNo,
LONG lIndex, LONG* plData, LPOLESTR* lppwszBuffer,
LONG* plRet
// (I) Axis designation // (I) Designation of monitor information // (O) Monitor information value // (O) Absolute position monitor
information character strings // (O) Error code
)
Calling procedure (Automation interface) Monitor_ GetAbsPositionMonitor (
lAxisNo As LONG
lIndex As LONG plData As LONG* lppwszBuffer As STRING*
) As LONG
// (I) Axis designation // (I) Designation of monitor information // (O) Monitor information value // (O) Absolute position monitor
information character strings
// (O) Error code
Argument lAxisNo: Set axis # (“1” or later)
lIndex: Set the monitor information.
plData: Returns the value of the monitor information.
lppwszBuffer: Gets the absolute position monitor information as UNICODE character strings Iindex outputs character string to 0. With CNC700, outputs the result of 0 to 3 of lIndex as UNICODE character strings.
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_READ_READ: Impossible to read the data EZNC_DATA_READ_ADDR: Part system designation or the axis designation is illegal
2-72
lIndex Description Data range Part system Axis PLC axis
0: Semi-closed encoder (ES) 1: Semi-closed high speed serial encoder (ESS)
Available Available Available
0
ABS SYS. Detection system.
2: Incremental(INC)
POF POS.
1
Power OFF
Unit: Command unit Available Available Available position. PON POS.
2
Power ON
Unit: Command unit Available Available Available position. MAC POS.
3
Current
Unit: Command unit Available Available Available position.
4 R0 Available Available Available 5 P0 Available Available Available 6 E0 Available Available Available 7 Rn Available Available Available 8 Pn Available Available Available 9 En Available Available Available 10 ABSn Available Available Available 11 ABS0 Available Available Available
*In the case of CNC700, gets the value converted according to the command unit (actual value)
as character string. For the command unit conversion, refer to Function of IEZNcAxisMonitor::GetServoMonitor().
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This gets the absolute position monitor information. ABS0 is valid only with CNC700. Memory area for character strings is saved inside of EZSocket. If your client is a VC++ client, it is necessary to release the memory area explicitly by using CoTaskMemFree().
Reference
Designation System, PLC axis, Axis
2-73
M6x5M C64 CNC700
2.9.10 IEZNcAxisMonitor::GetAuxAxisMonitor Getting the auxiliary axis monitor information
Calling procedure (Custom interface) HRESULT GetAuxAxisMonitor(
LONG lAxisNo,
LONG lIndex, LONG* plData, LPOLESTR* lppwszBuffer,
LONG* plRet
// (I) Axis designation // (I) Auxiliary axis information type // (O) Auxiliary axis information value // (O) Auxiliary axis monitor information
character strings
// (O) Error code
)
Calling procedure (Automation interface) Monitor_GetAuxAxisMonitor (
lAxisNo As LONG
lIndex As LONG plData As LONG* lppwszBuffer As STRING*
) As LONG
// (I) Axis designation // (I) Auxiliary axis information type // (O) Auxiliary axis information value // (O) Auxiliary axis monitor information
character strings
// (O) Error code
Argument
lAxisNo: Set axis # (“1” or later)
lIndex: Set the type of the auxiliary axis information. Refer to the table below.
plData: Returns the value of the auxiliary axis information
lppwszBuffer: Gets the monitor information as UNICODE character strings
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_READ_READ: Impossible to read the data
lIndex Description Data range
0 Droop -999 to 999 1 Rotation speed 0 to 9999 [rpm] 2 Load current -999 to 999 [%] 3 MAX current 1 -999 to 999 [%] 4 MAX current 2 -999 to 999 [%] 5 Load ratio -999 to 999 [%] 6 Regenerative load -999 to 999 [%] 7 Current st_No 1 to 360 8 Current position -99999.999 to 99999.999 9 Target st_No 1 to 360 10 Command position -99999.999 to 99999.999 11 Position control gain 1 0 to 999 12 Speed control gain 1 0 to 999 13 Position control gain 2 0 to 999 14 Speed control gain 2 0 to 999 15 Speed integral compensation 0 to 999 16 Load inertia ratio 0 to 999.9
2-74
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This gets the auxiliary axis monitor information. Memory area for character strings is saved inside of EZSocket. If your client is a VC++ client, it is necessary to release the memory area explicitly by using CoTaskMemFree().
Reference
Designation Axis
2-75
M6x5M C64 CNC700
2.9.11 IEZNcAxisMonitor::GetAuxAxisDiagnosis Getting the auxiliary axis diagnosis information
Calling procedure (Custom interface) HRESULT GetAuxAxisDiagnosis(
LONG lAxisNo,
LONG lIndex, LPOLESTR* lppwszBuffer,
LONG* plRet
// (I) Axis designation // (I) Auxiliary axis diagnosis
information type
// (O) Auxiliary axis diagnosis
information character strings
// (O) Error code
)
Calling procedure (Automation interface) Monitor_GetAuxAxisDiagnosis(
lAxisNo As LONG
lIndex As LONG lppwszBuffer As STRING*
) As LONG
// (I) Axis designation // (I) Auxiliary axis diagnosis
information type
// (O) Auxiliary axis diagnosis
information character strings
// (O) Error code
Argument
lAxisNo: Set axis # (“1” or later)
lIndex: Set the type of the auxiliary axis diagnosis information. Refer to the table below.
lppwszBuffer: Gets the auxiliary axis diagnosis information as UNICODE character strings
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_READ_READ: Impossible to read the data EZNC_DATA_READ_ADDR: Part system designation or the axis designation is illegal
lIndex Description Data range
0 Alarm history 1 Character string within 9 letters "Alarm information by type" 1 Alarm history 2 Character string within 9 letters "Alarm information by type" 2 Alarm history 3 Character string within 9 letters "Alarm information by type" 3 Alarm history 4 Character string within 9 letters "Alarm information by type" 4 Alarm history 5 Character string within 9 letters "Alarm information by type" 5 Alarm history 6 Character string within 9 letters "Alarm information by type"
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This gets the auxiliary axis diagnosis information. Memory area for character strings is saved inside of EZSocket. If your client is a VC++ client, it is necessary to release the memory area explicitly by using CoTaskMemFree().
Reference
Designation Axis
2-76
M6x5M C64 CNC700
2.9.12 IEZNcAxisMonitor::GetAuxAxisVersion Getting the auxiliary axis version information
Calling procedure (Custom interface) HRESULT GetAuxAxisVersion(
LONG lAxisNo,
LONG lIndex, LPOLESTR* lppwszBuffer, LONG* plRet
// (I) Axis designation
// (I) Auxiliary axis version information
type // (O) Version information character string // (O) Error code
)
Calling procedure (Automation interface) Monitor_ GetAuxAxisVersion (
lAxisNo As LONG
lIndex As LONG lppwszBuffer As STRING*
) As LONG
// (I) Axis designation // (I) Auxiliary axis version information
type // (O) Version information character string // (O) Error code
Argument
lAxisNo: Set axis # (“1” or later)
lIndex: Set the type of the auxiliary axis version information. Refer to the table below.
lppwszBuffer: Gets the version information as UNICODE character strings
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_READ_READ: Impossible to read the data EZNC_DATA_READ_ADDR: Part system designation or the axis designation is illegal
lIndex Description Data range
0 Unit model name Character string within 9 letters 1 S/W version Character string within 16 letters 2 Motor model name Character string within 9 letters
Return
Return value Meaning
value S_OK Normal termination S_FALSE Communication failure
Functions
This gets the auxiliary axis’s version information. Memory area for character strings is saved inside of EZSocket. If your client is a VC++ client, it is necessary to release the memory area explicitly by using CoTaskMemFree().
Reference
Designation Axis
2-77
Magic64 M6x5M M6x5L C64 CNC700
2.9.13 IEZNcAxisMonitor::GetDowelTime Getting the remaining dwell time
Calling procedure (Custom interface) HRESULT GetDowelTime(
DOUBLE* pdTime,
LONG* plRet
// (O) Remaining dwell time // (O) Error code
)
Calling procedure (Automation interface) Monitor_GetDowelTime(
pdTime As DOUBLE*
) As LONG
// (O) Remaining dwell time // (O) Error code
Argument pdTime: Returns the remaining time of dowel (G04)
Unit: second Value: 0.000 to 99999.999 (sec)
plRet: Returns an error code. (When using automation interface, returns a return value instead.)
S_OK: Normal termination EZNC_DATA_READ_READ: Impossible to read the data EZNC_DATA_READ_ADDR: Part system designation or the axis designation is illegal
Return
Return value Meaning
value
S_OK Normal termination S_FALSE Communication failure
Functions
This returns the remaining time of dowel (G04). Unit: second.
Reference
Designation System
2-78
Loading...