Documente Academic
Documente Profesional
Documente Cultură
PowerMotion™ Products
Operator's Manual
Warning
Warning notices are used in this publication to emphasize that hazardous voltages, currents,
temperatures, or other conditions that could cause personal injury exist in this equipment or
may be associated with its use.
In situations where inattention could cause either personal injury or damage to equipment, a
Warning notice is used.
Caution
Caution notices are used where equipment might be damaged if care is not taken.
Note
Notes merely call attention to information that is especially significant to understanding and
operating the equipment.
This document is based on information available at the time of its publication. While efforts
have been made to be accurate, the information contained herein does not purport to cover all
details or variations in hardware or software, nor to provide for every possible contingency in
connection with installation, operation, or maintenance. Features may be described herein
which are not present in all hardware and software systems. GE Fanuc Automation assumes
no obligation of notice to holders of this document with respect to changes subsequently made.
This section describes the safety precautions related to the use of CNC units. It is essential that these precautions
be observed by users to ensure the safe operation of machines equipped with a CNC unit (all descriptions in this
section assume this configuration). Note that some precautions are related only to specific functions, and thus
may not be applicable to certain CNC units.
Users must also observe the safety precautions related to the machine, as described in the relevant manual supplied
by the machine tool builder. Before attempting to operate the machine or create a program to control the operation
of the machine, the operator must become fully familiar with the contents of this manual and relevant manual
supplied by the machine tool builder.
Contents
s–1
SAFETY PRECAUTIONS B–62684EN–1/01
This manual includes safety precautions for protecting the user and preventing damage to the
machine. Precautions are classified into Warning and Caution according to their bearing on safety.
Also, supplementary information is described as a Note. Read the Warning, Caution, and Note
thoroughly before attempting to use the machine.
WARNING
Applied when there is a danger of the user being injured or when there is a damage of both the user
being injured and the equipment being damaged if the approved procedure is not observed.
CAUTION
Applied when there is a danger of the equipment being damaged, if the approved procedure is not
observed.
NOTE
The Note is used to indicate supplementary information other than Warning and Caution.
s–2
B–62684EN–1/01 SAFETY PRECAUTIONS
WARNING
1. Never attempt to machine a workpiece without first checking the operation of the machine.
Before starting a production run, ensure that the machine is operating correctly by performing
a trial run using, for example, the single block, feedrate override, or machine lock function or
by operating the machine with neither a tool nor workpiece mounted. Failure to confirm the
correct operation of the machine may result in the machine behaving unexpectedly, possibly
causing damage to the workpiece and/or machine itself, or injury to the user.
3. Ensure that the specified feedrate is appropriate for the intended operation. Generally, for each
machine, there is a maximum allowable feedrate. The appropriate feedrate varies with the
intended operation. Refer to the manual provided with the machine to determine the maximum
allowable feedrate. If a machine is run at other than the correct speed, it may behave
unexpectedly, possibly causing damage to the workpiece and/or machine itself, or injury to the
user.
4. When using a tool compensation function, thoroughly check the direction and amount of
compensation.
Operating the machine with incorrectly specified data may result in the machine behaving
unexpectedly, possibly causing damage to the workpiece and/or machine itself, or injury to the
user.
5. The parameters for the CNC and PMC are factory–set. Usually, there is not need to change them.
When, however, there is not alternative other than to change a parameter, ensure that you fully
understand the function of the parameter before making any change.
Failure to set a parameter correctly may result in the machine behaving unexpectedly, possibly
causing damage to the workpiece and/or machine itself, or injury to the user.
6. Immediately after switching on the power, do not touch any of the keys on the MDI panel until
the position display or alarm screen appears on the CNC unit.
Some of the keys on the MDI panel are dedicated to maintenance or other special operations.
Pressing any of these keys may place the CNC unit in other than its normal state. Starting the
machine in this state may cause it to behave unexpectedly.
7. The operator’s manual and programming manual supplied with a CNC unit provide an overall
description of the machine’s functions, including any optional functions. Note that the optional
functions will vary from one machine model to another. Therefore, some functions described
in the manuals may not actually be available for a particular model. Check the specification of
the machine if in doubt.
s–3
SAFETY PRECAUTIONS B–62684EN–1/01
WARNING
8. Some functions may have been implemented at the request of the machine–tool builder. When
using such functions, refer to the manual supplied by the machine–tool builder for details of their
use and any related cautions.
NOTE
Programs, parameters, and macro variables are stored in nonvolatile memory in the CNC unit.
Usually, they are retained even if the power is turned off. Such data may be deleted inadvertently,
however, or it may prove necessary to delete all data from nonvolatile memory as part of error
recovery.
To guard against the occurrence of the above, and assure quick restoration of deleted data, backup
all vital data, and keep the backup copy in a safe place.
s–4
B–62684EN–1/01 SAFETY PRECAUTIONS
This section covers the major safety precautions related to programming. Before attempting to
perform programming, read the supplied operator’s manual and programming manual carefully
such that you are fully familiar with their contents.
WARNING
s–5
SAFETY PRECAUTIONS B–62684EN–1/01
WARNING
6. Stroke check
After switching on the power, perform a manual reference position return as required. Stroke
check is not possible before manual reference position return is performed. Note that when stroke
check is disabled, an alarm is not issued even if a stroke limit is exceeded, possibly damaging
the tool, the machine itself, the workpiece, or causing injury to the user.
7. Tool post interference check
A tool post interference check is performed based on the tool data specified during automatic
operation. If the tool specification does not match the tool actually being used, the interference
check cannot be made correctly, possibly damaging the tool or the machine itself, or causing
injury to the user.
After switching on the power, or after selecting a tool post manually, always start automatic
operation and specify the tool number of the tool to be used.
8. Absolute/incremental mode
If a program created with absolute values is run in incremental mode, or vice versa, the machine
may behave unexpectedly.
9. Plane selection
If an incorrect plane is specified for circular interpolation, helical interpolation, or a canned cycle,
the machine may behave unexpectedly. Refer to the descriptions of the respective functions for
details.
10. Torque limit skip
Before attempting a torque limit skip, apply the torque limit. If a torque limit skip is specified
without the torque limit actually being applied, a move command will be executed without
performing a skip.
11. Programmable mirror image
Note that programmed operations vary considerably when a programmable mirror image is
enabled.
12. Compensation function
If a command based on the machine coordinate system or a reference position return command
is issued in compensation function mode, compensation is temporarily canceled, resulting in the
unexpected behavior of the machine.
Before issuing any of the above commands, therefore, always cancel compensation function
mode.
s–6
B–62684EN–1/01 SAFETY PRECAUTIONS
This section presents safety precautions related to the handling of machine tools. Before attempting
to operate your machine, read the supplied operator’s manual and programming manual carefully,
such that you are fully familiar with their contents.
WARNING
1. Manual operation
When operating the machine manually, determine the current position of the tool and workpiece,
and ensure that the movement axis, direction, and feedrate have been specified correctly.
Incorrect operation of the machine may damage the tool, the machine itself, the workpiece, or
cause injury to the operator.
2. Manual reference position return
After switching on the power, perform manual reference position return as required. If the
machine is operated without first performing manual reference position return, it may behave
unexpectedly. Stroke check is not possible before manual reference position return is performed.
An unexpected operation of the machine may damage the tool, the machine itself, the workpiece,
or cause injury to the user.
3. Manual numeric command
When issuing a manual numeric command, determine the current position of the tool and
workpiece, and ensure that the movement axis, direction, and command have been specified
correctly, and that the entered values are valid.
Attempting to operate the machine with an invalid command specified may damage the tool, the
machine itself, the workpiece, or cause injury to the operator.
4. Manual handle feed
In manual handle feed, rotating the handle with a large scale factor, such as 100, applied causes
the tool and table to move rapidly. Careless handling may damage the tool and/or machine, or
cause injury to the user.
5. Disabled override
If override is disabled (according to the specification in a macro variable) during threading, rigid
tapping, or other tapping, the speed cannot be predicted, possibly damaging the tool, the machine
itself, the workpiece, or causing injury to the operator.
6. Origin/preset operation
Basically, never attempt an origin/preset operation when the machine is operating under the
control of a program. Otherwise, the machine may behave unexpectedly, possibly damaging the
tool, the machine itself, the tool, or causing injury to the user.
s–7
SAFETY PRECAUTIONS B–62684EN–1/01
WARNING
Manual intervention, machine lock, or mirror imaging may shift the workpiece coordinate
system. Before attempting to operate the machine under the control of a program, confirm the
coordinate system carefully.
If the machine is operated under the control of a program without making allowances for any shift
in the workpiece coordinate system, the machine may behave unexpectedly, possibly damaging
the tool, the machine itself, the workpiece, or causing injury to the operator.
Using the software operator’s panel and menu switches, in combination with the MDI panel, it
is possible to specify operations not supported by the machine operator’s panel, such as mode
change, override value change, and jog feed commands.
Note, however, that if the MDI panel keys are operated inadvertently, the machine may behave
unexpectedly, possibly damaging the tool, the machine itself, the workpiece, or causing injury
to the user.
9. Manual intervention
If manual intervention is performed during programmed operation of the machine, the tool path
may vary when the machine is restarted. Before restarting the machine after manual intervention,
therefore, confirm the settings of the manual absolute switches, parameters, and
absolute/incremental command mode.
The feed hold, feedrate override, and single block functions can be disabled using custom macro
system variable #3004. Be careful when operating the machine in this case.
Usually, a dry run is used to confirm the operation of the machine. During a dry run, the machine
operates at dry run speed, which differs from the corresponding programmed feedrate. Note that
the dry run speed may sometimes be higher than the programmed feed rate.
Pay careful attention to a tool path specified by a command in MDI mode, because cutter or tool
nose radius compensation is not applied. When a command is entered from the MDI to interrupt
in automatic operation in cutter or tool nose radius compensation mode, pay particular attention
to the tool path when automatic operation is subsequently resumed. Refer to the descriptions of
the corresponding functions for details.
If the machine is stopped, after which the machining program is edited (modification, insertion,
or deletion), the machine may behave unexpectedly if machining is resumed under the control
of that program. Basically, do not modify, insert, or delete commands from a machining program
while it is in use.
s–8
B–62684EN–1/01 SAFETY PRECAUTIONS
WARNING
NOTE
The CNC uses batteries to preserve the contents of its memory, because it must retain data such as
programs, offsets, and parameters even while external power is not applied.
If the battery voltage drops, a low battery voltage alarm is displayed on the machine operator’s panel
or CRT screen.
When a low battery voltage alarm is displayed, replace the batteries within a week. Otherwise, the
contents of the CNC’s memory will be lost.
Refer to the maintenance section of the operator’s manual or programming manual for details of the
battery replacement procedure.
s–9
SAFETY PRECAUTIONS B–62684EN–1/01
WARNING
NOTE
The absolute pulse coder uses batteries to preserve its absolute position.
If the battery voltage drops, a low battery voltage alarm is displayed on the machine operator’s panel
or CRT screen.
When a low battery voltage alarm is displayed, replace the batteries within a week. Otherwise, the
absolute position data held by the pulse coder will be lost.
Refer to the maintenance section of the operator’s manual or programming manual for details of the
battery replacement procedure.
s–10
B–62684EN–1/01 SAFETY PRECAUTIONS
WARNING
3. Fuse replacement
For some units, the chapter covering daily maintenance in the operator’s manual or programming
manual describes the fuse replacement procedure.
Before replacing a blown fuse, however, it is necessary to locate and remove the cause of the
blown fuse.
For this reason, only those personnel who have received approved safety and maintenance
training may perform this work.
When replacing a fuse with the cabinet open, be careful not to touch the high–voltage circuits
(marked and fitted with an insulating cover).
Touching an uncovered high–voltage circuit presents an extremely dangerous electric shock
hazard.
s–11
B–62684EN–1/01 INTRODUCTION
INTRODUCTION
Use this manual together with the operator’s manual, the connecting and
maintenance manual for High Speed Serial Bus.
p–1
B–62684EN–1/01 Table of Contents
SAFETY PRECAUTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . s–1
INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . p–1
I. GENERAL
1. GENERAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 1
2. CONFIGURATION OF HARDWARE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 3
2.1 NOTICE ABOUT THE SELECTION OF THE PERSONAL COMPUTER . . . . . . . . . . . . . . . . . . 1 – 4
2.2 ENVIRONMENTAL REQUIREMENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 4
3. CONFIGURATION OF SOFTWARE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 5
3.1 SOFTWARE OF HIGH SPEED SERIAL BUS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 6
3.2 PRODUCT DISTRIBUTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 6
3.3 SPECIFICATIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 7
3.4 HIGH SPEED SERIAL BUS DRIVER SOFTWARE FOR WINDOWS 3.1 . . . . . . . . . . . . . . . . . . 1 – 7
3.5 API LIBRARY FOR HSSB (FOR WINDOWS 3.1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 8
3.6 PACKAGE SOFTWARE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 13
3.6.1 Boot Application Software (for Windows 3.1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 13
3.6.2 Maintenance Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 13
3.6.3 Basic Operation Package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 – 13
1. GENERAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 – 1
2. GENERAL DESCRIPTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 – 2
3. FUNCTION LIST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 – 4
3.1 RELATED TO THE COMMUNICATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 – 8
3.2 RELATED TO THE CONTROL AXES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 – 12
3.3 RELATED TO PROGRAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 – 34
3.4 RELATED TO NC DATA FILE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 – 69
3.5 RELATED TO OPERATION HISTORY DATA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 – 115
3.6 RELATED TO THE AXIS MOVEMENT CONTROL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 – 131
3.7 OTHERS FUNCTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 – 150
3.8 RELATED TO THE PMC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 – 196
c–1
TABLE OF CONTENTS B–62684EN–1/01
2. INSTALL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 – 2
3. OPERATION EXPLANATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 – 3
4. OPERATION SCREEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 – 4
4.1 MACHINE SELECT SCREEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 – 5
4.2 PROCESSING SELECT SCREEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 – 6
4.3 BOOT PROCESSING SCREEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 – 8
4.4 IPL PROCESSING SCREEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 – 9
4.5 SYSTEM ALARM SCREEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 – 11
4.6 HSSB BOARD TEST SCREEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 – 12
4.7 HSSB REGISTERS SCREEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 – 13
4.8 CONTENT C–RAM SCREEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 – 15
c–2
I. GENERAL
B–62684EN–1/01 GENERAL 1. GENERAL
1
“High Speed Serial Bus” connects the FANUC Power Mate with the
commercial personal computer via an optical fiber cable, so that the
personal computer can handles the following functions.
1) Related to the communication
initialize, communication establishment, etc
2) Reading of data related to controlled axes
These data include the absolute position, relative position, machine
position, remaining travel distance, actual feedrate, and so forth.
3) Operations related to CNC program
Operations include upload/download, search, and deletion of NC
programs, read NC program directory.
4) Reading/writing of CNC file data
These data include tool offset data, parameters, settings, custom macro
variables, and P–code macro variables.
5) Reading of operation history data
These data include operation history data and alarm history data.
6) Related to the axis movement control
These command include reference point return, positioning
absolute/incremental, dwell, etc.
7) Reading of other data
These data include continuous–state data, diagnostic data, alarm
information, and operator messages.
8) Reading/writing of data related to PMC
These data include addresses G, F, Y, X, A, R, T, C, and D.
Features
Can use IBM PC compatible personal computer as a operation unit of
Power Mate.
Various kinds of personal computers, with variety of processors, video
display type, hard disk size, extension slots, an so on,,, which match
the needs of the customer can be used.
By using multiple HSSB boards, Power Mate corresponding to the
number of the boards can be controlled.
Up to four Power Mate can be connected with one personal computer.
However, the number of axes which can be controlled changes
according to the performance of the personal–computer and the
content of the application software.
Power Mate can work alone, even if a personal computer is not
connected with Power Mate.
Connecting or disconnecting the personal computer from Power Mate
can be done while the power of Power Mate is on.
1–1
1. GENERAL GENERAL B–62684EN–1/01
1–2
B–62684EN–1/01 GENERAL 2. CONFIGURATION OF HARDWARE
2 CONFIGURATION OF HARDWARE
Power Mate
Control of CNC
Control of PMC
HSSB Module
HSSB control
COMMON RAM
The total edition of Power Mate–H base PCB needs 06F or later.
(DPL/MDI)
IBM–PC Compatible
personal Computer
Personal HSSB Control
Computer
Function
ISA BUS
1–3
2. CONFIGURATION OF HARDWARE GENERAL B–62684EN–1/01
2.1 (1) FANUC requires the customer to purchase and maintain the personal
computer itself.
NOTICE ABOUT THE
(2) Every personal computer should be operated by MS–DOS (V6.2 or
SELECTION OF THE later) and Windows3.1.
PERSONAL (3) The interface board for the personal computer is based on the ISA
COMPUTER specification and it can be used in IBM–PC/AT and full compatible
computer.
(Need 386 processor or above. 286 cannot manage HSSB.)
(4) The number of the ISA–BUS expansion slot must be beyond the
number of Power Mate’s and the number of other ISA boards in total.
(5) The interface board for the personal computer uses the I/O space
instead of the ISA memory space. You should arrange the I/O address
with other ISA extended board.
(6) Please examine the connection test including the communication
between the personal computer and Power Mate controller
sufficiently.
NOTE
FANUC is not responsible for the proper working of the
personal computer itself and any troubles caused by using
the personal computer.
2.2 Please use the interface board under the environmental conditions
required for each systems, that is Power Mate control unit or personal
ENVIRONMENTAL computer or Intelligent Terminal, in which the interface boards are
REQUIREMENTS installed.
1–4
B–62684EN–1/01 GENERAL 3. CONFIGURATION OF SOFTWARE
3 CONFIGURATION OF SOFTWARE
Power Mate
NOTE
1 When High Speed Serial Bus is used, C language Executor
function cannot be used at the same time.
2 When you use a Macro Library function, be sure to use the
version of the software which supports the HSSB function.
1–5
3. CONFIGURATION OF SOFTWARE GENERAL B–62684EN–1/01
3.1 The following special software for High Speed Serial Bus is supplied.
SOFTWARE OF HIGH HSSB Driver software for Windows3.1
Data Input and output is carried out by connecting Power Mate with
SPEED SERIAL BUS a personal computer through HSSB.
At maximum, four Power Mate can be connected by this software.
API Library for Windows3.1
This is a library of functions to execute data input/output operation and
command to the Power Mate from the application software on the
personal computer.
Package Software
The following software is available.
1. BOOT Application Software
2. Maintenance Operation Package Software
3. Basic Operation Package Software
1–6
B–62684EN–1/01 GENERAL 3. CONFIGURATION OF SOFTWARE
3.3
SPECIFICATIONS Item Specifications Remarks
Library API Library for Windows3.1 Provides the Various data ex-
change between Power Mate/
(A08B–9001–J721) PMC and axis moving command
3.4 This driver software initializes of the HSSB board connected with
ISA–BUS of the personal computer and executes the input and output
HIGH SPEED SERIAL management of the data from API Library.
BUS DRIVER At maximum, four Power Mate can be connected with this driver
SOFTWARE FOR software.
The number of HSSB boards in the file of SYSTEM.INI of Windows
WINDOWS 3.1
must be equal to the real board number.
Refer to the manual of HSSB driver for the detailed specification and
explanation of operation.
1–7
3. CONFIGURATION OF SOFTWARE GENERAL B–62684EN–1/01
3.5 This library reads/writes the various kinds of Power Mate/PMC data via
High Speed Serial Bus.
API LIBRARY FOR For the detail of the functions, refer to “API Library Manual”.
HSSB
(FOR WINDOWS 3.1) Function related to the communication
1–8
B–62684EN–1/01 GENERAL 3. CONFIGURATION OF SOFTWARE
1–9
3. CONFIGURATION OF SOFTWARE GENERAL B–62684EN–1/01
1 – 10
B–62684EN–1/01 GENERAL 3. CONFIGURATION OF SOFTWARE
Others
1 – 11
3. CONFIGURATION OF SOFTWARE GENERAL B–62684EN–1/01
NOTE
1 Please do the exclusive control between tasks and design
so that the function is called only by one task at a time when
you use the function of the API library in the multitask
environment. That is, it is designed so that two or more
functions may not be called at the same time in the multitask
environment.
2 The function of the API library is designed so that the
processing is not influenced by the protection processing in
Power Mate.
Therefore, by using the API library function, data can be
changed or axis can be moved at any time. But this is on the
other hand dangerous.
Please consider the protection or interlock processing on
the application software side.
1 – 12
B–62684EN–1/01 GENERAL 3. CONFIGURATION OF SOFTWARE
3.6
PACKAGE
SOFTWARE
3.6.1 Boot application software executs the following operation for Power
Boot Application Mate.
Software (1) The exchange of the system control software and PMC ladder.
(for Windows 3.1) (2) The backup and restore of the S–RAM data.
(3) The deletion and initialization of the flash ROM file.
(4) The deletion and format of the memory card file.
(5) The initialization of the system file such as the NC program, the NC
parameter, the tool offset, etc.
(6) The diagnosis and maintenance of the HSSB board.
3.6.3 This package software enables the Power Mate/PMC basic operation
Basic Operation from the personal computer. Various screens for operator are included.
Package Here shows the additional screens to “Maintenance Package”.
Status
Show Program/Sequence number, Feedrate
Position
Shows Relative/Absolute/Machine position, Distance to go, Over all
position
Program
Show program directory, Edit the program
Data Setting
Setting, Tool offset, Custom Macro variable, Operator’s panel
1 – 13
4. SET UP POWER MATE GENERAL B–62684EN–1/01
There are the following two modes when Power Mate is connected with
the personal computer through High Speed Serial Bus.
1 – 14
II. API LIBRARY
B–62684EN–1/01 API LIBRARY 1. GENERAL
1
The API library is used for exchanging data and information between the
personal computer and Power Mate.
2–1
2. GENERAL DESCRIPTION API LIBRARY B–62684EN–1/01
2 GENERAL DESCRIPTION
EW_INIERR Error in API library S The initial value file is not found.
(–14) inital valuefile S The mistake is found in set value.
S Necessary information is not de-
scribed.
EW_FUNC Error (start operation The user has not started any of the
(1) not executed or start following operations, or attempted to
already executed) start one of the following operations
hile it was
while as already
alread started
started.
S Start downloading NC program.
S Start uploading NC program.
2–2
B–62684EN–1/01 API LIBRARY 2. GENERAL DESCRIPTION
EW_LENGTH Error (data block Check and correct the data block
(2) length error) length or number of data.
EW_NUMBER Error (data number Check and correct the data number.
(3) error)
EW_ATTRIB Error (data attribute Check and correct the data attrib-
(4) error) ute.
EW_NOOPT Error (no option) The Power Mate option is not pro-
(6) vided.
CAUTION
1 Please do the exclusive control between tasks and design
so that the function is called only by one task at a time when
you use the function of the API library in the multitask
environment. That is, two functions or more must not be
called at the same time in the multitask environment.
2 The Input/Output the data by the function of the API library
is not influenced by the processing of protecting status in
Power Mate. The change and the movement instruction of
the data are possible at any time.
Therefore, it is necessary to build the protecting processing
and the interlock processing of the data Input/Output in the
application software side.
2–3
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
3 FUNCTION LIST
2–4
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
2–5
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
2–6
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Others function
2–7
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
3.1
RELATED TO THE Function name Brief description
COMMUNICATION (1) Init_HSSB Initialization for HSSB
(2) Set_HSSB_Port_no Port number estabishment
(3) Get_HSSB_Port_no Port number reading
2–8
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Description The communication with Power Mate via HSSB is established, and
initialization is done. It is enough to execute this command one time
when the application is started.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
#include <stdio.h>
#include ”apilib.h”
2–9
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Description When plural I/F boards are connected, it is set up which board an order
is issued in. “1” must be specified when I/F board is one.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
num A port number is set.(1 – 4)
Example The following program sets up the number set in the argument “num” as
a port number. When a set number is not effective, an error message is
indicated and the procedure is finished.
#include <stdio.h>
#include ”apilib.h”
2 – 10
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Description When plural I/F board are connected, it can get the information of the port
number which an order can be issued to.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
num A port number is stored.
Example The following program shows how to read the port number selected at
present.
#include <stdio.h>
#include ”apilib.h”
Get_HSSB_Port_no( 0, &port_no ) ;
printf( ”A port number is %d.¥n”, port_no ) ;
}
2 – 11
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
3.2
RELATED TO THE Function name Brief description
CONTROL AXES (1) cnc_actf Read actual axis feedrate(F)
(2) cnc_absolute Read absolute axis position
(3) cnc_machine Read machine axis position
(4) cnc_relative Read relative axis position
(5) cnc_distance Read distance to go
(6) cnc_skip Read skip position
(7) cnc_srvdelay Read servo delay value
(8) cnc_accdecdly Read acceleration/deceleration delay value
(9) cnc_rddynamic Read all dynamic data
(10) cnc_wrrelpos Set origin / preset relative axis position
2 – 12
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Description Reads the actual feed rate of the controlled axes of CNC.
The actual feed rate is stored in “data” of “ODBACT”.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
actualfeed
Pointer to the ODBACT structure including the actual feed rate of
the controlled axes.
The ODBACT structure is as follows.
typedef struct odbact {
short dummy[2]; /* dummy */
long data; /* the actual feed rate(F)*/
} ODBACT ;
Example The following program displays “CURRENT F=1200” while the block
N20:O1234 of the following NC program is being executed.
(in case of “mm input”.)
O1234 ;
N10 G90 F1200 ;
N20 G1 X10. Z200.
N30 ...
#include <stdio.h>
#include ”apilib.h”
void example( void )
{
ODBACT buf ;
cnc_actf( 0, &buf ) ;
printf( ”CURRENT F=%ld¥n”, buf.data ) ;
}
2 – 13
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Description Reads the absolute position data of the axis specified with “axis”.
The absolute position is stored in “data[0]” of “ODBAXIS”.
All axes can be read at a time by specifying ALL_AXES for “axis”.
In that case, an absolute position of each axis is stored in the data array
of ODBAXIS.
The decimal point position of the absolute position can be acquired in the
cnc_getfigure() function.
As for Power Mate, amounts of Tool Length Compensation , and amounts
of servo delay and acceleration/deceleration delay is always included in
the read absolute position.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
axis Specify axis number to read.
ALL_AXES : for all axes(ALL_AXES : –1)
1,..,m : for each axis
(m : number of controlled axis)
length
Specify the length of the data block (size of ODBAXIS structure)
4+4x(n–1)
data[n–1]
4+4xn
n : Current controlled axes
absolute
Pointer to the ODBAXIS structure including the absolute position
data of the controlled axes.
The ODBAXIS structure is as follows.
typedef struct odbaxis {
short dummy ; /* Not used. */
short type ; /* Axis number. */
long data[MAX_AXIS] ; /* Absolute position
data of controlled axis. */
} ODBAXIS ; /* MAX_AXIS is the maximum controlled axes. */
2 – 14
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
#include <stdio.h>
#include ”apilib.h”
2 – 15
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Description Reads the machine position data of the axis specified with “axis”.
The machine position is stored in “data[0]” of “ODBAXIS”.
All axes can be read at a time by specifying ALL_AXES for “axis”.
In that case, an machine position of each axis is stored in the data array
of ODBAXIS.
The decimal point position of the machine position can be acquired in the
cnc_getfigure() function.
As for Power Mate, amounts of servo delay and acceleration/deceleration
delay is always included in the read machine position.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
axis Specify axis number to read.
ALL_AXES : for all axes(ALL_AXES : –1)
1,..,m : for each axis
(m :number of controlled axis)
length
Specify the length of the data block (size of ODBAXIS structure)
4+4x(n–1)
data[n–1]
4+4xn
n : Current controlled axes
machine
Pointer to the ODBAXIS structure including the machine position
data of the controlled axes.
The ODBAXIS structure is as follows.
typedef struct odbaxis {
short dummy ; /* Not used. */
short type ; /* Axis number. */
long data[MAX_AXIS] ; /* Machine position
data of controlled axis. */
} ODBAXIS ; /* MAX_AXIS is the maximum controlled axes. */
2 – 16
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
#include <stdio.h>
#include ”apilib.h”
2 – 17
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Description Reads the relative position data of the axis specified with “axis”.
The relative position is stored in “data[0]” of “ODBAXIS”.
All axes can be read at a time by specifying ALL_AXES for “axis”.
In that case, an relative position of each axis is stored in the data array of
ODBAXIS.
The decimal point position of the relative position can be acquired in the
cnc_getfigure() function.
As for Power Mate, amounts of Tool Length Compensation, and amounts
of servo delay and acceleration/deceleration delay is always included in
the read relative position.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
axis Specify axis number to read.
ALL_AXES : for all axes(ALL_AXES : –1)
1,..,m : for each axis
(m : number of controlled axis)
length
Specify the length of the data block (size of ODBAXIS structure)
4+4x(n–1)
data[n–1]
4+4xn
n : Current controlled axes
relative
Pointer to the ODBAXIS structure including the relative position
data of the controlled axes.
The ODBAXIS structure is as follows.
typedef struct odbaxis {
short dummy ; /* Not used. */
short type ; /* Axis number. */
long data[MAX_AXIS] ; /* Relative position
data of controlled axis. */
} ODBAXIS ; /* MAX_AXIS is the maximum controlled axes. */
2 – 18
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
#include <stdio.h>
#include ”apilib.h”
2 – 19
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Description Reads the amount of distance to go of the axis specified with “axis”.
The amount of distance to go is stored in “data[0]” of “ODBAXIS”.
All axes can be read at a time by specifying ALL_AXES for “axis”.
In that case, an amount of distance to go of each axis is stored in the data
array of ODBAXIS.
The decimal point position of the amount of distance to go can be acquired
in the cnc_getfigure() function.
As for Power Mate, the read amount of distance to go is twice as big as
the actual.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
axis Specify axis number to read.
ALL_AXES : for all axes(ALL_AXES : –1)
1,..,m : for each axis
(m : number of controlled axis)
length
Specify the length of the data block(size of ODBAXIS structure)
4+4x(n–1)
data[n–1]
4+4xn
n : Current controlled axes
distance
Pointer to the ODBAXIS structure including the number of
distance to go of the controlled axes.
The ODBAXIS structure is as follows.
typedef struct odbaxis {
short dummy ; /* Not used. */
short type ; /* Axis number. */
long data[MAX_AXIS] ; /* number of distance to go of
controlled axis. */
} ODBAXIS ; /* MAX_AXIS is the maximum controlled axes. */
2 – 20
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
#include <stdio.h>
#include ”apilib.h”
2 – 21
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Description Reads the skipped position of the axis specified with “axis”.
The skipped position is stored in “data[0]” of “ODBAXIS”.
All axes can be read at a time by specifying ALL_AXES for “axis”.
In that case, an skipped position of each axis is stored in the data array of
ODBAXIS.
The decimal point position of the skipped position can be acquired in the
cnc_getfigure() function.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
axis Specify axis number to read.
ALL_AXES : for all axes(ALL_AXES : –1)
1,..,m : for each axis
(m : number of controlled axis)
length
Specify the length of the data block (size of ODBAXIS structure)
4+4x(n–1)
data[n–1]
4+4xn
n : Current controlled axes
2 – 22
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Example The following program displays the skipped position of the 1st and 2nd
axes.
#include <stdio.h>
#include ”apilib.h”
2 – 23
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Description Reads the servo delay amount of the axis specified with “axis”.
The servo delay amount is stored in “data[0]” of “ODBAXIS”.
All axes can be read at a time by specifying ALL_AXES for “axis”.
In that case, an servo delay amount of each axis is stored in the data array
of ODBAXIS.
The decimal point position of the servo delay amount can be acquired in
the cnc_getfigure() function.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
axis Specify axis number to read.
ALL_AXES : for all axes(ALL_AXES : –1)
1,..,m : for each axis
(m : number of controlled axis)
length
Specify the length of the data block (size of ODBAXIS structure)
4+4x(n–1)
data[n–1]
4+4xn
n : Current controlled axes
srvdelay
Pointer to the ODBAXIS structure including the servo delay amount
of controlled axis.
The ODBAXIS structure is as follows.
typedef struct odbaxis {
short dummy ; /* Not used. */
short type ; /* Axis number. */
long data[MAX_AXIS] ; /* Servo delay amount
of controlled axis. */
} ODBAXIS ; /* MAX_AXIS is the maximum controlled axes.*/
2 – 24
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Example The following program displays the servo delay amount of all axes
(number of axes = MAX_AXIS).
#include <stdio.h>
#include ”apilib.h”
void example( void )
{
ODBAXIS buf ;
unsigned int idx ;
cnc_srvdelay( 0, –1, 4+4*MAX_AXIS, &buf ) ;
for ( idx = 0 ; idx < MAX_AXIS ; idx++ )
printf( ”%u:%8ld¥n”, idx, buf.data[idx] ) ;
}
2 – 25
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
axis Specify axis number to read.
ALL_AXES : for all axes(ALL_AXES : –1)
1,..,m : for each axis
(m : number of controlled axis)
length
Specify the length of the data block (size of ODBAXIS structure)
4+4x(n–1)
data[n–1]
4+4xn
n : Current controlled axes
accdecdly
Pointer to the ODBAXIS structure including the acceleration/
deceleration delay amount of the controlled axes.
The ODBAXIS structure is as follows.
typedef struct odbaxis {
short dummy ; /* Not used. */
short type ; /* Axis number. */
long data[MAX_AXIS] ; /* Acceleration/deceleration
delay amount of controlled axis. */
} ODBAXIS ; /* MAX_AXIS is the maximum controlled axes.*/
2 – 26
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
2 – 27
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
axis Specify axis number to read.
ALL_AXES : for all axes(ALL_AXES : –1)
1,..,m : for each axis
(m : number of controlled axis)
2 – 28
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
length
Specify the length of the data block(size of ODBDY structure)
22+4x(2n–1)
machine[n–1]
22+4x2n
relative[0]
22+4x(2n+1)
22+4x(3n–1)
relative[n–1]
22+4x3n
distance[0]
22+4x(3n+1)
22+4x(4n–1)
distance[n–1]
22+4x4n
n : Maximum controlled axes
* The data for current controlled axes are valid.
rddynamic
Pointer to the ODBDY structure including various data.
The ODBDY structure is as follows.
typedef struct odbdy {
short dummy ; /* not used */
short axis ; /* axis number */
short alarm ; /* alarm status */
short prgnum ; /* current program number */
short prgmnum ; /* main program number */
long seqnum ; /* current sequence number */
long actf ; /* actual feed rate */
long acts ; /* not used */
union {
struct {
long absolute[MAX_AXIS] ; /* absolute */
2 – 29
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
2 – 30
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Example The following program reads the dynamic data of all axes
(number of axes = MAX_AXIS) and displays them on the screen.
#include <stdio.h>
#include ”apilib.h”
2 – 31
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Description Preset relative position against the axis specified with “type”.
Preset data is specified by “data[0]” in “IDBWRR”.
If 0 is specified as preset data, it means origin (0 clear of relative position).
It is possible to make preset to all axes at a time by specifying ALL_AXES
for “type”.
In that case, an preset data of each axis is specified by the data array in
IDBWRR.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
length
Specify the length of the data block(size of IDBWRR structure)
4+4x(n–1)
data[n–1]
4+4xn
n : Current controlled axes
wrrelpos
Pointer to the IDBWRR structure to be set the relative position data
of the controlled axes.
The IDBWRR structure is as follows.
typedef struct idbwrr {
short datano; /* Not used. */
short type; /* Axis number. */
long data[MAX_AXIS]; /* Preset data. */
} IDBWRR ; /* MAX_AXIS is the maximum controlled axes. */
type Specify axis number to make preset.
ALL_AXES : for all axes(ALL_AXES : –1)
1,..,m : for each axis
(m : number of controlled axis)
data Specify value to make preset.
data[0],..,data[m–1] : for all axes
data[0] : for each axis
2 – 32
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Example The following program preset the relative position of the first axis.
#include <stdio.h>
#include ”apilib.h”
#define FIRST_AXIS 1
#define ONE_AXIS_LEN 8
IDBWRR wrrelpos ;
short ret ;
wrrelpos.type = FIRST_AXIS ;
wrrelpos.data[0] = 0 ;
ret = cnc_wrrelpos( 0, ONE_AXIS_LEN, &wrrelpos);
2 – 33
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
3.3
RELATED TO Function name Brief description
PROGRAM (1) cnc_dwnstart Start downloading NC program
(2) cnc_download Download NC program
(3) cnc_dwnend End of downloading NC program
(4) cnc_upstart Start uploading NC program
(5) cnc_upload Upload NC program
(6) cnc_upend End of uploading NC program
(7) cnc_search Search specified program
(8) cnc_delall Delete all programs
(9) cnc_delete Delete specified program
(10) cnc_rdprogdir Read program directory
(11) cnc_rdproginfo Read program information
(12) cnc_rdprgnum Read program number under execution
(13) cnc_rdseqnum Read sequence number under execution
(14) cnc_rdexecprog Read program under execution
(15) cnc_wrmdiprog Write program for MDI operation
(16) cnc_rdmdipntr Read execution pointer for MDI operation
(17) cnc_wrmdipntr Write execution pointer for MDI operation
(18) cnc_seqsrch Search specified sequence number
(19) cnc_rewind Rewind cursor of NC program
2 – 34
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
EW_BUSY busy
S cnc_dwnstart function has been executed.
Terminate a downloading(verifying) by using
cnc_dwnend function.
S background edit processing in CNC side
Terminate background edit processing in CNC side.
S alarm (PS000, PS101) in CNC side
Reset the alarm on CNC.
S MDI mode
Change CNC mode to any mode except MDI.
EW_PROT write protection in CNC side
S Protection KEY(DI) turns on.
2 – 35
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
(2) Download NC
program
Function Name cnc_download
Yes
Is there data of unoutput?
No
2 – 36
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
data Specify the top address of NC program data.
number
Specify the number of characters of NC program data. (1 – 256)
2 – 37
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
O1234 ;
G0 Z0 ;
G0 X0 Y0 ;
G1 F500 X120. Y–30. ;
M30 ;
#include ”apilib.h”
2 – 38
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
2 – 39
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
2 – 40
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
number
Specify program number
EW_BUSY busy
S cnc_upstart function has been executed.
Terminate an uploading by using cnc_upend function.
S alarm (PS000, PS101) in CNC side
Reset the alarm on CNC.
EW_DATA data error
Program number(number) is not found or wrong.
2 – 41
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Description Read NC program registered for the tape memory in CNC (program
memory).
The procedure of uploading is as follows.
No
the last data=‘%’?
Yes
Format of input data NC program which is read from CNC is a string composed of ASCII
characters as following format.
% LF Oxxxx LF Block1 LF Block2 LF ... LF Mxx LF %
LF 0x0A(‘¥n’)
Oxxxx Program number
Mxx M code at the end of the program(M02,M30,etc.)
A null character(‘¥x00’) is not added at the end of each strings stored in
the buffer. The last character of read NC program is ‘%’.
Nothing for Power Mate can be read by attempting to read more data
beyond this last ‘%’.
For example, when you read the following NC program using this
function,
O1234 ;
G1 F0.3 W10. ;
M30 ;
%
you will get the following strings.
In case of fully large buffer.
1st time “%¥nO1234¥nG1F0.3W10.¥nM30¥n%”
(24 characters)
2nd and after “” (0 character)
2 – 42
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
And in case that the buffer size is less than 24 bytes, you will get the
following strings.
In case that the buffer size is 10 bytes.
1st time “%¥nO1234¥nG1” (10 characters)
2nd time “F0.3W10.¥nM” (10 characters)
3rd time “30¥n%” (4 characters)
4th and after “” (0 character)
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
upld Pointer to the ODBUP structure including the NC program.
The ODBUP structure is as follows.
typedef struct odbup {
short dummy[2] ; /* Not used. */
char data[MAX_RBUF] ; /* NC program data. */
} ODBUP ; (MAX_RBUF : maximum character number
to read)
The default value of read buffer size (MAX_RBUF) with ODBUP
structure is 256.
In order to read more characters at a time, it is necessary to
customize.
ODBUP 0
dummy[0]
2
dummy[1]
4
data[0]
5
4+MAX_RBUF–1
data[MAX_RBUF–1]
4+MAX_RBUF
number
Specify the address of the variable which shows number of
characters to read.
Set read number of characters by one time to this
variable(*number).
After reading ends, the number of characters actually read is set in
this variable(*number) again.
2 – 43
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
#include <stdio.h>
#include ”apilib.h”
#define BUFSIZE 40
2 – 44
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
2 – 45
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
number
Specify program number.
EW_BUSY busy
S ‘OP’ signal(DO)<F000#7> on
(only EDIT mode or MEMORY mode)
Automatic operation is being executed in CNC.
S downloading
Terminate a downloading by using cnc_dwnend func-
tion.
S alarm (PS000, PS101) in CNC side
Reset the alarm on CNC.
EW_DATA data error
Program number(number) is not found or wrong.
CNC mode The behavior of this function depends on the CNC mode.
EDIT,MEMORY mode :foreground search
Other mode :background search
(foreground search : set again selecting program.)
(background search : check whether the specified program exists
or not.)
2 – 46
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Example The following program searches the program whose program number is
same as specified one, and displays the result.
#include <stdio.h>
#include ”apilib.h”
2 – 47
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
EW_BUSY busy
S background edit processing in CNC side
Terminate background edit.
S downloading
Terminate a downloading by using cnc_dwnend
function.
S alarm (PS000, PS101) in CNC side
Reset the alarm on CNC.
S MEMORY, MDI mode in CNC side
Change CNC mode except MEMORY, MDI mode.
S ‘OP’ signal(DO)<F000#7> on
(only EDIT mode or MEMORY mode)
Automatic operation is being executed in CNC.
EW_PROT write protection in CNC side
S Protection KEY(DI) turns on.
S CNC parameter is a state of write–protection
(O8000–/O9000– protection, encoding).
See ‘Description’ about the timing of error.
2 – 48
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Example The following program deletes all programs and displays the result.
#include <stdio.h>
#include ”apilib.h”
2 – 49
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
number
Specify program number.
EW_BUSY busy
S background edit processing in CNC side
Terminate background edit.
S downloading
Terminate a downloading by using cnc_dwnend
function.
S alarm (PS000, PS101) in CNC side
Reset the alarm on CNC.
S MDI mode in CNC side
Change CNC mode except MDI mode.
S ‘OP’ signal(DO)<F000#7> on
(only EDIT mode or MEMORY mode)
Automatic operation is being executed in CNC.
S foreground program selected by CNC
Change selected program in CNC.
EW_PROT write protection in CNC side
S Protection KEY(DI) turns on.
S CNC parameter is a state of write–protection
(O8000–/O9000– protection, encoding).
See ‘Description’ about the timing of error.
2 – 50
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Example The following program deletes the program whose program number is
same as specified one, and displays the result.
#include <stdio.h>
#include ”apilib.h”
2 – 51
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
type Specify the form of the read program list.
0 : only the program number
1 : program number and comment
2 : program number, comment, and number of use
characters.
datano_s
Specify the start program number.
datano_e
Specify the end program number.
length
Specify the length of a block(buffer size).
prgdir
Pointer to the PRGDIR structure including program directory.
The PRGDIR structure is as follows.
typedef struct prgdir {
char prg_data[MAX_PBUF] ; /* Directory data. */
} PRGDIR ; (MAX_PBUF : maximum character number
to read)
Format of input data The program directory list which is read from CNC is a string composed
of ASCII characters as following format.
type=0 Oxxxx Oxxxx ... %
type=1 % LF Oxxxx (COMMENT) LF Oxxxx (COMMENT)
LF ... LF %
type=2 Oxxxx (COMMENT) CHAR_NUMBER Oxxxx (COMMENT)
CHAR_NUMBER ... %
LF 0x0A (‘¥n’)
2 – 52
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
0 “O12O200O201O9001%”
1 “%¥nO12(TEST)¥nO200(WORK1)¥nO201()¥nO9001
(SUB–PRO1)¥n%”
2 “O12(TEST)420O200(WORK1)352O201()537O9001
(SUB–PRO1)781%”
If the buffer size is not enough for the specified program, the specified size
is read. In case of 15 bytes, the result is as follows.
type Contents to be read
0 “O12O200O201O900”
1 “%¥nO12(TEST)¥nO20”
2 “O12(TEST)420O20”
2 – 53
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
#include <stdio.h>
#include <string.h>
#include ”apilib.h”
#define BUFSIZE 256
2 – 54
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
type Specify the output format.
0 : binary
1 : ASCII
length
Specify the length of data block.
12 : binary
31 : ASCII
prginfo
Pointer to the ODBNC structure including the program directory.
The ODBNC structure is as follows.
typedef struct odbnc {
union {
struct {
short reg_prg ;
/* Amount of registered programs. */
short unreg_prg ;
/* Amount of available programs. */
long used_mem ;
/* Character number of used memory. */
long unused_mem ;
/* Character number of unused memory. */
} bin ;
char asc[31] ; /* Buffer for ASCII format */
}u;
} ODBNC ;
2 – 55
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
S type=0
Each data are stored in each members of the structure with
binary format.
prginfo.bin.reg_prg Amount of registered programs.
prginfo.bin.unreg_prg Amount of available programs.
prginfo.bin.used_mem
Character number of used memory.
prginfo.bin.unused_mem
Character number of unused memory.
S type=1
ASCII strings are stored in “prginfo.u.asc” with following
format.
% LF d1 LF d2 LF d3 LF d4 LF %
LF 0x0A(‘¥n’)
d1 Amount of registered programs
d2 Amount of available programs
d3 Character number of used memory
d4 Character number of unused memory
d1 – d4 are ASCII strings without the leading ‘0’.
2 – 56
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Example The following program reads the management data of NC program, and
displays them.
#include <stdio.h>
#include ”apilib.h”
2 – 57
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Description Reads program number of the program which is being currently selected
in CNC.
As for Power Mate, if that program is a sub–program, the program number
of the main program of it is also read. The program number which can
be read is one of the root program. If the program in executing is not a
sub–program, the main program number is set as running program
number.
This function is used for management of NC programs in CNC by the
application program, etc.
The program numbers are stored in “buf.data” and “buf.mdata” with
unsigned binary format.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
prgnum
Pointer to the ODBPRO structure including the number of
executing program.
The ODBPRO structure is as follows.
typedef struct odbpro {
short dummy[2] ; /* Not used. */
short data ; /* Running program number. */
short mdata ; /* Main program number. */
} ODBPRO ;
2 – 58
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
#include <stdio.h>
#include ”apilib.h”
2 – 59
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Description Reads the sequence number of the NC program which is being currently
executed in CNC.
If the NC program has no sequence numbers in its all blocks, the sequence
number of the last executed block is read.
This function is used for watch the block being executed or the current
process by the application program, or only displaying the current
sequence number.
The sequence number is stored in “buf.data” with unsigned binary format.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
seqnum
Pointer to the ODBSEQ structure including the sequence number
under execution.
The ODBSEQ structure is as follows.
typedef struct odbseq {
short dummy[2] ; /* Not used. */
long data ; /* Sequence number in executing. */
} ODBSEQ ;
2 – 60
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Example The following program displays “CURRENT N30” while the block
“O1234/N30” of the following NC program is being executed.
#include <stdio.h>
#include ”apilib.h”
O1234 ;
N10 M3 ;
N20 T12 ;
N30 G0 X110. ;
N40 ...
2 – 61
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Description Read only the number of specified characters from the executing
program.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
length
Specify the address of the variable which shows the number of
characters to read.
Set the number of characters to read to this variable(*length).
After reading ends, the number of characters actually read is set in
this variable(*length) again.
blknum
Specify the address of the variable to store the block counter.
data Specify the top address of the array to store with the executing NC
program.
2 – 62
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
length
Specify the number of characters of NC program to write.
1 ,.., 199
data Specify the top address of NC program data.
2 – 63
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
2 – 64
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Description Read the execution pointer information for MDI operating program.
The content which can be acquired is the following items.
program number being executed
It is basically 0 for MDI operation.
When executing program is sub–program, the sub–program number
is return.
execution block pointer
block pointer which is being currently executed in CNC.
preread program number
program number read in advance.(displayed in green on the CNC
screen)
For MDI operating, it is basically 0, and for reading sub–program in
advance, it is the number of sub–program.
preread block pointer
last block pointer in the program read ahead.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
mdip Pointer to the ODBMDIP structure including the execution pointer
information.
The ODBMDIP structure is as follows.
typedef struct odbmdip {
short mdiprog; /* Program number being executed. */
long mdipntr; /* Execution block pointer. */
short crntprog; /* Preread program number.*/
long crntpntr; /* Preread block pointer. */
} ODBMDIP ;
2 – 65
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
crntpntr
Specify the block pointer to execute first.
2 – 66
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Description Searches the specified sequence number of the selected program in CNC.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
seq_no
Specify sequence number.
2 – 67
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
2 – 68
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
3.4
RELATED TO NC Function name Brief description
DATA FILE (1) cnc_rdtofs Read tool offset value
(2) cnc_wrtofs Write tool offset value
(3) cnc_rdtofsr Read tool offset value(area specified)
(4) cnc_wrtofsr Write tool offset value(area specified)
(5) cnc_rdtofsinfo Read tool offset information
(6) cnc_rdparam Read parameter
(7) cnc_wrparam Write parameter
(8) cnc_rdparar Read parameter(area specified)
(9) cnc_wrparas Write parameter(area specified)
(10) cnc_rdparainfo Read parameter information
(11) cnc_rdsetr Read setting data(area specified)
(12) cnc_wrsets Write setting data(area specified)
(13) cnc_rdmacro Read custom macro variable
(14) cnc_wrmacro Write custom macro variable
(15) cnc_rdmacror Read custom macro variable(area specified)
(16) cnc_wrmacror Write custom macro variable(area specified)
(17) cnc_rdmacroinfo Read custom macro variable information
(18) cnc_getmactype Get type of custom macro variable
(19) cnc_setmactype Set type of custom macro variable
2 – 69
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
number
Specify the tool offset number.
The available number of tool offset can be got by cnc_rdtofsinfo()
function.
type Specify the tool offset type.
A zero is set up at the time of Power Mate.
length
Specify the data block length(size of ODBTOFS structure=8).
tofs Pointer to the ODBTOFS structure including the tool offset value.
The ODBTOFS structure is as follows.
typedef struct odbtofs {
short datano ; /* offset number */
short type ; /* offset type */
long data ; /* offset value */
} ODBTOFS ;
2 – 70
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Example The following program reads the offset value of specified tool number and
displays them.
#include <stdio.h>
#include ”apilib.h”
2 – 71
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
number
Specify the tool offset number.
The available number of tool offset can be got by cnc_rdtofsinfo()
function.
type Specify the tool offset type.
A zero is set up at the time of Power Mate.
length
Specify the data block length(size of ODBTOFS structure=8).
data Set the tool offset value.
2 – 72
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Example The following program writes the offset value of specified offset number.
#include <stdio.h>
#include ”apilib.h”
2 – 73
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Description Reads the tool offset value specified by “s_number”, “e_number”, “type”.
The offset value is stored in “IODBTO” with signed binary format.
The unit of offset value is the same as “Read tool offset
value(cnc_rdtofs)”. See the description of cnc_rdtofs() function.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
s_number
Specify the start tool offset number.
The available number of tool offset can be got by cnc_rdtofsinfo()
function.
e_number
Specify the end tool offset number.
type Specify the tool offset type.(see the following table)
length
Specify the data block length.(see the following table)
tofsr Pointer to the IODBTO structure including the tool offset value.
The IODBTO structure is as follows.
typedefstructiodbto {
short datano_s; /* start offset number */
short type; /* offset type */
short datano_e; /* end offset number */
union {
long m_ofs[N]; /* individual */
long m_ofs_a[N]; /* all */
}u;
} IODBTO ; /* N is number of the offset value. */
The combinations of the value specified in “type”, the data block length
“length”, the kind of offset value to be read and the member where the
result is stored in are as follows.
Type Length Attribute Offset type Member to be stored in
2 – 74
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Example The following program reads all offset values of 99 sets and displays
them.
#include <stdio.h>
#include <stdlib.h>
#include ”apilib.h”
#define MAXTOOL 99
2 – 75
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Description Writes the tool offset value specified by “datano_s”, “datano_e”, “type”.
The offset value must be stored in “IODBTO” with signed binary format.
The unit of offset value is the same as “Write tool offset
value(cnc_wrtofs)”. See the description of cnc_wrtofs() function.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
length
Specify the data block length.
tofsr Pointer to the IODBTO structure including the tool offset value.
The IODBTO structure is as follows.
typedef struct iodbto {
short datano_s; /* start offset number */
short type; /* offset type */
short datano_e; /* end offset number */
union {
long m_ofs[N]; /* individual */
long m_ofs_a[N]; /* all */
}u;
} IODBTO ; /* N is number of the offset value. */
datano_s Specify the start tool offset number.
The available number of tool offset can be got by
cnc_rdtofsinfo() function.
datano_e Specify the end tool offset number.
type Specify the tool offset type.
The combinations of the value specified in “type”, the data block length
“length”, the kind of offset value to be written and the member where the
offset value must be stored in are the same as “Read tool offset value(area
specified)(cnc_rdtofsr)”. See the description of cnc_rdtofsr() function.
2 – 76
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Example The following program writes all tool offset values of 99 sets.
#include <stdlib.h>
#include <string.h>
#include ”apilib.h”
#define MAXTOOL 99
short example( long *offset )
{
IODBTO *tofsr ;
short ret ;
tofsr = (IODBTO *)malloc( 6+4*MAXTOOL ) ;
tofsr–>datano_s = 1 ;
tofsr–>datano_e = MAXTOOL ;
tofsr–>type = –1 ;
memcpy( &(tofsr–>u.m_ofs_a[0]), offset, 4*MAXTOOL ) ;
ret = cnc_wrtofsr( 0, 6+4*MAXTOOL, tofsr ) ;
free( tofsr ) ;
return ( ret ) ;
}
2 – 77
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Description Reads the memory type of tool offset, and the available number of it.
Those are stored in “ofs_type” and “use_no” of “ODBTLINF” with
signed binary format.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
tlinf Pointer to the ODBTLINF structure for the tool offset information.
The ODBTLINF structure is as follows.
typedef struct odbtlinf {
short ofs_type; /* memory type */
short use_no; /* available number */
} ODBTLINF ;
ofs_type Memory type of tool offset
The offset type always becomes 0.
use_no Available number of tool offset
2 – 78
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
number
Specify the parameter number.
See the “PARAMETER MANUAL” of CNC about available
parameter number. It can be got by cnc_rdparainfo() function.
axis Specify the axis number.
ALL_AXES : assigns all axes(ALL_AXES=–1)
0 : assigns no axis
1,..,m : assigns 1 axis(m=max. controlled axes)
2 – 79
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
length
Specify the data block length(size of IODBPSD structure).
(4+(byte size of parameter)*(number of axis))
In case that the size of parameter is 4 byte, the IODBPSD structure
is as follows. In case that its size is 1 or 2 byte, the size of data part
per 1 parameter or 1 axis is 1 or 2 byte.
4+2x(n–1)
ldatas[n–1]:n–th
4+2xn
n : Current controlled axes
param
Pointer to the IODBPSD structure including the parameter.
The IODBPSD structure is as follows.
typedef struct iodbpsd {
short datano; /* parameter number */
short type; /* axis */
union {
char cdata; /* bit/byte parameter */
short idata; /* word parameter */
long ldata; /* 2–word parameter */
char cdatas[MAX_AXIS]; /* bit/byte parameter
with axis*/
short idatas[MAX_AXIS]; /* word parameter
with axis */
long ldatas[MAX_AXIS]; /* 2–word parameter
with axis */
}u;
} IODBPSD ; /* MAX_AXIS : max. controlled axes */
datano Parameter number which was read is stored.
type Attribute of parameter which was read is stored.
axis
ALL_AXES : all axes(ALL_AXES=–1)
0 : no axis
1,..,m : 1 axis(m=max. controlled axes)
2 – 80
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Example The following program reads axes name of controlled axes (number of
axis=MAX_AXIS), and displays them.
#include <stdio.h>
#include <stdlib.h>
#include ”apilib.h”
2 – 81
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
2 – 82
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
length
Specify the data block length(size of IODBPSD structure).
(4+(byte size of parameter)*(number of axis))
In case that the size of parameter is 4 byte, the IODBPSD structure
is as follows. In case that its size is 1 or 2 byte, the size of data part
per 1 parameter or 1 axis is 1 or 2 byte.
4+2x(n–1)
ldatas[n–1]:n–th
4+2xn
n : Current controlled axes
param
Pointer to the IODBPSD structure including the parameter.
The IODBPSD structure is as follows.
typedef struct iodbpsd {
short datano; /* parameter number */
short type; /* axis number */
union {
char cdata; /* bit/byte parameter */
short idata; /* word parameter */
long ldata; /* 2–word parameter */
char cdatas[MAX_AXIS]; /* bit/byte parameter
with axis*/
short idatas[MAX_AXIS] ; /* word parameter
with axis */
long ldatas[MAX_AXIS]; /* 2–word parameter
with axis */
}u;
} IODBPSD ; /* MAX_AXIS : max. controlled axes */
datano Specify the parameter number.
See the “PARAMETER MANUAL” of CNC about available
parameter number. It can be got by cnc_rdparainfo() function.
type Specify the axis number.
ALL_AXES : assigns all axes(ALL_AXES=–1)
0 : assigns no axis
1,..,m : assigns 1 axis
(m=max. controlled axes)
2 – 83
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
CNC option In case of Power Mate, there may be need of CNC option for some specific
parameters.
Example The following program writes the parameter of stroke limit check for the
specified axis.
#include ”apilib.h”
2 – 84
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
s_number
Specify the start parameter number.
The first parameter number to be read is returned.
See the “PARAMETER MANUAL” of CNC about available
parameter number. It can be got by cnc_rdparainfo() function.
2 – 85
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
e_number
Specify the end parameter number.
The last parameter number to be read is returned.
The new parameter may be added according to updating CNC
software, addition of the new function, etc. If the new parameter
is added within reading range, the error(Return: EW_LENGTH)
will be returned or the application program will not work correctly.
In order to avoid these mistakes, specify the continuous numbers
of existing parameters as the reading range.
axis Specify the axis number.
ALL_AXES : assigns all axes(ALL_AXES=–1)
0 : assigns no axis
1,..,m : assigns 1 axis(m=max. controlled axes)
None axis type parameter can be read even if any value is specified
in “axis”. In case that an axis type parameter exists in the specified
range, the error(Return:EW_ATTRIB) is returned by specifying
“axis=0”.
length
Specify the data block length which is enough to store the specified
parameter.
The structure per 1 parameter is as follows, and each parameter is
lined up in order of number.
[= Sum of (4+(byte size of each parameter)*(number of axis))]
Because the size to be read is returned, it is possible to specify the
length more than the actual size.
In case that the size of parameter is 1 byte, the IODBPSD structure
is as follows.
In case that the size of parameter is 1 byte and the length per 1
parameter is an odd number, ‘dummy’ is necessary in the end of
structure. In case that its size is 2 or 4 byte, the size of data part per
1 parameter or 1 axis is 2 or 4 byte, and so ‘dummy’ is not
necessary.
2 – 86
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
param
Pointer to the area to store the parameters.
Each parameter can be referred by using the IODBPSD structure.
typedef struct iodbpsd {
short datano; /* parameter number */
short type; /* upper byte:type */
/* lower byte:axis */
union {
char cdata; /* bit/byte parameter */
short idata; /* word parameter */
long ldata; /* 2–word parameter */
char cdatas[MAX_AXIS]; /* bit/byte parameter
with axis*/
short idatas[MAX_AXIS]; /* word parameter
with axis */
long ldatas[MAX_AXIS]; /* 2–word parameter
with axis */
}u;
} IODBPSD ; /* MAX_AXIS : max. controlled axes */
datano Parameter number which was read is stored.
type Attribute of parameter which was read is stored.
Upper byte:type
0 : bit type
1 : byte type
2 : word type
3 : 2–word type
Lower byte:axis
ALL_AXES : all axes(ALL_AXES=–1)
0 : no axis
1,..,m : 1 axis(m=max. controlled axes)
2 – 87
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Example The following program reads the parameter within the specified number
range and axis, and displays them.
#include <stdio.h>
#include <stdlib.h>
#include ”apilib.h”
2 – 88
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
default :
printf( ” #%d:”, ptr–>type & 0xff ) ;
case 0 :
switch ( ptr–>type >> 8 ) {
case 0:
printf( ” 0x%02X¥n”,
(unsigned char)(ptr–>u.cdata) ) ;
inc = 1+1 ; break ;
case 1:
printf( ” %d¥n”, ptr–>u.cdata ) ;
inc = 1+1 ; break ;
case 2:
printf( ” %d¥n”, ptr–>u.idata ) ;
inc = 2 ; break ;
case 3:
printf( ” %ld¥n”, ptr–>u.ldata ) ;
inc = 4 ; break ;
}
ptr = (IODBPSD *)(((char *)ptr)+4+inc) ;
break ;
}
}
}
else
printf( ”ERROR!(%d)¥n”, ret ) ;
free( param ) ;
return ( ret ) ;
}
2 – 89
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
length
Specify the data block length which is enough to store the specified
parameter.
The structure per 1 parameter is as follows, and each parameter
must be lined up in order of number.
[= Sum of (4+(byte size of each parameter)*(number of axis))]
2 – 90
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
param
Pointer to the area to store the parameters.
Each parameter can be referred by using the IODBPSD structure.
typedef struct iodbpsd {
short datano; /* parameter number */
short type; /* upper byte:type */
/* lower byte:axis */
union {
char cdata; /* bit/byte parameter */
short idata; /* word parameter */
long ldata; /* 2–word parameter */
char cdatas[MAX_AXIS]; /* bit/byte parameter
with axis*/
short idatas[MAX_AXIS]; /* word parameter with axis */
long ldatas[MAX_AXIS]; /* 2–word parameter
with axis */
}u;
} IODBPSD ; /* MAX_AXIS : max. controlled axes */
datano Specify the parameter number.
See the “PARAMETER MANUAL” of CNC about available
parameter number. It can be got by cnc_rdparainfo() function.
type Specify the attribute of parameter.
Upper byte:type
0 : bit type
1 : byte type
2 : word type
3 : 2–word type
Lower byte:axis
ALL_AXES : assigns all axes(ALL_AXES=–1)
0 : assigns no axis
1,..,m : assigns 1 axis (m=max. controlled axes)
2 – 91
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
CNC option In case of Power Mate, there may be need of CNC option for some specific
parameters.
Example The following program writes M codes for macro call in No.6080,..,
No.6089.
#include <stdlib.h>
#include ”apilib.h”
short example( short *mcode )
{
IODBPSD *param, *ptr ;
short ret, idx ;
param = (IODBPSD *)calloc( 1, 100 ) ;
ptr = param ;
for ( idx = 0 ; idx < 10 ; idx++ ) {
ptr–>datano = 6080 + idx ;
ptr–>type = 0 ;
ptr–>cdata = mcode[idx] ;
ptr = (IODBPSD *)(((char *)ptr)+6) ;
}
ret = cnc_wrparar( 0, 6*10, param ) ;
free( param ) ;
return ( ret ) ;
}
2 – 92
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
s_number
Specify the start parameter number.
read_no
Specify the number of the parameter information to read.
paraif
Pointer to the ODBPARAIF structure including the parameter
information. The ODBPARAIF structure is as follows.
typedef struct odbparaif {
unsigned short info_no ;
/* number of parameter information */
short prev_no ;
/* previous parameter number */
short next_no ;
/* next parameter number */
struct {
short prm_no ; /* parameter number */
short prm_type ; /* attribute of parameter */
} info[N] ;/* N is amount of parameter information */
} ODBPARAIF ;
info_no Number of parameter information
Number of parameter information read actually.
prev_no Previous parameter number
Effective number ahead of parameter information read
first.
next_no Next parameter number
Effective number after parameter information read at the
end.
info[N].prm_no
Parameter number
Parameter number which exists actually.
2 – 93
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
info[N].prm_type
Attribute of parameter
The following attributes are set.
bit 0,1 : type attribute
0 : bit type 2 : word type
1 : bite type 3 : 2–word type
bit 2 : axis attribute
0 : without axis
1 : with axis
bit 3 : sign
0 : with sign
1 : without sign
bit 4 : settings input
0 : disable 1 : enable
bit 5 : write protection
0 : enable 1 : disable
bit 6 : power must be off after writing
0 : not necessary
1 : necessary
bit 7 : read protection
0 : enable 1 : disable
bit 8 : spindle parameter
0 : no spindle 1 : spindle
bit 9 – 15:(reserve)
2 – 94
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
s_number
Specify the start setting data number.
The first setting data number to be read is returned.
See the “PARAMETER MANUAL” of CNC about available
setting data number.
2 – 95
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
e_number
Specify the end setting data number.
The last setting data number to be read is returned.
The new setting data may be added according to updating CNC
software, addition of the new function, etc. If the new setting data
is added within reading range, the error(Return: EW_LENGTH)
will be returned or the application program will not work correctly.
In order to avoid these mistakes, specify the continuous numbers
of existing setting data as the reading range.
axis Specify the axis number.
ALL_AXES : assigns all axes(ALL_AXES=–1)
0 : assigns no axis
1,..,m : assigns 1 axis(m=max. controlled axes)
None axis type setting data can be read even if any value is specified
in “axis”. In case that an axis type setting data exists in the
specified range, the error(Return:EW_ATTRIB) is returned by
specifying “axis=0”.
length
Specify the data block length which is enough to store the specified
setting data.
The structure per 1 setting data is as follows, and each setting data
is lined up in order of number.
[= Sum of (4+(byte size of each setting data)*(number of axis))]
Because the size to be read is returned, it is possible to specify the
length more than the actual size.
In case that the size of setting data is 1 byte, the IODBPSD structure
is as follows.
In case that the size of setting data is 1 byte and the length per 1
setting data is an odd number, ‘dummy’ is necessary in the end of
structure. In case that its size is 2 or 4 byte, the size of data part per
1 setting data or 1 axis is 2 or 4 byte, and so ‘dummy’ is not
necessary.
2 – 96
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
2 – 97
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
2 – 98
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
length
Specify the data block length which is enough to store the specified
setting data.
The structure per 1 setting data is as follows, and each setting data
must be lined up in order of number.
[= Sum of (4+(byte size of each setting data)*(number of axis))]
In case that the size of setting data is 1 byte, the IODBPSD structure
is as follows.
In case that the size of setting data is 1 byte and the length per 1
setting data is an odd number, ‘dummy’ is necessary in the end of
structure. In case that its size is 2 or 4 byte, the size of data part per
1 setting data or 1 axis is 2 or 4 byte, and so ‘dummy’ is not
necessary.
2 – 99
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
CNC option In case of Power Mate, there may be need of CNC option for some specific
setting data.
2 – 100
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
2 – 101
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
number
Specify the custom macro variable number.
length
Specify the data block length(size of ODBM structure=10).
ODBM 0
datano
2
dummy
4 length
mcr_val
8
dec_val
10
macro
Pointer to the ODBM structure including the custom macro
variable. The ODBM structure is as follows.
typedef struct odbm {
short datano ; /* custom macro variable number */
short dummy ; /* (not used) */
long mcr_val ; /* value of custom macro variable */
short dec_val ; /* number of places of decimals */
} ODBM ;
2 – 102
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Example The following program reads the custom macro variable data of specified
number and displays it.
#include <stdio.h>
#include <string.h>
#include ”apilib.h”
2 – 103
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
number
Specify the custom macro variable number.
length
Specify the data block length(=10).
2 – 104
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
mcr_val
Specify the value of variable/numerical part of variable.
dec_val
Specify the number of places of decimals/exponent part of
variable.
Example The following program writes the specified value in the specified custom
macro variable.
#include ”apilib.h”
2 – 105
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
2 – 106
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
s_number
Specify the start custom macro variable number.
e_number
Specify the end custom macro variable number.
length
Specify the data block length(size of IODBMR structure).
(6+6*(Number of custom macro variable)
IODBMR 0
datano_s
2
dummy
4
datano_e
6
data[0].mcr_val length
10
data[0].dec_val
12
6+6*(N–1)
data[N–1].mcr_val
data[N–1].dec_val
6+6*N
macror
Pointer to the IODBMR structure including the custom macro
variable. The IODBMR structure is as follows.
typedef struct iodbmr {
short datano_s; /* start custom macro variable number */
short dummy; /* (not used) */
short datano_e; /* end custom macro variable number */
struct {
longmcr_val; /* value of custom macro var. */
short dec_val; /* number of places of decimals*/
} data[N]; /* N : number of variable */
} IODBMR;
datano_s The first custom macro variable number to be read is
returned.
datano_e The last custom macro variable number to be read is
returned.
2 – 107
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Example The following program reads the custom macro variables within the
specified range and displays them.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include ”apilib.h”
2 – 108
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
2 – 109
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
length
Specify the data block length(size of IODBMR structure).
(6+6*(Number of custom macro variable)
IODBMR 0
datano_s
2
dummy
4
datano_e
6
data[0].mcr_val length
10
data[0].dec_val
12
6+6*(N–1)
data[N–1].mcr_val
data[N–1].dec_val
6+6*N
N : Number of custom macro variable
macror
Pointer to the IODBMR structure including the custom macro
variable. The IODBMR structure is as follows.
typedef struct iodbmr {
short datano_s; /* start custom macro variable number */
short dummy; /* (not used) */
short datano_e; /* end custom macro variable number */
struct {
long mcr_val; /* value of custom macro var. */
short dec_val; /* number of places of decimals*/
} data[N]; /* N : number of variable */
} IODBMR;
datano_s Specify the start custom macro variable number.
datano_e Specify the end custom macro variable number.
mcr_val Specify the value of variable/numerical part of variable.
dec_val Specify the number of places of decimals/exponent part of
variable.
2 – 110
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Example The following program writes the specified values into the custom macro
variables within the specified range.
#include <stdlib.h>
#include ”apilib.h”
2 – 111
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Description Reads the available number of the local macro variable and the common
macro variable. Those are stored in “use_no1”, “use_no2” of
“ODBMVINF” with signed binary format.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
mvinf
Pointer to the ODBMVINF structure including the custom macro
variable information. The ODBMVINF structure is as follows.
typedef struct odbmvinf {
short use_no1 ; /* number of local variable */
short use_no2 ; /* indicator of common variable */
} ODBMVINF ;
use_no1 Available number of local macro variable(33 sets)
use_no2 Indicator of available common variable
0 : 100,..,149, 500,..,531
1 : 100,..,199, 500,..,999
2 : 100,..,199, 500,..,699
2 – 112
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Description Gets the type of custom macro variable which is used by cnc_rdmacro,
cnc_wrmacro, cnc_rdmacror, cnc_wrmacror function.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
macro_type
Custom macro variable type
0 :Fixed–point type (default)
none 0 :Floating–point type
2 – 113
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
macro_type
Custom macro variable type
0 :Fixed–point type (default)
none 0 :Floating–point type
2 – 114
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
3.5
RELATED TO Function name Brief description
OPERATION HISTORY (1) cnc_stopophis Stop logging operation history data
DATA (2) cnc_startophis Restart logging operation history data
(3) cnc_rdophisno Read number of operation history data
(4) cnc_rdophistry Read operation history data
(5) cnc_rdalmhisno Read number of alarm history data
(6) cnc_rdalmhistry Read alarm history data
(7) cnc_clearophis Clear operation history data
(8) cnc_rdhissgnl Read signals related operation history
(9) cnc_wrhissgnl Write signals related operation history
2 – 115
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Description Stops sampling the operation history data and the alarm history data of
CNC.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
2 – 116
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Description Restarts sampling the operation history data and the alarm history data of
CNC.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
2 – 117
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
hisno
Pointer to the variable by which the number of operation history
data is stored.
2 – 118
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
s_no Specify the beginning record number.(more than 1)
e_no Specify the end record number.(more than 1)
2 – 119
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
length
Specify the data block length(size of ODBHIS structure).
ODBHIS 0
s_no
2
type
4
e_no
6 length
data[0]
14
6+8*(n–1)
data[n]
6+8*n
data.rec_alm 0
rec_type
2
alm_grp
4
alm_no
6
axis_no
7
dummy
8
data.rec_mdi 0
rec_type
2
key_code
3
pw_flag
4
dummy[0]
5
dummy[1]
6
dummy[2]
7
dummy[3]
8
data.rec_sgn 0
rec_type
2
sig_name
3
sig_old
4
sig_new
5
dummy
6
sig_no
8
2 – 120
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
2 – 121
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
2 – 122
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
hisno
Pointer to the variable by which the number of alarm history data
is stored.
2 – 123
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
2 – 124
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
s_no Specify the beginning record number.(more than 1)
e_no Specify the end record number.(more than 1)
length
Specify the data block length(size of ODBHIS structure).
ODBAHIS 0
s_no
2
type
4
e_no
6 length
alm_his[0]
54
6+48*(n–1)
alm_his[n]
6+48*n
alm_his 0
dummy
2
alm_grp
4
alm_no
6
axis_no
7
year
8
month
9
day
10
hour
11
minute
12
second
13
dummy2
14
len_meg
16
alm_msg[0]
17
47
alm_msg[31]
48
2 – 125
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
his Pointer to the ODBAHIS structure by which the alarm history data
is stored. The ODBAHIS structure is as follows.
typedef struct odbahis {
unsigned s_no; /* Start record number */
short type; /* Not used */
unsigned e_no; /* Most recently entered */
/* record number */
struct {
short dummy; /* Not used */
short alm_grp; /* Alarm type */
short alm_no; /* Alarm number */
char axis_no; /* Axis number */
char year; /* Year(Not used) */
char month; /* Month (Not used) */
char day; /* Day (Not used) */
char hour; /* Hour(Not used) */
char minute; /* Minute(Not used) */
char second; /* Second(Not used) */
char dummy2; /* Not used */
short len_msg; /* Length of alarm */
/* messafe */
char alm_msg[32]; /* Alarm messafe */
} alm_his[N]; /* N : Number of record */
} ODBAHIS ;
alm_grp Alarm type
Power Mate Not used
alm_no Alarm number
axis_no Axis number(from 1 to maximum controlled axis)
It is –1 for an unrelated alarm to the axis.
len_msg Length of alarm message (from 0 to 32)
alm_msg Alarm message
2 – 126
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Description Clears the opeation history data and the alarm history data.
It is possible to be selected the operation history or the alarm history by
setting “slct” in Power Mate.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
slct Specify the kind of the cleared history data.
0 : the operation history data
1 : the alarm history data
2 – 127
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
sig Pointer to the IODBSIG structure by which the operation history
signal is stored. The IODBSIG structure is as follows.
typedef struct iodbsig {
short datano; /* Not used */
short type; /* Not used */
struct {
short ent_no; /* Registration sequence number */
short sig_no; /* Registered signal number */
char sig_name; /* Registered signal name */
char mask_pat; /* Signal mask pattern */
} data[20];
} IODBSIG ;
ent_no Registration sequence number (from 1 to 20)
sig_no Number of a registered signal
X : from 0 to 127 or from 1000 to 1063
G : from 0 to 255 or from 1000 to 1255
Y : from 0 to 127 or from 1000 to 1063
F : from 0 to 255 or from 1000 to 1255
sig_name Name of a registered signal
0 : Not registered
1 : X
2 : G
3 : Y
4 : F
mask_pat Signal mask pattern
2 – 128
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
sig Pointer to the IODBSIG structure which the operation history
signal to set to CNC is stored.
The IODBSIG structure is as follows.
typedef struct iodbsig {
short datano; /* Not used */
short type; /* Number of signals*/
struct {
short ent_no; /* Registration sequence number */
short sig_no; /* Registered signal number */
char sig_name; /* Registered signal name */
char mask_pat; /* Signal mask pattern */
} data[20];
} IODBSIG ;
ent_no Registration sequence number (from 1 to 20)
sig_no Number of a registered signal
X : from 0 to 127 or from 1000 to 1063
G : from 0 to 255 or from 1000 to 1255
Y : from 0 to 127 or from 1000 to 1063
F : from 0 to 255 or from 1000 to 1255
sig_name Name of a registered signal
0 : Not registered
1 : X
2 : G
3 : Y
4 : F
mask_pat Signal mask pattern
2 – 129
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
2 – 130
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
3.6
RELATED TO THE Function name Brief description
AXIS MOVEMENT (1) cnc_opdi Signal operation command
CONTROL (2) cnc_refpoint Reference point return
(3) cnc_abspoint Absolute movement
(4) cnc_incpoint Incremental movement
(5) cnc_dwell Dwell
(6) cnc_coordre Coordinate establihment
(7) cnc_exebufstat Reading of the executive buffer condition
(8) cnc_finstate Reading of the execution completion condition
(9) cnc_setfin Release of the reading mode of the execution
completion condition
2 – 131
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
number
An operation signal number is set.
idb It is pointer to the ODBPOS structure that shows the information
of each axis.
The ODBPOS structure is as follows.
typedef struct odbopdi {
short axis; /* axis number */
union {
char cdata;
short idata;
long ldata;
} u; /* signal data */
} ODBOPDI;
operation operation signal set value
signal name
number
2 – 132
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
0 0 0 0 0 0
#3 move direction
1:–J 0:+J
#0 1:move 0:stop
15 Single block signal cdata 1:effective 0:not effective
EW_BUSY Busy
Try it again or wait until the procedure of CNC is finished.
2 – 133
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Description Moves the axis specified by “path_no” and “axis” to the reference point.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
path_no
PATH number is set.(1 – 6)
nmod
The requirement to send the completion notice flag is set.
1:require
0:not require
axis Axis number is set.(1 – 6)
odb It is pointer to the ODBEXEC structure that shows the information
of executive condition.
The ODBEXEC structure is as follows.
typedef struct odbexec {
short dummy; /* none */
char cdata[2][8]; /* The infomation of the */
} ODBEXEC; /* executive condition of*/
/* each PATH. */
cdata The condition of the present command buffer is shown.
#7 #6 #5 #4 #3 #2 #1 #0
cdata[0][x–1] EMNT16 EMNT15 EMNT14 EMNT13 EMNT12 EMNT11
0 0 A buffer is empty
0 1 There is data in the buffer 1.
1 0 There is data in the buffer 2.
1 1 A buffer is full.
x : PATH number
EW_BUSY Busy
Try it again or wait until the procedure of CNC is finished.
2 – 134
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Example The following program moves the first axis of first PATH to the reference
point and indicates command buffer condition.
#include <stdio.h>
#include ”apilib.h”
2 – 135
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Description Moves the axis specified by “path_no” to the position specified by the
absolute command in “idb.data” by the “feed” speed.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
path_no
PATH number is set.(1 – 6)
nmod
The requirement to send the completion notice flag is set.
1:require
0:not require
axis The number of movement axis is set.(1 – 6)
feed A movement speed is set.
idb It is pointer to the ODBPOS structure that shows the information
of each axis.
The ODBPOS structure is as follows.
typedef struct odbpos {
short idata; /* axis number */
long ldata; /* coordinate value */
} ODBPOS;
idata Axis number is set.(1 – 6)
ldata The coordinate value of movement axis is set.
A movement unit is as the following.
IS–B
2 – 136
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
#7 #6 #5 #4 #3 #2 #1 #0
cdata[0][x–1] EMNT16 EMNT15 EMNT14 EMNT13 EMNT12 EMNT11
0 0 A buffer is empty
0 1 There is data in the buffer 1.
1 0 There is data in the buffer 2.
1 1 A buffer is full.
x : PATH number
EW_BUSY Busy
Try it again or wait until the procedure of CNC is finished.
2 – 137
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Example The 1st axis of 1st PATH is moved to the position of 100 and 2nd axis is
moved to the position of –100 at the speed 500. The following program
requests the reply about the buffer condition.
(mm output. Least incremental unit is IS–B.)
#include <stdio.h>
#include ”apilib.h”
idb[0].idata = 1 ;
idb[0].ldata = 100000 ;
idb[1].idata = 2 ;
idb[1].ldata = –100000 ;
2 – 138
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
(4) Incremental
movement
Description Moves the axis specified by “path_no” to the position specified by the
incremental command in “idb.data” by the “feed” speed.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
path_no
PATH number is set.(1 – 6)
nmod
The requirement to send the completion notice flag is set.
1:require
0:not require
axis The number of movement axis is set.(1 – 6)
feed A movement speed is set.
idb It is pointer to the ODBPOS structure that shows the information
of each axis.
The ODBPOS structure is as follows.
typedef struct odbpos {
short idata; /* axis number */
long ldata; /* movement distance */
} ODBPOS;
idata Axis number is set.(1 – 6)
ldata The distance of movement axis is set.
A movement unit is as the following.
IS–B
2 – 139
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
#7 #6 #5 #4 #3 #2 #1 #0
cdata[0][x–1] EMNT16 EMNT15 EMNT14 EMNT13 EMNT12 EMNT11
0 0 A buffer is empty
0 1 There is data in the buffer 1.
1 0 There is data in the buffer 2.
1 1 A buffer is full.
x : PATH number
EW_BUSY Busy
Try it again or wait until the procedure of CNC is finished.
2 – 140
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Example The 1st axis of 1st PATH is moved to the distance of +100 and 2nd axis
is moved to the distance of –100 at the speed 500. The following program
requests the reply about the buffer condition.
(mm output. Least incremental unit is IS–B.)
#include <stdio.h>
#include ”apilib.h”
idb[0].idata = 1 ;
idb[0].ldata = 100000 ;
idb[1].idata = 2 ;
idb[1].ldata = –100000 ;
2 – 141
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
(5) Dwell
Description Pause the operation of the path specified “path_no” for the time (sec)
specified by “data”.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
path_no
PATH number is set.(1 – 6)
nmod
The requirement to send the completion notice flag is set.
1:require
0:not require
axis The number of stop axis is set.(1 – 6)
idb It is pointer to the ODBPOS structure that shows the information
of each axis.
The ODBPOS structure is as follows.
typedef struct odbpos {
short idata; /* axis number */
long ldata; /* stop time(sec) */
} ODBPOS;
idata Axis number is set.(1 – 6)
ldata Time(sec) is set.(0.001 – 99999.999)
odb It is pointer to the ODBEXEC structure that shows the information
of executive condition.
The ODBEXEC structure is as follows.
typedef struct odbexec {
short dummy; /* none */
char cdata[2][8]; /* The infomation of the */
} ODBEXEC; /* executive condition of*/
/* each PATH. */
cdata The condition of the present command buffer is shown.
#7 #6 #5 #4 #3 #2 #1 #0
cdata[0][x–1] EMNT16 EMNT15 EMNT14 EMNT13 EMNT12 EMNT11
0 0 A buffer is empty
0 1 There is data in the buffer 1.
1 0 There is data in the buffer 2.
1 1 A buffer is full.
x : PATH number
2 – 142
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
EW_BUSY Busy
Try it again or wait until the procedure of CNC is finished.
2 – 143
3. FUNCTION LIST API LIBRARY B–62684EN–1/0
1
(6) Coordinate
establishment
Description Preset the coordinate of the axis specified by “path_no” and “idb.idata”
to the value specified by “idb.ldata”.
Arguments FlibHndl
Because it isn ’t used at present, this a rgument must be set up a zero.
path_no
PATH number is set.(1 – 6)
nmod
The requirement to send the completion notice flag is set.
1:require
0:not require
axis A number of the axis to set up is set.(1 – 6)
idb It is pointer to the ODBPOS structure that shows the information
of each axis.
The ODBPOS structure is as follows.
typedef struct odbpos {
short idata; /* axis number */
long ldata; /* stop time(sec) */
} ODBPOS;
idata Axis number is set.(1 – 6)
ldata Coordinate value is set.
A movement unit is as the following.
IS–B
2 – 144
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
#7 #6 #5 #4 #3 #2 #1 #0
cdata[0][x–1] EMNT16 EMNT15 EMNT14 EMNT13 EMNT12 EMNT11
0 0 A buffer is empty
0 1 There is data in the buffer 1.
1 0 There is data in the buffer 2.
1 1 A buffer is full.
x : PATH number
EW_BUSY Busy
Try it again or wait until the procedure of CNC is finished.
2 – 145
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Description Request the information of the buffer condition of the block that is
commanded by cnc_refpoint, cnc_abspoint, cnc_incpoint, cnc_dwell or
cnc_coordre.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
odb It is pointer to the ODBEXEC structure that information of
executive condition is shown.
ODBEXEC structure is as the next.
typedef struct odbexec {
short dummy; /* none */
char cdata[2][8]; /* The infomation of the */
} ODBEXEC; /* executive condition of*/
/* each PATH. */
cdata The condition of the present command buffer is shown.
#7 #6 #5 #4 #3 #2 #1 #0
cdata[0][x–1] EMNT16 EMNT15 EMNT14 EMNT13 EMNT12 EMNT11
0 0 A buffer is empty
0 1 There is data in the buffer 1.
1 0 There is data in the buffer 2.
1 1 A buffer is full.
x : PATH number
EW_BUSY Busy
Try it again or wait until the procedure of CNC is finished.
2 – 146
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
2 – 147
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Description Request the completion notice flag of the block that is commanded by
cnc_refpoint, cnc_abspoint, cnc_incpoint, cnc_dwell or cnc_coordre for
each path.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
odb It is pointer to the ODBFIN structure that the condition of the
completion notice flag is returned.
The ODBFIN structure is as follows.
typedef struct odbfin {
short dummy; /* none */
char cdata[8]; /* The infomation of the */
} ODBFIN; /* complete notice flag */
/* condition of each PATH. */
cdata The present condition of the completion notice flag is
shown.
#7 #6 #5 #4 #3 #2 #1 #0
cdata[x–1] EMNT63 EMNT15 EMNT14 EMNT13 EMNT12 EMNT11
EMNT1x 0 : un–completion
1 : completion
x : PATH number
EW_BUSY Busy
Try it again or wait until the procedure of CNC is finished.
2 – 148
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
odb It is pointer to the ODBFIN structure that the condition of the
completion notice flag is returned.
The ODBFIN structure is as follows.
typedef struct odbfin {
short dummy; /* none */
char cdata[8]; /* The infomation of the */
} ODBFIN; /* complete notice flag */
/* condition of each PATH. */
cdata A complete notice flag to reset is specified.
#7 #6 #5 #4 #3 #2 #1 #0
cdata[x–1] EMNT63 EMNT15 EMNT14 EMNT13 EMNT12 EMNT11
EW_BUSY Busy
Try it again or wait until the procedure of CNC is finished.
2 – 149
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
3.7
OTHER FUNCTIONS Function name Brief description
2 – 150
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Description Reads system information such as series and version number of CNC
system software in ROM and an amount of controllable axes.
Use this function to confirm compatibility of CNC’s system software and
PMC’s software or to get an amount of controllable axes before reading
axis coordinate data such as absolute, machine position.
Note that a null character (‘¥x00’) is not added at the end of each strings.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
sysinfo
Pointer to the ODBSYS structure including CNC system
information.
The ODBSYS structure for Power Mate is as follows.
typedef struct odbsys {
short dummy[2] ; /* dummy */
char cnc_type[2] ; /* not used */
char mt_type[2] ; /* not used */
char series[4] ; /* Series number (ASCII) */
char version[4] ; /* Version number (ASCII) */
char axes[2] ; /* Current controlled axes(ASCII)*/
} ODBSYS ;
series Series number of CNC(ASCII)
The character string of 4 digits is stored.
version Version number of CNC(ASCII)
The character string of 4 digits is stored.
axes Amount of controlled axes(ASCII)
The character string of 2 digits is stored.
In case of 4 axes, ‘4’ is set.
ODBSYS 0
dummy
4
cnc_type
6
mt_type
8
series
12
version
16
axes
18
2 – 151
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
2 – 152
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
sysinfo
Pointer to the ODBSYSC structure includingthe CNC
configuration information.
S The ODBSYSC structure for Power Mate is as follows.
typedef struct odbsysc {
char slot_no_p[16]; /*Physical slot number(Not used)*/
char slot_no_l[16]; /* Logical slot number(Not used)*/
short mod_id[16]; /* Module ID */
short soft_id[16]; /* Software ID */
char s_series[16][5]; /* Software series */
char s_version[16][5];/* Software version */
char dummy[16]; /* Not used */
2 – 153
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
2 – 154
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
2 – 155
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
2 – 156
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
statinfo
Pointer to the ODBST structure including the status information of
CNC.
The ODBST structure for Power Mate is as follows.
typedef struct odbst {
short dummy[2]; /* Not used */
short aut ; /* AUTOMATIC/MANUAL mode
selection*/
short run ; /* Status of automatic operation */
short motion ; /* Status of axis movement,dwell */
short mstb ; /* Status of M,S,T,B function */
short emergency ; /* Status of emergency */
short alarm ; /* Status of alarm */
short edit ; /* Status of program editing */
} ODBST ;
aut AUTOMATIC/MANUAL mode selection
0 : MDI 1 : MEMory
2 : **** 3 : EDIT
4 : HaNDle 5 : JOG
6 : Teach in JOG 7 : Teach in HND
8 : INC– feed 9 : REFerence
10 : ReMoTe
run Status of automatic operation
0 : **** (reset) 1 : STOP
2 : HOLD 4 : STaRT
motion
Status of axis movement,dwell
0 : *** 1 : MoTioN
3 : DWeLl
mstb Status of M,S,T,B function
0 : *** (Others) 1 : FIN
emergency
Status of emergency
0 : (Not emergency) 1 : EMerGency
2 : ReSET
2 – 157
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
2 – 158
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
alarm
Pointer to the ODBALM structure including the alarm status
information.
The ODBALM structure is as follows.
typedef struct odbalm {
short dummy[2] ; /* Not used. */
short data ; /* Alarm status */
} ODBALM ;
dummy Not used.
data Alarm status
The meaning of each bit is as follows.
#00 : P/S alarm 100
#01 : P/S alarm 000
#02 : P/S alarm 101
#03 : P/S alarm except above
#04 : Overtravel alarm
#05 : Overheat alarm
#06 : Servo alarm
#07 : (Not used)
#08 : APC alarm
#09 : (Not used)
#10 : P/S alarms (No.5000 –)
#11 : (Not used)
#12 : (Not used)
#13 : (Not used)
#14 : (Not used)
#15 : External alarm message
2 – 159
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Example The following program displays the kinds of alarms currently arising.
#include <stdio.h>
#include ”apilib.h”
2 – 160
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
type Specify the type of output format.
0 : Alarm information 1 (without message)
1 : Alarm information 2 (with message)
alm_type
Specify the type of alarm.
The meaning of each bit is as follows.
#00 : P/S alarm 100
#01 : P/S alarm 000
#02 : P/S alarm 101
#03 : P/S alarm except above
#04 : Overtravel alarm
#05 : Overheat alarm
#06 : Servo alarm
#07 : (Not used)
#08 : APC alarm
#09 : (Not used)
#10 : P/S alarm (No.5000 – )
#11 : (Not used)
#12 : (Not used)
#13 : (Not used)
#14 : (Not used)
#15 : External alarm message
2 – 161
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
length
Specify the length of the data block(size of ALMINFO structure)
u.alm1 0
alm[0]
4
4*(N–1) length
alm[N–1]
4*N
data_end
4*N+2
u.alm1.alm 0
axis
2
alm_no
4
u.alm2 0
alm[0]
38
38*(N–1) length
alm[N–1]
38*N
data_end
38*N+2
u.alm2.alm 0
axis
2
alm_no
4
msg_len
6
alm_msg[0]
7
37
alm_msg[31]
38
alarminfo
Pointer to the ALMINFO structure including the alarm
information.
The ALMINFO structure is as follows.
typedef struct alminfo {
union {
struct {
struct {
short axis ; ;/* Axis information.*/
short alm_no ; ;/* Alarm number. */
} alm[N] ;
short data_end ; ;/* data end */
} alm1 ;
struct {
struct {
short axis ; ;/* Axis information.*/
2 – 162
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
2 – 163
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
type Type of data is stored.(refer to below)
–3 : Read the all data concerning axis other than G code at
a time.
–2 : Read the all data other than G code at a time.
–1 : Read the all data of G code at a time.
0 to 20 : Read the data of G code one by one.
100 to 126 : Read the data other than G code one by one.
200 to 205 : Read the data concerning axis other than G
code one by one.
block
Assigned block in stored.
0 : active block
1 : next block
2 : block after next block
2 – 164
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
modal
Pointer to the ODBMDL structure including the modal data.
The ODBMDL structure is as follows.
typedef struct odbmdl {
short datano; /* Kind of modal data. */
short type; /* Objective block. */
union {
char g_data; /* Modal data of G code. */
char g_rdata[21]; /* Modal data of G code */
struct {
long aux_data;
/* Modal data other than G code */
char flag1; /* Flag 1 */
char flag2; /* Flag 2 */
}aux;
struct {
long aux_data;
/* Modal data other than G code */
char flag1; /* Flag 1 */
char flag2; /* Flag 2 */
}raux1[27];
struct {
long aux_data;
/* Modal data other than G code */
char flag1; /* Flag 1 */
char flag2; /* Flag 2 */
}raux2[MAX_AXIS];
}modal; /* MAX_AXIS : max. controlled axes. */
} ODBMDL ;
datano Kind of modal data is stored.
type Objected block is stored.
g_data Use for an individual reading G code.
Modal G code in the corresponding G code group is
stored.
g_rdata Use for reading G code at a time.
Modal G code in the all G code group is stored.
aux Use for an individual reading other than G code
(include axis data).
raux1 Use for reading other than G code at a time.
raux2 Use for reading concerning axis other than G code at a
time.
aux_data Modal data other than G code is stored.
flag1 Supplementary information is stored.
flag2 Supplementary information is stored.
2 – 165
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
0 0 G00
1 G01
2 G02
3 G03
1 0 G17
4 G19
8 G18
2 0 G90
1 G91
4 0 G94
1 G95
5 0 G20
1 G21
7 0 G49
1 G43
2 G44
11 0 G67
1 G66
20 0 G13.1
1 G12.1
7 6 5 4 3 2 1 0
For example, the following result is gotten by calling this function during
executing N100’s block of the next machining program.
N090 G18 ;
N100 G1 Z100. ;
N110 G17 G2 X10. Y–20. R12. ;
type block g_data[0] Modal status
0 0 0x81 G1 is commanded.
0 1 0x82 G2 is commanded.
1 0 0x08 G18 mode. (not commanded)
1 1 0x80 G17 is commanded.
2 – 166
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
100 B
101 D
102 E
103 F
104 H
105 L
106 M
107 S
108 T
109 R
110 P
111 Q
112 A
113 C
114 I
115 J
116 K
117 N
118 O
119 U
120 V
121 W
122 X
123 Y
124 Z
125 M2
126 M3
200 1st axis
201 2nd axis
202 3rd axis
203 4th axis
204 5th axis
205 6th axis
2 – 167
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Data : 4 byte
FLAG1 : 1 byte
FLAG2 : 1 byte
7 6 5 4 3 2 1 0
Number of input place
0 : Positive
1 : Negative
0 : There is no command of a decimal point.
1 : There is a command of a decimal point.
0 : There is no command in the present block.
1 : There is a command in the present block.
2 – 168
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
number
Specify the diagnosis number.
See the “MAINTENANCE MANUAL” of CNC about available
diagnosis number.
axis Specify the axis number.
0 : assigns no axis
1,..,m : assigns 1 axis(m=max. controlled axes)
ALL_AXES : assigns all axes(ALL_AXES=–1)
2 – 169
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
length
Specify the data block length(size of ODBDGN structure).
(4+(byte size of diagnosis)*(number of axis))
In case that the size of diagnosis is 4 byte, the ODBDGN structure
is as follows. In case that its size is 1 or 2 byte, the size of data part
per 1 diagnosis or 1 axis is 1 or 2 byte.
4+2x(n–1)
ldatas[n–1]:n–th
4+2xn
n : Current controlled axes
2 – 170
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
2 – 171
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
s_number
Specify the start diagnosis number.
The first diagnosis number to be read is returned.
See the “MAINTENANCE MANUAL” of CNC about available
diagnosis number.
e_number
Specify the end diagnosis number.
The last diagnosis number to be read is returned.
The new diagnosis may be added according to updating CNC
software, addition of the new function, etc. If the new diagnosis
is added within reading range, the error(Return:EW_LENGTH)
will be returned or the application program will not work correctly.
In order to avoid these mistakes, specify the continuous numbers
of existing diagnoses as the reading range.
2 – 172
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
2 – 173
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
2 – 174
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Description Reads the maximum valid figures, number of digits below decimal point
by unit of input and output, which is related to various data of CNC.
The value which can be read in the window library is binary data by set
unit of the CNC side. Therefore, it is nesessary to display decimal point
position etc. in consideration of set unit.
It is valid when using the following functions.
S axis type data S tool offset S custum macro
cnc_absolute cnc_rdtofs cnc_rdmacro
cnc_machine cnc_rdtofsr cnc_rdmacror
cnc_relative cnc_rdpmacro
cnc_distance cnc_rdpmacror
cnc_skip
cnc_srvdelay
cnc_accdecdly
cnc_rddynamic
The value which returns from the function is as follows.
D maximum valid figures
Power Mate
2 – 175
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
3) custom macro
The number of digits below the decimal point under the input unit
only at the first axis part is valid, and it under the output unit is
invalid.
[mm] [inch]
IS–B 3 4
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
data_type
Specify the kind of the data.
0 : axis type dat
1 : tool offset
2 : custom macro
valid_fig
Specify the address of the variable to store with the maximum valid
figures.
dec_fig_in
Specify the address of the array to store with the number of digits
below decimal point under the input unit.
The number of array must be equal to the number of maximum
controlled axis.
(In the case except axis type data, only the top of array is valid.)
dec_fig_out
Specify the address of the array to store with the number of digits
below decimal point under the output unit.
The number of array must be equal to the number of maximum
controlled axis.
(In the case except axis type data, only the top of array is valid.)
2 – 176
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
crrnt Specify the address of the array to store with the real current for
servo adjustment.
The number of array must be equal to the number of maximum
controlled axis.
Actually the object within the number of controlled axis is valid.
long gain[MAX_AXIS] ;/* MAX_AXIS : max. controlled axes */
2 – 177
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
speed
Specify the address of the array to store with the real speed for servo
adjustment.
The number of array must be equal to the number of maximum
controlled axis.
Actually the object within the number of controlled axis is valid.
long gain[MAX_AXIS] ;/* MAX_AXIS : max. controlled axes */
2 – 178
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
gain Specify the address of the array to store with the loop gain for servo
adjustment.
The number of array must be equal to the number of maximum
controlled axis.
Actually the object within the number of controlled axis is valid.
long gain[MAX_AXIS] ;/* MAX_AXIS : max. controlled axes */
2 – 179
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
type Specify the kind of operator’s message.
0 : 1st message
length
Specify the length of the data block(size of OPMSG structure)
0
datano
2
type
4
char_num
6 length
data[0]
7
6+255
data[255]
6+256
opmsg
Pointer to the OPMSG structure including the operator’s message.
The OPMSG structure is as follows.
typedef struct msg {
short datano ; /* Number of operator’s message */
short type ; /* Kind of operator’s message */
short char_num ; /* Message length */
char data[MSG_SIZE] ;/* Operator’s message strings */
} OPMSG ; /* MSG_SIZE : Message length */
datano The Number of operator’s message is stored.
message exists
100 to999
2000 to 2099
message does not exist
–1
type Kind of operator’s message is stored.
0 : 1st message
char_num The operator’s message length is stored.
1 to 256 : operator’s message
data The operator’s message strings are stored.
ASCII strings are set.
‘¥0’ is set at the end of strings.
2 – 180
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Example The following program reads the operator’s message and displays it.
#include <stdio.h>
#include ”apilib.h”
2 – 181
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
slct_data
Specify the data select flag.
bit 0 : Mode signal
bit 1 : (Not used)
bit 2 : (Not used)
bit 3 : Rapid traverse override signal
bit 4 : Manual feedrate override signal
bit 5 : Feedrate override signal
bit 6 : (Not used)
bit 7 : Optional block skip signal
bit 8 : Single block signal
bit 9 : Machine lock signal
bit 10 : Dry run signal
bit 11 : Memory protection signal
bit 12 : Automatic operation halt signal
bit 13 : (Not used)
bit 14 : (Not used)
bit 15 : (Not used)
* When the bit corresponding to a signal is set to 0, that signal is not
applied.
To apply a signal, set the corresponding bit to 1.
sgnl Pointer to the IODBSGNL structure including the output signal
image of software operator’s panel.
The IODBSGNL structure is as follows.
typedef struct iodbsgnl {
short datano; /* (Not used) */
short type; /* Data select flag */
short mode; /* Mode signal */
short hndl_ax; /* (Not used)*/
short hndl_mv; /* (Not used)*/
short rpd_ovrd; /* Rapid traverse override signal */
short jog_ovrd; /* Manual feedrate override signal */
short feed_ovrd; /* Feedrate override signal */
short spdl_ovrd; /* (Not used) */
short blck_del; /* Optional block skip signal(0/1) */
short sngl_blck; /* Single block signal(0/1) */
2 – 182
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
2 – 183
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
mem_prtct
Memory protection signal(0/1) is stored.
feed_hold Automatic operation halt signal(0/1) is stored.
2 – 184
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
sgnl Pointer to the IODBSGNL structure to be set the output signal of
software operator’s panel.
The IODBSGNL structure is as follows.
typedef struct iodbsgnl {
short datano; /* (Not used) */
short type; /* Data select flag */
short mode; /* Mode signal */
short hndl_ax; /* (Not used)
short hndl_mv; /* (Not used)
short rpd_ovrd; /* Rapid traverse override signal */
short jog_ovrd; /* Manual feedrate override signal */
short feed_ovrd; /* Feedrate override signal */
short spdl_ovrd; /* (Not used) */
short blck_del; /* Optional block skip signal(0/1) */
short sngl_blck; /* Single block signal(0/1) */
short machn_lock; /* Machine lock signal(0/1) */
short dry_run; /* Dry run signal(0/1) */
short mem_prtct; /* Memory protection signal(0/1) */
short feed_hold; /* Automatic operation halt
signal(0/1) */
} IODBSGNL ;
datano Not used
2 – 185
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
2 – 186
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
2 – 187
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Description Read the general output signal image of software operator’s panel.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
slct_data
Specify the data select flag.
bit 0 : General–purpose signal 1
bit 1 : General–purpose signal 2
bit 2 : General–purpose signal 3
bit 3 : General–purpose signal 4
bit 4 : General–purpose signal 5
bit 5 : General–purpose signal 6
bit 6 : General–purpose signal 7
bit 7 : General–purpose signal 8
* Bit 8 to 15 is not used.
* When the bit corresponding to a signal is set to 0, that signal is not
applied.
To apply a signal, set the corresponding bit to 1.
opnlgnrl
Pointer to the IODBGNRL structure including the general output
signal image of software operator’s panel.
The IODBGNRL structure is as follows.
typedef struct iodbgnrl {
short datano; /* Not used */
short type; /* Data select flag */
char sgnal; /* General–purpose signal 1 to 8 */
} IODBGNRL ;
datano Not used.
type Data select flag is stored.
sgnal General–purpose signal is stored.
bit 0 : General–purpose signal 1
bit 1 : General–purpose signal 2
bit 2 : General–purpose signal 3
bit 3 : General–purpose signal 4
bit 4 : General–purpose signal 5
bit 5 : General–purpose signal 6
bit 6 : General–purpose signal 7
bit 7 : General–purpose signal 8
2 – 188
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
2 – 189
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
opnlgnrl
Pointer to the IODBGNRL structure to be set the general output
signal of software operator’s panel.
The IODBGNRL structure is as follows.
typedef struct iodbgnrl {
short datano; /* Not used */
short type; /* Data select flag */
char sgnal; /* General–purpose signal 1 to 8 */
} IODBGNRL ;
datano Not used.
type Specify the data select flag.
bit 0 : General–purpose signal 1
bit 1 : General–purpose signal 2
bit 2 : General–purpose signal 3
bit 3 : General–purpose signal 4
bit 4 : General–purpose signal 5
bit 5 : General–purpose signal 6
bit 6 : General–purpose signal 7
bit 7 : General–purpose signal 8
* Bit 8 to 15 is not used.
* When the bit corresponding to a signal is set to 0, that signal is not
written.
To write a signal, set the corresponding bit to 1.
sgnal Specify the General–purpose signal.
bit 0 : General–purpose signal 1
bit 1 : General–purpose signal 2
bit 2 : General–purpose signal 3
bit 3 : General–purpose signal 4
bit 4 : General–purpose signal 5
bit 5 : General–purpose signal 6
bit 6 : General–purpose signal 7
bit 7 : General–purpose signal 8
2 – 190
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
2 – 191
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
slct_data
Specify the data select flag.
bit 0 : General–purpose signal 1
bit 1 : General–purpose signal 2
bit 2 : General–purpose signal 3
bit 3 : General–purpose signal 4
bit 4 : General–purpose signal 5
bit 5 : General–purpose signal 6
bit 6 : General–purpose signal 7
bit 7 : General–purpose signal 8
* Bit 8 to 15 is not used.
* When the bit corresponding to a signal is set to 0, that signal is not
applied.
To apply a signal, set the corresponding bit to 1.
brdna
Pointer to the IODBRDNA structure including the general signal
name of software operator’s panel.
The IODBRDNA structure is as follows.
typedef struct iodbrdna {
short datano; /* Not used */
short type; /* Data select flag */
char sgnl1_name[9]; /* General signal name 1 (ASCII) */
char sgnl2_name[9]; /* General signal name 2 (ASCII) */
char sgnl3_name[9]; /* General signal name 3 (ASCII) */
char sgnl4_name[9]; /* General signal name 4 (ASCII) */
char sgnl5_name[9]; /* General signal name 5 (ASCII) */
char sgnl6_name[9]; /* General signal name 6 (ASCII) */
char sgnl7_name[9]; /* General signal name 7 (ASCII) */
char sgnl8_name[9]; /* General signal name 8 (ASCII) */
} IODBRDNA ;
datano Not used.
type Data select flag is stored.
2 – 192
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
2 – 193
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
brdna
Pointer to the IODBRDNA structure to be set the general signal
name of software operator’s panel.
The IODBRDNA structure is as follows.
typedef struct iodbrdna {
short datano; /* Not used */
short type; /* Data select flag */
char sgnl1_name[9]; /* General signal name 1 (ASCII) */
char sgnl2_name[9]; /* General signal name 2 (ASCII) */
char sgnl3_name[9]; /* General signal name 3 (ASCII) */
char sgnl4_name[9]; /* General signal name 4 (ASCII) */
char sgnl5_name[9]; /* General signal name 5 (ASCII) */
char sgnl6_name[9]; /* General signal name 6 (ASCII) */
char sgnl7_name[9]; /* General signal name 7 (ASCII) */
char sgnl8_name[9]; /* General signal name 8 (ASCII) */
} IODBRDNA ;
datano Not used.
type Specify the select flag.
bit 0 : General–purpose signal 1
bit 1 : General–purpose signal 2
bit 2 : General–purpose signal 3
bit 3 : General–purpose signal 4
bit 4 : General–purpose signal 5
bit 5 : General–purpose signal 6
bit 6 : General–purpose signal 7
bit 7 : General–purpose signal 8
* Bit 8 to 15 is not used.
* When the bit corresponding to a signal is set to 0, that signal is not
written.
To write a signal, set the corresponding bit to 1.
2 – 194
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
2 – 195
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
3.8
RELATED TO THE Function name Brief description
PMC (1) pmc_rdpmcrng read PMC data(area specified)
(2) pmc_wrpmcrng write PMC data(area specified)
(3) pmc_rdpmcinfo read PMC data information
2 – 196
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
adr_type
Specify the identification code corresponding to the kind of the
PMC address.
<The referenceable range of PMC data of Power Mate>
ID code Kind of PMC address Referenceable range
(*) It is not possible to write to all areas of address ‘F’ and ‘X’, and
“R9000”,... Moreover, “K0017”,..,“K0019”.
(*) See the “PROGRAMMING MANUAL” of PMC about CNC
which each PMC can correspond.
data_type
Specify the type of the PMC data.
It must be the same one as the type of data of the PMC side.
0 : Byte type
1 : Word type
2 : Long type
s_number
Specify the start PMC address number.
e_number
Specify the end PMC address number.
2 – 197
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
length
Specify the data block length.
data_type is 0 (byte type) : length = 8 + N
data_type is 1 (word type) : length = 8 + N * 2
data_type is 2 (long type) : length = 8 + N * 4
* N is a number of read data.
buf Pointer to the IODBPMC structure.
The IODBPMC structure is as follows.
typedef struct iodbpmc {
short type_a ; /* Kind of PMC address */
short type_d ; /* Type of the PMC data */
short datano_s ; /* Start PMC address number */
short datano_e ; /* End PMC address number */
union {
char cdata[N] ; /* The PMC data(byte type) */
short idata[N] ; /* (word type) */
long ldata[N] ; /* (long type) */
}u; /* N is a number of read data */
} IODBPMC ;
2 – 198
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
2 – 199
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
length
Specify the data block length.
data_type is 0 (byte type) : length = 8 + N
data_type is 1 (word type) : length = 8 + N * 2
data_type is 2 (long type) : length = 8 + N * 4
* N is a number of written data.
buf Pointer to the IODBPMC structure.
The IODBPMC structure is as follows.
typedef struct iodbpmc {
short type_a ; /* Kind of PMC address */
short type_d ; /* Type of the PMC data */
short datano_s ; /* Start PMC address number */
short datano_e ; /* End PMC address number */
union {
char cdata[N] ; /* The PMC data(byte type) */
short idata[N] ; /* (word type) */
long ldata[N] ; /* (long type) */
}u; /* N is a number of written data */
} IODBPMC ;
type_a Specify the identification code corresponding to the
kind of the PMC address.
type_d Specify the type of the PMC data.
It must be the same one as the type of data of the PMC
side.
0 : Byte type
1 : Word type
2 : Long type
datano_s Specify the start PMC address number.
datano_e Specify the end PMC address number.
See “The referenceable range of PMC data” of “Read PMC data(area
specified)(pmc_rdpmcrng)” about the kind of the PMC address, the start
address, and the end address.
2 – 200
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
2 – 201
3. FUNCTION LIST API LIBRARY B–62684EN–1/01
Description Read the data information about the attribute of each kind of PMC, the
effective range of address, etc.
Arguments FlibHndl
Because it isn’t used at present, this argument must be set up a zero.
adr_type
Specify the kind of PMC address.
0 <––> : refer to the table pmc_rdpmcrng() function
–1 : all address information
pmcif
Pointer to the ODBPMCINF structure including the PMC data
information.
The ODBPMCINF structure is as follows.
typedef struct odbpmcinf {
short datano ; /* number of PMC data information */
struct {
char pmc_adr ; /* kind of PMC address */
char adr_attr ; /* attribute of PMC address */
unsigned short top_num ; /* top number of PMC address */
unsigned short last_num ; /* end number of PMC address */
} info[64] ;
} ODBPMCINF ;
datano Number of PMC data information (1 – 64)
* Some PMC address may be devided into several
parts.
pmc_adr Type of PMC address (ASCII CODE)
adr_attr Attribute of PMC address
bit 7 : Write protection
0 : enable 1 : disable
bit 0<––>6 : (Not used)
top_num Top number of PMC address
last_num Last number of PMC address
* Refer to the table of cnc_rdpmcrng() function.
2 – 202
B–62684EN–1/01 API LIBRARY 3. FUNCTION LIST
2 – 203
III. BOOT APPLICATION SOFTWARE
B–62684EN–1/01 BOOT APPLICATION SOFTWARE 1. FUNCTION OUTLINE
1 FUNCTION OUTLINE
NOTE
This function is equivalent to the Boot function and the
memory clearing function on the CRT/MDI. The operation
by Boot application is for maintenance.
Careful operation is required because it is a special
operation of the system such as starting up.
3–1
2. INSTALL BOOT APPLICATION SOFTWARE B–62684EN–1/01
2 INSTALL
3–2
B–62684EN–1/01 BOOT APPLICATION SOFTWARE 3. OPERATION EXPLANATION
3 OPERATION EXPLANATION
Please set the value of “0” to rotary switch(RSW) for setting the CRT
device number in Power Mate.
(0 : Power Mate synchronizes with the personal computer)
3–3
4. OPERATION SCREEN BOOT APPLICATION SOFTWARE B–62684EN–1/01
4 OPERATION SCREEN
3–4
B–62684EN–1/01 BOOT APPLICATION SOFTWARE 4. OPERATION SCREEN
4.1
MACHINE SELECT
SCREEN **** MACHINE SELECT ****
ADDRESS:MACHINE NAME
300H:Machine1
310H:Machine2
END
The above screen is the top menu when PMBOOT is started. The
following items set up in the SYSTEM.INI file for Windows is displayed.
I/O Port Address
Machine name
Number of HSSB boards
A machine to connect is chosen by this menu screen. The reversed
machine name is just selected. This reversal display position can be
moved up and down by the cursor key. After a cursor is moved to the
target machine and Enter key is pushed, the following confirmation
message is displayed at the MESSAGE display line. Confirm the
machine name, and type “Y” or “N”.
ARE YOU SURE?
[Y]es OR [N]o.
3–5
4. OPERATION SCREEN BOOT APPLICATION SOFTWARE B–62684EN–1/01
4.2
PROCESSING
SELECT SCREEN **** MENU ****
BOOT
IPL
BOOT&IPL
ALARM MESSAGE
HSSB BOARD I/O TEST
HSSB REGISTERS
COMMON RAM DUMP
END
Operation to the selected machine can be chosen by this sub menu screen.
Top three items in the menu are always displayed but if the machine is
already started up, they appears as follows showing that they cannot be
chosen.
BOOT (THIS FUNCTION CAN’T BE CHOSEN.)
IPL (THIS FUNCTION CAN’T BE CHOSEN.)
BOOT&IPL (THIS FUNCTION CAN’T BE CHOSEN.)
Above is displayed when “1” is set in rotary switch(RSW) for setting the
CRT device number in Power Mate.
When system alarm occurs in Power Mate, “ALARM MESSAGE” is
displayed automatically.
When PMBOOT is started with “–T” option, three other items from
“HSSB BOARD I/O TEST” appears. These items are used at the time of
the maintenance of HSSB.
When “END” is chosen, machine can be started.
Introductory remarks
*1:This is basic function when PMBOOT is started.
S Set “0” on the rotary switch(RSW) for setting the CRT device
number in Power Mate, and turn on the power of Power Mate
to do this function.
S This function cannot be chosen when system alarm occurs in
Power Mate.
*2:This is displayed automatically according to the state of Power
Mate.
*3:This is displayed when PMBOOT is started with “–T” option, or
when the system alarm occurs.
3–6
B–62684EN–1/01 BOOT APPLICATION SOFTWARE 4. OPERATION SCREEN
3–7
4. OPERATION SCREEN BOOT APPLICATION SOFTWARE B–62684EN–1/01
4.3
BOOT PROCESSING
SCREEN BOOT MENU 881A – 06
PMBOOT V1.00
SYSTEM DATA LOADING
SYSTEM DATA CHECK
SYSTEM DATA DELETE
SYSTEM DATA SAVE
SRAM DATA BACKUP
MEMORY CARD FILE DELETE
MEMORY CARD FORMAT
END
NOTE
The file name for “SRAM DATA BACKUP” is fixed to be
“SRAM256A.FDB”.
Therefore, the object of input and output is only
“SRAM256A.FDB”.
“SRAM256K.000” or other file name cannot be handled.
The ROM series and ROM number of only [NC BASIC] and
[DG SERVO] can be displayed properly. As for other file
name, the ROM series can not be displayed properly
because file structure is different.
(Example: The data of [PMC–PA],[PCD 128K],[CEX 1.0M]
can not be displayed. )
3–8
B–62684EN–1/01 BOOT APPLICATION SOFTWARE 4. OPERATION SCREEN
4.4
IPL PROCESSING
SCREEN IPL MENU
(MENU)
0. EXIT
1. MEMORY CLEAR
2. SETTING
9. OTHERS
SELECT NO. : 1
When “IPL” is chosen, the above “IPL MENU” screen appears. To select
the function from the menu, type the number of the items displayed on the
screen and type Enter key. When a wrong number is typed, it can be
corrected with Back Space key.
NOTE
When a DPL/MDI unit is attached to Power Mate, the
presponse of the key input from the personal computer
become slow. Operate it after you remove DPL/MDI when
DPL/MDI unit is not necessary.
When the item of “1. MEMORY CLEAR” is chosen, the sub menu screen
example like the following Fig.4.4 (b) appears.
3–9
4. OPERATION SCREEN BOOT APPLICATION SOFTWARE B–62684EN–1/01
IPL MENU
(MENU) MEMORY CLEAR
0. CANCEL
1. ALL MEMORY
2. PARAMETER AND OFFSET
3. PROGRAM
4. PMC
SELECT NO. : 1
In the above screen select an item by typing item number and Enter key.
Then next menu appears.
0. CANCEL
1. EXEC
The following message appears when “1. EXIT” is selected.
SURE ?:
(NO=0,YES=1)
Judge “yes” or “no” and type “1” or “0” accordingly.
After the file initialization processing is done, series and edition number
of system software are displayed. Then IPL processing is finished.
3 – 10
B–62684EN–1/01 BOOT APPLICATION SOFTWARE 4. OPERATION SCREEN
4.5
SYSTEM ALARM
SCREEN SYSTEM ALARM 8880–12
3 – 11
4. OPERATION SCREEN BOOT APPLICATION SOFTWARE B–62684EN–1/01
4.6
HSSB BOARD TEST
SCREEN HSSB BOARD I/O TEST
2W––W–B–
ACCESS TIMES/DATA ... 001000 / 12345678H
BYTE DATA W/R TEST PC(I.T.) PM
W/R ERROR TIMES.... 0 –––––– *Good *
BIT ERROR RATE ....0.001% 0.000% *Good *
WORD DATA W/R TEST
W/R ERROR TIMES.... 2 –––––– *No Good*
BIT ERROR RATE ....0.002% 0.003% *Good *
2WORD DATA W/R TEST
W/R ERROR TIMES.... 123 –––––– *No Good*
BIT ERROR RATE ....0.000% 12.3% *Warning*
3 – 12
B–62684EN–1/01 BOOT APPLICATION SOFTWARE 4. OPERATION SCREEN
4.7
HSSB REGISTERS
SCREEN HSSB REGISTERS
I/O PORT REGISTERS
DATA ADDRESS S1 S2
12345678 12345678 12 12 FFFF FFFFFFFF
PERSONAL COMPUTER(I.T.) SIDE
BIT C 8 4 0 HEX
R0 1111 0000 1111 0000 (F0F0)
R2 0000 1111 0000 1111 (0F0F)
R4 1111 0000 1111 0000 (F0F0)
R6 0000 1111 0000 1111 (0F0F)
POWER MATE SIDE
BIT C 8 4 0 HEX
R0 0001 0010 0011 0100 (1234)
R2 0101 0110 0111 1000 (5678)
R4 1001 1010 1011 1100 (9ABC)
R6 1101 1110 1111 0000 (DEF0)
The above screen indicates the condition of I/O port 16 byte, HSSB
register 8 byte of personal computer, and HSSB register 8 byte of Power
Mate.
The meaning of the register is the following.
R0.00 BUSRDY
When the link of HSSB is established and it can access remote space after
the power is turned on, it becomes “1”.
R0.02
It becomes “1” at the time of the condition that the signal of the receiving line
is not changed electrically.
0 0 : Close state
0 1 : Openstate
1 1 : Error state
3 – 13
4. OPERATION SCREEN BOOT APPLICATION SOFTWARE B–62684EN–1/01
R0.12–R0.09 The factor on the partner side is shown when “ERROR NO-
TICE” is taken from the partner side while communication
opens.
0001: This error occurs when the hardware of the partner side HSSB is re-
set.
0010: This error occurs when “ERROR NOTICE” from the partner side HSSB
is received.
0100: It occurs when a bus cycle to HSSB is finished abnormally.
0101: It occurs when an OPEN requirement was received in BUSRDY.
0110: It occurs when the data of packet–ID that is send again from the part-
ner side HSSB did not exist any longer in the buffer.
0111: It occurs when SYNC–code cannot be detected more than 256 bit.
(disconnection condition)
R0.14
When “FATAL ERROR” except for the hardware resetting error occurs, it be-
comes “1”.
R2.08
3 – 14
B–62684EN–1/01 BOOT APPLICATION SOFTWARE 4. OPERATION SCREEN
4.8
CONTENT C–RAM
SCREEN CONTENT
ADDRESS
OF
+0
COMMON RAM
+1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F
00000 12 34 56 78–9A BC DE F0–00 00 00 00–00 00 00 00
00010 00 00 00 00–00 00 00 00–00 00 00 00–00 00 00 00
00020 00 00 00 00–00 00 00 00–00 00 00 00–00 00 00 00
00030 00 00 00 00–00 00 00 00–00 00 00 00–00 00 00 00
00040 00 00 00 00–00 00 00 00–00 00 00 00–00 00 00 00
00050 00 00 00 00–00 00 00 00–00 00 00 00–00 00 00 00
00060 00 00 00 00–00 00 00 00–00 00 00 00–00 00 00 00
00070 00 00 00 00–00 00 00 00–00 00 00 00–00 00 00 00
00080 00 00 00 00–00 00 00 00–00 00 00 00–00 00 00 00
00090 00 00 00 00–00 00 00 00–00 00 00 00–00 00 00 00
000A0 00 00 00 00–00 00 00 00–00 00 00 00–00 00 00 00
000B0 00 00 00 00–00 00 00 00–00 00 00 00–00 00 00 00
000C0 00 00 00 00–00 00 00 00–00 00 00 00–00 00 00 00
000D0 00 00 00 00–00 00 00 00–00 00 00 00–00 00 00 00
000E0 00 00 00 00–00 00 00 00–00 00 00 00–00 00 00 00
000F0 00 00 00 00–00 00 00 00–00 00 00 00–00 00 00 00
3 – 15
4. OPERATION SCREEN BOOT APPLICATION SOFTWARE B–62684EN–1/01
3 – 16
B–62684EN–1/01 Index
ƠAơ IPL processing screen, 3 – 9
ƠM ơ
ƠBơ
Machine select screen, 3 – 5
Maintenance package, 1 – 13
Basic operation package, 1 – 13
Boot application software (for Windows 3.1), 1 – 13
Boot processing screen, 3 – 8 ƠNơ
Notice about the selection of the personal computer, 1 – 4
ƠCơ
Configuration of hardware, 1 – 3 ƠOơ
Configuration of software, 1 – 5 Operation explanation, 3 – 3
Content C–RAM screen, 3 – 15 Operation screen, 3 – 4
Others function, 2 – 150
ƠE ơ
Environmental requirements, 1 – 4
ƠP ơ
Package software, 1 – 13
Processing select screen, 3 – 6
ƠF ơ Product distribution, 1 – 6
Function list, 2 – 4
Function outline, 3 – 1
ƠRơ
Related to NC data file, 2 – 69
Related to operation history data, 2 – 115
ƠGơ Related to program, 2 – 34
General description, 2 – 2 Related to the axis movement control, 2 – 131
Related to the communication, 2 – 8
Related to the control axes, 2 – 12
ƠI ơ
Specifications, 1 – 7
System alarm screen, 3 – 11
Install, 3 – 2
i–1
Revision Record
FANUCĄPower Mate-MODEL H High Speed Serial Bus function OPERATOR’S MANUAL (B–62684EN–1)
01 Jan., ’97
PowerMotion™ Products
Warning
Warning notices are used in this publication to emphasize that hazardous voltages, currents,
temperatures, or other conditions that could cause personal injury exist in this equipment or
may be associated with its use.
In situations where inattention could cause either personal injury or damage to equipment, a
Warning notice is used.
Caution
Caution notices are used where equipment might be damaged if care is not taken.
Note
Notes merely call attention to information that is especially significant to understanding and
operating the equipment.
This document is based on information available at the time of its publication. While efforts
have been made to be accurate, the information contained herein does not purport to cover all
details or variations in hardware or software, nor to provide for every possible contingency in
connection with installation, operation, or maintenance. Features may be described herein
which are not present in all hardware and software systems. GE Fanuc Automation assumes
no obligation of notice to holders of this document with respect to changes subsequently made.
GFZ-62684EN-1/01 iii
Introduction ______________________________________________________________________ 4
1. Extended Libraries_______________________________________________________________ 5
1.1 CNC/PMC Data Window Library for Windows 95 ____________________________________ 5
1.1.1 Outline ___________________________________________________________________________5
1.1.2 General Description_________________________________________________________________6
1.1.3 Library Handle ____________________________________________________________________7
(1) Library Handle Description. ___________________________________________________________________ 7
(2) Library Handle Cautions. _____________________________________________________________________ 8
1.1.4 Return Status of Data Window Function________________________________________________9
1.1.5 Function List _____________________________________________________________________11
Multi-Connection of HSSB ______________________________________________________________________ 11
Functions Related to Controlled Axis ______________________________________________________________ 11
Functions Related to CNC Program _______________________________________________________________ 11
Functions Related to CNC File Data_______________________________________________________________ 12
Functions Related to History Data ________________________________________________________________ 12
Functions Related to the axis movement control _____________________________________________________ 12
Functions Related to Others _____________________________________________________________________ 13
Functions Related to PMC ______________________________________________________________________ 13
1.1.6 Multi-Connection of HSSB __________________________________________________________14
Structure of library for multi-connection ___________________________________________________________ 14
(1) Allocate the Library Handle (for Multi-Connection) _______________________________________________ 15
(2) Allocate library handle 2(for Multi-Connection) __________________________________________________ 16
(3) Free library handle(for Multi-Connection) _______________________________________________________ 17
1.1.7 Function Reference Related to Controlled Axes _________________________________________18
(1) Read Actual Axis Feedrate (F) ________________________________________________________________ 18
(2) Read absolute axis position ___________________________________________________________________ 19
(3) Read machine axis position___________________________________________________________________ 21
(4) Read relative axis position____________________________________________________________________ 23
(5) Read distance to go _________________________________________________________________________ 25
(6) Read skip position __________________________________________________________________________ 27
(7) Read servo delay value ______________________________________________________________________ 29
(8) Read acceleration/deceleration delay value_______________________________________________________ 31
(9) Read all dynamic data _______________________________________________________________________ 33
(10) Set origin / preset relative axis position ________________________________________________________ 37
1.1.8 Function Reference Related to Program _______________________________________________39
(1) Start Downloading NC Program _______________________________________________________________ 39
(2) Download NC program ______________________________________________________________________ 40
(3) End of downloading NC program ______________________________________________________________ 43
(4) Start uploading NC program __________________________________________________________________ 44
(5) Upload NC program ________________________________________________________________________ 45
(6) End of uploading NC program ________________________________________________________________ 48
(7) Search specified program ____________________________________________________________________ 49
(8) Delete all programs _________________________________________________________________________ 51
(9) Delete specified program_____________________________________________________________________ 53
(10) Read program directory _____________________________________________________________________ 55
(11) Read program information __________________________________________________________________ 58
(12) Read program number under execution ________________________________________________________ 60
(13) Read sequence number under execution ________________________________________________________ 61
(14) Read program under execution _______________________________________________________________ 62
(15) Write program for MDI operation_____________________________________________________________ 63
1
(16) Read execution pointer for MDI operation ______________________________________________________ 64
(17) Write execution pointer for MDI operation______________________________________________________ 65
(18) Search specified sequence number ____________________________________________________________ 66
(19) Rewind cursor of NC program _______________________________________________________________ 67
1.1.9 Function Reference Related to NC File Data____________________________________________68
(1) Read Tool Offset Value ______________________________________________________________________ 68
(2) Write tool offset value _______________________________________________________________________ 70
(3) Read tool offset value(area specified) ___________________________________________________________ 72
(4) Write tool offset value(area specified)___________________________________________________________ 74
(5) Read tool offset information __________________________________________________________________ 76
(6) Read parameter ____________________________________________________________________________ 77
(7) Write parameter____________________________________________________________________________ 80
(8) Read parameter(area specified) ________________________________________________________________ 83
(9) Write parameter(area specified) _______________________________________________________________ 87
(10) Read parameter information _________________________________________________________________ 90
(11) Read setting data(area specified)______________________________________________________________ 92
(12) Write setting data(area specified) _____________________________________________________________ 95
(13) Read custom macro variable _________________________________________________________________ 98
(14) Write custom macro variable________________________________________________________________ 100
(15) Read custom macro variable(area specified) ____________________________________________________ 102
(16) Write custom macro variable(area specified) ___________________________________________________ 105
(17) Read custom macro variable information ______________________________________________________ 108
(18) Get type of custom macro variable ___________________________________________________________ 109
(19) Set type of custom macro variable____________________________________________________________ 110
1.1.10 Function Reference Related to History Data__________________________________________111
(1) Stop Logging Operation History Data__________________________________________________________ 111
(2) Restart logging operation history data _________________________________________________________ 112
(3) Read number of operation history data _________________________________________________________ 113
(4) Read operation history data __________________________________________________________________ 114
(5) Read number of alarm history data ____________________________________________________________ 118
(6) Read alarm history data_____________________________________________________________________ 119
(7) Clear operation history data _________________________________________________________________ 122
(8) Read signals related operation history__________________________________________________________ 123
(9) Write signals related operation history _________________________________________________________ 124
1.1.11 Functions Related to the axis movement control _______________________________________125
(1) Signal operation command (Cannot be used on Power Mate-D) _____________________________________ 125
(2) Reference point return (Cannot be used on Power Mate-D) _________________________________________ 128
(3) Absolute movement (Cannot be used on Power Mate-D) ___________________________________________ 130
(4) Incremental movement (Cannot be used on Power Mate-D) ________________________________________ 133
(5) Dwell (Cannot be used on Power Mate-D) ______________________________________________________ 136
(6) Coordinate establishment (Cannot be used on Power Mate-D) ______________________________________ 138
(7) Reading of the executive buffer condition (Cannot be used on Power Mate-D)__________________________ 140
(8) Reading of the execution completion condition (Cannot be used on Power Mate-D) _____________________ 142
(9) The release of the reading mode of the execution completion condition (Cannot be used on Power Mate-D) __ 143
1.1.12 Function Reference of Others ______________________________________________________144
(1) Read CNC System Information _______________________________________________________________ 144
(2)Read CNC configuration information __________________________________________________________ 146
(3)Read CNC status information_________________________________________________________________ 149
(4) Read alarm status__________________________________________________________________________ 151
(5) Read alarm information_____________________________________________________________________ 153
(6) Read modal data __________________________________________________________________________ 156
(7) Read diagnosis data ________________________________________________________________________ 161
(8) Read diagnosis data(area specified) ___________________________________________________________ 163
(9) Read maximum valid figures, number of decimal places ___________________________________________ 166
(10) Read real current for servo adjustment ________________________________________________________ 168
2
(11) Read real speed for servo adjustment _________________________________________________________ 169
(12) Read loop gain for servo adjustment __________________________________________________________ 170
(13) Read operator's message ___________________________________________________________________ 171
(14) Read output signal image of software operator's panel ____________________________________________ 173
(15) Write output signal of software operator's panel_________________________________________________ 175
(16) Read general signal image of software operator's panel ___________________________________________ 177
(17) Write general output signal of software operator's panel __________________________________________ 178
(18) Read general signal name of software operator's panel ___________________________________________ 179
(19) Write general signal name of software operator's panel ___________________________________________ 181
1.1.13 Function Reference Related to PMC ________________________________________________183
(1) Read PMC data(area specified) _______________________________________________________________ 183
(2) Write PMC data(area specified) ______________________________________________________________ 185
(3) Read PMC data information _________________________________________________________________ 187
3
Introduction
This manual describes the information necessary for developing the
application software of the Power Mate CNCs in the 32 bit Windows 95
and Windows NT4.0 environment.
Use this manual together with the operator's manual for the Power Mate CNCs.
NOTE:
The Power Mate CNC is supported in Version 1.4 and newer
of the HSSB software only.
COPYRIGHT, OTHERS
* The copyright of MS-DOS and other software provided with the control is
owned by Microsoft Corporation(U.S.A.), Phoenix Technologies
Limited(U.S.A.), Cirrus Logic Inc.(U.S.A.), Fujitsu Limited, and FANUC
Limited.
* Basically, one set of the software described above must be purchased for
each control.
* The software described above, and its manual, must be used under the
conditions described in the attached license agreement.
* The use of the CNC incorporating HSSB shall imply that the user agrees
to the conditions of the license agreement described above.
+---------------------------------------------------------------------------+
| * Microsoft, MS, MS-DOS, Windows, Visual Basic are registered trademark of|
| Microsoft corporation, U.S.A. |
| * Visual C++ is trademark of Microsoft corporation, U.S.A. |
| * Company name and product name mentioned in this manual are registered |
| trademark or trademark of each company. |
+---------------------------------------------------------------------------+
4
1. Extended Libraries
1.1.1 Outline
The CNC/PMC data window library is used for exchanging data and information
between the Intelligent terminal or personal computer through HSSB and
the CNC/PMC.
This data includes tool offset data, workpiece reference point offset
data, parameters, settings, custom macro variables, P-code macro
variables, and pitch error compensation data.
This data includes operation history data and alarm history data.
This data includes manual control of the servos, separate from the CNC
control or part program control.
5
1.1.2 General Description
(1) Library files
Maximum controlled axes : maximum number of axes for data window interface
Current controlled axes : number of axes controlled by CNC system currently
System Option(-D)
----------------------------------
Power Mate-H #define MAX_AXIS 6
Power Mate-D #define MAX_AXIS 2
6
1.1.3 Library Handle
+------------------------------+
| Start of application program |
+------------------------------+
|
v
+---------------------------+
| Get library handle number |
+---------------------------+
|
v
+----------------------------------------------+
| Set library handle number to global variable |
+----------------------------------------------+
|
v
+------------------------+
| Call library function | * Pass library handle number as argument
+------------------------+
|
v
+-------------------------------+
| Release library handle number |
+-------------------------------+
|
v
+------------------------------------+
| Termination of application program |
+------------------------------------+
NOTE
If an application program terminates without releasing the library
handle number, the area for it remains and accumulates. If this repeats,
to much memory will be used and the library handle number will
eventually not be able to be obtained.
7
(2) Library Handle Cautions.
Cautions, which have to be considered when the power supply on the NC side
connected with PC via HSSB is turned off, are shown below.
(1) When the power supply on the NC side is turned off while the library
function is running
When the power supply on the NC side is turned off while the library
function is running, the result of the operation under execution is not
guaranteed. Therefore, the power supply should be turned off after confirming
that no library functions are running.
When the power supply on the NC side is turned off while the library is not
running, the library function becomes executable by acquiring the library
handle again after NC is started up.
(3) Validity of the library handle when power supply on the NC side is
turned off
When the power supply of NC is turned off after the library handle is
acquired, the acquired library handles become invalid.
(When multiple NC's are connected via HSSB interface, only the library handle
of the NC whose power supply is turned off becomes invalid. The library
handle of the NC whose power supply is not off remains valid.)
If the library function is executed with the invalid library handle while the
power supply of the NC is OFF, the completion status of EW_HSSB is returned.
Moreover, when the library function is executed with the invalid library
handle after starting up the NC again, the completion status of EW_HANDLE
is returned.
The library handle which became invalid must be released by the function
cnc_freelibhndl().
8
1.1.4 Return Status of Data Window Function
(1) CNC/PMC data window
+------------+---------------------------+-----------------------------------+
|return value| meaning | explanation and user response |
+------------+---------------------------+-----------------------------------+
| EW_ITLOW | Low temperature alarm of | Please cut and reactivate the |
| (-13) | intelligent terminal | power supply where the data in the|
| | | disk might be destroyed after a |
| | | while. |
+------------+---------------------------+-----------------------------------+
| EW_IHIGHT | High temperature alarm of | Please cut and reactivate the |
| (-12) | intelligent terminal | power supply where the data in the|
| | | disk might be destroyed after a |
| | | while. |
+------------+---------------------------+-----------------------------------+
| EW_BUS | Bus error. | Bus error of Power Mate. |
| (-11) | | Ask service/charge post. |
+------------+---------------------------+-----------------------------------+
| EW_SYSTEM2| System error(2). | System error of Power Mate. |
| (-10) | | Ask service/charge post. |
+------------+---------------------------+-----------------------------------+
| EW_HSSB | Communication error of | Confirm the serial cable of HSSB |
| (- 9) | HSSB. | or I/F board. |
+------------+---------------------------+-----------------------------------+
| EW_SYSTEM | System error. | System error of Power Mate. |
| (- 5) | | Ask service/charge post. |
+------------+---------------------------+-----------------------------------+
| EW_BUSY | Busy. | Wait until the completion of Power|
| (- 1) | | Mate processing, or retry. |
+------------+---------------------------+-----------------------------------+
| EW_OK | Normal termination. | |
| ( 0) | | |
+------------+---------------------------+-----------------------------------+
| EW_FUNC | Error(start operation not | The user has not started any of |
| ( 1) | executed or start | the following operations, or |
| | already executed) | attempted to start one of the |
| | | following operations while it was |
| | | already started. |
| | | - Start downloading NC program. |
| | | - Start uploading NC program. |
+------------+---------------------------+-----------------------------------+
| EW_LENGTH | Error(data block length | Check and correct the data block |
| ( 2) | error) | length or number of data. |
+------------+---------------------------+-----------------------------------+
| EW_NUMBER | Error(data number error) | Check and correct the data number.|
| ( 3) | | |
+------------+---------------------------+-----------------------------------+
| EW_ATTRIB | Error(data attribute | Check and correct the data |
| ( 4) | error) | attribute. |
+------------+---------------------------+-----------------------------------+
| | | Check and correct the data. |
| | | For the following operations, this|
| EW_DATA | Error(data error) | code indicates that the specified |
| ( 5) | | program cannot be found. |
| | | - Delete specified program. |
| | | - Search specified program. |
| | | - Start uploading NC program. |
+------------+---------------------------+-----------------------------------+
9
+------------+---------------------------+-----------------------------------+
| EW_NOOPT | Error(no option) | The Power Mate option is not |
| ( 6) | | provided. |
+------------+---------------------------+-----------------------------------+
| EW_PROT | Error(write protect) | Write operation is prohibited. |
| ( 7) | | |
+------------+---------------------------+-----------------------------------+
| EW_OVRFLOW| Error(memory overflow) | The Power Mate memory overflowed. |
| ( 8) | | |
+------------+---------------------------+-----------------------------------+
| EW_PARAM | Error(Power Mate parameter| Power Mate parameter is set |
| ( 9) | error) | incorrectly |
+------------+---------------------------+-----------------------------------+
| | | The buffer is empty or full. |
| EW_BUFFER | Error(buffer empty/full) | Wait unit completion of Power Mate|
| ( 10) | | processing, or retry. |
+------------+---------------------------+-----------------------------------+
| EW_PATH | Error(path number error) |A path number is incorrect. |
| ( 11) | | |
+------------+---------------------------+-----------------------------------+
| EW_MODE | Error(Power Mate mode | The Power Mate mode is incorrect. |
| ( 12) | error) | Correct the Power Mate mode. |
+------------+---------------------------+-----------------------------------+
| EW_REJECT | Error(execution refusal of| The execution of the processing |
| ( 13) | CNC side processing) | was refused by Power Mate. |
| | | Please confirm the execution |
| | | condition. |
+------------+---------------------------+-----------------------------------+
10
1.1.5 Function List
Multi-Connection of HSSB
-------------------------------------------------------------------------------
1.1.6 Function name Brief description
-------------------------------------------------------------------------------
( 1) cnc_allclibhndl Allocate library handle
( 2) cnc_allclibhndl2 Allocate library handle2
( 3) cnc_freelibhndl Free library handle
-------------------------------------------------------------------------------
11
Functions Related to CNC File Data
--------------------------------------------------------------------------------
1.1.9 Function name Brief description
--------------------------------------------------------------------------------
( 1) cnc_rdtofs Read tool offset value
( 2) cnc_wrtofs Write tool offset value
( 3) cnc_rdtofsr Read tool offset value(area specified)
( 4) cnc_wrtofsr Write tool offset value(area specified)
( 5) cnc_rdtofsinfo Read tool offset information
( 6) cnc_rdparam Read parameter
( 7) cnc_wrparam Write parameter
( 8) cnc_rdparar Read parameter(area specified)
( 9) cnc_wrparas Write parameter(area specified)
(10) cnc_rdparainfo Read parameter information
(11) cnc_rdsetr Read setting data(area specified)
(12) cnc_wrsets Write setting data(area specified)
(13) cnc_rdmacro Read custom macro variable
(14) cnc_wrmacro Write custom macro variable
(15) cnc_rdmacror Read custom macro variable(area specified)
(16) cnc_wrmacror Write custom macro variable(area specified)
(17) cnc_rdmacroinfo Read custom macro variable information
(18) cnc_getmactype Get type of custom macro variable
(19) cnc_setmactype Set type of custom macro variable
-------------------------------------------------------------------------------
12
Functions Related to Others
--------------------------------------------------------------------------------
1.1.12 Function name Brief description
--------------------------------------------------------------------------------
( 1) cnc_sysinfo Read CNC system information
( 2) cnc_sysconfig Read CNC configuration information
( 3) cnc_statinfo Read CNC status information
( 4) cnc_alarm Read alarm status
( 5) cnc_rdalminfo Read alarm information
( 6) cnc_modal Read modal data
( 7) cnc_diagnoss Read diagnosis data
( 8) cnc_diagnosr Read diagnosis data(area specified)
( 9) cnc_getfigure Read maximum valid figures, number of decimal places
(10) cnc_rdcurrent Read real current for servo adjustment
(11) cnc_rdsrvspeed Read real speed for servo adjustment
(12) cnc_rdloopgain Read loop gain for servo adjustment
(13) cnc_rdopmsg Read operator's message
(14) cnc_rdopnlsgnl Read output signal image of software operator's panel
(15) cnc_wropnlsgnl Write output signal of software operator's panel
(16) cnc_rdopnlgnrl Read general signal image of software operator's panel
(17) cnc_wropnlgnrl Write general output signal of software operator's panel
(18) cnc_rdopnlgsname Read general signal name of software operator's panel
(19) cnc_wropnlgsname Write general signal name of software operator's panel
-------------------------------------------------------------------------------
13
1.1.6 Multi-Connection of HSSB
+---------------------------+
| Application |
+-------------+-------------+
|
+-------------+-------------+
| FWLIB32.DLL: Control DLL |
+-----------+---+---+-------+
| | |
+--------------+ | +--------------+
| | |
+-------+-------+ +-------+-------+ +-------+-------+
| FWLIB150.DLL: | | FWLIB160.DLL: | | FWLIBPM.DLL: |
| DLL for 150 | | DLL for | | DLL for |
| | | 160/180/210 | | Power Mate |
+---------------+ +---------------+ +---------------+
- All function must be called through the control DLL after the handle
number of specified node has been got by using the cnc_allclibhndl2()
function.
14
(1) Allocate the Library Handle (for Multi-Connection)
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_allclibhndl(unsigned short *FlibHndl);
Arguments:
FlibHndl Identify the process which uses the library.
15
(2) Allocate library handle 2(for Multi-Connection)
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_allclibhndl2(long node,
unsigned short *FlibHndl);
Arguments:
FlibHndl Identify the process which uses the library.
16
(3) Free library handle(for Multi-Connection)
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_freelibhndl(unsigned short FlibHndl);
Description: Frees the library handle which is used by the Windows version
library.
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
17
1.1.7 Function Reference Related to Controlled Axes
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_actf(unsigned short FlibHndl,
ODBACT *actualfeed);
Description: Reads the actual feed rate of the controlled axes of CNC.
The actual feed rate is stored in "data" of "ODBACT".
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
Example:
The following program displays "CURRENT F=1200" while the block
N20:O1234 of the following NC program is being executed.
(in case of "mm input".)
O1234 ;
N10 G90 F1200 ;
N20 G1 X10. Z200.
N30 ...
#include <stdio.h>
#include "apilib.h"
void example( void )
{
ODBACT buf ;
cnc_actf( 0, &buf ) ;
printf( "CURRENT F=%ld\n", buf.data ) ;
}
18
(2) Read absolute axis position
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_absolute(unsigned short FlibHndl, short axis,
short length, ODBAXIS *absolute);
Description: Reads the absolute position data of the axis specified with
"axis".
The absolute position is stored in "data[0]" of "ODBAXIS".
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
19
Return: EW_OK is returned on successful completion, otherwise any value
except EW_OK is returned. The main error codes are as follows.
(As for the rest, see "Return status of Library".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH data block length error
Size of ODBAXIS structure(length) is illegal.
EW_ATTRIB data attribute error
The specification of axis number (axis) is
improper.
Example:
The following program displays
1: 120005
2: -50119
3: 80
while the absolute position data for each axes is
The 1st axis 120.005
The 2nd axis -50.119
The 3rd axis 0.080
in 3-axis system.
(in case of "mm input" and "IS-B".)
#include <stdio.h>
#include "apilib.h"
20
(3) Read machine axis position
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_machine(unsigned short FlibHndl, short axis,
short length, ODBAXIS *machine);
Description: Reads the machine position data of the axis specified with
"axis".
The machine position is stored in "data[0]" of "ODBAXIS".
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
21
Return: EW_OK is returned on successful completion, otherwise any value
except EW_OK is returned. The main error codes are as follows.
(As for the rest, see "Return status of Library".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH data block length error
Size of ODBAXIS structure(length) is illegal.
EW_ATTRIB data attribute error
The specification of axis number (axis) is
improper.
Example:
The following program displays "MACHINE 2: -265593" while the machine
position data of the 2nd axis is -26.5593.
(in case of "inch output" and "IS-B".)
#include <stdio.h>
#include "apilib.h"
22
(4) Read relative axis position
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_relative(unsigned short FlibHndl, short axis,
short length, ODBAXIS *relative);
Description: Reads the relative position data of the axis specified with
"axis".
The relative position is stored in "data[0]" of "ODBAXIS".
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
23
Return: EW_OK is returned on successful completion, otherwise any value
except EW_OK is returned. The main error codes are as follows.
(As for the rest, see "Return status of Library".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH data block length error
Size of ODBAXIS structure(length) is illegal.
EW_ATTRIB data attribute error
The specification of axis number (axis) is
improper.
Example:
The following program displays "RELATIVE 4: 900051" while the relative
position data of the 4th axis(rotation axis) is 900.051 .
(in case of "IS-B".)
#include <stdio.h>
#include "apilib.h"
24
(5) Read distance to go
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_distance(unsigned short FlibHndl, short axis,
short length, ODBAXIS *distance);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
25
Return: EW_OK is returned on successful completion, otherwise any value
except EW_OK is returned. The main error codes are as follows.
(As for the rest, see "Return status of Library".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH data block length error
Size of ODBAXIS structure(length) is illegal.
EW_ATTRIB data attribute error
The specification of axis number (axis) is
improper.
Example:
The following program displays
1: -34600
2: 60018
3: -360
while the amount of distance to go for each axes are
The 1st axis -17.300 (Linear axis)
The 2nd axis 30.009 (linear axis)
The 3rd axis -0.180 (Rotation axis)
in 3-axis system.(in case of "mm input" and "IS-B".)
#include <stdio.h>
#include "apilib.h"
26
(6) Read skip position
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_skip(unsigned short FlibHndl, short axis,
short length, ODBAXIS *skip);
Description: Reads the skipped position of the axis specified with "axis".
The skipped position is stored in "data[0]" of "ODBAXIS".
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
27
Return: EW_OK is returned on successful completion, otherwise any value
except EW_OK is returned. The main error codes are as follows.
(As for the rest, see "Return status of Library".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH data block length error
Size of ODBAXIS structure(length) is illegal.
EW_ATTRIB data attribute error
The specification of axis number (axis) is
improper.
Example:
The following program displays the skipped position of the 1st and 2nd
axes.
#include <stdio.h>
#include "apilib.h"
28
(7) Read servo delay value
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_srvdelay(unsigned short FlibHndl, short axis,
short length, ODBAXIS *srvdelay);
Description: Reads the servo delay amount of the axis specified with "axis".
The servo delay amount is stored in "data[0]" of "ODBAXIS".
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
29
Return: EW_OK is returned on successful completion, otherwise any value
except EW_OK is returned. The main error codes are as follows.
(As for the rest, see "Return status of Library".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH data block length error
Size of ODBAXIS structure(length) is illegal.
EW_ATTRIB data attribute error
The specification of axis number (axis) is
improper.
Example:
The following program displays the servo delay amount of all axes
(number of axes = MAX_AXIS).
#include <stdio.h>
#include "apilib.h"
void example( void )
{
ODBAXIS buf ;
unsigned int idx ;
cnc_srvdelay( 0, -1, 4+4*MAX_AXIS, &buf ) ;
for ( idx = 0 ; idx < MAX_AXIS ; idx++ )
printf( "%u:%8ld\n", idx, buf.data[idx] ) ;
}
30
(8) Read acceleration/deceleration delay value
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_accdecdly(unsigned short FlibHndl,
short axis, short length, ODBAXIS *accdecdly);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
31
Return: EW_OK is returned on successful completion, otherwise any value
except EW_OK is returned. The main error codes are as follows.
(As for the rest, see "Return status of Library".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH data block length error
Size of ODBAXIS structure(length) is illegal.
EW_ATTRIB data attribute error
The specification of axis number (axis) is
improper.
Example:
The following program displays the acceleration/deceleration delay
amount of all axes (number of axes = MAX_AXIS).
#include <stdio.h>
#include "apilib.h"
void example( void )
{
ODBAXIS buf ;
unsigned int idx ;
cnc_accdecdly( 0, -1, 4+4*MAX_AXIS, &buf ) ;
for ( idx = 0 ; idx < MAX_AXIS ; idx++ )
printf( "%u:%8ld\n", idx, buf.data[idx] ) ;
}
32
(9) Read all dynamic data
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rddynamic(unsigned short FlibHndl,
short axis, short length, ODBDY *rddynamic);
Function used
for reading
Data individually
-----------------------------------------------+--------------
Alarm status cnc_alarm
Program number in executing cnc_rdprgnum
Program number of the main program cnc_rdprgnum
Sequence number cnc_rdseqnum
Actual feed rate cnc_actf
Absolute position data of controlled axis cnc_absolute
Machine position data of controlled axis cnc_machine
Relative position data of controlled axis cnc_relative
Amount of distance to go of controlled axis cnc_distance
The formats of each data are the same as each corresponding "Function"
used for reading each data.
Refer each functions for details.
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
33
length Specify the length of the data block(size of ODBDY structure)
34
long machine[MAX_AXIS] ; /* machine */
long relative[MAX_AXIS] ; /* relative */
long distance[MAX_AXIS] ; /* distance to go*/
} faxis ; /* In case of all axes */
struct {
long absolute ; /* absolute */
long machine ; /* machine */
long relative ; /* relative */
long distance ; /* distance to go */
} oaxis ; /* In case of 1 axis */
} pos ;
} ODBDY ; /* MAX_AXIS is the maximum controlled axes. */
Power Mate
#15:External alarm message
#14:(Not used)
#13:(Not used)
#12:(Not used)
#11:(Not used)
#10:P/S alarm 5000
#09:(Not used)
#08:APC alarm
#07:System alarm
#06:Servo alarm
#05:Overheat alarm
#04:Overtravel alarm
#03:P/S alarm except above
#02:P/S alarm 101
#01:P/S alarm 000
#00:P/S alarm 100
35
Return: EW_OK is returned on successful completion, otherwise any value
except EW_OK is returned. The main error codes are as follows.
(As for the rest, see "Return status of Library".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH data block length error
Size of ODBDY structure(length) is illegal.
EW_ATTRIB data attribute error
The specification of axis number (axis) is
improper.
Example:
The following program reads the dynamic data of all axes
(number of axes = MAX_AXIS) and displays them on the screen.
#include <stdio.h>
#include "apilib.h"
36
(10) Set origin / preset relative axis position
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_wrrelpos(unsigned short FlibHndl,
short length, IDBWRR *wrrelpos);
Description: Preset relative position against the axis specified with "type".
Preset data is specified by "data[0]" in "IDBWRR".
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
37
Return: EW_OK is returned on successful completion, otherwise any value
except EW_OK is returned. The main error codes are as follows.
(As for the rest, see "Return status of Library".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH data block length error
Size of ODBWRR structure(length) is illegal.
EW_ATTRIB data attribute error
The specification of axis number (type) is
improper.
EW_DATA data error
The content of "data" is out of range which
can be specified.
Example:
The following program preset the relative position of the first axis.
#include <stdio.h>
#include "apilib.h"
#define FIRST_AXIS 1
#define ONE_AXIS_LEN 8
IDBWRR wrrelpos ;
short ret ;
wrrelpos.type = FIRST_AXIS ;
wrrelpos.data[0] = 0 ;
ret = cnc_wrrelpos( 0, ONE_AXIS_LEN, &wrrelpos);
38
1.1.8 Function Reference Related to Program
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_dwnstart(unsigned short FlibHndl);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
39
(2) Download NC program
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_download(unsigned short FlibHndl, char *data,
short number);
When the data processing on the CNC side is delayed and the data
cannot be transferred, this function waits until it can be
transferred.
+-------------------+
| cnc_dwnstart() | beginning of download
+---------+---------+ (must be done)
+-------------->|
| +---------+---------+
| | cnc_download() | output of download data
| +---------+---------+
| |
| Yes +---------+----------------+
+-----+Is there data of unoutput?|
+---------+----------------+
| No
+---------+---------+
| cnc_dwnend() | End of download
+-------------------+ (must be done)
NC program format
~~~~~~~~~~~~~~~~~
NC program to be registered to CNC is a string composed of
ASCII characters as following format.
LF 0x0A('\n')
Oxxxx Program number
Mxx M code at the end of the program(M02,M30,etc.)
'LF' must be placed at the top of the whole program, and '%' at
the end
Data before 'LF' at the top are ignored. Address 'O' and program
number must be placed in the program to be registered.
For example, to register a program such as
O1234 ;
G1 F0.3 W10. ;
M30 ;
40
%
"\nO1234\nG1F0.3W10.\nM30\n%"
"\n"
"O1234\n"
"G1F0.3W10.\n"
"M30\n"
"%"
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
41
CNC option: There is no need of CNC option for this function.
Example:
The following program registers the following NC program to CNC.
O1234 ;
G0 Z0 ;
G0 X0 Y0 ;
G1 F500 X120. Y-30. ;
M30 ;
#include "apilib.h"
42
(3) End of downloading NC program
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_dwnend(unsigned short FlibHndl);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
43
(4) Start uploading NC program
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_upstart(unsigned short FlibHndl,
short number);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
44
(5) Upload NC program
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_upload(unsigned short FlibHndl,
ODBUP *upld, unsigned short *number);
Description: Read NC program registered for the tape memory in CNC (program
memory).
+-------------------+
| cnc_upstart() | beginning of upload
+---------+---------+ (must be done)
+-------------->|
| +---------+---------+
| | cnc_upload() | read NC program
| +---------+---------+
| |
| No +---------+---------+
+-----+ the last data='%'?|
+---------+---------+
| Yes
+---------+---------+
| cnc_upend() | End of upload
+-------------------+ (must be done)
LF 0x0A('\n')
Oxxxx Program number
Mxx M code at the end of the program(M02,M30,etc.)
O1234 ;
G1 F0.3 W10. ;
M30 ;
%
And in case that the buffer size is less than 24 bytes, you will
get the following strings.
45
In case that the buffer size is 10 bytes.
1st time "%\nO1234\nG1" (10 characters)
2nd time "F0.3W10.\nM" (10 characters)
3rd time "30\n%" (4 characters)
4th and after "" (0 character)
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
ODBUP 0+-----------------------------------+
| dummy[0] |
2+-----------------------------------+
| dummy[1] |
4+-----------------+-----------------+
| data[0] |
5+-----------------+
= =
4+MAX_RBUF-1+-----------------+
| data[MAX_RBUF-1]|
4+MAX_RBUF +-----------------+
46
Example:
The following program reads the specified NC program registered in CNC,
and displays its contents on the screen.
#include <stdio.h>
#include "apilib.h"
#define BUFSIZE 40
47
(6) End of uploading NC program
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_upend(unsigned short FlibHndl);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
48
(7) Search specified program
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_search(unsigned short FlibHndl,
short number);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
CNC mode: The behavior of this function depends on the CNC mode.
EDIT,MEMORY mode :foreground search
Other mode :background search
(foreground search : set again selecting program.)
(background search : check whether the specified program exists
or not.)
49
Example:
The following program searches the program whose program number is same
as specified one, and displays the result.
#include <stdio.h>
#include "apilib.h"
50
(8) Delete all programs
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_delall(unsigned short FlibHndl);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
51
Example:
The following program deletes all programs and displays the result.
#include <stdio.h>
#include "apilib.h"
52
(9) Delete specified program
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_delete(unsigned short FlibHndl,
short number);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
53
Example:
The following program deletes the program whose program number is same
as specified one, and displays the result.
#include <stdio.h>
#include "apilib.h"
54
(10) Read program directory
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdprogdir(unsigned short FlibHndl,
short type, short datano_s, short datano_e, short length,
PRGDIR *prgdir);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
LF 0x0A ('\n')
Oxxxx Program number. This is a ASCII string
without the leading '0' of numeric part
sorted in numeric order.("O1" - "O9999")
55
CHAR_NUMBER Character number of the program.
This is a ASCII string without the
leading '0'. The number is raised to
80-character unit.
COMMENT The comment which is written just after
the program number is stored.
The maximum character number of the
comment body is 48. (50 including the
before and the behind parentheses.)
Only beginning 48 characters are stored
for the comment which is longer than 48
characters.
If the program has no comment, only
parentheses ("()") are stored.
For example, when the next programs are registered in CNC, the
result of this function, in case that datano_s=1 and
datano_e=9999, is as follows.
Program number (COMMENT) Character number
-------------------------------+----------------
O0012 (TEST) ; 420
O0200 (WORK1) ; 352
O0201 ; 537
O9001 (SUB-PRO1) ; 781
If the buffer size is not enough for the specified program, the
specified size is read. In case of 15 bytes, the result is as
follows.
type Contents to be read
-------+-------------------------------------------------------
0 "O12O200O201O900"
1 "%\nO12(TEST)\nO20"
2 "O12(TEST)420O20"
56
Example:
The following program reads the registration information of NC program
included specified by the arguments, and displays program number list.
#include <stdio.h>
#include <string.h>
#include "apilib.h"
#define BUFSIZE 256
57
(11) Read program information
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdproginfo(unsigned short FlibHndl,
short type, short length, ODBNC *prginfo);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
- type=0
Each data are stored in each members of the structure with
binary format.
prginfo.bin.reg_prg Amount of registered programs.
prginfo.bin.unreg_prg Amount of available programs.
prginfo.bin.used_mem Character number of used memory.
prginfo.bin.unused_mem Character number of unused memory.
- type=1
ASCII strings are stored in "prginfo.u.asc" with following
58
format.
% LF d1 LF d2 LF d3 LF d4 LF %
LF 0x0A('\n')
d1 Amount of registered programs
d2 Amount of available programs
d3 Character number of used memory
d4 Character number of unused memory
d1 - d4 are ASCII strings without the leading '0'.
Example:
The following program reads the management data of NC program,
and displays them.
#include <stdio.h>
#include "apilib.h"
59
(12) Read program number under execution
Function Name: cnc_rdprgnum
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdprgnum(unsigned short FlibHndl,ODBPRO *prgnum);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
Example:
The next program displays "CURRENT(O9876) MAIN(O1234)" while
the block "O9876/N210" of the following NC program is being executed.
#include <stdio.h>
#include "apilib.h"
void example( void )
{
struct odbpro buf ;
cnc_rdprgnum( 0, &buf ) ;
printf( "CURRENT(O%d) MAIN(O%d)\n", buf.data, buf.mdata ) ;
}
O1234 ; O5678 ; O9876 ;
N10 M98 P5678 ; N110 M98 P9876 ; N210 M45 ;
N20 M30 ; N120 M99 ; N220 M99 ;
60
(13) Read sequence number under execution
Function Name: cnc_rdseqnum
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdseqnum(unsigned short FlibHndl,
ODBSEQ *seqnum);
This function is used for watch the block being executed or the
current process by the application program, or only displaying
the current sequence number.
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
#include <stdio.h>
#include "apilib.h"
61
(14) Read program under execution
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdexecprog(unsigned short FlibHndl,
unsigned short *length, short *blknum, char *data);
Description: Read only the number of specified characters from the executing
program.
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
length Specify the address of the variable which shows the number of
characters to read.
Set the number of characters to read to this variable(*length).
After reading ends, the number of characters actually read is
set in this variable(*length) again.
blknum Specify the address of the variable to store the block counter.
62
(15) Write program for MDI operation
Function Name: cnc_wrmdiprog
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_wrmdiprog(unsigned short FlibHndl,
short length, char *data);
'LF' must be placed at the top of the whole NC commands, and '%'
at the end.
'LF's are added after each NC commands.
For example, to execute commands such as
O1234 ;
G01F0.3W10. ;
M30 ;
send a following string using cnc_wrmdiprog function.
cnc_wrmdiprog( 0, 24, "\nO1234\nG01F0.3W10.\nM30\n%" ) ;
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
63
(16) Read execution pointer for MDI operation
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdmdipntr(unsigned short FlibHndl,
ODBMDIP *mdip);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
64
(17) Write execution pointer for MDI operation
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_wrmdipntr(unsigned short FlibHndl,long crntpntr);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
65
(18) Search specified sequence number
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_seqsrch(unsigned short FlibHndl,
long seq_no);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
66
(19) Rewind cursor of NC program
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rewind(unsigned short FlibHndl);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
67
1.1.9 Function Reference Related to NC File Data
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdtofs(unsigned short FlibHndl, short number,
short type, short length, ODBTOFS *tofs);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
68
CNC option: There is need of CNC option for this function.
Example:
The following program reads the offset value of specified tool
number and displays them.
#include <stdio.h>
#include "apilib.h"
69
(2) Write tool offset value
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_wrtofs(unsigned short FlibHndl, short number,
short type, short length, long data);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
70
CNC mode: This function can be used in any CNC mode.
Example:
The following program writes the offset value of specified offset
number.
#include <stdio.h>
#include "apilib.h"
71
(3) Read tool offset value(area specified)
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdtofsr(unsigned short FlibHndl,
short s_number, short type, short e_number, short length,
IODBTO *tofsr);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
72
Return: EW_OK is returned on successful completion, otherwise any value
except EW_OK is returned. The main error codes are as follows.
(As for the rest, see "Return status of Library".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Size of ODBTOFS structure(length) is wrong.
EW_NUMBER Data number error
Offset number(number) is wrong.
EW_ATTRIB Data attribute error
Offset type(type) is wrong.
Example:
The following program reads all offset values of 99 sets and displays
them.
#include <stdio.h>
#include <stdlib.h>
#include "apilib.h"
#define MAXTOOL 99
73
(4) Write tool offset value(area specified)
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_wrtofsr(unsigned short FlibHndl,
short length, IODBTO *tofsr);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
74
Return: EW_OK is returned on successful completion, otherwise any value
except EW_OK is returned. The main error codes are as follows.
(As for the rest, see "Return status of Library".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Size of ODBTOFS structure(length) is wrong.
EW_NUMBER Data number error
Offset number(number) is wrong.
EW_ATTRIB Data attribute error
Offset type(type) is wrong.
Example:
The following program writes all tool offset values of 99 sets.
#include <stdlib.h>
#include <string.h>
#include "apilib.h"
#define MAXTOOL 99
short example( long *offset )
{
IODBTO *tofsr ;
short ret ;
tofsr = (IODBTO *)malloc( 6+4*MAXTOOL ) ;
tofsr->datano_s = 1 ;
tofsr->datano_e = MAXTOOL ;
tofsr->type = -1 ;
memcpy( &(tofsr->u.m_ofs_a[0]), offset, 4*MAXTOOL ) ;
ret = cnc_wrtofsr( 0, 6+4*MAXTOOL, tofsr ) ;
free( tofsr ) ;
return ( ret ) ;
}
75
(5) Read tool offset information
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdtofsinfo(unsigned short FlibHndl,
ODBTLINF *tlinf);
Description: Reads the memory type of tool offset, and the available number
of it.
Those are stored in "ofs_type" and "use_no" of "ODBTLINF" with
signed binary format.
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
Number of offset 99
76
(6) Read parameter
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdparam(unsigned short FlibHndl,
short number, short axis, short length, IODBPSD *param);
The attribute of CNC parameter depends on the type and axis, and
it is different for each parameter. It is as follows, and can
be got by cnc_rdparainfo() function.
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
77
no axis/1 axis all axes
IODBPSD 0 +-------+ --- 0 +-------+ ---
|datano | ^ |datano | ^
2 +-------+ | 2 +-------+ |
|type | length |type | length
4 +-------+-------+ | 4 +-------+-------+ |
| ldata | v |ldatas[0] :1st| |
8 +---------------+--- 8 +---------------+ |
= = |
4+2x(n-1) +---------------+ |
|ldatas[n-1]:n-th v
4+2xn +---------------+---
n : Current controlled axes
78
Example:
The following program reads axes name of controlled axes(number of axis
=MAX_AXIS), and displays them.
#include <stdio.h>
#include <stdlib.h>
#include "apilib.h"
79
(7) Write parameter
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_wrparam(unsigned short FlibHndl,
short length, IODBPSD *param);
The attribute of CNC parameter depends on the type and axis, and
it is different for each parameter. It is as follows, and can
be got by cnc_rdparainfo() function.
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
80
no axis/1 axis all axes
IODBPSD 0 +-------+ --- 0 +-------+ ---
|datano | ^ |datano | ^
2 +-------+ | 2 +-------+ |
|type | length |type | length
4 +-------+-------+ | 4 +-------+-------+ |
| ldata | v |ldatas[0] :1st| |
8 +---------------+--- 8 +---------------+ |
= = |
4+2x(n-1) +---------------+ |
|ldatas[n-1]:n-th v
4+2xn +---------------+---
n : Current controlled axes
CNC option: In case of Power Mate, there may be need of CNC option
for some specific parameters.
81
Example:
The following program writes the parameter of stroke limit check for
the specified axis.
#include "apilib.h"
82
(8) Read parameter(area specified)
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdparar(unsigned short FlibHndl,
(short *)&s_number, short axis, (short *)&e_number,
(short *)&length, (void *)param);
The attribute of CNC parameter depends on the type and axis, and
it is different for each parameter. It is as follows, and can
be got by cnc_rdparainfo() function.
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
83
axis Specify the axis number.
ALL_AXES : assigns all axes(ALL_AXES=-1)
0 : assigns no axis
1,..,m : assigns 1 axis(m=max. controlled axes)
length Specify the data block length which is enough to store the
specified parameter.
The structure per 1 parameter is as follows, and each parameter
is lined up in order of number.
[= Sum of (4+(byte size of each parameter)*(number of axis))]
84
datano Parameter number which was read is stored.
Upper byte:type
0 : bit type
1 : byte type
2 : word type
3 : 2-word type
Lower byte:axis
ALL_AXES : all axes(ALL_AXES=-1)
0 : no axis
1,..,m : 1 axis(m=max. controlled axes)
Example:
The following program reads the parameter within the specified number
range and axis, and displays them.
#include <stdio.h>
#include <stdlib.h>
#include "apilib.h"
85
switch ( ptr->type & 0xff ) {
case 0xff :
for ( idx2 = 0 ; idx2 < axno ; idx2++ ) {
printf( " #%d:", idx2+1 ) ;
switch ( ptr->type >> 8 ) {
case 0:
printf( "0x%02X",
(unsigned char)(ptr->u.cdatas[idx2]) ) ;
inc = 1 ; break ;
case 1:
printf( "%d", ptr->u.cdatas[idx2] ) ;
inc = 1 ; break ;
case 2:
printf( "%d", ptr->u.idatas[idx2] ) ;
inc = 2 ; break ;
case 3:
printf( "%ld", ptr->u.ldatas[idx2] ) ;
inc = 4 ; break ;
}
}
putchar( '\n' ) ;
ptr = (IODBPSD *)(((char *)ptr)+4+8*inc) ;
break ;
default :
printf( " #%d:", ptr->type & 0xff ) ;
case 0 :
switch ( ptr->type >> 8 ) {
case 0:
printf( " 0x%02X\n",
(unsigned char)(ptr->u.cdata) ) ;
inc = 1+1 ; break ;
case 1:
printf( " %d\n", ptr->u.cdata ) ;
inc = 1+1 ; break ;
case 2:
printf( " %d\n", ptr->u.idata ) ;
inc = 2 ; break ;
case 3:
printf( " %ld\n", ptr->u.ldata ) ;
inc = 4 ; break ;
}
ptr = (IODBPSD *)(((char *)ptr)+4+inc) ;
break ;
}
}
}
else
printf( "ERROR!(%d)\n", ret ) ;
free( param ) ;
return ( ret ) ;
}
86
(9) Write parameter(area specified)
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_wrparas(unsigned short FlibHndl,
short length, (void *)param);
The attribute of CNC parameter depends on the type and axis, and
it is different for each parameter. It is as follows, and can
be got by cnc_rdparainfo() function.
PS000 alarm:"PLEASE TURN OFF POWER" may be issued when some specific
parameters are written.
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
length Specify the data block length which is enough to store the
specified parameter.
The structure per 1 parameter is as follows, and each parameter
must be lined up in order of number.
87
no axis/1 axis all axes
IODBPSD 0 +-------+ --- 0 +-------+ ---
|datano | ^ |datano | ^
2 +-------+ | 2 +-------+ |
|type |length/parameter |type | length
4 +---+---+ | 4 +---+---+ /param.
|cdata | |cdatas[0] :1st |
5 +---+ | 5 +---+ |
|dummy v = = |
6 +---+ --- 4+1x(n-1) +---+ |
|cdatas[n-1]:n-th |
4+1xn +---+ |
|dummy(in case of v
+---+ n=odd num.)---
n : Maximum controlled axes
Lower byte:axis
ALL_AXES : assigns all axes(ALL_AXES=-1)
0 : assigns no axis
1,..,m : assigns 1 axis(m=max. controlled axes)
88
Return: EW_OK is returned on successful completion, otherwise any value
except EW_OK is returned. The main error codes are as follows.
(As for the rest, see "Return status of Library".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Size of area to store parameter(length) is
wrong.
EW_NUMBER Data number error
Parameter number(datano) is wrong.
EW_ATTRIB Data attribute error
Axis number(type) is wrong.
EW_NOOPT No option
There is no option required for the specified
parameter.
EW_PROT Write operation is prohibited.
CNC option: In case of Power Mate, there may be need of CNC option
for some specific parameters.
Example:
The following program writes M codes for macro call in No.6080,..,
No.6089.
#include <stdlib.h>
#include "apilib.h"
short example( short *mcode )
{
IODBPSD *param, *ptr ;
short ret, idx ;
param = (IODBPSD *)calloc( 1, 100 ) ;
ptr = param ;
for ( idx = 0 ; idx < 10 ; idx++ ) {
ptr->datano = 6080 + idx ;
ptr->type = 0 ;
ptr->cdata = mcode[idx] ;
ptr = (IODBPSD *)(((char *)ptr)+6) ;
}
ret = cnc_wrparar( 0, 6*10, param ) ;
free( param ) ;
return ( ret ) ;
}
89
(10) Read parameter information
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdparainfo(unsigned short FlibHndl,
short s_number, unsigned short read_no, ODBPARAIF *paraif);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
90
info[N].prm_type Attribute of parameter
The following attributes are set.
bit 0,1 : type attribute
0 : bit type 2 : word type
1 : bite type 3 : 2-word type
bit 2 : axis attribute
0 : without axis
1 : with axis
bit 3 : sign (Only Series160/180/210)
0 : with sign
1 : without sign
bit 4 : settings input
0 : disable 1 : enable
bit 5 : write protection
0 : enable 1 : disable
bit 6 : power must be off after writing
0 : not necessary
1 : necessary
bit 7 : read protection
0 : enable 1 : disable
bit 8 : spindle parameter
0 : no spindle 1 : spindle
bit 9 - 15:(reserve)
91
(11) Read setting data(area specified)
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdsetr(unsigned short FlibHndl,(short *)&s_number,
short axis, (short *)&e_number,
(short *)&length, (void *)set);
The attribute of setting data depends on the type and axis, and
it is different for each setting data.
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
92
range.
None axis type setting data can be read even if any value is
specified in "axis". In case that an axis type setting data
exists in the specified range, the error(Return:EW_ATTRIB) is
returned by specifying "axis=0".
length Specify the data block length which is enough to store the
specified setting data.
The structure per 1 setting data is as follows, and each
setting data is lined up in order of number.
[= Sum of (4+(byte size of each setting data)*(number of axis))]
93
} u ;
} IODBPSD ; /* MAX_AXIS : max. controlled axes */
Lower byte:axis
ALL_AXES : all axes(ALL_AXES=-1)
0 : no axis
1,..,m : 1 axis(m=max. controlled axes)
94
(12) Write setting data(area specified)
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_wrsets(unsigned short FlibHndl, short length,
(void *)set);
The attribute of setting data depends on the type and axis, and
it is different for each setting data.
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
length Specify the data block length which is enough to store the
specified setting data.
The structure per 1 setting data is as follows, and each
setting data must be lined up in order of number.
[= Sum of (4+(byte size of each setting data)*(number of axis))]
95
no axis/1 axis all axes
IODBPSD 0 +-------+ --- 0 +-------+ ---
|datano | ^ |datano | ^
2 +-------+ | 2 +-------+ |
|type |length/set data |type | length
4 +---+---+ | 4 +---+---+ /set.data
|cdata | |cdatas[0] :1st |
5 +---+ | 5 +---+ |
|dummy v = = |
6 +---+ --- 4+1x(n-1) +---+ |
|cdatas[n-1]:n-th |
4+1xn +---+ |
|dummy(in case of v
+---+ n=odd num.)---
n : Maximum controlled axes
96
Return: EW_OK is returned on successful completion, otherwise any value
except EW_OK is returned. The main error codes are as follows.
(As for the rest, see "Return status of Library".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Size of area to store setting data(length) is
wrong.
EW_NUMBER Data number error
Setting data number(datano) is wrong.
EW_ATTRIB Data attribute error
Axis number(type) is wrong.
EW_NOOPT No option
There is no option required for the specified
setting data.
CNC option: In case of Power Mate, there may be need of CNC option
for some specific setting data.
97
(13) Read custom macro variable
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdmacro(unsigned short FlibHndl,
short number, short length, ODBM *macro);
Arguments:
98
length Specify the data block length(size of ODBM structure=10).
#include <stdio.h>
#include <string.h>
#include "apilib.h"
/* number is variable number to be read. */
short example( short number )
{
ODBM macro ;
char strbuf[11] ;
short ret ;
ret = cnc_rdmacro( 0, number, 10, ¯o ) ;
if ( !ret ) {
sprintf( &strbuf[1], "%09ld", macro.mcr_val ) ;
if ( strbuf[1] == '0' ) strbuf[1] = ' ' ;
strncpy( &strbuf[0], &strbuf[1], 9 - macro.dec_val ) ;
strbuf[9-macro.dec_val] = '.' ;
printf( "%s\n", strbuf ) ;
}
else
printf( "**********\n" ) ;
return ( ret ) ;
}
99
(14) Write custom macro variable
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_wrmacro(unsigned short FlibHndl,
short number, short length, long mcr_val, short dec_val);
Arguments:
100
mcr_val Specify the value of variable/numerical part of variable.
Example:
The following program writes the specified value in the specified
custom macro variable.
#include "apilib.h"
101
(15) Read custom macro variable(area specified)
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdmacror(unsigned short FlibHndl,short s_number,
short e_number, short length,
IODBMR *macror);
Arguments:
102
s_number Specify the start custom macro variable number.
103
CNC mode: This function can be used in any CNC mode.
Example:
The following program reads the custom macro variables within the
specified range and displays them.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "apilib.h"
104
(16) Write custom macro variable(area specified)
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_wrmacror(unsigned short FlibHndl,
short length, IODBMR *macror);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
105
IODBMR 0 +-----------+ ---
|datano_s | ^
2 +-----------+ |
|dummy | |
4 +-----------+ |
|datano_e | |
6 +-----------+---------+ |
|data[0].mcr_val | length
10+-----------+---------+ |
|data[0].dec_val |
12+-----------+---------+ |
= = |
6+6*(N-1) +-----------+---------+ |
|data[N-1].mcr_val | |
+-----------+---------+ |
|data[N-1].dec_val v
6+6*N +-----------+ ---
N : Number of custom macro variable
106
CNC mode: This function can be used in any CNC mode.
Example:
The following program writes the specified values into the custom macro
variables within the specified range.
#include <stdlib.h>
#include "apilib.h"
107
(17) Read custom macro variable information
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdmacroinfo(unsigned short FlibHndl,
ODBMVINF *mvinf);
Description: Reads the available number of the local macro variable and the
common macro variable. Those are stored in "use_no1", "use_no2"
of "ODBMVINF" with signed binary format.
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
108
(18) Get type of custom macro variable
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_getmactype(unsigned short FlibHndl,
(short *)¯o_type);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
109
(19) Set type of custom macro variable
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_setmactype(unsigned short FlibHndl,
short macro_type);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
110
1.1.10 Function Reference Related to History Data
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_stopophis(unsigned short FlibHndl);
Description: Stops sampling the operation history data and the alarm history
data of CNC.
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
111
(2) Restart logging operation history data
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_startophis(unsigned short FlibHndl);
Description: Restarts sampling the operation history data and the alarm
history data of CNC.
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
112
(3) Read number of operation history data
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdophisno(unsigned short FlibHndl,
unsigned short *hisno);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
113
(4) Read operation history data
Declaration:
#include "Fwlib32.h
FWLIBAPI short WINAPI cnc_rdophistry(unsigned short FlibHndl,unsigned short
s_no, unsigned short e_no,unsigned short
length, ODBHIS *his);
The operation history data and the alarm history data are
automatically recorded on the CNC. When these data are
accessed, it is necessary to temporarily stop sampling on the
CNC.
Therefore, it is necessary to execute "Stop logging operation
history data"(cnc_stopophis) before this function is used.
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
114
data.rec_alm 0 +-----------------------+
| rec_type |
2 +-----------------------+
| alm_grp |
4 +-----------------------+
| alm_no |
6 +-----------+-----------+
| axis_no |
7 +-----------+
| dummy |
8 +-----------+
data.rec_mdi 0 +-----------------------+
| rec_type |
2 +-----------+-----------+
| key_code |
3 +-----------+
| pw_flag |
4 +-----------+
| dummy[0] |
5 +-----------+
| dummy[1] |
6 +-----------+
| dummy[2] |
7 +-----------+
| dummy[3] |
8 +-----------+
data.rec_sgn 0 +-----------------------+
| rec_type |
2 +-----------+-----------+
| sig_name |
3 +-----------+
| sig_old |
4 +-----------+
| sig_new |
5 +-----------+
| dummy |
6 +-----------+-----------+
| sig_no |
8 +-----------------------+
115
The ODBHIS structure is as follows.
116
sig_name Signal name
1 : X
2 : G
3 : Y
4 : F
117
(5) Read number of alarm history data
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdalmhisno(unsigned short FlibHndl,unsigned short
*hisno);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
118
(6) Read alarm history data
Declaration:
#include "Fwlib32.h
FWLIBAPI short WINAPI cnc_rdalmhistry(unsigned short FlibHndl,unsigned short
s_no, unsigned short e_no,unsigned
short length, ODBAHIS *his);
The operation history data and the alarm history data are
automatically recorded on the CNC. When these data are
accessed, it is necessary to temporarily stop sampling on the
CNC.
Therefore, it is necessary to execute "Stop logging operation
history data"(cnc_stopophis) before this function is used.
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
119
alm_his 0 +---------------------------+
| dummy |
2 +---------------------------+
| alm_grp |
4 +---------------------------+
| alm_no |
6 +-------------+-------------+
| axis_no |
7 +-------------+
| year |
8 +-------------+
| month |
9 +-------------+
| day |
10 +-------------+
| hour |
11 +-------------+
| minute |
12 +-------------+
| second |
13 +-------------+
| dummy2 |
14 +-------------+-------------+
| len_meg |
16 +-------------+-------------+
| alm_msg[0] |
17 +-------------+
= =
47 +-------------+
| alm_msg[31]|
48 +-------------+
120
alm_grp Alarm type Power Mate Not used
121
(7) Clear operation history data
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_clearophis(unsigned short FlibHndl,short slct);
Description: Clears the operation history data and the alarm history data.
It is possible to be selected the operation history or the alarm
history by setting "slct" in Power Mate.
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
122
(8) Read signals related operation history
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdhissgnl(unsigned short FlibHndl,IODBSIG *sig);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
123
(9) Write signals related operation history
Function Name: cnc_wrhissgnl
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_wrhissgnl(unsigned short FlibHndl,IODBSIG *sig);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
124
1.1.11 Functions Related to the axis movement control
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_opdi(unsigned short FlibHndl, short number,ODBOPDI
*idb );
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
+---------+-------------------------+---------------------------------------+
|operation| operation signal name | set value |
| signal | | |
| number | | |
+---------+-------------------------+---------------------------------------+
| 1 | Emergency stop signal | cdata 0:Emergency state 1:release |
+---------+-------------------------+---------------------------------------+
| 2 | Feed hold signal | cdata 0:Feedhold state 1:release |
+---------+-------------------------+---------------------------------------+
| 3 | Reset signal | cdata 1:Reset status 0:release |
+---------+-------------------------+---------------------------------------+
| 4 | Servo off signal | cdata #7 #6 #5 #4 #3 #2 #1 #0 |
| | | +---+---+---+---+---+---+---+---+ |
| | | | 0 | 0 | | | | | | | |
| | | +---+---+---+---+---+---+---+---+ |
| | | #0 1:1st axis servo off |
| | | 0:1st axis servo on |
| | | ~ |
| | | #5 1:6th axis servo off |
| | | 0:6th axis servo on |
+---------+-------------------------+---------------------------------------+
125
+---------+-------------------------+---------------------------------------+
|operation| operation signal name | set value |
| signal | | |
| number | | |
+---------+-------------------------+---------------------------------------+
| 7 | Rapid traverse signal | cdata 1:set 0:reset |
+---------+-------------------------+---------------------------------------+
| 8 | Start signal | cdata 1:set 0:reset |
+---------+-------------------------+---------------------------------------+
| 9 | Change mode signal | cdata #7 #6 #5 #4 #3 #2 #1 #0 |
| | | +---+---+---+---+---+---+---+---+ |
| | | | 0 | 0 | 0 | 0 | | | | | |
| | | +---+---+---+---+---+---+---+---+ |
| | | #3,#2,#1,#0 |
| | | 0 0 0 0 :MDI |
| | | 0 0 0 1 :MEM |
| | | 0 0 1 0 :EDIT |
| | | 0 0 1 1 :REF |
| | | 0 1 0 0 :JOG |
| | | 0 1 0 1 :INC |
| | | 0 1 1 1 :HNDL |
+---------+-------------------------+---------------------------------------+
| 10 | Feedrate override signal| cdata 00000000 : 0% |
| | | 00000001 : 1% |
| | | 00000010 : 2% |
| | | ... |
| | | 01100100 :100% |
| | | ... |
| | | 11111110 :254% |
| | | 11111111 : 0% |
+---------+-------------------------+---------------------------------------+
| 12 | Torque limit enable | cdata #7 #6 #5 #4 #3 #2 #1 #0 |
| | signal | +---+---+---+---+---+---+---+---+ |
| | | | 0 | 0 | | | | | | | |
| | | +---+---+---+---+---+---+---+---+ |
| | | #0 1:1st axis enable |
| | | 0:1st axis disable |
| | | ~ |
| | | #5 1:6th axis enable |
| | | 0:6th axis disable |
+---------+-------------------------+---------------------------------------+
| 13 | Torque limit signal | axis : 0:for all axes |
| | | 1 - m:for each axis |
| | | (m:number of controlled axis)|
| | | cdata :0 - 255 |
| | | override value |
| | | = ( cdata / 255 ) * 100% |
+---------+-------------------------+---------------------------------------+
| 14 | Jog signal | axis : 0:for all axes |
| | | 1 - m:for each axis |
| | | (m:number of controlled axis)|
| | | cdata #7 #6 #5 #4 #3 #2 #1 #0 |
| | | +---+---+---+---+---+---+---+---+ |
| | | | 0 | 0 | 0 | 0 | | 0 | 0 | | |
| | | +---+---+---+---+---+---+---+---+ |
| | | #3 move direction |
| | | 1:-J 0:+J |
| | | #0 1:move 0:stop |
+---------+-------------------------+---------------------------------------+
| 15 | Single block signal | cdata 1:effective 0:not effective |
+---------+-------------------------+---------------------------------------+
126
Return: EW_OK is returned on successful completion, otherwise any value
except EW_OK is returned. The main error codes are as follows.
(As for the rest, see "Return status of Library".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
Try it again or wait until the procedure of
CNC is finished.
127
(2) Reference point return (Cannot be used on Power Mate-D)
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_refpoint(unsigned short FlibHndl, short path_no,
short nmod, short axis, ODBEXEC *odb);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
7 6 5 4 3 2 1 0 bit
+------+------+------+------+------+------+------+------+
cdata[0][x-1] | | |EMNT16|EMNT15|EMNT14|EMNT13|EMNT12|EMNT11|
+------+------+------+------+------+------+------+------+
cdata[1][x-1] | | |EMNT26|EMNT25|EMNT24|EMNT23|EMNT22|EMNT21|
+------+------+------+------+------+------+------+------ +
+------+------+---------------------------------------+
|EMNT2x|EMNT1x| status |
+------+------+---------------------------------------+
| 0 | 0 | A buffer is empty |
| 0 | 1 | There is data in the buffer 1. |
| 1 | 0 | There is data in the buffer 2. |
| 1 | 1 | A buffer is full. |
+------+------+---------------------------------------+
x : PATH number
128
Return: EW_OK is returned on successful completion, otherwise any value
except EW_OK is returned. The main error codes are as follows.
(As for the rest, see "Return status of Library".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
Try it again or wait until the procedure of
CNC is finished.
Example:
The following program moves the first axis of first PATH to the
reference point and indicates command buffer condition.
#include <stdio.h>
#include "apilib.h"
129
(3) Absolute movement (Cannot be used on Power Mate-D)
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_abspoint(unsigned short FlibHndl,short path_no,
short nmod, short axis, long feed,
ODBPOS *idb, ODBEXEC *odb);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
+--------------+---------------+
| | IS-B |
+--------------+---------------+
| linear axis | 0.001 [mm] |
+--------------+---------------+
| linear axis | 0.0001 [inch] |
+--------------+---------------+
| rotation axis| 0.001 [deg] |
+--------------+---------------+
130
/* each PATH. */
7 6 5 4 3 2 1 0 bit
+------+------+------+------+------+------+------+------+
cdata[0][x-1] | | |EMNT16|EMNT15|EMNT14|EMNT13|EMNT12|EMNT11|
+------+------+------+------+------+------+------+------+
cdata[1][x-1] | | |EMNT26|EMNT25|EMNT24|EMNT23|EMNT22|EMNT21|
+------+------+------+------+------+------+------+------+
+------+------+---------------------------------------+
|EMNT2x|EMNT1x| status |
+------+------+---------------------------------------+
| 0 | 0 | A buffer is empty |
| 0 | 1 | There is data in the buffer 1. |
| 1 | 0 | There is data in the buffer 2. |
| 1 | 1 | A buffer is full. |
+------+------+---------------------------------------+
x : PATH number
131
Example:
The 1st axis of 1st PATH is moved to the position of 100 and 2nd axis
is moved to the position of -100 at the speed 500. The following
program requests the reply about the buffer condition.
(mm output. Least incremental unit is IS-B.)
#include <stdio.h>
#include "apilib.h"
132
(4) Incremental movement (Cannot be used on Power Mate-D)
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_incpoint(unsigned short FlibHndl,short path_no,
short nmod, short axis, long feed,
ODBPOS *idb, ODBEXEC *odb);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
+--------------+---------------+
| | IS-B |
+--------------+---------------+
| linear axis | 0.001 [mm] |
+--------------+---------------+
| linear axis | 0.0001 [inch] |
+--------------+---------------+
| rotation axis| 0.001 [deg] |
+--------------+---------------+
133
/* each PATH. */
7 6 5 4 3 2 1 0 bit
+------+------+------+------+------+------+------+------+
cdata[0][x-1] | | |EMNT16|EMNT15|EMNT14|EMNT13|EMNT12|EMNT11|
+------+------+------+------+------+------+------+------+
cdata[1][x-1] | | |EMNT26|EMNT25|EMNT24|EMNT23|EMNT22|EMNT21|
+------+------+------+------+------+------+------+------+
+------+------+---------------------------------------+
|EMNT2x|EMNT1x| status |
+------+------+---------------------------------------+
| 0 | 0 | A buffer is empty |
| 0 | 1 | There is data in the buffer 1. |
| 1 | 0 | There is data in the buffer 2. |
| 1 | 1 | A buffer is full. |
+------+------+---------------------------------------+
x : PATH number
134
Example:
The 1st axis of 1st PATH is moved to the distance of +100 and 2nd axis
is moved to the distance of -100 at the speed 500. The following
program requests the reply about the buffer condition.
(mm output. Least incremental unit is IS-B.)
#include <stdio.h>
#include "apilib.h"
135
(5) Dwell (Cannot be used on Power Mate-D)
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_dwell(unsigned short FlibHndl, short path_no,
short nmod, short axis, ODBPOS *idb,
ODBEXEC *odb);
Description: Pause the operation of the path specified "path_no" for the time
(sec) specified by "data".
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
136
cdata The condition of the present command buffer is shown.
7 6 5 4 3 2 1 0 bit
+------+------+------+------+------+------+------+------+
cdata[0][x-1] | | |EMNT16|EMNT15|EMNT14|EMNT13|EMNT12|EMNT11|
+------+------+------+------+------+------+------+------+
cdata[1][x-1] | | |EMNT26|EMNT25|EMNT24|EMNT23|EMNT22|EMNT21|
+------+------+------+------+------+------+------+------+
+------+------+---------------------------------------+
|EMNT2x|EMNT1x| status |
+------+------+---------------------------------------+
| 0 | 0 | A buffer is empty |
| 0 | 1 | There is data in the buffer 1. |
| 1 | 0 | There is data in the buffer 2. |
| 1 | 1 | A buffer is full. |
+------+------+---------------------------------------+
x : PATH number
137
(6) Coordinate establishment (Cannot be used on Power Mate-D)
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_coordre(unsigned short FlibHndl, short path_no,
short nmod, short axis, ODBPOS *idb,
ODBEXEC *odb);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
+--------------+---------------+
| | IS-B |
+--------------+---------------+
| linear axis | 0.001 [mm] |
+--------------+---------------+
| linear axis | 0.0001 [inch] |
+--------------+---------------+
| rotation axis| 0.001 [deg] |
+--------------+---------------+
138
cdata The condition of the present command buffer is shown.
7 6 5 4 3 2 1 0 bit
+------+------+------+------+------+------+------+------+
cdata[0][x-1] | | |EMNT16|EMNT15|EMNT14|EMNT13|EMNT12|EMNT11|
+------+------+------+------+------+------+------+------+
cdata[1][x-1] | | |EMNT26|EMNT25|EMNT24|EMNT23|EMNT22|EMNT21|
+------+------+------+------+------+------+------+------+
+------+------+---------------------------------------+
|EMNT2x|EMNT1x| status |
+------+------+---------------------------------------+
| 0 | 0 | A buffer is empty |
| 0 | 1 | There is data in the buffer 1. |
| 1 | 0 | There is data in the buffer 2. |
| 1 | 1 | A buffer is full. |
+------+------+---------------------------------------+
x : PATH number
139
(7) Reading of the executive buffer condition (Cannot be used on Power Mate-D)
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_exebufstat(unsigned short FlibHndl,ODBEXEC *odb);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
7 6 5 4 3 2 1 0 bit
+------+------+------+------+------+------+------+------+
cdata[0][x-1] | | |EMNT16|EMNT15|EMNT14|EMNT13|EMNT12|EMNT11|
+------+------+------+------+------+------+------+------+
cdata[1][x-1] | | |EMNT26|EMNT25|EMNT24|EMNT23|EMNT22|EMNT21|
+------+------+------+------+------+------+------+------+
+------+------+---------------------------------------+
|EMNT2x|EMNT1x| status |
+------+------+---------------------------------------+
| 0 | 0 | A buffer is empty |
| 0 | 1 | There is data in the buffer 1. |
| 1 | 0 | There is data in the buffer 2. |
| 1 | 1 | A buffer is full. |
+------+------+---------------------------------------+
x : PATH number
140
Return: EW_OK is returned on successful completion, otherwise any value
except EW_OK is returned. The main error codes are as follows.
(As for the rest, see "Return status of Library".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
Try it again or wait until the procedure of
CNC is finished.
141
(8) Reading of the execution completion condition (Cannot be used on Power Mate-D)
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_finstate(unsigned short FlibHndl,ODBFIN *odb);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
7 6 5 4 3 2 1 0 bit
+------+------+------+------+------+------+------+------+
cdata[x-1] | | |EMNT63|EMNT15|EMNT14|EMNT13|EMNT12|EMNT11|
+------+------+------+------+------+------+------+------+
EMNT1x: 0 : un-completion
1 : completion
x : PATH number
142
(9) The release of the reading mode of the execution completion condition (Cannot be
used on Power Mate-D)
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_setfin(unsigned short FlibHndl, ODBFIN *idb);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
7 6 5 4 3 2 1 0 bit
+------+------+------+------+------+------+------+------+
cdata[x-1] | | |EMNT63|EMNT15|EMNT14|EMNT13|EMNT12|EMNT11|
+------+------+------+------+------+------+------+------+
EMNT1x: A bit to reset made 1.
x : PATH number
143
1.1.12 Function Reference of Others
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_sysinfo(unsigned short FlibHndl,ODBSYS *sysinfo);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
sysinfo Pointer to the ODBSYS structure for the CNC system information.
ODBSYS 0+---------+
| dummy |
4+---------+
| cnc_type|
6+---------+
| mt_type |
8+---------+-------+
| series |
12+-----------------+
| version |
16+---------+-------+
| axes |
144
18+---------+
Example:
The following information are gotten by execution of this function
on Power Mate (8880-10) system with 4 servo axes.
sysinfo.series = "8880"
sysinfo.version = "0010"
sysinfo.axes = " 4"
145
(2)Read CNC configuration information
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_sysconfig(unsigned short FlibHndl,
ODBSYSC *sysinfo);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
146
} ODBSYSC ;
soft_id Software ID
The software IDs of the modules which are built in the slots are
stored in binary in order of their position.
This array is terminated with FFH. The data subsequent to FFH
are invalid.
40H : CNC
148
(3)Read CNC status information
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_statinfo(unsigned short FlibHndl,ODBST *statinfo);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
149
emergency Status of emergency
0 : (Not emergency)
1 : EMerGency
2 : ReSET
150
(4) Read alarm status
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_alarm(unsigned short FlibHndl,ODBALM *alarm);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
151
Return: EW_OK is returned on successful completion, otherwise any value
except EW_OK is returned.
(As for the rest, see "Return status of Library".)
Example:
The following program displays the kinds of alarms currently arising.
#include <stdio.h>
#include "apilib.h"
152
(5) Read alarm information
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdalminfo(unsigned short FlibHndl,short type,
short alm_type, short length,
ALMINFO *alarminfo);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
153
length Specify the length of the data block(size of ALMINFO structure)
u.alm1.alm 0+-----------------------+
| axis |
2+-----------------------+
| alm_no |
4+-----------------------+
u.alm2.alm 0+-----------------------+
| axis |
2+-----------------------+
| alm_no |
4+-----------------------+
| msg_len |
6+-----------+-----------+
| alm_msg[0]|
7+-----------+
== ==
37+-----------+
| alm_msg[31]
38+-----------+
154
alarminfo Pointer to the ALMINFO structure including the alarm
information.
155
(6) Read modal data
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_modal(unsigned short FlibHndl, short type,
short block, ODBMDL *modal);
The union type which stores the data depends on the type of
modal data(type). therefore in case of accessing data, use the
union corresponding to the type.
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
156
The ODBMDL structure is as follows.
157
(1) Reading modal G code.
7 6 5 4 3 2 1 0
+---+---+---+---+---+---+---+---+
+-- * | Code in each group | : 1 byte
| +---+---+---+---+---+---+---+---+
+----+-----> 0 : Not under command in the present block
+-----> 1 : Under command in the present block
N090 G18 ;
N100 G1 Z100. ;
N110 G17 G2 X10. Y-20. R12. ;
158
(2) Reading modal data other than G code.
type Address
-------+------------------------
100 B (2nd auxiliary function)
101 D
102 E
103 F
104 H
105 L
106 M
107 S
108 T
109 R
110 P
111 Q
112 A
113 C
114 I
115 J
116 K
117 N
118 O
119 U
120 V
121 W
122 X
123 Y
124 Z
125 M2
126 M3
-------+------------------------
200 1st axis
201 2nd axis
202 3rd axis
203 4th axis
204 5th axis
205 6th axis
-------+------------------------
159
+-------------------------------+-
| Data | : 4 byte
+-------------------------------+
+---| FLAG1 | : 1 byte
| +-------------------------------+
+-+---| FLAG2 | : 1 byte
| | +-------------------------------+
| | 7 6 5 4 3 2 1 0
| | +---+---+---+---+---+---+---+---+
| +-->| | | |---|Number of input place
| +---+---+---+---+---+---+---+---+
| | | +----> 0 : Positive
| | | +----> 1 : Negative
| | +--------> 0 : There is no command of a decimal point.
| | +--------> 1 : There is a command of a decimal point.
| +------------> 0 : There is no command in the present block.
| +------------> 1 : There is a command in the present block.
| +---+---+---+---+---+---+---+---+
+---->|---|---|---|---|---|Number of places of decimals
+---+---+---+---+---+---+---+---+
160
(7) Read diagnosis data
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_diagnoss(unsigned short FlibHndl,short number,
short axis, short length, ODBDGN *diag);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
161
no axis/1 axis all axes
ODBDGN 0 +-------+ --- 0 +-------+ ---
|datano | ^ |datano | ^
2 +-------+ | 2 +-------+ |
|type | length |type | length
4 +-------+-------+ | 4 +-------+-------+ |
| ldata | v |ldatas[0] :1st| |
8 +---------------+--- 8 +---------------+ |
= = |
4+2x(n-1) +---------------+ |
|ldatas[n-1]:n-th v
4+2xn +---------------+---
n : Current controlled axes
162
(8) Read diagnosis data(area specified)
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_diagnosr(unsigned short FlibHndl,
(short *)&s_number, short axis,
(short *)&e_number,(short *)&length,
(void *)diag);
The attribute of CNC diagnosis depends on the type and axis, and
it is different for each diagnosis.
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
163
axis Specify the axis number.
0 : assigns no axis
1,..,m : assigns 1 axis(m=max. controlled axes)
ALL_AXES : assigns all axes(ALL_AXES=-1)
length Specify the data block length which is enough to store the
specified diagnosis.
The structure per 1 diagnosis is as follows, and each diagnosis
is lined up in order of number.
[= Sum of (4+(byte size of each diagnosis)*(number of axis))]
164
datano Diagnosis number which was read is stored.
165
(9) Read maximum valid figures, number of decimal places
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_getfigure(unsigned short FlibHndl,short data_type,
short *valid_fig, short *dec_fig_in,
short *dec_fig_out);
Description: Reads the maximum valid figures, number of digits below decimal
point by unit of input and output, which is related to various
data of CNC.
The value which can be read in the window library is binary data
by set unit of the CNC side. Therefore, it is necessary to
display decimal point position etc. in consideration of set
unit.
166
2) tool offset
The number of digits below the decimal point under the
input unit only at the first axis part is valid, and it
under the output unit is invalid.
[mm] [inch]
--------+--------
3 4 IS-B
3) custom macro
The number of digits below the decimal point under the
input unit only at the first axis part is valid, and it
under the output unit is invalid.
[mm] [inch]
--------+--------
3 4 IS-B
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
valid_fig Specify the address of the variable to store with the maximum
valid figures.
dec_fig_in Specify the address of the array to store with the number of
digits below decimal point under the input unit.
The number of array must be equal to the number of maximum
controlled axis.
(In the case except axis type data, only the top of array is
valid.)
dec_fig_out Specify the address of the array to store with the number of
digits below decimal point under the output unit.
The number of array must be equal to the number of maximum
controlled axis.
(In the case except axis type data, only the top of array is
valid.)
167
(10) Read real current for servo adjustment
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdcurrent(unsigned short FlibHndl,short *crrnt);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
crrnt Specify the address of the array to store with the real current
for servo adjustment.
The number of array must be equal to the number of maximum
controlled axis.
Actually the object within the number of controlled axis is
valid.
short crrnt[MAX_AXIS] ; /* MAX_AXIS : max. controlled axes */
168
(11) Read real speed for servo adjustment
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdsrvspeed(unsigned short FlibHndl,long *speed);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
speed Specify the address of the array to store with the real speed
for servo adjustment.
The number of array must be equal to the number of maximum
controlled axis.
Actually the object within the number of controlled axis is
valid.
long speed[MAX_AXIS] ; /* MAX_AXIS : max. controlled axes */
169
(12) Read loop gain for servo adjustment
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdloopgain(unsigned short FlibHndl,long *gain);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
gain Specify the address of the array to store with the loop gain
for servo adjustment.
The number of array must be equal to the number of maximum
controlled axis.
Actually the object within the number of controlled axis is
valid.
long gain[MAX_AXIS] ; /* MAX_AXIS : max. controlled axes */
170
(13) Read operator's message
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdopmsg(unsigned short FlibHndl, short type,
short length, OPMSG *opmsg);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
0+-----------------------+ ----
| datano | ^
2+-----------------------+ |
| type | |
4+-----------------------+ |
| char_num | |
6+-----------+-----------+ length
| data[0] | |
7+-----------+ |
== == |
6+255+-----------+ |
| data[255]| v
6+256+-----------+ ----
171
'\0' is set at the end of strings.
Example:
The following program reads the operator's message and displays it.
#include <stdio.h>
#include "apilib.h"
172
(14) Read output signal image of software operator's panel
Function Name: cnc_rdopnlsgnl
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdopnlsgnl(unsigned short FlibHndl,
short slct_data, IODBSGNL *sgnl);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
173
datano Not used
174
(15) Write output signal of software operator's panel
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_wropnlsgnl(unsigned short FlibHndl,
IODBSGNL *sgnl);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
175
mode Specify the mode signal.
0 : MDI 3 : HNDL or INC
1 : MEM 4 : JOG
2 : EDIT 5 : REF
176
(16) Read general signal image of software operator's panel
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdopnlgnrl(unsigned short FlibHndl,
short slct_data, IODBGNRL *opnlgnrl);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
177
(17) Write general output signal of software operator's panel
Function Name: cnc_wropnlgnrl
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_wropnlgnrl(unsigned short FlibHndl,
IODBGNRL *opnlgnrl);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
178
(18) Read general signal name of software operator's panel
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_rdopnlgsname(unsigned short FlibHndl,
short slct_data, IODBRDNA *brdna);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
179
The specified name is set.
For the end of name(sgnl?_name[8]), NULL character('\0') is set.
180
(19) Write general signal name of software operator's panel
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI cnc_wropnlgsname(unsigned short FlibHndl,
IODBRDNA *brdna);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
181
(sgnl?_name[0] - sgnl?_name[7]) is set in CNC.
182
1.1.13 Function Reference Related to PMC
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI pmc_rdpmcrng(unsigned short FlibHndl,short adr_type,
short data_type, short s_number,
short e_number, short length,
IODBPMC *buf);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
(*) It is not possible to write to all areas of address 'F' and 'X',
and "R9000",... Moreover, "K0017",..,"K0019".
(*) See the "PROGRAMMING MANUAL" of PMC about CNC which each PMC can
correspond.
183
buf Pointer to the IODBPMC structure.
184
(2) Write PMC data(area specified)
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI pmc_wrpmcrng(unsigned short FlibHndl,short length,
IODBPMC *buf);
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
185
Example of specifying argument
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(1) 250 is written in D0100(It is assumed the word type)
buf.type_a 9
buf.type_d 1
buf.datano_s 100
buf.datano_e 101
length 8+2*1 (=10)
buf.u.idata[0] 250
186
(3) Read PMC data information
Declaration:
#include "Fwlib32.h"
FWLIBAPI short WINAPI pmc_rdpmcinfo(unsigned short FlibHndl,short adr_type,
ODBPMCINF *pmcif);
Description: Read the data information about the attribute of each kind of
PMC,the effective range of address, etc.
Arguments:
FlibHndl Identify the process which uses the library.
The library steering wheel acquired with cnc_allclibhndl() or
cnc_allclibhndl2() is specified.
187
Return: EW_OK is returned on successful completion, otherwise any value
except EW_OK is returned. The main error codes are as follows.
(As for the rest, see "Return status of Library".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_ATTRIB data attribute error
Kind of data(adr_type)is improper.
188
· No part of this manual may be
reproduced in any form.