You are on page 1of 12

Makino Milling Machine Libraries (MML) McComm.

OCX
Data Server Function (M198) with PC

Makino Milling Machine Libraries (MML)

McComm.OCX
Data Server Function (M198) with PC

for Professional A / 3 / 5

MAKINO MILLING MACHINE CO., LTD.


Control Software Development

1/12
Makino Milling Machine Libraries (MML) McComm.OCX
Data Server Function (M198) with PC

EDITION DATE DETAILS EDITOR


1st 2004/01/30 Created English edition. T. YAMAGUCHI
J. ORIOLT
2nd 2005/09/16 Modified the contents of I/O Channel settings. T. YAMAGUCHI

Index

1 Introduction ........................................................................................................................................3
2 NC Parameters ....................................................................................................................................4
2.1 Fixed Parameter ...........................................................................................................................4
2.2 I/O Channel .................................................................................................................................4
3 Flow of Procedures ..............................................................................................................................5
4 Specification of McComm.ocx ..............................................................................................................7
4.1 Methods & Properties ...................................................................................................................7
MMm198Start(ByRef onumber As Long, ByRef fileName As String, ByVal arraySize As Integer, ByVal
synchroCNC As Boolean).....................................................................................................................7
MMm198Terminate() As Boolean .........................................................................................................8
MMgetM198DncSize(ByRef onumber As Long, ByRef fileName As String, ByRef dncSize As Long) ........9
MMgetM198DncStatus(ByRef onumber As Long, ByRef fileName As String, ByRef status As Integer).......9
MPm198Action As Boolean [Get].......................................................................................................9
MPm198DefDir As String [Get/Set]..................................................................................................10
MPm198DefExtension As String [Get/Set] .......................................................................................10
MPncpPrep As Boolean [Get/Set] .....................................................................................................10
MPdncTmpFname As String [Get/Set] ..............................................................................................11
4.2 Events .......................................................................................................................................11
MVm198Finish(ByVal errorNo As Long).............................................................................................11
MVm198DncFinish(ByVal onumber As Long, ByVal fileName As String, ByVal errorNo As Long) ..........11
MVm198DncSize(ByVal onumber As Long, ByVal fileName As String, ByVal size As Long) ................12
MVm198DncStatus(ByVal onumber As Long, ByVal fileName As String, ByVal status As Integer) ........12

2/12
Makino Milling Machine Libraries (MML) McComm.OCX
Data Server Function (M198) with PC

1 Introduction

The two methods which exist to transfer/execute NC programs from a PC without using CNC memory
are as follows;

(1) DNC Operation


Execute all contents of the NC program, from the top to the end M30 (or M02), while
transferring from a PC to the CNC.
It is required for the PC to command machining start to the CNC, and to monitor the finish of
NC program.
This function cannot be used with the MC functions that start NC programs automatically, such
as random operation of the Professional 3/5.

(2) M198 Operation (Data Server Function by PC)

M98 function executes sub programs stored in the CNC memory.


M198 function executes sub programs stored on the PC.
i.e. When the CNC executes the M198 block of a main program in CNC memory, all blocks of
the sub program in the PC are transferred and executed.
After executing the last M99 block of the transferred sub program, the CNC executes the next
block after the M198 block of the main program automatically.

CNC PC

O1000 O2000
: :
M198P2000 M99
:
M198P3001 O3000
: :
M30 M99

M198 operation can be used with manual functions such as cycle-start of NC program in CNC memory
with memory mode, cycle-start with MDI mode, and also functions that start execution of the NC
program automatically such as random operation of the Professional 3/5.

McComm.ocx supports M198 operation (Data Server function by PC).


This document describes the details of the function.

3/12
Makino Milling Machine Libraries (MML) McComm.OCX
Data Server Function (M198) with PC

2 NC Parameters

It is necessary to set the following NC parameters to the appropriate values to use the M198 function.
Refer to the Capt. 2 “Setting the Parameters (MDI)” in FANUC “PARAMETER MANUAL”.

2.1 Fixed Parameter

Parameter No. Bit Value


8706 #0 1
8706 #1 1

※ Check whether MC is idle before changing NC parameters.


※ It is necessary to turn off the MC power after changing the NC parameters.

2.2 I/O Channel

It is necessary to set the I/O channel (to select I/O devices) to the following value to use with the M198
function.
I/O channel can be confirmed/changed in the CNC Setting screen (push [OFFSET SETTING]
[Setting]).

Parameter No. Value Remark


0020 6 Connected with FOCAS1/2 Ethernet.
15 Subject MC is controlled with Professional 3,
and connected with FOCAS1/2 HSSB.
16 Subject MC is controlled with Professional 5,
and connected with FOCAS1/2 HSSB.

※ It is NOT necessary to turn off the MC power after changing this NC parameter.

4/12
Makino Milling Machine Libraries (MML) McComm.OCX
Data Server Function (M198) with PC

3 Flow of Procedures

The flows of basic procedures between client applications, McComm.ocx and CNC are shown as
follows;
The details of methods and events of McComm.ocx (MMm198Start(), MVm198DncFinish(), and so
on) are described in the next chapter.

Client Application Mccomm.ocx CNC


(1) MMm198Start() (2) Wait for M198

(3) Start NC program


(5) Start Data Transfer (4) Execute M198Pxxxx
(6) Execute transferred data
(9) MVm198DncFinish() (8) Raise Event (7) Execute M99

(repeat (3) to (9) )

(10) MMm198Terminate() (11) Release waiting for M198

(1) Execute MMm198Start():


Client application executes MMm198Start() method of McComm.ocx.
(2) Waiting for M198:
McComm.ocx starts monitoring periodically whether CNC executes M198.
(3) Start NC program:
Operator starts main NC program with memory/MDI mode.
(4) Execute M198P****:
CNC executes M198P**** block in CNC memory.
(5) Start data transfer:
McComm.ocx detects that CNC executed M198P****, and transfers the file corresponding to the
O-number **** from PC to CNC.
(6) Executes transferred data:
CNC executes transferred data from PC.
(7) Executes M99:
After executing transferred M99 block, CNC restarts to execute main program.
(8) Raise event:
McComm.ocx detects that the machining of transferred data is finished with M99, and raises
MVm198DncFinish() event to client application.
(9) Retrieve MVm198DncFinish():
Client application retrieves the event of M198 finish from McComm.ocx.

5/12
Makino Milling Machine Libraries (MML) McComm.OCX
Data Server Function (M198) with PC

(10) Execute MMm198Terminate():


Client application executes MMm198Terminate() of McComm.ocx to finish monitoring of M198.
(11) Release waiting for M198:
McComm.ocx finishes monitoring of M198 after MMm198Terminate().

※ Status of (2) through (11) are called “Waiting for M198”, status of (4) through (7) are called
“Executing M198”.

※ If one main program includes multiple M198 blocks, step (4) through (9) will be repeated. If
multiple main programs are executed while waiting for M198, step (3) through (9) will be repeated.

※ It is not possible to execute M198 while using DNC operation. It is not possible to execute M198
during execution of an existing M198 operation (i.e. duplicate call of M198).

※ You cannot use IF, GOTO, WHILE in NC programs using M198 operation, as these NC programs
are not executed using CNC memory.

※ If the NC programs executing from DNC or M198 include M98 (sub program call), G65, G66
(macro call) blocks, the CNC searches and executes the specified programs in CNC memory, using
the same method as standard memory operation.

6/12
Makino Milling Machine Libraries (MML) McComm.OCX
Data Server Function (M198) with PC

4 Specification of McComm.ocx
4.1 Methods & Properties

MMm198Start(ByRef onumber As Long, ByRef fileName As String,


ByVal arraySize As Integer, ByVal synchroCNC As Boolean)
Remarks
Start waiting for M198 notification. This method changes the state to enable the PC to detect
M198 execution from the CNC.
The correspondence between O-numbers specified with M198P**** and file names in the PC
will be specified with onumber, fileName and arraySize.
Parameters
onumber [in]: array of O-numbers.
fileName [in]: array of file names.
arraySize[in]: size of array onumber and fileName.
synchroCNC[in]:
True Release waiting for M198 by M30, M02 or NC reset.
False Keep waiting for M198 until MMm198Terminate() execute.
Return Values
No return value.
Errors
If this method fails to execute, this method raises the error to the client application. You can trap this
error using On Error statement of Visual Basic.
The error number will be stored in the Number property of the Err object.

Error Number Description


2005 MMm198Start() method is already executed.
3400 I/O channel is not set.
3401 Error on retrieving NC parameters.
3410 FANUC 16MB cannot execute M198.
Others Other errors.

7/12
Makino Milling Machine Libraries (MML) McComm.OCX
Data Server Function (M198) with PC

Example
Sub Func()

On Error GoTo ERR_TRAP

McComm.MMM198Start( … )

Exit Sub

ERR_TRAP:

Select Case Err.Number

Case 3400

MsgBox “Set the I/O channel.”

End Select

End Sub

Notes
When using this function, it is necessary to set I/O channel of the CNC.
The onumber and filename arrays must use a 1 to 1 association.
The fileName method parameter must be specified with the full-path.
If onumber or filename are not specified (i.e. arraySize = 0), or if there is no O-number specified
with M198P**** in array onumber, the appropriate file name will be decided with MPm198DefDir
and MPm198DefExtension properties automatically.

MMm198Terminate() As Boolean
Remark
Release the waiting for M198 with MMm198Start().
Return Values
TRUE Release the waiting for M198.
FALSE Not waiting for M198, or executing M198.

8/12
Makino Milling Machine Libraries (MML) McComm.OCX
Data Server Function (M198) with PC

MMgetM198DncSize(ByRef onumber As Long, ByRef fileName As String,


ByRef dncSize As Long)
Remarks
Returns the size of the data already transferred during execution of the M198 function.
The O-number and file name are also returned.
Parameters
onumber[out]: O-number specified with M198P****.
fileName[out]: file name of transferring/executing.
dncSize[out]: the data size that is already transferred.
Return Values
No return value.

MMgetM198DncStatus(ByRef onumber As Long, ByRef fileName As String,


ByRef status As Integer)
Remark
Returns the status of M198 executing.
The O-number and file name are also returned.
Parameters
onumber[out]: O-number specified with M198P****.
fileName[out]: file name of transferring/executing.
status[out]: status of M198 executing.
0 M198 is not executed yet / M198 finished normally.
1 On checking of initial condition for data transferring.
4 On data transferring
5 Finished data transferring (waiting for M198 finish).
6 M198 finished abnormally.
Return Values
No return value.

MPm198Action As Boolean [Get]


Remarks
Returns the status of the M198 function.
TRUE: MMm198Start() already executed.
FALSE: MMm198Start() not execute yet.

9/12
Makino Milling Machine Libraries (MML) McComm.OCX
Data Server Function (M198) with PC

MPm198DefDir As String [Get/Set]


Remarks
Get/Set the folder used during M198 operation.
Notes
If the O-number specified in MMm198Start() is executed by M198 from the CNC, the full-path
and file name specified in MMm198Start() has higher priority when the file is selected.
This property specifies the folder that stores files used by M198. The O-number executed with
M198 from the CNC and MPm198DefExtension create the transferred file name automatically.
The file executed with M198 is as follows;
MPm198DefDir¥O****.???
**** 4-digit O-number with leading 0.
??? File extension specified by MPm198DefExtension.

MPm198DefExtension As String [Get/Set]


Remarks
Get/Set the file extension that is used during M198 operation.
Note
If the O-number specified in MMm198Start() is executed with M198 from the CNC , the full-path
and file name specified in MMm198Start() has higher priority when the file is selected.
The file executed with M198 is as follows;
MPm198DefDir¥O****.???
**** 4-digit O-number with leading 0.
??? File extension specified with MPm198DefExtension.
Ex.1) MPm198DefDir=C:¥NcData, MPm198DefExtension=txt
The file of C:¥NcData¥O0001.txt is transferred to CNC with M198P1.
Ex.2) MPm198DefDir=C:¥NcData, MPm198DefExtension=
The file of C:¥NcData¥O5000 is transferred to CNC with M198P5000.

MPncpPrep As Boolean [Get/Set]


Remarks
If this property is set to TRUE, and the transferred file is stored on another PC on the network,
McComm.ocx will first copy this file to the local HDD automatically. MPdncTmpFname will
be used as the local file name. McComm.ocx executes the data-transfer to the CNC with the
local file copy.
When this property is set to TRUE, network troubles will not influence data transfer to the
CNC and machining will not be affected.

10/12
Makino Milling Machine Libraries (MML) McComm.OCX
Data Server Function (M198) with PC

MPdncTmpFname As String [Get/Set]


Remarks
Get/Set the local path and filename where network files are copied when MPncpPrep=TRUE.
You must specify a local path and filename on the local HDD.
Default Value C:¥TmpDnc.tmp

4.2 Events

MVm198Finish(ByVal errorNo As Long)


Remarks
This event is raised when waiting for M198 is released.
Normally, when MMm198Treminate() is executed, or when MMm198Start() executed with
synchroCNC=TRUE and M30, M02, NC reset executed.

MVm198DncFinish(ByVal onumber As Long, ByVal fileName As String,


ByVal errorNo As Long)
Remarks
This event is raised when the procedure returns to the main program after the CNC finishes
M198 operation (M99 was executed after data transfer from PC).
Parameters
onumber[out]: O-number specified with M198P****.
fileName[out]: File name transferred from PC.
errorNo[out]: Finish status of M198.
0 Finished normally
2006 Error of file opening
2009 Error of file reading
2010 Error of file seeking
3002 Specified the file with 0 byte.
3402 Error on reporting of DNC start to CNC.
3403 Error on reporting of DNC finish to CNC.
3404 Error on data transferring to CNC.
3405 Failed in file copy from network disk to local disk.
3406 CNC reset while DNC operation with DataServer function.
3407 CNC alarm while DNC operation with DataServer function.
3408 On emergency stopped
3409 CNC request to stop DNC with DataServer function.
Others Other errors.

11/12
Makino Milling Machine Libraries (MML) McComm.OCX
Data Server Function (M198) with PC

MVm198DncSize(ByVal onumber As Long, ByVal fileName As String,


ByVal size As Long)
Remarks
This event returns the size of the data already transferred during execution of the M198
function.
The O-number and file name are also returned.
Parameters
onumber[out]: O-number specified with M198P****.
fileName[out]: file name of transferring/executing.
dncSize[out]: data size that is already transferred

MVm198DncStatus(ByVal onumber As Long, ByVal fileName As String,


ByVal status As Integer)
Remarks
This event returns the status during execution of the M198 function
The O-number and file name are also returned.
Parameters
onumber[out]: O-number specified with M198P****.
fileName[out]: file name of transferring/executing.
status[out]: status of M198 executing (same as MMgetM198DncStatus)

12/12

You might also like