Vous êtes sur la page 1sur 831

GE Fanuc Automation

Computer Numerical Control Products

Windows '95 and Windows NT


32-Bit Drivers and Libraries
for Open CNC Systems

Reference Manual

GFK-1365B November 1997


GFL-001
Warnings, Cautions, and Notes
as Used in this Publication

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.

GE Fanuc Automation makes no representation or warranty, expressed, implied, or statutory


with respect to, and assumes no responsibility for the accuracy, completeness, sufficiency, or
usefulness of the information contained herein. No warranties of merchantability or fitness for
purpose shall apply.

©Copyright 1997 GE Fanuc Automation North America, Inc.


All Rights Reserved.
Introduction ______________________________________________________________________ 8
1. Extended Libraries_______________________________________________________________ 9
1.1 CNC/PMC Data Window Library for Windows 95 ____________________________________ 9
1.1.1 Outline ___________________________________________________________________________9
1.1.2 General Description________________________________________________________________10
1.1.3 Library Handle ___________________________________________________________________12
(1) Library Handle Description. __________________________________________________________________ 12
(2) Library Handle Cautions. ____________________________________________________________________ 13
1.1.4 Return Status of Data Window Function_______________________________________________14
1.1.5 Function List _____________________________________________________________________18
CNC: Multi-Connection of HSSB_________________________________________________________________ 18
CNC: Functions Related to Controlled Axis/Spindle __________________________________________________ 18
CNC: Functions Related to CNC Program __________________________________________________________ 19
CNC: Functions Related to CNC File Data _________________________________________________________ 20
CNC: Functions Related to Tool Life Management Data_______________________________________________ 22
CNC: Functions Related to History Data ___________________________________________________________ 23
CNC: Functions Related to Servo/Spindle __________________________________________________________ 23
CNC: Functions Related to Data Server, DNC1, DNC2, OSI-Ethernet____________________________________ 24
CNC: Functions Related to PUNCH PRESS_________________________________________________________ 25
CNC: Functions Related to LASER _______________________________________________________________ 26
CNC: Functions Related to Servo Learning Data_____________________________________________________ 27
CNC: Functions Related to Others ________________________________________________________________ 27
CNC: Functions Related to PMC _________________________________________________________________ 28
1.1.6 Multi-Connection of HSSB __________________________________________________________29
Structure of library for multi-connection ___________________________________________________________ 29
(1) Allocate the Library Handle (for Multi-Connection) (Version 1.2 and newer) ___________________________ 30
(2) Read the Number of Node (Version 1.2 and newer) ________________________________________________ 31
(3) Read the Node Information (Version 1.2 and newer) _______________________________________________ 32
(4) Set the Default Node Number (Version 1.2 and newer) _____________________________________________ 34
1.1.7 Function Reference Related to Controlled Axes/Spindle __________________________________35
(1) Read Actual Axis Feedrate (F) ________________________________________________________________ 35
(2) Read Absolute Axis Position __________________________________________________________________ 37
(3) Read Machine Axis Position __________________________________________________________________ 39
(4) Read Relative Axis Position __________________________________________________________________ 41
(5) Read Distance to Go ________________________________________________________________________ 43
(6) Read Skip Position__________________________________________________________________________ 45
(7) Read Servo Delay Value _____________________________________________________________________ 47
(8) Read Acceleration/Deceleration Delay Value _____________________________________________________ 49
(9) Read All Dynamic Data______________________________________________________________________ 51
(10) Set Origin / Preset Relative Axis Position_______________________________________________________ 56
(11) Preset Work Coordinate_____________________________________________________________________ 58
(12) Read Manual Overlapped Motion Value________________________________________________________ 60
(13) Cancel Manual Overlapped Motion Value ______________________________________________________ 63
(14) Read Actual Spindle Speed (S) _______________________________________________________________ 65
(15) Read Load Information of Serial Spindle _______________________________________________________ 67
(16) Read Maximum RPM Ratio of Serial Spindle ___________________________________________________ 69
(17) Read Gear Ratio of Serial Spindle_____________________________________________________________ 71
(18) Read tool tip coordinates for 3-dimensional handle feed(Version 1.3 and newer)________________________ 73
(19) Read handle interrupt pulse amount for 3-dimensional handle feed(Version 1.3 and newer) _______________ 75

1
(20) Read handle interrupt move amount for 3-dimensional handle feed(Version 1.3 and newer)_______________ 77
(21) Read the modification of tool length compensation amount in tool axis direction(Version 1.3 and newer) ____ 79
(22) Clear handle interrupt pulse amount and move amount for 3-dimensional handle feed(version 1.3 and newer) 81
(23) Read absolute axis position 2 (Version 1.4 and newer) ____________________________________________ 83
(24) Read relative axis position 2 (Version 1.4 and newer) _____________________________________________ 84
1.1.8 Function Reference Related to Program _______________________________________________85
(1) Start Downloading NC Program _______________________________________________________________ 85
(2) Download NC Program ______________________________________________________________________ 87
(3) Download NC Program (Conditional) __________________________________________________________ 90
(4) End of Downloading NC Program _____________________________________________________________ 92
(5) Start Verification of NC Program ______________________________________________________________ 94
(6) Verify NC Program _________________________________________________________________________ 96
(7) Verify NC Program (Conditional)______________________________________________________________ 99
(8) End of Verification ________________________________________________________________________ 101
(9) Start Downloading DNC Program ____________________________________________________________ 103
(10) Download DNC Program __________________________________________________________________ 105
(11) Download DNC Program (Conditional) _______________________________________________________ 109
(12) End of Downloading DNC Program __________________________________________________________ 111
(13) Start downloading DNC program (2) (Version 1.4 and newer) _____________________________________ 113
(14) Download DNC program (2) (Version 1.4 and newer)____________________________________________ 116
(15) End of downloading DNC program (2) (Version 1.4 and newer) ___________________________________ 119
(16) Read the diagnosis data of downloading DNC program (Version 1.4 and newer)_______________________ 121
(17) Start Uploading NC Program _______________________________________________________________ 123
(18) Upload NC Program ______________________________________________________________________ 125
(19) Upload NC Program (Conditional) ___________________________________________________________ 128
(20) End of Uploading NC Program ______________________________________________________________ 130
(21) Read Buffer Status for Downloading/Verification NC Program_____________________________________ 131
(22) Search Specified Program __________________________________________________________________ 133
(23) Delete All Programs ______________________________________________________________________ 135
(24) Delete Specified Program __________________________________________________________________ 137
(25) Read Program Directory ___________________________________________________________________ 139
(26) Read Program Directory (2) ________________________________________________________________ 142
(27) Read Program Information _________________________________________________________________ 144
(28) Read Program Number under Execution_______________________________________________________ 146
(29) Read Sequence Number under Execution ______________________________________________________ 148
(30) Search Specified Sequence Number __________________________________________________________ 150
(31) Rewind Cursor of NC Program ______________________________________________________________ 151
(32) Read Block Counter_______________________________________________________________________ 152
(33) Read Program under Execution______________________________________________________________ 153
(34) Write Program for MDI Operation ___________________________________________________________ 155
(35) Read Execution Pointer for MDI Operation ____________________________________________________ 157
(36) Write Execution Pointer for MDI Operation____________________________________________________ 159
(37) Read Processing Time Stamp Data ___________________________________________________________ 161
(38) Read Directory for Processing Time Stamp Data ________________________________________________ 163
1.1.9 Function Reference Related to NC File Data___________________________________________165
(1) Read Tool Offset Value _____________________________________________________________________ 165
(2) Write Tool Offset Value ____________________________________________________________________ 168
(3) Read Tool Offset Value (Area Specified) _______________________________________________________ 172
(4) Write Tool Offset Value (Area Specified)_______________________________________________________ 176
(5) Read Tool Offset Information ________________________________________________________________ 179
(6) Read Work Zero Offset Value ________________________________________________________________ 181
(7) Write Work Zero Offset Value _______________________________________________________________ 184
(8) Read Work Zero Offset Value (Area Specified) __________________________________________________ 187
(9) Write Work Zero Offset Value (Area Specified)__________________________________________________ 190
(10) Read Work Zero Offset Information (Area Specified) ____________________________________________ 193
(11) Read Parameter __________________________________________________________________________ 195

2
(12) Write Parameter__________________________________________________________________________ 198
(13) Read Parameter (Area Specified) ____________________________________________________________ 201
(14) Write Parameter (Area Specified) ____________________________________________________________ 205
(15) Read Parameter Information ________________________________________________________________ 208
(16) Read Minimum, Maximum, Total Number of Parameter__________________________________________ 210
(17) Read Setting Data ________________________________________________________________________ 212
(18) Write Setting Data________________________________________________________________________ 215
(19) Read Setting Data (Area Specified)___________________________________________________________ 218
(20) Write Setting Data (Area Specified) __________________________________________________________ 222
(21) Read Setting Data Information ______________________________________________________________ 225
(22) Read Minimum, Maximum, Total Number of Setting Data ________________________________________ 227
(23) Read Pitch Error Compensation Data (Area Specified) ___________________________________________ 229
(24) Write Pitch Error Compensation Data (Area Specified)___________________________________________ 231
(25) Read Pitch Error Compensation Data Information_______________________________________________ 233
(26) Read Custom Macro Variable _______________________________________________________________ 235
(27) Write Custom Macro Variable ______________________________________________________________ 238
(28) Read Custom Macro Variable (Area Specified) _________________________________________________ 241
(29) Write Custom Macro Variable (Area Specified)_________________________________________________ 244
(30) Read Custom Macro Variable Information _____________________________________________________ 247
(31) Get Type of Custom Macro Variable__________________________________________________________ 249
(32) Set Type of Custom Macro Variable __________________________________________________________ 250
(33) Read P Code Macro Variable _______________________________________________________________ 251
(34) Write P Code Macro Variable _______________________________________________________________ 253
(35) Read P Code Macro Variable (Area Specified)__________________________________________________ 255
(36) Write P Code Macro Variable (Area Specified) _________________________________________________ 258
(37) Read P Code Macro Variable Information _____________________________________________________ 261
(38) Get Type of P Code Macro Variable __________________________________________________________ 264
(39) Set Type of P Code Macro Variable __________________________________________________________ 265
(40) Read M Code Group Data __________________________________________________________________ 266
(41) Write M Code Group Data _________________________________________________________________ 268
(42) Read M Code Group Data (Executing, Executed M Code)_________________________________________ 270
(43) Read M Code Group Data (for Program Restart) ________________________________________________ 272
(44) Read Interference Check Data (Area Specified) _________________________________________________ 274
(45) Write Interference Check Data (Area Specified) ________________________________________________ 277
(46) Read Interference Check Data Information_____________________________________________________ 281
(47) Read Setting Data for High-Speed and High-Precision Machining __________________________________ 283
(48) Write Setting Data for High-Speed and High-Precision Machining _________________________________ 286
(49) Set Setting Data for High-Speed and High-Precision Machining Automatically________________________ 289
(50) Read Tuning Data (Parameter Input) for High-Speed and High-Precision Machining ___________________ 291
(51) Write Tuning Data (Parameter Input) for High-Speed and High-Precision Machining __________________ 294
(52) Read Tuning Data (Acc./Dec. Input) for High-Speed and High-Precision Machining ___________________ 297
(53) Write Tuning Data (Acc./Dec. Input) for High-Speed and High-Precision Machining___________________ 300
(54) Tune Up Tuning Data for High-Speed and High-Precision Machining Automatically ___________________ 303
(55) Read Fine Level for High-Speed and High-Precision Machining____________________________________ 305
(56) Select Fine Level for High-Speed and High-Precision Machining ___________________________________ 306
(57) Read Active Fixture Offset _________________________________________________________________ 308
(58) Read Fixture Offset Value (Area Specified) ____________________________________________________ 310
(59) Write Fixture Offset Value (Area Specified)____________________________________________________ 313
(60) Read Work Coordinate Shift Value___________________________________________________________ 316
(61) Write Work Coordinate Shift Value __________________________________________________________ 318
(62) Read Work Coordinate Shift Measured Value __________________________________________________ 320
(63) Write Work Coordinate Shift Measured Value__________________________________________________ 322
(64) Read Tool Offset Value for B Axis (Area Specified) _____________________________________________ 324
(65) Write Tool Offset Value for B Axis (Area Specified) _____________________________________________ 327
(66) Read Tool Offset Information for B Axis ______________________________________________________ 329
(67) Read Command Data for B Axis_____________________________________________________________ 331

3
1.1.10 Function Reference Related to Tool Life Management Data _____________________________333
(1) Read Tool Life Management Data (Tool Group Number) __________________________________________ 333
(2) Read Tool Life Management Data (Number of Tool Groups) _______________________________________ 335
(3) Read Tool Life Management Data (Number of Tools) _____________________________________________ 337
(4) Read Tool Life Management Data (Tool Life) ___________________________________________________ 339
(5) Read Tool Life Management Data (Tool Lift Counter) ____________________________________________ 341
(6) Read Tool Life Management Data (Tool Length Number-1) ________________________________________ 343
(7) Read Tool Life Management Data (Tool Length Number-2) ________________________________________ 345
(8) Read Tool Life Management Data (Cutter Compensation No.-1) ____________________________________ 347
(9) Read Tool Life Management Data (Cutter Compensation No.-2) ____________________________________ 349
(10) Read Tool Life Management Data (Tool Information-1) __________________________________________ 351
(11) Read Tool Life Management Data (Tool Information-2) __________________________________________ 353
(12) Read Tool Life Management Data (Tool Number) _______________________________________________ 355
(13) Read Tool Life Management Data (Tool Number, Tool Life, Tool Life Counter) (Area Specified) _________ 357
(14) Read Tool Life Management Data (All Data within Group) _______________________________________ 359
(15) Write Tool Life Management Data (Tool Life Counter) (Area Specified) _____________________________ 362
(16) Read Tool Life Management Data (Used Tool Group Number)_____________________________________ 364
(17) Read Tool Life Management Data (Maximum Number of Tool Groups) _____________________________ 366
(18) Read Tool Life Management Data (Maximum Number of Tool within Group) ________________________ 368
(19) Read Tool Life Management Data (Used Tool No. within Group)___________________________________ 370
(20) Read Tool Life Management Data (Tool Data1)_________________________________________________ 372
(21) Read Tool Life Management Data (Tool Data 2) ________________________________________________ 374
(22) Write Tool Life Management Data (Tool Data 1) _______________________________________________ 376
(23) Write Tool Life Management Data (Tool Data 2) _______________________________________________ 378
(24) Read Tool Life Management Data (Tool Group Information) ______________________________________ 380
(25) Write Tool Life Management Data (Tool Group Information)______________________________________ 383
(26) Delete Tool Life Management Data (Tool Group) _______________________________________________ 386
(27) Insert Tool Life Management Data (Tool Data) _________________________________________________ 388
(28) Delete Tool Life Management Data (Tool Data) ________________________________________________ 390
(29) Clear Tool Life Management Data (Tool Life Counter, Tool Information) (Area Specified) ______________ 392
1.1.11 Function Reference Related to History Data__________________________________________394
(1) Stop Logging Operation History Data__________________________________________________________ 394
(2) Restart Logging Operation History Data________________________________________________________ 395
(3) Read Number of Operation History Data _______________________________________________________ 396
(4) Read Operation History Data_________________________________________________________________ 397
(5) Read Number of Alarm History Data __________________________________________________________ 403
(6) Read Alarm History Data ___________________________________________________________________ 404
(7) Clear Operation History Data ________________________________________________________________ 408
(8) Read Signals Related Operation History ________________________________________________________ 410
(9) Write Signals Related Operation History _______________________________________________________ 412
(10) Stop Logging External Operator's Message History Data__________________________________________ 414
(11) Restart Logging External Operator's Message History Data________________________________________ 416
(12) Read External Operator's Message History Data Information ______________________________________ 417
(13) Read External Operator's Message History Data ________________________________________________ 419
(14) Clear External Operator's Message History Data ________________________________________________ 421
1.1.12 Function Reference Related to Servo/Spindle _________________________________________422
(1) Read Loop Gain for Servo Adjustment _________________________________________________________ 422
(2) Read Real Current for Servo Adjustment _______________________________________________________ 423
(3) Read Real Speed for Servo Adjustment_________________________________________________________ 425
(4) Read Number of Spindle ____________________________________________________________________ 426
(5) Read Operation Mode for Spindle Adjustment ___________________________________________________ 428
(6) Read Position Deflection S for Spindle Adjustment _______________________________________________ 430
(7) Read Position Deflection S1, S2 for Spindle Adjustment (Synchronous Control Mode) ___________________ 432
(8) Read Position Deflection Z of Tapping Axis for Spindle Adjustment (Rigid Tapping Mode)_______________ 434
(9) Read Synchronous Error for Spindle Adjustment (Synchronous Control Mode)_________________________ 436

4
(10) Read Synchronous Error for Spindle Adjustment (Rigid Tapping Mode) _____________________________ 438
(11) Read Spindle Alarm for Spindle Monitor ______________________________________________________ 440
(12) Read Control Input Signal for Spindle Monitor _________________________________________________ 442
(13) Read Control Output Signal for Spindle Monitor ________________________________________________ 445
(14) Read Waveform Diagnosis Parameter_________________________________________________________ 447
(15) Write Waveform Diagnosis Parameter ________________________________________________________ 454
(16) Start Sampling Waveform Diagnosis Data _____________________________________________________ 462
(17) Stop Sampling Waveform Diagnosis Data _____________________________________________________ 464
(18) Read Sampling Status of Waveform Diagnosis Data _____________________________________________ 465
(19) Read Waveform Diagnosis Data _____________________________________________________________ 467
1.1.13 Function Reference Related to Data Server, DNC1, DNC2, OSI-Ethernet _________________472
(1) Transfer File from Host to Data Server_________________________________________________________ 472
(2) Transfer File from Data Server to Host_________________________________________________________ 475
(3) Read Status of File Transfer between Host and Data Server_________________________________________ 478
(4) Read Directory in Data Server________________________________________________________________ 480
(5) Delete File in Data Server ___________________________________________________________________ 483
(6) Download from Data Server to CNC___________________________________________________________ 485
(7) Upload from CNC to Data Server _____________________________________________________________ 488
(8) Cancel Upload/Download between Data Server and CNC __________________________________________ 491
(9) Read Upload/Download Status between Data Server and CNC ______________________________________ 492
(10) Get DNC Operation File Name in Data Server__________________________________________________ 494
(11) Set DNC Operation File Name in Data Server __________________________________________________ 495
(12) Read Setting Data for Data Server ___________________________________________________________ 497
(13) Write Setting Data for Data Server ___________________________________________________________ 499
(14) Check Hard Disk on Data Server ____________________________________________________________ 501
(15) Format Hard Disk on Data Server____________________________________________________________ 503
(16) Save I/F Buffer for Data Server______________________________________________________________ 505
(17) Read I/F Buffer for Data Server _____________________________________________________________ 506
(18) Read Maintenance Information for Data Server _________________________________________________ 508
(19) Get Mode of Data Server ___________________________________________________________________ 510
(20) Set Mode of Data Server ___________________________________________________________________ 511
(21) Read Error Message for Data Server__________________________________________________________ 513
(22) Read DNC File Name for DNC1,DNC2,OSI-Ethernet____________________________________________ 515
(23) Write DNC File Name for DNC1,DNC2,OSI-Ethernet ___________________________________________ 517
(24) Read Communication Parameter for DNC1,DNC2,OSI-Ethernet ___________________________________ 519
(25) Write Communication Parameter for DNC1,DNC2,OSI-Ethernet___________________________________ 524
(26) Read Logging Message for DNC2____________________________________________________________ 529
(27) Read Operator's Message for DNC1,DNC2 ____________________________________________________ 531
(28) Read Receipt Message for OSI-Ethernet _______________________________________________________ 533
(29) Read Sending Message for OSI-Ethernet ______________________________________________________ 535
(30) Send Message for OSI-Ethernet _____________________________________________________________ 537
(31) Clear Message Buffer for OSI-Ethernet _______________________________________________________ 539
(32) Read Receipt Status of Message for OSI-Ethernet _______________________________________________ 540
1.1.14 Function Reference Related to PUNCH PRESS _______________________________________542
(1) Read Tool Control Data_____________________________________________________________________ 542
(2) Write Tool Control Data ____________________________________________________________________ 544
(3) Read Tool Data ___________________________________________________________________________ 546
(4) Write Tool Data___________________________________________________________________________ 549
(5) Read Multiple Tool Data ____________________________________________________________________ 553
(6) Write Multiple Tool Data ___________________________________________________________________ 556
(7) Read Safety Zone Data _____________________________________________________________________ 559
(8) Write Safety Zone Data _____________________________________________________________________ 561
(9) Read Tool Zone Data_______________________________________________________________________ 563
(10) Write Tool Zone Data _____________________________________________________________________ 565
(11) Read Actual Tool Zone Data ________________________________________________________________ 567
(12) Read Number of Automatic Setting Zone ______________________________________________________ 569

5
(13) Write Number of Automatic Setting Zone _____________________________________________________ 570
1.1.15 Function Reference Related to LASER ______________________________________________571
(1) Read Cutting Condition File (Cutting Data)_____________________________________________________ 571
(2) Write Cutting Condition File (Cutting Data) ____________________________________________________ 574
(3) Read Cutting Condition File (Piercing Data) ____________________________________________________ 577
(4) Write Cutting Condition File (Piercing Data)____________________________________________________ 580
(5) Read Cutting Condition File (Edge Cutting Data) ________________________________________________ 583
(6) Write Cutting Condition File (Edge Cutting Data)________________________________________________ 586
(7) Read Cutting Condition File (Slope Control Data)________________________________________________ 589
(8) Write Cutting Condition File (Slope Control Data) _______________________________________________ 592
(9) Read Duty Data for Power Control ____________________________________________________________ 595
(10) Write Duty Data for Power Control___________________________________________________________ 597
(11) Read Laser Power Data ____________________________________________________________________ 599
(12) Read Power Compensation Coefficient ________________________________________________________ 601
(13) Write Power Compensation Coefficient _______________________________________________________ 602
(14) Read Assist Gas Selection __________________________________________________________________ 603
(15) Write Assist Gas Selection _________________________________________________________________ 605
(16) Read Assist Gas Flow _____________________________________________________________________ 607
(17) Write Assist Gas Flow _____________________________________________________________________ 609
(18) Read Laser Power for Contouring ____________________________________________________________ 611
(19) Write Laser Power for Contouring ___________________________________________________________ 613
(20) Read Laser Power for Piercing ______________________________________________________________ 615
(21) Write Laser Power for Piercing ______________________________________________________________ 617
(22) Read Command Data of Laser_______________________________________________________________ 619
(23) Read Command Data of Reference Displace____________________________________________________ 621
(24) Write Command Data of Reference Displace ___________________________________________________ 622
(25) Read Error of Z-Axis Tracing _______________________________________________________________ 623
(26) Read Active Cutting Number / Piercing Number / Slope Number ___________________________________ 624
(27) Read Comment Data ______________________________________________________________________ 626
(28) Read Laser Power Selection ________________________________________________________________ 628
(29) Write Laser Power Selection ________________________________________________________________ 629
(30) Read Laser Power Control__________________________________________________________________ 631
(31) Write Laser Power Control _________________________________________________________________ 632
1.1.16 Function Reference of Servo Learning Data __________________________________________633
(1) Start of reading servo learning data ___________________________________________________________ 633
(2) Reading of the data from I/F buffer for the servo learning data ______________________________________ 635
(3) End of reading servo learning data ____________________________________________________________ 637
(4) Start of writing servo learning data____________________________________________________________ 638
(5) Writing of the data to I/F buffer for the servo learning data_________________________________________ 640
(6) End of writing servo learning data ____________________________________________________________ 642
(7) Stop of reading/writing of the servo learning data ________________________________________________ 643
1.1.17 Function Reference of Others ______________________________________________________644
(1) Read CNC System Information _______________________________________________________________ 644
(2) Read CNC Configuration Information _________________________________________________________ 647
(3) Read Series/Version of CNC System Software ___________________________________________________ 667
(4) Read Module Configuration of CNC System ____________________________________________________ 672
(5) Read Module Configuration of CNC System (2) _________________________________________________ 679
(6) Read CNC Status Information________________________________________________________________ 690
(7) Read Alarm Status_________________________________________________________________________ 694
(8) Read Alarm Information ____________________________________________________________________ 696
(9) Read Modal Data __________________________________________________________________________ 701
(10) Read Diagnosis Data ______________________________________________________________________ 716
(11) Read Diagnosis Data (Area Specified) ________________________________________________________ 719
(12) Read Diagnosis Information ________________________________________________________________ 723
(13) Read Minimum, Maximum, Total Number of Diagnosis __________________________________________ 725

6
(14) Read A/D Conversion Data _________________________________________________________________ 727
(15) Read Operator's Message___________________________________________________________________ 731
(16) Read Program Restart Information ___________________________________________________________ 735
(17) Search Sequence Number for Program Restart __________________________________________________ 737
(18) Search Sequence Number for Program Restart (2) _______________________________________________ 739
(19) Read Block Restart Information _____________________________________________________________ 741
(20) Read Output Signal Image of Software Operator's Panel __________________________________________ 743
(21) Write Output Signal of Software Operator's Panel _______________________________________________ 747
(22) Read General Signal Image of Software Operator's Panel _________________________________________ 751
(23) Write General Output Signal of Software Operator's Panel ________________________________________ 753
(24) Read General Signal Name of Software Operator's Panel _________________________________________ 755
(25) Write General Signal Name of Software Operator's Panel _________________________________________ 757
(26) Read Menu Switch Signal __________________________________________________________________ 759
(27) Write Menu Switch Signal _________________________________________________________________ 761
(28) Read Internal Position Compensation Data (Cutter Compensation / Tool Nose Radius Compensation) _____ 763
(29) Read Internal Position Compensation Data (Tool Length Compensation)_____________________________ 765
(30) Read Internal Position Compensation Data (Canned Cycle) _______________________________________ 767
(31) Read Internal Position Compensation Data (Coordinate Rotation) __________________________________ 770
(32) Read Internal Position Compensation Data (3-D Coordinate Conversion) ____________________________ 772
(33) Read Internal Position Compensation Data (Programmable Mirror Image) ___________________________ 774
(34) Read Internal Position Compensation Data (Scaling)_____________________________________________ 776
(35) Read Internal Position Compensation Data (3-D Tool Compensation) _______________________________ 778
(36) Read Internal Position Compensation Data (Tool Position Compensation)____________________________ 780
(37) Read Maximum Valid Figures, Number of Decimal Places ________________________________________ 782
(38) Get Current Screen _______________________________________________________________________ 786
(39) Select Screen ____________________________________________________________________________ 787
(40) Get Path Number (for 4 Axes Lathes, Multi-Path and Loader Control)_______________________________ 788
(41) Set Path Number (for 4 Axes Lathes, Multi-Path and Loader Control) _______________________________ 789
(42) Allocate Library Handle ___________________________________________________________________ 791
(43) Free Library Handle_______________________________________________________________________ 792
(44) Get Detail Error For CNC __________________________________________________________________ 793
(45) Get calendar timer of CNC (Version 1.4 and newer) _____________________________________________ 794
(46) Set calendar timer of CNC (Version 1.4 and newer) _____________________________________________ 796
1.1.18 Function Reference Related to PMC ________________________________________________798
(1) Read Message from PMC to MMC ____________________________________________________________ 798
(2) Write Message from MMC to PMC ___________________________________________________________ 800
(3) Read Message from PMC to MMC (Conditional) ________________________________________________ 802
(4) Write Message from MMC to PMC (Conditional) ________________________________________________ 804
(5) Read PMC Data (Area Specified) _____________________________________________________________ 806
(6) Write PMC Data (Area Specified)_____________________________________________________________ 810
(7) Read PMC Data Information_________________________________________________________________ 812
(8) Read Control Data of PMC Data Table_________________________________________________________ 814
(9) Write Control Data of PMC Data Table ________________________________________________________ 817
(10) Read the Sum Total Group of Control Data of PMC Data Table ____________________________________ 820
(11) Write the Sum Total Group of Control Data of PMC Data Table ___________________________________ 821
(12) Read Data from Extended Backup Memory ____________________________________________________ 822
(13) Write Data to Extended Backup Memory ______________________________________________________ 824
(14) Read Maximum Size of Extended Backup Memory ______________________________________________ 826
(15) Get Detail Error for PMC __________________________________________________________________ 828

7
Introduction
This manual describes the information necessary for developing the
application software of the following FANUC CNC, incorporating the MMC-IV
function, the HSSB function or the intelligent terminal(MMC-IV is used in
this manual).

Use this manual together with the operator's manual for the following CNC.

Application
+---------------------------------+------------------------+
| Product name | Abbreviation |
+---------------------------------+------------+-----------+
|FANUC Series 150-MODEL B |150-B |Series 150 |
+---------------------------------+------------+-----------+
|FANUC Series 160-MODEL B/MODEL C |160-B/160-C |Series 160 |
+---------------------------------+------------+-----------+
|FANUC Series 180-MODEL B/MODEL C |180-B/180-C |Series 180 |
+---------------------------------+------------+-----------+
|FANUC Series 210-MODEL B |210-B |Series 210 |
+---------------------------------+------------+-----------+
|FANUC Series 160i-MODEL A |160i |Series 160i|
+---------------------------------+------------+-----------+
|FANUC Series 180i-MODEL A |180i |Series 180i|
+---------------------------------+------------+-----------+
|FANUC Series 210i-MODEL A |210i |Series 210i|
+---------------------------------+------------+-----------+
|FANUC NC board |NC board | |
+---------------------------------+------------+-----------+
* '160', '180', and '210' include '160i', '180i', and '210i'
respectively.

COPYRIGHT, OTHERS

* The copyright of MS-DOS and other software provided with MMC-IV 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.

* No part of the software described above, or its manuals, may be used or


reproduced without permission.

* No part of the software described above, or its manuals, may be sold


independently of the MMC-IV.

* Basically, one set of the software described above must be purchased for
each MMC-IV.

* 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 MMC-IV 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. |
+---------------------------------------------------------------------------+

8
1. Extended Libraries

1.1 CNC/PMC Data Window Library for Windows 95

1.1.1 Outline
The CNC/PMC data window library is used for exchanging data and information
between the MMC-IV, Intelligent terminal, personal computer through HSSB and
the CNC/PMC.

The main functions of the library are as follows.

(1) CNC: Reading of data related to controlled axes/spindle

This data includes the absolute position, relative position, machine


position, remaining travel distance, actual feedrate, and so forth.

(2) CNC: Operations related to CNC program

Operations include upload/download, verification, search, and deletion of


CNC programs, read CNC program directory, and DNC operation from the MMC.

(3) CNC: Reading/writing of CNC file data

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.

(4) CNC: Reading/writing of tool life management data

(5) CNC: Reading of history data

This data includes operation history data and alarm history data.

(6) CNC: Reading of servo/spindle data

(7) CNC: Reading/writing of data related to data server, DNC1, DNC2


and OSI-Ethernet

(8) CNC: Reading/writing of data related to PUNCH PRESS

(9) CNC: Reading/writing of data related to LASER

(10) CNC: Reading/writing of data related to servo learning data

(11) CNC: Reading of other data

This data includes continuous-state data, diagnostic data, A/D conversion


data, alarm information, and operator messages.

(12) Reading/writing of data related to PMC

This data includes addresses G, F, Y, X, A, R, T, C, and D, extended


backup memory, and information to be exchanged between the MMC and PMC.

9
1.1.2 General Description
(1) Library files

FWLIB32.DLL : the DLL library


FWLIB32.LIB : the import library
FWLIB32.H : the header file for 'prototype of function', 'structure'
and 'definition of return status'

* The files for Series 150 and Series 160/180/210,NC board are different
each other.

(2) Language for development and Memory model

CNC/PMC data window library is developed/tested by using the following


language.

- Visual C++ 4.0,4.1

(3) Number of axes

Maximum controlled axes : maximum number of axes for data window interface
Current controlled axes : number of axes controlled by CNC system currently

Maximum controlled axes is defined as 'MAX_AXIS' in the header file.


It is different each CNC system, and so define the following constant by
using the '-D' option which is specified on compiling.

'Current controlled axis' can be got by 'Read CNC system information


(cnc_sysinfo())' function.

- In case of header file for Series 150


System Option(-D)
----------------------------------
Standard(10 axes) : (nothing)
Multi axes(15 axes) : M_AXIS1
Multi axes(24 axes) : M_AXIS2

#if defined(M_AXIS2)
#define MAX_AXIS 24
#elif defined(M_AXIS1)
#define MAX_AXIS 15
#else
#define MAX_AXIS 10
#endif

- In case of header file for Series 160/180/210,NC board


System Option(-D)
----------------------------------
#define MAX_AXIS 8

(4) F-D Mate mini

At FD Mate mini system, data window function only for PMC is available.

(5) Program number 8 digits

In case of program number 8 digits, the argument and the member of


structure, which are related with program number of data window function,
is changed from "short" to "long".

10
In case of C language, define character constant "ONO8D" at compiling by
option "-D" to switch library for program number 8 digits.

System Option(-D)
------------------------------------------
program number 4 digits : (nothing)
program number 8 digits : ONO8B

In case of Visual Basic, define "ONO8D=1" in VB menu "[Tool] -> [Option] ->
[Detail Setting] -> [Conditional compile argument]" to switch library for
program number 8 digits.
If "ONO8D" is not defined or "ONO8D=0" is defined, it becomes for program
number 4 digits.

The window function compiled for the program number 8 digits operates
normally when CNC side is program number 4 digits. Conversely, if the
window function for the program number 4 digits is used when CNC side is
the program number 8 digits, it becomes an error(EW_FUNC).

11
1.1.3 Library Handle

(1) Library Handle Description.

The library handle number has to be got by using the 'cnc_allclibhndl()'


function until the CNC/PMC data window function is called for the first
time after the start of an application program.

It has to be held until an application program terminates, and it has to


be released by using the 'cnc_freelibhndl()' function when an application
program terminates.

The outline of sequence of an application program is as follows.

+------------------------------+
| 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 arguement
+------------------------+
|
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 repeats,
the library handle number cannot be got at last.

12
(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.

(2) Specification of cnc_allclibhndl() and cnc_allclibhndl2()

If cnc_allclibhndl() or cnc_allclibhndl2() is executed while the power


supply on the NC side is off, EW_HSSB is returned as the completion status.
And, if cnc_allclibhndl() or cnc_allclibhndl2() is executed immediately after
the NC starting up, the completion status EW_BUSY may be returned. This
shows that the initialization of the interface between NC and PC is not
finished.
Retry calling the function until the initialization completes when the
completion status is EW_BUSY.

(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 statusof 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().

13
1.1.4 Return Status of Data Window Function
(1) CNC data window

+-----------+-------------------------+---------------------------------------+
| Return | Meaning | Explanation and Error handling |
+-----------+-------------------------+---------------------------------------+
|EW_NODLL |DLL file error |There is no DLL file for each CNC |
| (-12) | |series corresponding to specified node.|
+-----------+-------------------------+---------------------------------------+
|EW_BUS |Bus error |A bus error of CNC system occurred. |
| (-11) | |Contact with the service section or |
| | |the section in charge. |
+-----------+-------------------------+---------------------------------------+
|EW_SYSTEM2 |System error (2) |A system error of CNC system occurred. |
| (-10) | |Contact with the service section or |
| | |the section in charge. |
+-----------+-------------------------+---------------------------------------+
|EW_HSSB |Communication error |Investigate the serial line or I/F |
| ( -9) |of HSSB |board of HSSB. |
+-----------+-------------------------+---------------------------------------+
|EW_HANDLE |Handle number error |Get the library handle number. |
| ( -8) | | |
+-----------+-------------------------+---------------------------------------+
|EW_VERSION |Version mismatch between |The CNC/PMC version does not match that|
| ( -7) |the CNC/PMC and library |of the library. Replace the library |
| | |or the CNC/PMC control software. |
+-----------+-------------------------+---------------------------------------+
|EW_UNEXP |Abnormal library state |An unanticipated error occurred. |
| ( -6) | |Contact with the section in charge. |
+-----------+-------------------------+---------------------------------------+
|EW_SYSTEM |System error |A system error of CNC occurred. |
| ( -5) | |Contact with the service section or |
| | |the section in charge. |
+-----------+-------------------------+---------------------------------------+
|EW_PARITY |Shared RAM parity error |A hardware error occurred. |
| ( -4) | |Contact with the service section. |
+-----------+-------------------------+---------------------------------------+
|EW_MMCSYS |EMM386.EXE, MMCSYS.EXE |The drivers required for execution are |
| ( -3) |installation error |not installed. |
+-----------+-------------------------+---------------------------------------+
|EW_RESET |Reset or stop request |The RESET or STOP button was pressed. |
| ( -2) | |Call the termination function. |
+-----------+-------------------------+---------------------------------------+
|EW_BUSY |Busy |Wait until the completion of CNC |
| ( -1) | |processing, or retry. |
+-----------+-------------------------+---------------------------------------+
|EW_OK |Normal termination | |
| ( 0) | | |
+-----------+-------------------------+---------------------------------------+
|EW_FUNC |Error(function is not |Specific function which must be |
| ( 1) |executed, |executed beforehand has not been |
| |or not available) |executed. |
| | |Otherwise that function is not |
| | |available. |
+-----------+-------------------------+---------------------------------------+

14
+-----------+-------------------------+---------------------------------------+
|EW_LENGTH |Error(data block length |Check and correct the data block length|
| ( 2) | error, error of |or number of data. |
| | 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 attribute. |
| ( 4) | error) | |
+-----------+-------------------------+---------------------------------------+
|EW_DATA |Error(data error) |Check and correct the data. For the |
| ( 5) | |following operations, this code |
| | |indicates that the specified program |
| | |cannot be found. |
| | | - Delete specified program |
| | | - Search specified program |
| | | - Start uploading NC program |
+-----------+-------------------------+---------------------------------------+
|EW_NOOPT |Error(no option) |There is no corresponding CNC option. |
| ( 6) | | |
+-----------+-------------------------+---------------------------------------+
|EW_PROT |Error(write protection) |Write operation is prohibited. |
| ( 7) | | |
+-----------+-------------------------+---------------------------------------+
|EW_OVRFLOW |Error(memory overflow) |CNC tape memory is overflowed. |
| ( 8) | | |
+-----------+-------------------------+---------------------------------------+
|EW_PARAM |Error(CNC parameter |CNC parameter is set incorrectly. |
| ( 9) | error) | |
+-----------+-------------------------+---------------------------------------+
|EW_BUFFER |Error(buffer empty/full) |The buffer is empty or full. |
| ( 10) | |Wait until completion of CNC |
| | |processing, or retry. |
+-----------+-------------------------+---------------------------------------+
|EW_PATH |Error(path number error) |A path number is incorrect. |
| ( 11) | | |
+-----------+-------------------------+---------------------------------------+
|EW_MODE |Error(CNC mode error) |The CNC mode is incorrect. |
| ( 12) | |Correct the CNC mode. |
+-----------+-------------------------+---------------------------------------+
|EW_REJECT |Error(CNC execution |The execution at the CNC is denied. |
| ( 13) | denial) |Check the condition of execution. |
+-----------+-------------------------+---------------------------------------+
|EW_DTSRVR |Error(Data server error) |Some error occurs at the data server. |
| ( 14) | | |
+-----------+-------------------------+---------------------------------------+

15
(2) PMC data window

+-----------+-------------------------+---------------------------------------+
| Return | Meaning | Explanation and Error handling |
+-----------+-------------------------+---------------------------------------+
|EW_NODLL |DLL file error |There is no DLL file for each CNC |
| (-12) | |series corresponding to specified node.|
+-----------+-------------------------+---------------------------------------+
|EW_BUS |Bus error |A bus error of CNC system occurred. |
| (-11) | |Contact with the service section or |
| | |the section in charge. |
+-----------+-------------------------+---------------------------------------+
|EW_SYSTEM2 |System error (2) |A system error of CNC system occurred. |
| (-10) | |Contact with the service section or |
| | |the section in charge. |
+-----------+-------------------------+---------------------------------------+
|EW_HSSB |Communication error |Investigate the serial line or I/F |
| ( -9) |of HSSB |board of HSSB. |
+-----------+-------------------------+---------------------------------------+
|EW_HANDLE |Handle number error |Get the library handle number. |
| ( -8) | | |
+-----------+-------------------------+---------------------------------------+
|EW_VERSION |Version mismatch between |The CNC/PMC version does not match that|
| ( -7) |the CNC/PMC and library |of the library. Replace the library |
| | |or the CNC/PMC control software. |
+-----------+-------------------------+---------------------------------------+
|EW_UNEXP |Abnormal library state |An unanticipated error occurred. |
| ( -6) | |Contact with the section in charge. |
+-----------+-------------------------+---------------------------------------+
|EW_SYSTEM |System error |A system error of CNC system occurred. |
| ( -5) | |Contact with the service section or |
| | |the section in charge. |
+-----------+-------------------------+---------------------------------------+
|EW_PARITY |Shared RAM parity error |A hardware error occurred. |
| ( -4) | |Contact with the service section. |
+-----------+-------------------------+---------------------------------------+
|EW_MMCSYS |EMM386.EXE, MMCSYS.EXE |The drivers required for execution are |
| ( -3) |installation error |not installed. |
+-----------+-------------------------+---------------------------------------+
|EW_RESET |Reset or stop request |The RESET or STOP button was pressed. |
| ( -2) | |Call the termination function. |
+-----------+-------------------------+---------------------------------------+
|EW_BUSY |Busy |Wait until the completion of CNC |
| ( -1) | |processing, or retry. |
+-----------+-------------------------+---------------------------------------+
|EW_OK |Normal termination | |
| ( 0) | | |
+-----------+-------------------------+---------------------------------------+
|EW_NOPMC |Error(PMC) |The PMC does not exist. |
| ( 1) | | |
+-----------+-------------------------+---------------------------------------+
|EW_LENGTH |Error(data block length |Check and correct the data block |
| ( 2) | error) |length. |
+-----------+-------------------------+---------------------------------------+
|EW_RANGE |Error(address range |Check and correct the address range. |
| ( 3) | error) | |
+-----------+-------------------------+---------------------------------------+

16
+-----------+-------------------------+---------------------------------------+
|EW_TYPE |Error(address type/data |Check and correct the address type/ |
| ( 4) | type error) |data type. |
+-----------+-------------------------+---------------------------------------+
|EW_NOOPT |Error(no option) |There is no corresponding CNC option. |
| ( 6) | | |
+-----------+-------------------------+---------------------------------------+
|EW_BUFFER |Error(buffer empty/full) |The buffer is empty or full. |
| ( 10) | |Wait until completion of PMC |
| | |processing, or retry. |
| | |Alternatively, add the required |
| | |processing for the PMC. |
+-----------+-------------------------+---------------------------------------+

17
1.1.5 Function List
The support status of each function is as follows.

--------------------------------------------------------------------------------
1.1.?? 15/16/IO/MEM Function name Brief description
--------------------------------------------------------------------------------
O/ O/ O/ X O : supported
| | | | X : not supported
| | | |
| | | +-> Memory map(MMC-IV, Intelligent Terminal, HSSB type 1)
| | +----> I/O map(HSSB type 2, NC board)
| +-------> Library for Series 160/180/210,NC board,160i/180i/210i
+----------> Library for Series 150

CNC: Multi-Connection of HSSB


--------------------------------------------------------------------------------
1.1.6 15/16/IO/MEM Function name Brief description
--------------------------------------------------------------------------------
(Version 1.2 and newer)
( 1) O/ O/ O/ X cnc_allclibhndl2 Allocate the library handle
(for multi-connection)
( 2) O/ O/ O/ X cnc_rdnodenum Read the number of node
( 3) O/ O/ O/ X cnc_rdnodeinfo Read the information of node
( 4) O/ O/ O/ X cnc_setdefnode Set the default node number
--------------------------------------------------------------------------------

CNC: Functions Related to Controlled Axis/Spindle


--------------------------------------------------------------------------------
1.1.7 15/16/IO/MEM Function name Brief description
--------------------------------------------------------------------------------
( 1) O/ O/ O/ O cnc_actf Read actual axis feedrate(F)
( 2) O/ O/ O/ O cnc_absolute Read absolute axis position
( 3) O/ O/ O/ O cnc_machine Read machine axis position
( 4) O/ O/ O/ O cnc_relative Read relative axis position
( 5) O/ O/ O/ O cnc_distance Read distance to go
( 6) O/ O/ O/ O cnc_skip Read skip position
( 7) O/ O/ O/ O cnc_srvdelay Read servo delay value
( 8) O/ O/ O/ O cnc_accdecdly Read acceleration/deceleration delay value
( 9) O/ O/ O/ O cnc_rddynamic Read all dynamic data
(10) O/ O/ O/ O cnc_wrrelpos Set origin / preset relative axis position
(11) O/ O/ O/ O cnc_prstwkcd Preset work coordinate
(12) O/ O/ O/ O cnc_rdmovrlap Read manual overlapped motion value
(13) O/ O/ O/ O cnc_canmovrlap Cancel manual overlapped motion value
(14) O/ O/ O/ O cnc_acts Read actual spindle speed(S)
(15) O/ O/ O/ O cnc_rdspload Read load infomation of serial spindle
(16) O/ O/ O/ O cnc_rdspmaxrpm Read maximum r.p.m. ratio of serial spindle
(17) O/ O/ O/ O cnc_rdspgear Read gear ratio of serial spindle
(Version 1.3 and newer)
(18) O/ X/ O/ X cnc_rd3dtooltip Read tool tip coordinates
(19) O/ X/ O/ X cnc_rd3dpulse Read handle interrupt pulse amount
(20) O/ X/ O/ X cnc_rd3dmovrlap Read handle interrupt move amount
(21) O/ X/ O/ X cnc_rd3dofschg Read modification tool length compensation
(22) O/ X/ O/ X cnc_clr3dplsmov Clear handle interrupt pulse & move amount
(Version 1.4.x and newer)
(23) O/ O cnc_absolute2 Read absolute axis position 2
(24) O/ O cnc_relative2 Read relative axis position 2
--------------------------------------------------------------------------------

18
CNC: Functions Related to CNC Program
--------------------------------------------------------------------------------
1.1.8 15/16/IO/MEM Function name Brief description
--------------------------------------------------------------------------------
( 1) O/ O/ O/ O cnc_dwnstart Start downloading NC program
( 2) O/ O/ O/ O cnc_download Download NC program
( 3) O/ O/ O/ O cnc_cdownload Download NC program(conditional)
( 4) O/ O/ O/ O cnc_dwnend End of downloading NC program
( 5) O/ O/ O/ O cnc_vrfstart Start verification of NC program
( 6) O/ O/ O/ O cnc_verify Verify NC program
( 7) O/ O/ O/ O cnc_cverify Verify NC program(conditional)
( 8) O/ O/ O/ O cnc_vrfend End of verification
( 9) O/ O/ O/ O cnc_dncstart Start downloading DNC program
(10) O/ O/ O/ O cnc_dnc Download DNC program
(11) O/ O/ O/ O cnc_cdnc Download DNC program(conditional)
(12) O/ O/ O/ O cnc_dncend End of downloading DNC program
(Version 1.4.x and newer)
(13) O/ O cnc_dncstart2 Start downloading DNC program (2)
(14) O/ O cnc_dnc2 Download DNC program (2)
(15) O/ O cnc_dncend2 End of downloading DNC program (2)
(16) O/ O cnc_rddncdgndt Read the diagnosis data of
downloading DNC program
(all versions)
(17) O/ O/ O/ O cnc_upstart Start uploading NC program
(18) O/ O/ O/ O cnc_upload Upload NC program
(19) O/ O/ O/ O cnc_cupload Upload NC program(conditional)
(20) O/ O/ O/ O cnc_upend End of uploading NC program
(21) O/ O/ O/ O cnc_buff Read buffer status for downloading/
verification NC program
(22) O/ O/ O/ O cnc_search Search specified program
(23) O/ O/ O/ O cnc_delall Delete all programs
(24) O/ O/ O/ O cnc_delete Delete specified program
(25) O/ O/ O/ O cnc_rdprogdir Read program directory
(26) O/ O/ O/ X cnc_rdprogdir2 Read program directory(2)
(27) O/ O/ O/ O cnc_rdproginfo Read program information
(28) O/ O/ O/ O cnc_rdprgnum Read program number under execution
(29) O/ O/ O/ O cnc_rdseqnum Read sequence number under execution
(30) O/ O/ O/ O cnc_seqsrch Search specified sequence number
(31) O/ O/ O/ O cnc_rewind Rewind cursor of NC program
(32) O/ O/ O/ O cnc_rdblkcount Read block counter
(33) O/ O/ O/ O cnc_rdexecprog Read program under execution
(34) O/ O/ O/ O cnc_wrmdiprog Write program for MDI operation
(35) O/ O/ O/ O cnc_rdmdipntr Read execution pointer for MDI operation
(36) O/ O/ O/ O cnc_wrmdipntr Write execution pointer for MDI operation
(37) O/ O/ O/ X cnc_rdproctime Read processing time stamp data
(38) O/ O/ O/ X cnc_rdprgdirtime Read directory for processing time stamp
data
--------------------------------------------------------------------------------

19
CNC: Functions Related to CNC File Data
--------------------------------------------------------------------------------
1.1.9 15/16/IO/MEM Function name Brief description
--------------------------------------------------------------------------------
( 1) O/ O/ O/ O cnc_rdtofs Read tool offset value
( 2) O/ O/ O/ O cnc_wrtofs Write tool offset value
( 3) O/ O/ O/ O cnc_rdtofsr Read tool offset value(area specified)
( 4) O/ O/ O/ O cnc_wrtofsr Write tool offset value(area specified)
( 5) O/ O/ O/ O cnc_rdtofsinfo Read tool offset information
( 6) O/ O/ O/ O cnc_rdzofs Read work zero offset value
( 7) O/ O/ O/ O cnc_wrzofs Write work zero offset value
( 8) O/ O/ O/ O cnc_rdzofsr Read work zero offset value(area specified)
( 9) O/ O/ O/ O cnc_wrzofsr Write work zero offset value( " )
(10) O/ O/ O/ O cnc_rdzofsinfo Read work zero offset information
(11) O/ O/ O/ O cnc_rdparam Read parameter
(12) O/ O/ O/ O cnc_wrparam Write parameter
(13) O/ O/ O/ O cnc_rdparar Read parameter(area specified)
(14) O/ O/ O/ O cnc_wrparas Write parameter(area specified)
(15) O/ O/ O/ O cnc_rdparainfo Read parameter information
(16) O/ O/ O/ O cnc_rdparanum Read minimum, maximum, total number of
parameter
(17) O/ O/ O/ O cnc_rdset Read setting data
(18) O/ O/ O/ O cnc_wrset Write setting data
(19) O/ O/ O/ O cnc_rdsetr Read setting data(area specified)
(20) O/ O/ O/ O cnc_wrsets Write setting data(area specified)
(21) O/ O/ O/ O cnc_rdsetinfo Read setting data information
(22) O/ O/ O/ O cnc_rdsetnum Read minimum, maximum, total number of
setting data
(23) O/ O/ O/ O cnc_rdpitchr Read pitch error compensation data
(area specified)
(24) O/ O/ O/ O cnc_wrpitchr Write pitch error compensation data( " )
(25) O/ O/ O/ O cnc_rdpitchinfo Read pitch error compensation data
information
(26) O/ O/ O/ O cnc_rdmacro Read custom macro variable
(27) O/ O/ O/ O cnc_wrmacro Write custom macro variable
(28) O/ O/ O/ O cnc_rdmacror Read custom macro variables(area specified)
(29) O/ O/ O/ O cnc_wrmacror Write custom macro variables( " )
(30) O/ O/ O/ O cnc_rdmacroinfo Read custom macro variable information
(31) O/ O/ O/ O cnc_getmactype Get type of custom macro variable
(32) O/ O/ O/ O cnc_setmactype Set type of custom macro variable
(33) O/ O/ O/ O cnc_rdpmacro Read P code macro variable
(34) O/ O/ O/ O cnc_wrpmacro Write P code macro variable
(35) O/ O/ O/ O cnc_rdpmacror Read P code macro variables(area specified)
(36) O/ O/ O/ O cnc_wrpmacror Write P code macro variables( " )
(37) O/ O/ O/ O cnc_rdpmacroinfo Read P code macro variable information
(38) O/ O/ O/ O cnc_getpmactype Get type of P code macro variable
(39) O/ O/ O/ O cnc_setpmactype Set type of P code macro variable
(40) O/ O/ O/ X cnc_rdmgrpdata Read M code group data
(41) O/ O/ O/ X cnc_wrmgrpdata Write M code group data
(42) O/ X/ O/ X cnc_rdexecmcode Read M code group data(executing,
executed M code)
(43) O/ X/ O/ X cnc_rdrstrmcode Read M code group data(for program restart)
(44) O/ O/ O/ X cnc_rdintchk Read interference check data
(area specified)
(45) O/ O/ O/ X cnc_wrintchk Write interference check data( " )
(46) O/ O/ O/ X cnc_rdintinfo Read interference check data information
(47) O/ X/ O/ X cnc_rdhpccset Read setting data for High-speed and
high-precision machining
(48) O/ X/ O/ X cnc_wrhpccset Write setting data for HPCC
(49) O/ X/ O/ X cnc_hpccatset Set setting data for HPCC automatically
(50) O/ X/ O/ X cnc_rdhpcctupr Read tuning data(parameter input) for HPCC
(51) O/ X/ O/ X cnc_wrhpcctupr Write tuning data(parameter input) for HPCC

20
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
1.1.9 15/16/IO/MEM Function name Brief description
--------------------------------------------------------------------------------
(52) O/ X/ O/ X cnc_rdhpcctuac Read tuning data(acc./dec. input) for HPCC
(53) O/ X/ O/ X cnc_wrhpcctuac Write tuning data(acc./dec. input) for HPCC
(54) O/ X/ O/ X cnc_hpccattune Tune up tuning data for HPCC automatically
(55) O/ X/ O/ X cnc_hpccactfine Read fine level for HPCC
(56) O/ X/ O/ X cnc_hpccselfine Select fine level for HPCC
(57) O/ X/ O/ X cnc_rdactfixofs Read active fixture offset
(58) O/ X/ O/ X cnc_rdfixofs Read fixture offset value(area specified)
(59) O/ X/ O/ X cnc_wrfixofs Write fixture offset value(area specified)
(60) X/ O/ O/ X cnc_rdwkcdshft Read work coordinate shift value
(61) X/ O/ O/ X cnc_wrwkcdshft Write work coordinate shift value
(62) X/ O/ O/ X cnc_rdwkcdsfms Read work coordinate shift measured value
(63) X/ O/ O/ X cnc_wrwkcdsfms Write work coordinate shift measured value
(64) X/ O/ O/ X cnc_rdbtofsr Read tool offset value for B axis
(area specified)
(65) X/ O/ O/ X cnc_wrbtofsr Write tool offset value for B axis( " )
(66) X/ O/ O/ X cnc_rdbtofsinfo Read tool offset information for B axis
(67) X/ O/ O/ X cnc_rdbaxis Read command data for B axis
--------------------------------------------------------------------------------

21
CNC: Functions Related to Tool Life Management Data
--------------------------------------------------------------------------------
1.1.10 15/16/IO/MEM Function name Brief description
--------------------------------------------------------------------------------
( 1) O/ O/ O/ O cnc_rdgrpid Read tool life management data
(tool group number)
( 2) O/ O/ O/ O cnc_rdngrp Read " (number of tool groups)
( 3) O/ O/ O/ O cnc_rdntool Read " (number of tools)
( 4) O/ O/ O/ O cnc_rdlife Read " (tool life)
( 5) O/ O/ O/ O cnc_rdcount Read " (tool lift counter)
( 6) O/ O/ O/ O cnc_rd1length Read " (tool length number-1)
( 7) O/ O/ O/ O cnc_rd2length Read " (tool length number-2)
( 8) O/ O/ O/ O cnc_rd1radius Read " (cutter compensation num.-1)
( 9) O/ O/ O/ O cnc_rd2radius Read " (cutter compensation num.-2)
(10) O/ O/ O/ O cnc_t1info Read " (tool information-1)
(11) O/ O/ O/ O cnc_t2info Read " (tool information-2)
(12) O/ O/ O/ O cnc_toolnum Read " (tool number)
(13) O/ O/ O/ O cnc_rdtoolrng Read " (tool number, tool life,
tool life counter)(area specified)
(14) O/ O/ O/ O cnc_rdtoolgrp Read " (all data within group)
(15) O/ O/ O/ O cnc_wrcountr Write " (tool life counter)
(area specified)
(16) O/ O/ O/ O cnc_rdusegrpid Read " (used tool group number)
(17) O/ O/ O/ O cnc_rdmaxgrp Read " (max. number of tool groups)
(18) O/ O/ O/ O cnc_rdmaxtool Read " (max. number of tool
within group)
(19) O/ O/ O/ O cnc_rdusetlno Read " (used tool number
within group)
(20) O/ O/ O/ O cnc_rd1tlifedata Read " (tool data1)
(21) O/ O/ O/ O cnc_rd2tlifedata Read " (tool data2)
(22) O/ O/ O/ O cnc_wr1tlifedata Write " (tool data1)
(23) O/ O/ O/ O cnc_wr2tlifedata Write " (tool data2)
(24) O/ O/ O/ O cnc_rdgrpinfo Read " (tool group information)
(25) O/ O/ O/ O cnc_wrgrpinfo Write " (tool group information
(26) O/ O/ O/ O cnc_deltlifegrp Delete " (tool group)
(27) O/ O/ O/ O cnc_instlifedt Insert " (tool data)
(28) O/ O/ O/ O cnc_deltlifedt Delete " (tool data)
(29) O/ O/ O/ O cnc_clrcntinfo Clear " (tool life counter,
tool information)(area specified)
--------------------------------------------------------------------------------

22
CNC: Functions Related to History Data
--------------------------------------------------------------------------------
1.1.11 15/16/IO/MEM Function name Brief description
--------------------------------------------------------------------------------
( 1) O/ O/ O/ O cnc_stopophis Stop logging operation history data
( 2) O/ O/ O/ O cnc_startophis Restart logging operation history data
( 3) O/ O/ O/ O cnc_rdophisno Read number of operation history data
( 4) O/ O/ O/ O cnc_rdophistry Read operation history data
( 5) O/ O/ O/ O cnc_rdalmhisno Read number of alarm history data
( 6) O/ O/ O/ O cnc_rdalmhistry Read alarm history data
( 7) O/ O/ O/ O cnc_clearophis Clear operation history data
( 8) O/ O/ O/ O cnc_rdhissgnl Read signals related operation history
( 9) O/ O/ O/ O cnc_wrhissgnl Write signals related operation history
(10) X/ O/ O/ X cnc_stopomhis Stop logging external operator's message
history data
(11) X/ O/ O/ X cnc_startomhis Restart logging external operator's message
history data
(12) X/ O/ O/ X cnc_rdomhisinfo Read external operator's message
history data information
(13) X/ O/ O/ X cnc_rdomhistry Read external operator's message
history data
(14) X/ O/ O/ X cnc_clearomhis Clear external operator's message
history data
--------------------------------------------------------------------------------

CNC: Functions Related to Servo/Spindle


--------------------------------------------------------------------------------
1.1.12 15/16/IO/MEM Function name Brief description
--------------------------------------------------------------------------------
( 1) O/ O/ O/ O cnc_rdloopgain Read loop gain for servo adjustment
( 2) O/ O/ O/ O cnc_rdcurrent Read real current for servo adjustment
( 3) O/ O/ O/ O cnc_rdsrvspeed Read real speed for servo adjustment
( 4) O/ O/ O/ O cnc_rdnspdl Read number of spindle
( 5) O/ O/ O/ O cnc_rdopmode Read operation mode for spindle setting
( 6) O/ O/ O/ O cnc_rdposerrs Read position deflection S for spindle
adjustment
( 7) O/ O/ O/ O cnc_rdposerrs2 Read position deflection S1, S2 for spindle
adjustment(synchronous control mode)
( 8) O/ O/ O/ O cnc_rdposerrz Read position deflection Z of tapping axis
for spindle adjustment(rigid tapping mode)
( 9) O/ O/ O/ O cnc_rdsynerrsy Read synchronous error for spindle
adjustment(synchronous control mode)
(10) O/ O/ O/ O cnc_rdsynerrrg Read synchronous error for spindle
adjustment(rigid tapping mode)
(11) O/ O/ O/ O cnc_rdspdlalm Read spindle alarm for spindle monitor
(12) O/ O/ O/ O cnc_rdctrldi Read control input signal for spindle
monitor
(13) O/ O/ O/ O cnc_rdctrldo Read control output signal for spindle
monitor
(14) O/ O/ O/ O cnc_rdwaveprm Read waveform diagnosis parameter
(15) O/ O/ O/ O cnc_wrwaveprm Write waveform diagnosis parameter
(16) O/ O/ O/ O cnc_wavestart Start sampling waveform diagnosis data
(17) O/ O/ O/ O cnc_wavestop Stop sampling waveform diagnosis data
(18) O/ O/ O/ O cnc_wavestat Read sampling status of waveform
diagnosis data
(19) O/ O/ O/ O cnc_rdwavedata Read waveform diagnosis data
--------------------------------------------------------------------------------

23
CNC: Functions Related to Data Server, DNC1, DNC2, OSI-Ethernet
--------------------------------------------------------------------------------
1.1.13 15/16/IO/MEM Function name Brief description
--------------------------------------------------------------------------------
( 1) O/ O/ O/ X cnc_dtsvftpget Transfer file from host to data server
( 2) O/ O/ O/ X cnc_dtsvftpput Transfer file from data server to host
( 3) O/ O/ O/ X cnc_dtsvftpstat Read status of file transfer between
host and data server
( 4) O/ O/ O/ X cnc_dtsvrdpgdir Read directory in data server
( 5) O/ O/ O/ X cnc_dtsvdelete Delete file in data server
( 6) O/ O/ O/ X cnc_dtsvdownload Download from data server to CNC
( 7) O/ O/ O/ X cnc_dtsvupload Upload from CNC to data server
( 8) O/ O/ O/ X cnc_dtsvcnclupdn Cancel upload/download between data server
and CNC
( 9) O/ O/ O/ X cnc_dtsvupdnstat Read upload/download status between
data server and CNC
(10) O/ O/ O/ X cnc_dtsvgetdncpg Get DNC operation file name in data server
(11) O/ O/ O/ X cnc_dtsvsetdncpg Set DNC operation file name in data server
(12) O/ O/ O/ X cnc_dtsvrdset Read setting data for data server
(13) O/ O/ O/ X cnc_dtsvwrset Write setting data for data server
(14) O/ O/ O/ X cnc_dtsvchkdsk Check hard disk on data server
(15) O/ O/ O/ X cnc_dtsvhdformat Format hard disk on data server
(16) O/ O/ O/ X cnc_dtsvsavecram Save I/F buffer for data server
(17) O/ O/ O/ X cnc_dtsvrdcram Read I/F buffer for data server
(18) O/ O/ O/ X cnc_dtsvmntinfo Read maintenance information for
data server
(19) O/ O/ O/ X cnc_dtsvgetmode Get mode of data server
(20) O/ O/ O/ X cnc_dtsvsetmode Set mode of data server
(21) O/ O/ O/ X cnc_dtsvrderrmsg Read error message for data server
(22) O/ O/ O/ X cnc_rddncfname Read DNC file name for DNC1,DNC2,
OSI-Ethernet
(23) O/ O/ O/ X cnc_wrdncfname Write DNC file name for DNC1,DNC2,
OSI-Ethernet
(24) O/ O/ O/ X cnc_rdcomparam Read communication parameter for DNC1,
DNC2,OSI-Ethernet
(25) O/ O/ O/ X cnc_wrcomparam Write communication parameter for DNC1,
DNC2,OSI-Ethernet
(26) O/ O/ O/ X cnc_rdcomlogmsg Read logging message for DNC2
(27) O/ O/ O/ X cnc_rdcomopemsg Read operator's message for DNC1,DNC2
(28) O/ O/ O/ X cnc_rdrcvmsg Read receipt message for OSI-Ethernet
(29) O/ O/ O/ X cnc_rdsndmsg Read sending message for OSI-Ethernet
(30) O/ O/ O/ X cnc_sendmessage Send message for OSI-Ethernet
(31) O/ O/ O/ X cnc_clrmsgbuff Clear message buffer for OSI-Ethernet
(32) O/ O/ O/ X cnc_rdrcvstat Read receipt status of message for
OSI-Ethernet
--------------------------------------------------------------------------------

24
CNC: Functions Related to PUNCH PRESS
--------------------------------------------------------------------------------
1.1.14 15/16/IO/MEM Function name Brief description
--------------------------------------------------------------------------------
( 1) X/ O/ O/ X cnc_rdtlctldata Read tool control data
( 2) X/ O/ O/ X cnc_wrtlctldata Write tool control data
( 3) X/ O/ O/ X cnc_rdtooldata Read tool data
( 4) X/ O/ O/ X cnc_wrtooldata Write tool data
( 5) X/ O/ O/ X cnc_rdmultitldt Read multiple tool data
( 6) X/ O/ O/ X cnc_wrmultitldt Write multiple tool data
( 7) X/ O/ O/ X cnc_rdsafetyzone Read safety zone data
( 8) X/ O/ O/ X cnc_wrsafetyzone Write safety zone data
( 9) X/ O/ O/ X cnc_rdtoolzone Read tool zone data
(10) X/ O/ O/ X cnc_wrtoolzone Write tool zone data
(11) X/ O/ O/ X cnc_rdacttlzone Read actual tool zone data
(12) X/ O/ O/ X cnc_rdsetzone Read number of automatic setting zone
(13) X/ O/ O/ X cnc_wrsetzone Write number of automatic setting zone
--------------------------------------------------------------------------------

25
CNC: Functions Related to LASER
--------------------------------------------------------------------------------
1.1.15 15/16/IO/MEM Function name Brief description
--------------------------------------------------------------------------------
( 1) X/ O/ O/ X cnc_rdpscdproc Read cutting condition file(cutting data)
( 2) X/ O/ O/ X cnc_wrpscdproc Write cutting condition file(cutting data)
( 3) X/ O/ O/ X cnc_rdpscdpirc Read cutting condition file(piercing data)
( 4) X/ O/ O/ X cnc_wrpscdpirc Write cutting condition file(piercing data)
( 5) X/ O/ O/ X cnc_rdpscdedge Read cutting condition file
(edge cutting data)
( 6) X/ O/ O/ X cnc_wrpscdedge Write cutting condition file
(edge cutting data)
( 7) X/ O/ O/ X cnc_rdpscdslop Read cutting condition file
(slope control data)
( 8) X/ O/ O/ X cnc_wrpscdslop Write cutting condition file
(slope control data)
( 9) X/ O/ O/ X cnc_rdlpwrdty Read duty data for power control
(10) X/ O/ O/ X cnc_wrlpwrdty Write duty data for power control
(11) X/ O/ O/ X cnc_rdlpwrdat Read laser power data
(12) X/ O/ O/ X cnc_rdlpwrcpst Read power compensation coefficient
(13) X/ O/ O/ X cnc_wrlpwrcpst Write power compensation coefficient
(14) X/ O/ O/ X cnc_rdlagslt Read assist gas selection
(15) X/ O/ O/ X cnc_wrlagslt Write assist gas selection
(16) X/ O/ O/ X cnc_rdlagst Read assist gas flow
(17) X/ O/ O/ X cnc_wrlagst Write assist gas flow
(18) X/ O/ O/ X cnc_rdledgprc Read laser power for contouring
(19) X/ O/ O/ X cnc_wrledgprc Write laser power for contouring
(20) X/ O/ O/ X cnc_rdlprcprc Read laser power for piercing
(21) X/ O/ O/ X cnc_wrlprcprc Write laser power for piercing
(22) X/ O/ O/ X cnc_rdlcmddat Read command data of laser
(23) X/ O/ O/ X cnc_rdldsplc Read command data of reference displace
(24) X/ O/ O/ X cnc_wrldsplc Write command data of reference displace
(25) X/ O/ O/ X cnc_rdlerrz Read error of Z-axis tracing
(26) X/ O/ O/ X cnc_rdlactnum Read active cutting number/piercing number
/slope number
(27) X/ O/ O/ X cnc_rdlcmmt Read comment data
(28) X/ O/ O/ X cnc_rdlpwrslt Read laser power selection
(29) X/ O/ O/ X cnc_wrlpwrslt Write laser power selection
(30) X/ O/ O/ X cnc_rdlpwrctrl Read laser power control
(31) X/ O/ O/ X cnc_wrlpwrctrl Write laser power control
--------------------------------------------------------------------------------

26
CNC: Functions Related to Servo Learning Data
--------------------------------------------------------------------------------
1.1.16 15/16/IO/MEM Function name Brief description
--------------------------------------------------------------------------------
( 1) X/ O/ O/ X cnc_svdtstartrd Start of reading servo learning data
( 2) X/ O/ O/ X cnc_svdtrddata Reading of the data from I/F buffer for
the servo learning data
( 3) X/ O/ O/ X cnc_svdtendrd End of reading servo learning data
( 4) X/ O/ O/ X cnc_svdtstartwr Start of writing servo learning data
( 5) X/ O/ O/ X cnc_svdtwrdata Writing of the data to I/F buffer for the
servo learning data
( 6) X/ O/ O/ X cnc_svdtendwr End of writing servo learning data
( 7) X/ O/ O/ X cnc_svdtstopexec Stop of reading/writing of the servo
learning data.
--------------------------------------------------------------------------------

CNC: Functions Related to Others


--------------------------------------------------------------------------------
1.1.17 15/16/IO/MEM Function name Brief description
--------------------------------------------------------------------------------
( 1) O/ O/ O/ O cnc_sysinfo Read CNC system information
( 2) O/ O/ O/ O cnc_sysconfig Read CNC configration information
( 3) X/ O/ O/ X cnc_rdsyssoft Read series/version of CNC system software
( 4) X/ O/ O/ X cnc_rdmdlconfig Read module configuration of CNC system
( 5) X/ O/ O/ X cnc_rdmdlconfig2 Read module configuration of CNC system(2)
( 6) O/ O/ O/ O cnc_statinfo Read CNC status information
( 7) O/ O/ O/ O cnc_alarm Read alarm status
( 8) O/ O/ O/ O cnc_rdalminfo Read alarm information
( 9) O/ O/ O/ O cnc_modal Read modal data
(10) O/ O/ O/ O cnc_diagnoss Read diagnosis data
(11) O/ O/ O/ O cnc_diagnosr Read diagnosis data(area specified)
(12) O/ O/ O/ O cnc_rddiaginfo Read diagnosis data information
(13) O/ O/ O/ O cnc_rddiagnum Read minimum, maximum, total number of
diagnosis data
(14) O/ O/ O/ O cnc_adcnv Read A/D conversion data
(15) O/ O/ O/ O cnc_rdopmsg Read operator's message
(16) O/ O/ O/ O cnc_rdprstrinfo Read program restart information
(17) O/ O/ O/ O cnc_rstrseqsrch Search sequence number for program restart
(18) O/ X/ O/ O cnc_rstrseqsrch2 Search sequence number for program
restart(2)
(19) O/ X/ O/ X cnc_rdbrstrinfo Read block restart information
(20) O/ O/ O/ O cnc_rdopnlsgnl Read output signal image of software
operator's panel
(21) O/ O/ O/ O cnc_wropnlsgnl Write output signal of software
operator's panel
(22) O/ O/ O/ O cnc_rdopnlgnrl Read general signal image of software
operator's panel
(23) O/ O/ O/ O cnc_wropnlgnrl Write general signal image of software
operator's panel
(24) O/ O/ O/ O cnc_rdopnlgsname Read general signal name of software
operator's panel
(25) O/ O/ O/ O cnc_wropnlgsname Write general signal name of software
operator's panel
(26) O/ X/ O/ X cnc_rdmenuswitch Read menu switch signal
(27) O/ X/ O/ X cnc_wrmenuswitch Write menu switch signal
(28) O/ X/ O/ X cnc_rdradofs Read internal position compensation data
(cutter compensation/tool nose radius compensation)
(29) O/ X/ O/ X cnc_rdlenofs Read internal position compensation data
(tool length compensation)
(30) O/ X/ O/ X cnc_rdfixcycle Read " (canned cycle)
(31) O/ X/ O/ X cnc_rdcdrotate Read " (coordinate rotation)

27
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
1.1.17 15/16/IO/MEM Function name Brief description
--------------------------------------------------------------------------------
(32) O/ X/ O/ X cnc_rd3dcdcnv Read " (3-D coordinate conversion)
(33) O/ X/ O/ X cnc_rdmirimage Read " (programmable mirror image)
(34) O/ X/ O/ X cnc_rdscaling Read " (scaling)
(35) O/ X/ O/ X cnc_rd3dtofs Read " (3-D tool compensation)
(36) O/ X/ O/ X cnc_rdposofs Read " (tool position compensation)
(37) O/ O/ O/ O cnc_getfigure Read maximum valid figures, number of
decimal places
(38) O/ O/ X/ O cnc_getcrntscrn Get current screen
(39) O/ O/ X/ O cnc_slctscrn Select screen
(40) O/ O/ O/ O cnc_getpath Get path number(for 4 axes lathes,
multi-path)
(41) O/ O/ O/ O cnc_setpath Set path number( " )
(42) O/ O/ O/ O cnc_allclibhndl Allocate library handle
(43) O/ O/ O/ O cnc_freelibhndl Free library handle
(44) O/ O/ O/ O cnc_getdtailerr Get detail error for CNC
(version 1.4 and newer)
(45) X/ O cnc_gettimer Get calendar timer of CNC
(46) X/ O cnc_settimer Set calendar timer of CNC
--------------------------------------------------------------------------------

CNC: Functions Related to PMC


--------------------------------------------------------------------------------
1.1.18 15/16/IO/MEM Function name Brief description
--------------------------------------------------------------------------------
( 1) O/ O/ O/ O pmc_rdmsg Read message from PMC to MMC
( 2) O/ O/ O/ O pmc_wrmsg Write message from MMC to PMC
( 3) O/ O/ O/ O pmc_crdmsg Read message from PMC to MMC(conditional)
( 4) O/ O/ O/ O pmc_cwrmsg Write message from MMC to PMC(conditional)
( 5) O/ O/ O/ O pmc_rdpmcrng Read PMC data(area specified)
( 6) O/ O/ O/ O pmc_wrpmcrng Write PMC data(area specified)
( 7) O/ O/ O/ O pmc_rdpmcinfo Read PMC data information
( 8) O/ O/ O/ O pmc_rdcntldata Read control data of PMC data table
( 9) O/ O/ O/ O pmc_wrcntldata Write control data of PMC data table
(10) O/ O/ O/ O pmc_rdcntlgrp Read the sum total group of control data
(11) O/ O/ O/ O pmc_wrcntlgrp Write the sum total group of control data
(12) O/ O/ O/ O pmc_rdkpm Read data from extended backup memory
(13) O/ O/ O/ O pmc_wrkpm Write data to extended backup memory
(14) O/ O/ O/ O pmc_kpmsiz Read maximum size of extended backup memory
(15) O/ O/ O/ O pmc_getdtailerr Get detail error for PMC
--------------------------------------------------------------------------------

28
1.1.6 Multi-Connection of HSSB

Structure of library for multi-connection

+---------------------------+
| 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.

- The cnc_allclibhndl() is allocated to the default node (number 0).


The default node can be changed by using the cnc_setdefnode() function.

29
(1) Allocate the Library Handle (for Multi-Connection) (Version 1.2 and newer)

Function Name:
cnc_allclibhndl2

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_allclibhndl2( long node_no,
unsigned short *FlibHndl );
Description:
Allocates the library handle to the specified node number.

Arguments:
node_no Specify the node number. (0,..,<maximum node number>)
Maximum node number is 'the number of node - 1'.
(The number of node is got by using cnc_rdnodenum() function.)

FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

Return: EW_OK is returned on successful completion, otherwise any value except


W_OK is returned. The main error codes are as follows.

--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NODLL There is no DLL file for each CNC series
corresponding to specified node.
EW_HANDLE Allocation of handle number is failed.
EW_MMCSYS Access failure to the device driver
The device driver for HSSB multi-connection is
not installed.
EW_NUMBER Node number(node_no) is wrong.
EW_NOOPT No option
The extended driver/library function is
necessary.

CNC option: This function needs the extended driver/library function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

30
(2) Read the Number of Node (Version 1.2 and newer)

Function Name:
cnc_rdnodenum

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdnodenum( long *node_num );

Description:
Reads the number of node of the HSSB.

Arguments:
node_num
Pointer to the variable for the number of node.

Return: EW_OK is returned on successful completion, otherwise any value except


EW_OK is returned. The main error codes are as follows.

--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_MMCSYS Access failure to the device driver
The device driver for HSSB multi-connection is
not installed.

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

31
(3) Read the Node Information (Version 1.2 and newer)

Function Name:
cnc_rdnodeinfo

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdnodeinfo( long node_no, ODBNODE *info );

Description:
Reads the specified node information of the HSSB.

Arguments:
node_no Specify the node number. (0,..,<maximum node number>)
Maximum node number is 'the number of node - 1'.
(The number of node is got by using cnc_rdnodenum() function.)

info Pointer to the ODBNODE structure including the node information


The ODBNODE structure is as follows.

typedef struct odbnode {


long node_no; /* Node number */
long io_base; /* Base address of I/O port */
long status; /* Status of device installation */
long cnc_type; /* Type of CNC */
char node_name[20];/* Node name */
} ODBNODE;

node_no Specified node number is set.

io_base Base address of I/O port of specified node is


set.

status Status of device installation of specified node


is set.
0 : Not installed
1 : Installed

cnc_type Type of CNC is set.


1 : Series 160/180/210
2 : Series 150

node_name[20] Node name is set.


Node name is up to 20 characters including
'NULL'.

Return: EW_OK is returned on successful completion, otherwise any value except


EW_OK is returned. The main error codes are as follows.

--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_MMCSYS Access failure to the device driver
The device driver for HSSB multi-connection is
not installed.
EW_NUMBER Node number(node_no) is wrong.

32
CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

33
(4) Set the Default Node Number (Version 1.2 and newer)

Function Name:
cnc_setdefnode

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_setdefnode( long node_no );

Description:
Sets the default node number which is allocated by cnc_allclibhndl()
function.

Arguments:
node_no Specify the default node number.

Return: EW_OK is returned on successful completion, otherwise any value except


EW_OK is returned. The main error codes are as follows.

--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_MMCSYS Access failure to the device driver
The device driver for HSSB multi-connection is
not installed.
EW_NUMBER Node number(node_no) is wrong.

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

34
1.1.7 Function Reference Related to Controlled Axes/Spindle

(1) Read Actual Axis Feedrate (F)

Function Name:
cnc_actf

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.
See "Library handle" for details.

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 ;

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_PARAM CNC parameter error
(Only Series150)7613#0=0 when CNC is turned on,
or 7613#0=1,7613#1=0,7613#2=0 at present.
Set 7613#0=1 and 7613#1=1.
Note)No error occurs in case of 7613#0=1,
7613#1=0,7613#2=1,but the data is invalid.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7613#0=1, 7613#1=1 --- must be set

Series 160/180/210,NC board none

CNC mode: This function can be used in any CNC mode.

35
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

36
(2) Read Absolute Axis Position

Function Name:
cnc_absolute

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 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.

In Series 150, the relation to the read absolute position, amounts of


Tool Length Compensation and Cutter Radius Compensation, and amounts of
servo delay and acceleration/deceleration delay follows setting the
CNC parameter of the following description.

As for Series 160/180/210,NC board, amounts of Tool Length Compensation


and Cutter Radius Compensation, and amounts of servo delay and
acceleration/deceleration delay is always included in the read absolute
position.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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)

for each axis for all axes


ODBAXIS 0+-------+ --- 0+-------+ ---
| dummy | ^ | dummy | ^
2+-------+ | 2+-------+ |
| type | length | type | length
4+-------+-------+ | 4+-------+-------+ |
| data[0] | v | data[0] | |
8+---------------+ --- 8+---------------+ |
== == |
4+4x(n-1)+---------------+ |
| data[n-1] | v
4+4xn+---------------+ ---

Series 150 : n = Maximum controlled axes


* The data for current controlled axes are valid.
Series 160/180/210,NC board : n = Current controlled axes

37
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. */

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
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.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 2204#1=1, 7613#0=1 --- must be set


(M Series)2202#2,#3,#4,#5 --- influenced by setting
(T Series)2202#4,#5, 2203#3 --- influenced by setting

Series 160/180/210,NC board none

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

38
(3) Read Machine Axis Position

Function Name:
cnc_machine

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 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.

In Series 150, the relation to the read machine position, and amounts
of servo delay and acceleration/deceleration delay follows setting the
CNC parameter of the following description.

As for Series 160/180/210,NC board, amounts of servo delay and


acceleration/deceleration delay is always included in the read machine
position.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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)

for each axis for all axes


ODBAXIS 0+-------+ --- 0+-------+ ---
| dummy | ^ | dummy | ^
2+-------+ | 2+-------+ |
| type | length | type | length
4+-------+-------+ | 4+-------+-------+ |
| data[0] | v | data[0] | |
8+---------------+ --- 8+---------------+ |
== == |
4+4x(n-1)+---------------+ |
| data[n-1] | v
4+4xn+---------------+ ---

Series 150 : n = Maximum controlled axes


* The data for current controlled axes are valid.
Series 160/180/210,NC board : n = Current controlled axes

39
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. */

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
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.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 2204#1=1, 7613#0=1 ---must be set


2202#6,#7 ---influenced by setting

Series 160/180/210,NC board none

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

40
(4) Read Relative Axis Position

Function Name:
cnc_relative

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 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.

In Series 150, the relation to the read relative position, amounts of


Tool Length Compensation and Cutter Radius Compensation, and amounts of
servo delay and acceleration/deceleration delay follows setting the
CNC parameter of the following description.

As for Series 160/180/210,NC board, amounts of Tool Length Compensation


and Cutter Radius Compensation, and amounts of servo delay and
acceleration/deceleration delay is always included in the read relative
position.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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)

for each axis for all axes


ODBAXIS 0+-------+ --- 0+-------+ ---
| dummy | ^ | dummy | ^
2+-------+ | 2+-------+ |
| type | length | type | length
4+-------+-------+ | 4+-------+-------+ |
| data[0] | v | data[0] | |
8+---------------+ --- 8+---------------+ |
== == |
4+4x(n-1)+---------------+ |
| data[n-1] | v
4+4xn+---------------+ ---

Series 150 : n = Maximum controlled axes


* The data for current controlled axes are valid.
Series 160/180/210,NC board : n = Current controlled axes

41
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. */

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
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.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 2204#1=1, 7613#0=1 --- must be set


2202#2,#3,#4,#5 --- influenced by setting

Series 160/180/210,NC board none

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

42
(5) Read Distance to Go

Function Name:
cnc_distance

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_distance(unsigned short FlibHndl,short axis,
short length,ODBAXIS *distance);
Description:
Reads the amount of distance to go of 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 Series 160/180/210,NC board, the read amount of distance to go


is twice as big as the actual one except the diameter specification of
linear axis in T series.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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)

for each axis for all axes


ODBAXIS 0+-------+ --- 0+-------+ ---
| dummy | ^ | dummy | ^
2+-------+ | 2+-------+ |
| type | length | type | length
4+-------+-------+ | 4+-------+-------+ |
| data[0] | v | data[0] | |
8+---------------+ --- 8+---------------+ |
== == |
4+4x(n-1)+---------------+ |
| data[n-1] | v
4+4xn+---------------+ ---

Series 150 : n = Maximum controlled axes


* The data for current controlled axes are valid.
Series 160/180/210,NC board : n = Current controlled axes

43
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. */

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
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.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 2204#1=1, 7613#0=1 --- must be set

Series 160/180/210,NC board none

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

44
(6) Read Skip Position

Function Name:
cnc_skip

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_skip(unsigned short FlibHndl,short axis,
short length,ODBAXIS *skip);
Description:
Reads the skipped position of 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
Identify the process which uses the library.
See "Library handle" for details.

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)

for each axis for all axes


ODBAXIS 0+-------+ --- 0+-------+ ---
| dummy | ^ | dummy | ^
2+-------+ | 2+-------+ |
| type | length | type | length
4+-------+-------+ | 4+-------+-------+ |
| data[0] | v | data[0] | |
8+---------------+ --- 8+---------------+ |
== == |
4+4x(n-1)+---------------+ |
| data[n-1] | v
4+4xn+---------------+ ---

Series 150 : n = Maximum controlled axes


* The data for current controlled axes are valid.
Series 160/180/210,NC board : n = Current controlled axes

45
skip
Pointer to the ODBAXIS structure including the skipped
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] ; /* Skipped position
data of controlled axis. */
} ODBAXIS ; /* MAX_AXIS is the maximum controlled axes. */

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
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.
EW_NOOPT No option
(only Series150)The skip function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The skip function is necessary.(only Series 150)

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

46
(7) Read Servo Delay Value

Function Name:
cnc_srvdelay

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 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
Identify the process which uses the library.
See "Library handle" for details.

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)

for each axis for all axes


ODBAXIS 0+-------+ --- 0+-------+ ---
| dummy | ^ | dummy | ^
2+-------+ | 2+-------+ |
| type | length | type | length
4+-------+-------+ | 4+-------+-------+ |
| data[0] | v | data[0] | |
8+---------------+ --- 8+---------------+ |
== == |
4+4x(n-1)+---------------+ |
| data[n-1] | v
4+4xn+---------------+ ---

Series 150 : n = Maximum controlled axes


* The data for current controlled axes are valid.
Series 160/180/210,NC board : n = Current controlled axes

47
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. */

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
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.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

48
(8) Read Acceleration/Deceleration Delay Value

Function Name:
cnc_accdecdly

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_accdecdly(unsigned short FlibHndl,short axis,
short length,ODBAXIS *accdecdly);
Description:
Reads the acceleration/deceleration delay amount of axis specified with
"axis".
The acceleration/deceleration 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 acceleration/deceleration delay amount of each axis is
stored in the data array of ODBAXIS.

The decimal point position of the acceleration/deceleration delay


amount can be acquired in the cnc_getfigure() function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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)

for each axis for all axes


ODBAXIS 0+-------+ --- 0+-------+ ---
| dummy | ^ | dummy | ^
2+-------+ | 2+-------+ |
| type | length | type | length
4+-------+-------+ | 4+-------+-------+ |
| data[0] | v | data[0] | |
8+---------------+ --- 8+---------------+ |
== == |
4+4x(n-1)+---------------+ |
| data[n-1] | v
4+4xn+---------------+ ---

Series 150 : n = Maximum controlled axes


* The data for current controlled axes are valid.
Series 160/180/210,NC board : n = Current controlled axes

49
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. */

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
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.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

50
(9) Read All Dynamic Data

Function Name:
cnc_rddynamic

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rddynamic(unsigned short FlibHndl,short axis,
short length,ODBDY *rddynamic);
Description:
Read various data which changes as CNC driving at a time.
The data which can be read is as follows.
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
Actual spindle speed cnc_acts
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

(Last four functions follow the axis specification)

The formats of each data are same as "Function used for reading
individually".
Refer each functions for details.

The data concerning the axis is read by specified with axis.


Each data is stored in oaxis structure in ODBDY.

All axes can be read at a time by specifying ALL_AXES for "axis".


In that case, various data concerning the axis is stored in each array
of faxis inside ODBDY.

The decimal point position of the various data concerning the axis
can be acquired in the cnc_getfigure() function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

axis Specify axis number to read.


ALL_AXES : for all axes(ALL_AXES : -1)
1,..,m : for each axis
(m : number of controlled axis)

51
length Specify the length of the data block(size of ODBDY structure)

for each axis for all axes


ODBDY 0+-------+ --- 0+-------+ ---
| dummy | ^ | dummy | ^
2+-------+ | 2+-------+ |
| axis | | | axis | |
4+-------+ | 4+-------+ |
| alarm | | | alarm | |
6+-------+ | 6+-------+ |
| prgnum| | | prgnum| |
8+-------+ | 8+-------+ |
| prgmnum length | prgmnum length
10+-------+-------+ | 10+-------+-------+ |
| seqnum | | | seqnum | |
14+---------------+ | 14+---------------+ |
| actf | | | actf | |
18+---------------+ | 18+---------------+ |
| acts | | | acts | |
22+---------------+ | 22+---------------+ |
| absolute | | | absolute[0] | |
26+---------------+ | 26+---------------+ |
| machine | | == == |
30+---------------+ | 22+4x(n-1)+---------------+ |
| relative | | | absolute[n-1]| |
34+---------------+ | 22+4xn+---------------+ |
| distance | v | machine[0] | |
38+---------------+ --- 22+4x(n+1)+---------------+ |
== == |
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]| v
22+4x4n+---------------+ ---

Series 150/160/180/210,NC board : n = Maximum controlled axes


* The data for current controlled axes are valid.

52
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 ; /* actual spindle speed */
union {
struct {
long absolute[MAX_AXIS] ; /* absolute */
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. */

dummy Not used

axis Axis number


The read axis number is returned.

alarm Alarm status


The meaning of each bit is as follows.

Series 150
#15:System error
#14:Power off parameter set
#13:I/O error
#12:Servo alarm
#11:Not used
#10:Serious P/S
#09:Not used
#08:External alarm message
#07:PMC error
#06:Overtravel,Ext. data
#05:Parameter switch on
#04:Syncronized error
#03:Sub-CPU error
#02:Overheat alarm
#01:Foreground P/S
#00:Background P/S

53
Series 160/180/210,NC board
#15:External alarm message
#14:(Not used)
#13:(Not used)
#12:(Not used)
#11:Laser alarm
#10:P/S alarm 5000, punchpress alarm
#09:Spindle alarm
#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

prgnum Program number under execution


(It is the selected program number while
automatic operation stopping)

prgmnum Main program number(It is invalid in Series 150)

seqnum Current sequence number

actf Actual feed rate of the controlled axes

acts Actual spindle speed data

absolute Absolute position of the controlled axes

machine Machine position of the controlled axes

relative Relative position of the controlled axes

distance Amount of distance to go of the controlled axes

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
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.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

54
CNC option: There is no need of CNC option for this function.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 2204#1, 7613#0,#1,#2 --- must be set


2202#2,#3,#4,#5,#6,#7 --- influenced by setting

Series 160/180/210,NC board none

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

55
(10) Set Origin / Preset Relative Axis Position

Function Name:
cnc_wrrelpos

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrrelpos(unsigned short FlibHndl,
short length,IDBWRR *wrrelpos);
Description:
Set again 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
Identify the process which uses the library.
See "Library handle" for details.

length Specify the length of the data block(size of IDBWRR structure)

for each axis for all axes


IDBWRR 0+-------+ --- 0+-------+ ---
| datano| ^ | datano| ^
2+-------+ | 2+-------+ |
| type | length | type | length
4+-------+-------+ | 4+-------+-------+ |
| data[0] | v | data[0] | |
8+---------------+ --- 8+---------------+ |
== == |
4+4x(n-1)+---------------+ |
| data[n-1] | v
4+4xn+---------------+ ---

Series 150/160/180/210,NC board : n = Maximum controlled axes


* The data for current controlled axes are valid.

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)

56
data Specify value to make preset.
data[0],..,data[m-1] : for all axes
data[0] : for each axis

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
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.
At this time, axis number(0 -) that error
occurs is set in global variable
cnc_errdtno(short).
EW_NOOPT no option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

57
(11) Preset Work Coordinate

Function Name:
cnc_prstwkcd

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_prstwkcd(unsigned short FlibHndl,
short length,IDBWRA *prstwkcd);
Description:
Preset the word coordinate selecting in CNC(absolute position).
Preset data is specified by "data[0]" in "IDBWRA".

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 IDBWRA.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

length Specify the length of the data block(size of IDBWRA structure)

for each axis for all axes


IDBWRA 0+-------+ --- 0+-------+ ---
| datano| ^ | datano| ^
2+-------+ | 2+-------+ |
| type | length | type | length
4+-------+-------+ | 4+-------+-------+ |
| data[0] | v | data[0] | |
8+---------------+ --- 8+---------------+ |
== == |
4+4x(n-1)+---------------+ |
| data[n-1] | v
+4xn+---------------+ ---

Series 150/160/180 : n = Maximum controlled axes


* The data for current controlled axes are valid.

prstwkcd
Pointer to the IDBWRA structure to be set work coordinate
system of the controlled axes.
The IDBWRA structure is as follows.
typedef struct idbwrr {
short datano; /* Not used. */
short type; /* Axis number. */
long data[MAX_AXIS]; /* Preset data. */
} IDBWRA ; /* 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

58
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH data block length error
Size of ODBWRA 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.
At this time, axis number(0 -) that error
occurs is set in global variable
cnc_errdtno(short).
EW_NOOPT no option
The work coordinate system preset function and
the extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The work coordinate system preset function and the extended
driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

59
(12) Read Manual Overlapped Motion Value

Function Name:
cnc_rdmovrlap

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdmovrlap(unsigned short FlibHndl,short axis,
short length,IODBOV *movrlap);

Description:
Read the manual overlapped motion value based on the input unit and
based on the output unit.

All axes can be read at a time by specifying ALL_AXES for "axis".


(It is impossible to read each axis)
In that case, an manual overlapped motion value of each axis is stored
in the data array of IODBOV.

The decimal point position of the manual overlapped motion value can
be acquired in the cnc_getfigure() function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

axis Specify axis number to read.


Only all axes specification can be specified.
ALL_AXES : for all axes(ALL_AXES : -1)

length Specify the length of the data block(size of IODBOV structure)

for all axes


IODBOV 0+-------+ ---
| dummy | ^
2+-------+ |
| type | length
4+-------+-------+ |
| data[0][0] | |
8+---------------+ |
== == |
4+4x(n-1)+---------------+ |
| data[0][n-1]| |
4+4xn+---------------+ |
| data[1][0] | |
4+4x(n+1)+---------------+ |
== == |
4+4x(2n-1)+---------------+ |
| data[1][n-1]| v
4+4x2n+---------------+ ---

Series 150/160/180/210,NC board : n = Maximum controlled axes


* The data for current controlled axes are valid.

60
movrlap
Pointer to the IODBOV structure including the manual overlapped
motion value of the controlled axes.
The IODBOV structure is as follows.
typedef struct iodbov {
short dummy ; /* Not used. */
short type ; /* Axis number. */
long data[2][MAX_AXIS] ; /* Manual overlapped
motion value. */
} IODBOV ; /* MAX_AXIS is the maximum controlled axes. */

datano Not used

type Axis number(only ALL_AXES)

data manual overlapped motion value


Input unit : data[0][0] ,.., data[0][n-1]
Output unit : data[1][0] ,.., data[1][n-1]
Two kind of the manual overlapped motion value
are acquired.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH data block length error
Size of IODBOV structure(length) is illegal.
EW_ATTRIB data attribute error
The specification of axis number (axis) is
improper.
EW_NOOPT no option
The handle interrupt function and the extended
driver/library function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The handle interrupt function and the extended driver/library
function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

61
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

62
(13) Cancel Manual Overlapped Motion Value

Function Name:
cnc_canmovrlap

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_canmovrlap(unsigned short FlibHndl,
short axis);
Description:
Cancel the manual overlapped motion value of axis specified with "axis".

It is possible to cancel the manual overlapped motion value of all axes


at a time by specifying ALL_AXES for "type".

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

axis Specify axis number to cancel.


ALL_AXES : for all axes(ALL_AXES : -1)
1,..,m : for each axis
(m : number of controlled axis)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_ATTRIB data attribute error
The specification of axis number (axis) is
improper.
EW_NOOPT no option
The handle interrupt function and the extended
driver/library function is necessary.
EW_PARAM CNC parameter error
(Series160/180 Set 7100#3=1
/210,NC board)

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The handle interrupt function and the extended driver/library
function is necessary.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 none


Series 160/180/210,NC board 7100#3=1 --- must be set

CNC mode: This function can be used in any CNC mode.

63
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

64
(14) Read Actual Spindle Speed (S)

Function Name:
cnc_acts

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_acts(unsigned short FlibHndl,
ODBACT *actualspindle);
Description:
Reads the actual rotational speed of the spindle connected to CNC.
The actual spindle speed is stored in "data" of "ODBACT".

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

actualfeed
Pointer to the ODBACT structure including the actual spindle
speed.
The ODBACT structure is as follows.
typedef struct odbact {
short dummy[2] ; /* Not used. */
long data ; /* Actual spindle speed(S). */
} ODBACT ;

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_PARAM CNC parameter error
(Only Series150)7613#0=0 when CNC is turned on,
or 7613#0=1,7613#2=0 at present.
Set 7613#0=1 and 7613#2=1.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7613#0=1, 7613#2=1 --- must be set

Series 160/180/210,NC board none

CNC mode: This function can be used in any CNC mode.

65
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

66
(15) Read Load Information of Serial Spindle

Function Name:
cnc_rdspload

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdspload(unsigned short FlibHndl,
short sp_no,ODBSPN *serialspindle);
Description:
Read the load infomation of the serial spindle.
The load information of the serial spindle is stored in "data[0]" of
"ODBSPN".

All spindle can be read at a time by specifying ALL_AXES for "sp_no".


In that case, an load information of each serial spindle is stored in
the data array of ODBSPN.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

sp_no Specify spindle number to read.


ALL_SPINDLES : for all spindles (ALL_SPINDLES: -1)
1,..,MAX_SPINDLES : for each spindle
MAX_SPINDLES is maximum number of spindle.
It becomes 4 in Series 150, and becomes 3 in Series 160/180/210
,NC board.

serialspindle
Pointer to the ODBSPN structure including the load information
of the serial spindle.
The ODBSPN structure is as follows.
typedef struct odbspn {
short datano; /* Spindle number. */
short type; /* Not used. */
short data[MAX_SPINDLES]; /* Spindle data. */
} ODBSPN ; /* MAX_SPINDLES is maximum number of spindle. */

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The specification of spindle number (sp_no) is
illegal.
EW_NOOPT no option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

67
CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

68
(16) Read Maximum RPM Ratio of Serial Spindle

Function Name:
cnc_rdspmaxrpm

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdspmaxrpm(unsigned short FlibHndl,
short sp_no,ODBSPN *serialspindle);
Description:
Read the maximum r.p.m. ratio of serial spindle.
The gear ratio is stored in "data[0]" of "ODBSPN".

All spindle can be read at a time by specifying ALL_AXES for "sp_no".


In that case, an maximum r.p.m. ratio of each serial spindle is stored
in the data array of ODBSPN.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

sp_no Specify spindle number to read.


ALL_SPINDLES : for all spindles (ALL_SPINDLES: -1)
1,..,n : for each spindle
n is MAX_SPINDLES(maximum number of spindle).
It becomes 4 in Series 150, and becomes 3 in Series 160/180/210
,NC board.

serialspindle
Pointer to the ODBSPN structure including the maximum r.p.m.
ratio of the serial spindle.
The ODBSPN structure is as follows.
typedef struct odbspn {
short datano; /* Spindle number. */
short type; /* Not used. */
short data[MAX_SPINDLES]; /* Spindle data. */
} ODBSPN ; /* MAX_SPINDLES is maximum number of spindle. */

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The specification of spindle number (sp_no) is
illegal.
EW_NOOPT no option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

69
CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

70
(17) Read Gear Ratio of Serial Spindle

Function Name:
cnc_rdspgear

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdspgear(unsigned short FlibHndl,
short sp_no,ODBSPN *serialspindle);
Description:
Read the gear ratio of the serial spindle.
The gear ratio is stored in "data[0]" of "ODBSPN".

All spindle can be read at a time by specifying ALL_AXES for "sp_no".


In that case, an gear ratio of each serial spindle is stored in the
data array of ODBSPN.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

sp_no Specify spindle number to read.


ALL_SPINDLES : for all spindles (ALL_SPINDLES: -1)
1,..,n : for each spindle
n is MAX_SPINDLES(maximum number of spindle).

It becomes 4 in Series 150, and becomes 3 in Series 160/180/210


,NC board.

serialspindle
Pointer to the ODBSPN structure including the gear ratio of the
serial spindle.
The ODBSPN structure is as follows.
typedef struct odbspn {
short datano; /* Spindle number. */
short type; /* Not used. */
short data[MAX_SPINDLES]; /* Spindle data. */
} ODBSPN ; /* MAX_SPINDLES is maximum number of spindle. */

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The specification of spindle number (sp_no) is
illegal.

EW_NOOPT no option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

71
CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

72
(18) Read tool tip coordinates for 3-dimensional handle feed(Version 1.3 and newer)

Function Name:
cnc_rd3dtooltip

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rd3dtooltip(unsigned short FlibHndl,
ODB3DHDL *tooltip);
Description:
Read the absolute position of the tool tip coordinates about
3-dimensional handle feed.
The number of each axis and the tool tip coordinates are stored
respectively in "axes" and "data" of "ODB3DHDL".

The places of decimal points can be got by cnc_getfigure() function.

The relation to the read tool tip coordinates, amounts of


Tool Length Compensation and Cutter Radius Compensation, and amounts of
servo delay and acceleration/deceleration delay follows setting the
CNC parameter of the following description.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

tooltip Pointer to the ODB3DHDL structure including the tool tip


coordinates of the controlled axes.
The ODB3DHDL structure is as follows.
typedef struct odb3dhdl {
short axes[5] ; /* Axis number(0 -) */
long data[5] ; /* Tool tip coordinates */
} ODB3DHDL ;

ODB3DHDL tooltip[2] ;
tooltip[0] : for general and first parallel axis
tooltip[1] : for second parallel axis

axes Axis number(0 -) is set.

data Tool tip coordinates is set.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The 3-dimensional handle feed function and
the extended driver/library function; besides,
either the manual handle feed function or
the manual handle interrupt function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the 3-dimensional handle feed function and
the extended driver/library function; moreover, needs either

73
the manual handle feed function or the manual handle interrupt
function.

CNC parameter: This function relates to the following CNC parameters.


See the manual of CNC parameter for details.
Series 150 2204#1=1, 7613#0=1 --- must be set
1022, 2202#2,#3,#4,#5 --- influenced by setting
Parameters concerning the 3-dimensional handle feed
function. --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

74
(19) Read handle interrupt pulse amount for 3-dimensional handle feed(Version 1.3
and newer)

Function Name:
cnc_rd3dpulse

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rd3dpulse(unsigned short FlibHndl,
ODB3DPLS *hdlpulse);
Description:
Read the handle interrupt pulse amount about 3-dimensional handle feed.

The handle interrupt pulse amount in special handle feed mode(G156#0,


#1,#2/DI) is stored in each member of ODB3DPLS structure.

Special handle feed mode Interrupt pulse amount stored


---------------------------------------+-----------------------------
Tool axis perpendicular direction right_angle_x
mode X axis direction
Tool axis perpendicular direction right_angle_y
mode Y axis direction
Tool axis direction mode tool_axis
Tool tip center rotation mode A, B axis tool_tip_a_b
Tool tip center rotation mode C axis tool_tip_c

The places of decimal points can be got by cnc_getfigure() function


specified tool offset.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

hdlpulse
Pointer to the ODB3DPLS structure including the handle
interrupt pulse amount of each mode.
The ODB3DPLS structure is as follows.
typedef struct odb3dpls {
long right_angle_x ; /* Tool axis perpendicular
direction mode X axis direction */
long right_angle_y ; /* Tool axis perpendicular
direction mode Y axis direction */
long tool_axis ; /* Tool axis direction mode */
long tool_tip_a_b ;
/* Tool tip center rotation mode A, B axis */
long tool_tip_c ;
/* Tool tip center rotation mode C axis */
} ODB3DPLS ;

ODB3DPLS hdlpulse[2] ;
hdlpulse[0] : for general and first parallel axis
hdlpulse[1] : for second parallel axis

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling

75
--------------------------------------------------------------
EW_NOOPT No option
The 3-dimensional handle feed function and
the extended driver/library function; besides,
either the manual handle feed function or
the manual handle interrupt function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the 3-dimensional handle feed function and
the extended driver/library function; moreover, needs either
the manual handle feed function or the manual handle interrupt
function.

CNC parameter: This function relates to the following CNC parameters.


See the manual of CNC parameter for details.
Series 150 Parameters concerning the 3-dimensional handle feed
function.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

76
(20) Read handle interrupt move amount for 3-dimensional handle feed(Version 1.3
and newer)

Function Name:
cnc_rd3dmovrlap

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rd3dmovrlap(unsigned short FlibHndl,
ODB3DHDL *hdlmove);
Description:
Read the movement amount (generally for 5 axes, in case of parallel
axis, 5 + 5 = 10 axes) about 3-dimensional handle feed.
The number of each axis and the movement amount are stored
respectively in "axes" and "data" of "ODB3DHDL".

The places of decimal points can be got by cnc_getfigure() function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

hdlmove
Pointer to the ODB3DHDL structure including the movement amount
of each axis.
The ODB3DHDL structure is as follows.
typedef struct odb3dhdl {
short axes[5] ; /* Axis number(0 -) */
long data[5] ; /* Movement amount */
} ODB3DHDL ;

ODB3DHDL hdlmove[2] ;
hdlmove[0] : for general and first parallel axis
hdlmove[1] : for second parallel axis

axes Axis number(0 -) is set.

data Handle interrupt move amount is set.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The 3-dimensional handle feed function and
the extended driver/library function; besides,
either the manual handle feed function or
the manual handle interrupt function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the 3-dimensional handle feed function and
the extended driver/library function; moreover, needs either
the manual handle feed function or the manual handle interrupt
function.

77
CNC parameter: This function relates to the following CNC parameters.
See the manual of CNC parameter for details.
Series 150 1022 and parameters concerning the 3-dimensional handle
feed function.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

78
(21) Read the modification of tool length compensation amount in tool axis
direction(Version 1.3 and newer)

Function Name:
cnc_rd3dofschg

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rd3dofschg(unsigned short FlibHndl,
long *ofschg);
Description:
Read the modification of tool length compensation amount in tool axis
direction.

The places of decimal points can be got by cnc_getfigure() function


specified tool offset.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

ofschg Specify the address of the array to store the modification of


tool length compensation amount in tool axis direction.
Actual modification of tool length compensation amount in tool
axis direction being read is stored after this function call.

long ofschg[2] ;
ofschg[0] : for general and parallel axes
ofschg[1] : (not used)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The 3-dimensional handle feed function and
the extended driver/library function; besides,
either the manual handle feed function or
the manual handle interrupt function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the 3-dimensional handle feed function and
the extended driver/library function; moreover, needs either
the manual handle feed function or the manual handle interrupt
function.

CNC parameter: This function relates to the following CNC parameters.


See the manual of CNC parameter for details.
Series 150 Parameters concerning the 3-dimensional handle feed
function.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+

79
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

80
(22) Clear handle interrupt pulse amount and move amount for 3-dimensional handle
feed(version 1.3 and newer)

Function Name:
cnc_clr3dplsmov

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_clr3dplsmov(unsigned short FlibHndl,
short type);
Description:
Clear the handle interrupt pulse amount and the handle interrupt move
amount.

It is only the handle interrupt pulse amount to be able to specify


the mode.
(The handle interrupt move amount is cleared always for all axes.)

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

type Specify the special handle feed mode number to clear handle
interrupt pulse amount.
1 : Tool axis perpendicular direction mode X axis direction
(for general and first parallel axis)
2 : Tool axis perpendicular direction mode Y axis direction
(for general and first parallel axis)
3 : Tool axis direction mode
(for general and first parallel axis)
4 : Tool tip center rotation mode A, B axis
(for general and first parallel axis)
5 : Tool tip center rotation mode C axis
(for general and first parallel axis)
6 : Tool axis perpendicular direction mode X axis direction
(for second parallel axis)
7 : Tool axis perpendicular direction mode Y axis direction
(for second parallel axis)
8 : Tool axis direction mode
(for second parallel axis)
9 : Tool tip center rotation mode A, B axis
(for second parallel axis)
10 : Tool tip center rotation mode C axis
(for second parallel axis)
-1 : All mode

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_DATA Data error
Special handle feed mode number(type) is wrong.

EW_NOOPT No option
The 3-dimensional handle feed function and
the extended driver/library function; besides,
either the manual handle feed function or

81
the manual handle interrupt function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the 3-dimensional handle feed function and
the extended driver/library function; moreover, needs either
the manual handle feed function or the manual handle interrupt
function.

CNC parameter: This function relates to the following CNC parameters.


See the manual of CNC parameter for details.
Series 150 Parameters concerning the 3-dimensional handle feed
function.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

82
(23) Read absolute axis position 2 (Version 1.4 and newer)

Function Name:
cnc_absolute2

Description:
Differences between functions of cnc_absolute2 and functions of
cnc_absolute are described.
The interface of function is similar to cnc_absolute function.

The cnc_absolute function reads an absolute actual position where the


amount of all the tool offset was tempered to the instruction value.
Therefore, the coordinates values called by this function and absolute
position displayed on the position display screen by setting CNC
parameter might be different.

The cnc_absolute2 function reads the value same as the absolute


position displayed on the position display screen of CNC.

Note 1) In Series 150, both cnc_absolute and cnc_absolute2 same value


as the absolute position displayed on the position display
screen of CNC is read.

Note 2) Only when the series and the number of version of CNC software
correspond to the cnc_absolute2 function, the same value as the
absolute position displayed on the position display screen of
CNC is read.
The same value as cnc_absolute function is read for the series
and the number of version of uncorrespondence.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 2204#1=1, 7613#0=1 --- must be set


(M Series)2202#2,#3,#4,#5 --- influenced by setting
(T Series)2202#4,#5, 2203#3 --- influenced by setting

Series 160/180/210,NC board


3104#6,#7 --- influenced by setting

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

83
(24) Read relative axis position 2 (Version 1.4 and newer)

Function Name:
cnc_relative2

Description:
Differences between functions of cnc_relative2 and functions of
cnc_relative are described.
The interface of function is similar to cnc_relative function.

The cnc_relative function reads an relative actual position where the


amount of all the tool offset was tempered to the instruction value.
Therefore, the coordinates values called by this function and relative
position displayed on the position display screen by setting CNC
parameter might be different.

The cnc_relative2 function reads the value same as the relative


position displayed on the position display screen of CNC.

Note 1) In Series 150, both cnc_relative and cnc_relative2 same value


as the relative position displayed on the position display
screen of CNC is read.

Note 2) Only when the series and the number of version of CNC software
correspond to the cnc_relative2 function, the same value as the
relative position displayed on the position display screen of
CNC is read.
The same value as cnc_relative function is read for the series
and the number of version of uncorrespondence.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 2204#1=1, 7613#0=1 --- must be set


(M Series)2202#2,#3,#4,#5 --- influenced by setting
(T Series)2202#4,#5, 2203#3 --- influenced by setting

Series 160/180/210,NC board


3104#4,#5 --- influenced by setting

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

84
1.1.8 Function Reference Related to Program

(1) Start Downloading NC Program

Function Name:
cnc_dwnstart

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dwnstart(unsigned short FlibHndl);

Description:
Requests CNC to start downloading NC program.
(This function must be executed before cnc_download/cnc_cdownload.)
In the case of Series 150, when the CNC side is in background edit
processing, this function waits the termination of background edit.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
Series150
- cnc_dwnstart(cnc_vrfstart) function has been
executed. Terminate a downloading(verifying)
by using cnc_dwnend(cnc_vrfend) function.
Series160/180/210,NC board
- cnc_dwnstart(cnc_vrfstart) function has been
executed. Terminate a downloading(verifying)
by using cnc_dwnend(cnc_vrfend) function.
- background edit processing in CNC side
Terminate background edit processing in CNC
side.
- alarm (PS000, PS101) in CNC side
Reset the alarm on CNC.
- MDI mode
Change CNC mode to any mode except MDI.
EW_FUNC Parameter(No.20,22:Input device) is wrong.
(Series 150)
EW_PROT Write protection in CNC side
- Protection KEY(DI) turns off.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

85
CNC option: There is no need of CNC option for this function.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 0020=16(EDIT mode) -+- must be set


0022=16(except EDIT mode) -+

0000#0 -+- influenced by setting


2200#1,#3,#4 -+
0011#0,2201#0 -+
2210,2211,2212,2213 -+

Series 160/180/210,NC board


0000#0 -+- influenced by setting
3201#2,#5,#6 -+
3202#0,#4 -+
3210,3211 -+
3290#7 -+

CNC mode: This function relates to the following mode.

Series 150 It is possible to use in any CNC mode.


(It is necessary to set the parameter according to
the mode)
Series 160/180/210,NC board
It is possible to use in other than MDI mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

86
(2) Download NC Program

Function Name:
cnc_download

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_download(unsigned short FlibHndl,char *data,
short number);
Description:
Output NC program to be registered(downloading).

When the data processing on the CNC side is delayed and the data
cannot be transferred, this function waits until it can be transferred.
If an application cannot wait, use the cnc_cdownload function.

The procedure of downloading is as follows.

+-------------------+
| 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)

For transferring the data, there are 4 buffers of 256 bytes.


One buffer is used in the call once without any relation to the data
size. Therefore, the maximum size which can be transferred by calling
once is 256 bytes.
+-----------------------------------------+
| Buffers are used in sequence. |
1 ---------> 2 ----------> 3 -----------> 4
---- +-------+ +--------+ +--------+ +--------+ ---
buffer | | | +--------+ | | | | | data
size 256 +-------+ | | +--------+ | | | size
| | | | | | | +--------+ ----
---- +-------+ +--------+ +--------+ +--------+

Because importance is attached to the speed of data transfer to the


CNC, in general, errors(EW_DATA,EW_OVRFLOW, etc.) are returned with
a delay.
Namely, in actual practice, an error at a certain time is for data
which was transferred several times previously. Further, an error
for an amount of data for several times before finish is returned
by "End of downloading NC program".

87
NC program format
~~~~~~~~~~~~~~~~~
NC program to be registered to 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.)

'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 ;
%

send a following string using cnc_download function.

"\nO1234\nG1F0.3W10.\nM30\n%"

The string data can be sent by multiple cnc_download functions.


For above example, the program can be sent block by block like this.

"\n"
"O1234\n"
"G1F0.3W10.\n"
"M30\n"
"%"

And more, it is possible to send one block by multiple cnc_download


functions.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

data Specify the top address of NC program data.

number Specify the number of characters of NC program data. (1 - 256)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_RESET Reset or stop request
'RESET or STOP' was pushed.
Call the cnc_dwnend function.
EW_FUNC cnc_dwnstart function has not been executed.
EW_LENGTH Data block length error
Length of data block(number) exceeds 256 bytes.

88
EW_DATA Data error
- The same program number has already been
registered.
- The same program number is selected on CNC.
- A character which is unavailable for NC
program is detected.
- When TV check is effective, a block which
includes odd characters(including 'LF' at the
end of the block) is detected.
See 'Description' about the timing of error.
EW_PROT Write protection in CNC side
- CNC parameter is a state of write-protection
(O8000-/O9000- protection, encoding).
See 'Description' about the timing of error.
EW_OVRFLOW Memory overflow
It is lack of free area in CNC memory.
Make enough free area in CNC memory.
See 'Description' about the timing of error.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 0020=16(EDIT mode) -+- must be set


0022=16(except EDIT mode) -+
0000#0 -+- influenced by setting
2200#1,#3,#4 -+
0011#0,2201#0 -+
2210,2211,2212,2213 -+
Series 160/180/210,NC board
0000#0 -+- influenced by setting
3201#2,#5,#6 -+
3202#0,#4 -+
3210,3211 -+
3290#7 -+

CNC mode: This function relates to the following mode.


Series 150 It is possible to use in any CNC mode.
(It is necessary to set the parameter according to the mode)
Series 160/180/210,NC board
It is possible to use in other than MDI mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

89
(3) Download NC Program (Conditional)

Function Name:
cnc_cdownload

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_cdownload(unsigned short FlibHndl,char *data,
short number);
Description:
Output NC program to be registered(downloading).

When the data processing on the CNC side is delayed and the next data
cannot be transferred, error(EW_BUFFER) results.
If an application should wait, use the cnc_download function.
Except the difference of the above-mentioned, this is same as "Download
NC program(cnc_download)", and refer "cnc_download" function for other
description.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

data Specify the top address of NC program data.

number Specify the number of characters of NC program data. (1 - 256)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_RESET Reset or stop request
'RESET or STOP' was pushed.
Call the cnc_dwnend function.
EW_FUNC cnc_dwnstart function has not been executed.
EW_LENGTH Data block length error
Length of data block(number) exceeds 256 bytes.
EW_DATA Data error
- The same program number has already been
registered.
- The same program number is selected on CNC.
- A character which is unavailable for NC
program is detected.
- When TV check is effective, a block which
includes odd characters(including 'LF' at the
end of the block) is detected.
See 'Description' about the timing of error.
EW_PROT Write protection in CNC side
- CNC parameter is a state of write-protection
(O8000-/O9000- protection, encoding).
See 'Description' about the timing of error.

90
EW_OVRFLOW Memory overflow
It is lack of free area in CNC memory.
Make enough free area in CNC memory.
See 'Description' about the timing of error.
EW_BUFFER Buffer full
Retry because the buffer is full.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 0020=16(EDIT mode) -+- must be set


0022=16(except EDIT mode) -+

0000#0 -+- influenced by setting


2200#1,#3,#4 -+
0011#0,2201#0 -+
2210,2211,2212,2213 -+

Series 160/180/210,NC board


0000#0 -+- influenced by setting
3201#2,#5,#6 -+
3202#0,#4 -+
3210,3211 -+
3290#7 -+

CNC mode: This function relates to the following mode.

Series 150 It is possible to use in any CNC mode.


(It is necessary to set the parameter according to the
mode)

Series 160/180/210,NC board


It is possible to use in other than MDI mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

91
(4) End of Downloading NC Program

Function Name:
cnc_dwnend

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dwnend(unsigned short FlibHndl);

Description:
Notices the end of downloading NC program to CNC.
(This function must be executed after cnc_download/cnc_cdownload.)
There are cases where errors(EW_DATA,EW_OVRFLOW, etc.) during execution
of downloading NC program are returned by this function.
Further, there is no return from this function until the registration
of the output data by cnc_download(cnc_cdownload) is finished.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC cnc_dwnstart function has not been executed.
EW_DATA Data error
- The same program number has already been
registered.
- The same program number is selected on CNC.
- A character which is unavailable for NC
program is detected.
- When TV check is effective, a block which
includes odd characters(including 'LF' at the
end of the block) is detected.
See 'Description' about the timing of error.
EW_PROT Write protection in CNC side
- CNC parameter is a state of write-protection
(O8000-/O9000- protection, encoding).
See 'Description' about the timing of error.
EW_OVRFLOW Memory overflow
It is lack of free area in CNC memory.
Make enough free area in CNC memory.
See 'Description' about the generation timing.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

92
CNC parameter: This function relates to the following CNC parameter.
See the manual of CNC parameter for details.

Series 150 0020=16(EDIT mode) -+- must be set


0022=16(except EDIT mode) -+

0000#0 -+- influenced by setting


2200#1,#3,#4 -+
0011#0,2201#0 -+
2210,2211,2212,2213 -+

Series 160/180/210,NC board


0000#0 -+- influenced by setting
3201#2,#5,#6 -+
3202#0,#4 -+
3210,3211 -+
3290#7 -+

CNC mode: This function relates to the following mode.

Series 150 It is possible to use in any CNC mode.


(It is necessary to set the parameter according to the
mode)

Series 160/180/210,NC board


It is possible to use in other than MDI mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

93
(5) Start Verification of NC Program

Function Name:
cnc_vrfstart

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_vrfstart(unsigned short FlibHndl);

Description:
Requests CNC to start verification of NC program.
(This function must be executed before cnc_verify/cnc_cverify.)

It is possible to compare already registered NC program in CNC and


a program which is output by the application program.

In the case of Series 150, when the CNC side is in background edit
processing, execution is made to wait.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
Series150
- cnc_vrfstart(cnc_dwnstart) function has been
executed. Terminate a verifying(downloading)
by using cnc_vrfend(cnc_dwnend) function.
Series160/180/210,NC board
- cnc_vrfstart(cnc_dwnstart) function has been
executed. Terminate a verifying(downloading)
by using cnc_vrfend(cnc_dwnend) function.
- background edit processing in CNC side
Terminate background edit processing in CNC
side.
- alarm (PS000, PS101) in CNC side
Reset the alarm on CNC.
- MDI mode
Change CNC mode to any mode except MDI.
EW_FUNC Parameter(No.20,22:Input device) is wrong.
(Series 150)

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

94
CNC parameter: This function relates to the following CNC parameter.
See the manual of CNC parameter for details.

Series 150 0020=16(EDIT mode) -+- must be set


0022=16(except EDIT mode) -+

0000#0 -+- influenced by setting


0011#0,2201#0 -+
2210,2211,2212,2213 -+

Series 160/180/210,NC board


0000#0 -+- influenced by setting
3202#0,#4 -+
3210,3211 -+

CNC mode: This function relates to the following mode.

Series 150 It is possible to use in any CNC mode.


(It is necessary to set the parameter according to the
mode)

Series 160/180/210,NC board


It is possible to use in other than MDI mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

95
(6) Verify NC Program

Function Name:
cnc_verify

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_verify(unsigned short FlibHndl,char *data,
short number);
Description:
Outputs NC program to be compared with already registered one to CNC.

When the data processing on the CNC side is delayed and the data
cannot be transferred, this function waits until it can be transferred.
If an application cannot wait, use the cnc_cverify function.

The procedure of verify is as follows.

+-------------------+
| cnc_vrfstart() | beginning of verify
+---------+---------+ (must be done)
+-------------->|
| +---------+---------+
| | cnc_verify() | output of verify data
| +---------+---------+
| |
| Yes +---------+----------------+
+-----+Is there data of unoutput?|
+---------+----------------+
| No
+---------+---------+
| cnc_vrfend() | End of verify
+-------------------+ (must be done)

For transferring the data, there are 4 buffers of 256 bytes.


One buffer is used in the call once without any relation to the data
size. Therefore, the maximum size which can be forwarded by calling
once is 256 bytes.
+-----------------------------------------+
| Buffers are used in sequence. |
1 ---------> 2 ----------> 3 -----------> 4
---- +-------+ +--------+ +--------+ +--------+ ---
buffer | | | +--------+ | | | | | data
size 256 +-------+ | | +--------+ | | | size
| | | | | | | +--------+ ----
---- +-------+ +--------+ +--------+ +--------+

Because importance is attached to the speed of data transfer to the


CNC, in general, errors(EW_DATA) are returned with a delay.
Namely, in actual practice, an error at a certain time is for data
which was transferred several times previously. Further, an error
for an amount of data for several times before finish is returned
by "End of verification".

Refer description of "cnc_download" function for format of output data.

96
Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

data Specify the top address of NC program data.

number Specify the number of characters of NC program data. (1 - 256)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_RESET Reset or stop request
'RESET or STOP' was pushed.
Call the cnc_vrfend function.
EW_FUNC cnc_vrfstart function has not been executed.
EW_LENGTH Data block length error
Length of data block(number) exceeds 256 bytes.
EW_DATA Data error
- Any difference has been detected during
comparing process.
- A character which is unavailable for NC
program is detected.
- When TV check is effective, a block which
includes odd characters(including 'LF' at the
end of the block) is detected.
See 'Description' about the timing of error.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 0020=16(EDIT mode) -+- must be set


0022=16(except EDIT mode) -+

0000#0 -+- influenced by setting


0011#0,2201#0 -+
2210,2211,2212,2213 -+

Series 160/180/210,NC board


0000#0 -+- influenced by setting
3202#0,#4 -+
3210,3211 -+

CNC mode: This function relates to the following mode.

Series 150 It is possible to use in any CNC mode.


(It is necessary to set the parameter according to the
mode)

Series 160/180/210,NC board


It is possible to use in other than MDI mode.

97
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

98
(7) Verify NC Program (Conditional)

Function Name:
cnc_cverify

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_cverify(unsigned short FlibHndl,char *data,
short number);
Description:
Outputs NC program to be compared with already registered one to CNC.
When the data processing on the CNC side is delayed and the next data
cannot be transferred, error(EW_BUFFER) results.
If an application should wait, use the cnc_verify function.

Except the difference of the above-mentioned, this is same as


"cnc_verify", and refer "cnc_verify" function for other description.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

data Specify the top address of NC program data.

number Specify the number of characters of NC program data. (1 - 256)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_RESET Reset or stop request
'RESET or STOP' was pushed.
Call the cnc_vrfend function.
EW_FUNC cnc_vrfstart function has not been executed.
EW_LENGTH Data block length error
Length of data block(number) exceeds 256 bytes.
EW_DATA Data error
- Any difference has been detected during
comparing process.
- A character which is unavailable for NC
program is detected.
- When TV check is effective, a block which
includes odd characters(including 'LF' at the
end of the block) is detected.
See 'Description' about the timing of error.
EW_BUFFER Buffer full
Retry because the buffer is full.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

99
CNC parameter: This function relates to the following CNC parameter.
See the manual of CNC parameter for details.

Series 150 0020=16(EDIT mode) -+- must be set


0022=16(except EDIT mode) -+

0000#0 -+- influenced by setting


0011#0,2201#0 -+
2210,2211,2212,2213 -+

Series 160/180/210,NC board


0000#0 -+- influenced by setting
3202#0,#4 -+
3210,3211 -+

CNC mode: This function relates to the following mode.

Series 150 It is possible to use in any CNC mode.


(It is necessary to set the parameter according to the
mode)

Series 160/180/210,NC board


It is possible to use in other than MDI mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

100
(8) End of Verification

Function Name:
cnc_vrfend

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_vrfend(unsigned short FlibHndl);

Description:
Notices the end of verification of NC program to CNC.
(This function must be executed after cnc_verify/cnc_cverify.)

There are cases where error(EW_DATA) during execution of verification


is returned by this function.

Further, there is no return from this function until the verification


of the output data by cnc_verify(cnc_cverify) is finished.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC cnc_vrfstart function has not been executed.
EW_DATA Data error
- Any difference has been detected during
comparing process.
- A character which is unavailable for NC
program is detected.
- When TV check is effective, a block which
includes odd characters(including 'LF' at the
end of the block) is detected.
Confirm the above-mentioned point.
See 'Description' about the generation timing.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 0020=16(EDIT mode) -+- must be set


0022=16(except EDIT mode) -+
0000#0 -+- influenced by setting
0011#0,2201#0 -+
2210,2211,2212,2213 -+
Series 160/180/210,NC board
0000#0 -+- influenced by setting
3202#0,#4 -+
3210,3211 -+

101
CNC mode: This function relates to the following mode.

Series 150 It is possible to use in any CNC mode.


(It is necessary to set the parameter according to the mode)

Series 160/180/210,NC board


It is possible to use in other than MDI mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

102
(9) Start Downloading DNC Program

Function Name:
cnc_dncstart

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dncstart(unsigned short FlibHndl);

Description:
It is possible to get CNC to run a NC program (NC command data),
which is made by the application program, directly (DNC operation).
The application program requests CNC to start DNC operation by this
function.

In case of Series 150, the parameter No.20 must be set to '15'.


Even if this setting is not done, this function does not return error.
In case of Series 160/180/210,NC board, "DMMC" signal(DI)<G042#7> must
be on.
Even if this setting is not done, this function does not return error.

Start the data transferring by using the 'cnc_dnc()' function or the


'cnc_cdnc()' function after executing this function and checking that
the "STL" signal(DO) is on.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
- cnc_dncstart function has been executed.
Terminate DNC operation by using cnc_dncend
function.
- alarm in CNC side(Series 160/180/210,
NC board)
Reset the alarm on CNC.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 0020=15 --- must be set


0000#0 --- influenced by setting

Series 160/180/210,NC board


0000#0 -+- influenced by setting
8706#0 -+

103
CNC mode: This function relates to the following mode.

Series 150 It is necessary to set TAPE mode.

Series 160/180/210,NC board


It is necessary to set MEM mode, and "DMMC" signal(DI)
G042#7=1.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

104
(10) Download DNC Program

Function Name:
cnc_dnc

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dnc(unsigned short FlibHndl,char *data,
short number);
Description:
Sends NC command data to CNC(for DNC operation).

When the data processing on the CNC side is delayed and the data
cannot be transferred, this function waits until it can be transferred.
If an application cannot wait, use the cnc_cdnc function.

The procedure of DNC operation is as follows.

+-------------------+
| cnc_dncstart() | beginning of DNC operation
+---------+---------+ (must be done)
+-------------->|
| +---------+---------+
| | cnc_dnc() | output of DNC download data
| +---------+---------+
| |
| Yes +---------+----------------+
+-----+Is there data of unoutput?|
+---------+----------------+
| No
+---------+---------+
| cnc_dncend() | End of DNC operation
+-------------------+ (must be done)

In case of Series 150, the parameter No.20 must be set to '15'.


Even if this setting is not done, this function does not return error.
In case of Series 160/180/210,NC board, "DMMC" signal(DI)<G042#7> must
be on.
Even if this setting is not done, this function does not return error.

For transferring the data, there are 16 buffers of 256 bytes in case of
Series 150, and there are 4 buffers of 256 bytes in case of Series 160/
180/210,NC board.
One buffer is used in the call once without any relation to the data
size. Therefore, the maximum size which can be transferred by calling
once is 256 bytes.

+-----------------------------------------+
| Buffers are used in sequence. |
1 ---------> 2 ----------> 3 -----------> 4
---- +-------+ +--------+ +--------+ +--------+ ---
buffer | | | +--------+ | | | | | data
size 256 +-------+ | | +--------+ | | | size
| | | | | | | +--------+ ----
---- +-------+ +--------+ +--------+ +--------+

105
For series 160/180/210 system, set the CNC parameter (No.8706#0=1) to
invoke the High Speed DNC interface. High Speed DNC uses the single
data buffer, which is 40K bytes size ring buffer. Application can
call the cnc_dnc() multiple times until the buffer becomes full.

+---------+ ----
| BUFFER | |
| for | <- READ Pointer | 40K bytes
WRITE Pointer ->| DNC| |
+---------+ ----

Maximum data which can be put into the buffer is 40K-1(40959) bytes.

Because importance is attached to the speed of data transfer to the


CNC, in general, errors(EW_DATA) are returned with a delay.
Namely, in actual practice, an error at a certain time is for data
which was transferred several times previously. Further, an error
for an amount of data for several times before finish is returned
by "End of verification".

Format of NC command data to be executed


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NC command data to be executed to CNC is a string composed of
ASCII characters as following format.

LF NC command1 LF NC command2 LF ... LF Mxx LF %

LF 0x0A('\n')
Mxx M code at the end of the DNC operation
(M02,M30,etc.)

'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

M3 S2000 ;
T14 ;
G0 X10. ;
G0 Z-5. ;
M30 ;

send a following string using cnc_dnc function.

cnc_dnc( "\nM3S2000\nT14\nG0X10.\nG0Z-5.\nM30\n%", 32 ) ;

The string data can be sent by multiple cnc_dnc functions.


For above example, the commands can be sent block by block like this.

cnc_dnc( "\n", 1 ) ;
cnc_dnc( "M3S2000\n", 8 ) ;
cnc_dnc( "T14\n", 4 ) ;
cnc_dnc( "G0X10.\n", 7 ) ;
cnc_dnc( "G0Z-5.\n", 7 ) ;
cnc_dnc( "M30\n", 4 ) ;
cnc_dnc( "%", 1 ) ;

106
Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

data Specify the top address of NC program data.

number Specify the number of characters of NC program data.(1,..,256)


(In case of High Speed DNC of Series 160/180/210,NC board, it
is 1,..,40959)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_RESET Reset or stop request
'RESET or STOP' was pushed.
Call the cnc_dncend function.
EW_FUNC cnc_dncstart function has not been executed.
EW_LENGTH Data block length error
Length of data block(number) exceeds 256 bytes.
(In case of High Speed DNC of
Series 160/180/210,NC board, 1,..,40959)
EW_DATA Data error
- A character which is unavailable for NC
program is detected.
- When TV check is effective, a block which
includes odd characters(including 'LF' at the
end of the block) is detected.
Confirm the above-mentioned point.
See 'Description' about the generation timing.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 0020=15 --- must be set


0000#0 --- influenced by setting
Series 160/180/210,NC board
0000#0 -+- influenced by setting
8706#0 -+

CNC mode: This function relates to the following mode.


Series 150 It is necessary to set TAPE mode.
Series 160/180/210,NC board
It is necessary to set MEM mode, and "DMMC" signal(DI)
G042#7=1.

107
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

108
(11) Download DNC Program (Conditional)

Function Name:
cnc_cdnc

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_cdnc(unsigned short FlibHndl,char *data,
short number);
Description:
Sends NC command data to CNC(for DNC operation).
When the data processing on the CNC side is delayed and the next data
cannot be transferred, error(EW_BUFFER) results.
If an application should wait, use the cnc_dnc function.
Except the difference of the above-mentioned, this is the same as
"cnc_dnc", and refer "cnc_dnc" function for other description.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

data Specify the top address of NC program data.

number Specify the number of characters of NC program data.(1,..,256)


(In case of High Speed DNC of Series 160/180/210,NC board, it
is 1,..,40959)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_RESET Reset or stop request
'RESET or STOP' was pushed.
Call the cnc_dncend function.
EW_FUNC cnc_dncstart function has not been executed.
EW_LENGTH Data block length error
Length of data block(number) exceeds 256 bytes.
(In case of High Speed DNC of
Series 160/180/210,NC board, 1,..,40959)
EW_DATA Data error
- A character which is unavailable for NC
program is detected.
- When TV check is effective, a block which
includes odd characters(including 'LF' at the
end of the block) is detected.
See 'Description' about the timing of error.
EW_BUFFER Buffer empty/full
Retry because the buffer is full.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

109
CNC option: There is no need of CNC option for this function.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 0020=15 --- must be set


0000#0 --- influenced by setting

Series 160/180/210,NC board


0000#0 -+- influenced by setting
8706#0 -+

CNC mode: This function relates to the following mode.

Series 150 It is necessary to set TAPE mode.

Series 160/180/210,NC board


It is necessary to set MEM mode, and "DMMC" signal(DI)
G042#7=1.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

110
(12) End of Downloading DNC Program

Function Name:
cnc_dncend

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dncend(unsigned short FlibHndl);

Description:
Notices the end of DNC operation to CNC.

Execute this stopping command after the CNC's operation has been
completed and reset. If this command is executed during CNC is
operating, the function-call waits until the end of operation and
resetting. Check "OP" signal(Series 150:F000#5, Series 160/180/210,
NC board:F000#7) to find whether CNC has been reset or not. When "OP"
signal is "0", CNC is has been reset.

There are cases where error(EW_DATA) during execution of downloading


DNC program is returned by this function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC cnc_dncstart function has not been executed.
EW_DATA Data error
- A character which is unavailable for NC
program is detected.
- When TV check is effective, a block which
includes odd characters(including 'LF' at the
end of the block) is detected.
Confirm the above-mentioned point.
See 'Description' about the generation timing.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 0020=15 --- must be set


0000#0 --- influenced by setting

Series 160/180/210,NC board


0000#0 -+- influenced by setting
8706#0 -+

111
CNC mode: This function relates to the following mode.

Series 150 It is necessary to set TAPE mode.

Series 160/180/210,NC board


It is necessary to set MEM mode, and "DMMC" signal(DI)
G042#7=1.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

112
(13) Start downloading DNC program (2) (Version 1.4 and newer)

Function Name:
cnc_dncstart2

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dncstart2(unsigned short FlibHndl,
char *filename);

Description:
This function returns whether or not DNC operation or M198 operation
are executed.

This function returns EW_OK in the case that DNC operation or M198
operation are started. If a return value is EW_OK, this function
returns a program number demanded from a CNC.
Also, if a return value is EW_OK, it become possible to outputted a
program of DNC operation or M198 operation by a function cnc_dnc2().

This function returns EW_REJECT in the case that DNC operation or M198
operation are not started,

The function that shows it below returns EW_FUNC in the case that this
function is not executed.

A basic procedure when carries out DNC operation or M198 operation is


shown below.

+-----------------------+
|Start of DNC operation |
|Start of M198 operation|
+-----------------------+
| <------------+
+-------------------+ | retry
| cnc_dncstart2() |----+
+-------------------+ =EW_REJECT
| =EW_OK
+-------------------+
| Program number is | No
| NULL? |-----------------------+
+-------------------+ |
| Yes |
|<-------------------+ |<-------------------+
|<-----------+ | |<-----------+ |
+-----------------+ | retry | +-----------------+ | retry |
| cnc_dnc2() |---+ | | cnc_dnc2() |---+ |
+-----------------+=EW_BUFFER | +-----------------+=EW_BUFFER |
| =EW_OK | | =EW_OK |
+-------------+ | +-------------+ |
| Continue ? |-------------+ | Continue ? |-------------+
+-------------+ Yes +-------------+ Yes
| No |No
|<--------------------------------+
( Next page )

( Previous page )
|
+-------------------+
| cnc_dncend2() | * The output result must be specified.
+-------------------+

113
|
+---------------------+
| DNC/M198 operation |
| completed |
+---------------------+

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

filename
The pointer of the area to set programs number were specified
by a CNC.
Such area that houses programs number is necessary biggest 16
bytes.
The actuation of this function is not warranted In the case
that areas over 16 bytes is not secured,

ASCII code that was terminated with null is set to programs


number.
<Example> In the case that 'O1234' was designated to
programs number, the following character string
is set to 'filename'.
'O1234' + NULL

The NULL string is set to programs number in case of DNC


operation, and the character string that shows programs number
in case of M198 operation.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
- cnc_dncstart function has been executed.
Terminate DNC operation by using cnc_dncend
function.
- alarm in CNC side(Series 160/180/210,
NC board)
Reset the alarm on CNC.

EW_NOOPT No option
The extended driver/library function is
necessary.

EW_PARAM CNC parameter error


Must be set the following to CNC parameter.
Series 150
7713#0 = 1
Series 160/180/210,NC board
8706#1 = 1

EW_REJECT DNC and M198 operation is not started.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

114
CNC parameter: This function relates to the following CNC parameter.
See the manual of CNC parameter for details.

Series 150
0000#0 --- influenced by setting
7713#0 = 1 -+- must be set
0020 = 15 -+

Series 160/180/210,NC board


0000#0 -+- influenced by setting
8706#0 -+
8706#1 = 1 -+- must be set
0020 = 15 -+

CNC mode: This function relates to the following mode.

Series 150
It is necessary to set TAPE mode.

Series 160/180/210,NC board


It is necessary to set MEM mode, and "DMMC" signal(DI)
G042#7=1 in case of DNC operation.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

115
(14) Download DNC program (2) (Version 1.4 and newer)

Function Name:
cnc_dnc2

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dnc2(unsigned short FlibHndl
long *length,char *data);
Description:
NC part program of DNC operation or M198 operation are done an output.

The size of the character string that was specified by '*length' is


done an output by this function. However, the size to output is the
empty size of buffer in the case that the empty size of buffer is smaller
than the size of character that was specified.
The size of the character that did an output actually is set to
'*length'.

This function returns EW_BUFFER In the case that buffer is full. If a


return value is EW_BUFFER, try again.

This function returns EW_RESET In the case that DNC operation or M198
operation were suspended. The output of NC part program needs to be
terminated by a function cnc_dncend2() in the case that a return value
is EW_RESET.

Shows the format of NC part program to do an output.

EOB CMD1 EOB CMD2 EOB ..... CMDn EOB Mxx EOB

CMD1...n ASCII character string


EOB LF(0x0A)
Mxx M code that show the terminate of DNC
operation. (M02 or M30 ... ect.)

Yet, In case of M198 operation, 'M99' must be


specified to 'Mxx'.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

length
The pointer of the variable of long type that the size of the
character that does an output actually be set.
The size of the character that was done an output actually is
set, when it returns from this function.
This function returns EW_LENGTH in the case that the size of
the character that does an output is negative.

data
The pointer of the area that NC part program that does an
output be set.

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 CNC data window" in "General
Description".)

116
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_RESET Reset or stop request
'RESET or STOP' was pushed.
Call the cnc_dncend function.

EW_FUNC cnc_dncstart2() function has not been executed.

EW_LENGTH Data block length error


The size of character string is negative.

EW_NOOPT No option
The extended driver/library function is
necessary.

EW_PARAM CNC parameter error


Must be set the following to CNC parameter.
Series 150
7713#0 = 1
Series 160/180/210,NC board
8706#1 = 1

EW_BUFFER Buffer empty/full


Retry because the buffer is full.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150
0000#0 --- influenced by setting
7713#0 = 1 -+- must be set
0020 = 15 -+

Series 160/180/210,NC board


0000#0 -+- influenced by setting
8706#0 -+
8706#1 = 1 -+- must be set
0020 = 15 -+

CNC mode: This function relates to the following mode.

Series 150
It is necessary to set TAPE mode.

Series 160/180/210,NC board


It is necessary to set MEM mode, and "DMMC" signal (DI)
G042#7=1 in case of DNC operation.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+

117
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

118
(15) End of downloading DNC program (2) (Version 1.4 and newer)

Function Name:
cnc_dncend2

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dncend2(unsigned short FlibHndl,
short result);

Description:
The termination to output of NC part program of DNC operation or M198
operation are informed to a CNC.
The notice to a CNC to normal termination or error termination of
anyway whether designated be must.

DNC_CANCEL must be informed to a CNC the output result in the case


that this function returned EW_RESET to during the output of NC part
program.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

result
The result that did an output of NC part program.

DNC_NORMAL : normal end


DNC_CANCEL : suspend from CNC
DNC_OPENERR : open error
DNC_NOFILE : file not found
DNC_READERR : read error

This function returns EW_DATA if the other value is specified


as the output result.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC cnc_dncstart2 function has not been executed.

EW_DATA Data error


The invalid value is specified as the output
result.

EW_NOOPT No option
The extended driver/library function is
necessary.

EW_PARAM CNC parameter error


Must be set the following to CNC parameter.
Series 150
7713#0 = 1
Series 160/180/210,NC board
8706#1 = 1

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,

119
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150
0000#0 --- influenced by setting
7713#0 = 1 -+- must be set
0020 = 15 -+

Series 160/180/210,NC board


0000#0 -+- influenced by setting
8706#0 -+
8706#1 = 1 -+- must be set
0020 = 15 -+

CNC mode: This function relates to the following mode.

Series 150
It is necessary to set TAPE mode.

Series 160/180/210,NC board


It is necessary to set MEM mode, and "DMMC" signal(DI)
G042#7=1 in case of DNC operation.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

120
(16) Read the diagnosis data of downloading DNC program (Version 1.4 and newer)

Function Name:
cnc_rddncdgndt

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rddncdgndt(unsigned short FlibHndl,
ODBDNCDGN *dgndt);

Description:
Diagnosis data regarding the output of downloading DNC program is
returned.
The purpose of this function is the maintenance of DNC operation or
M198 operation.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

dgndt
The pointer to a structure' ODBDNCDGN that returns diagnosis
data.
Shows the structure of ODBDNCDGN.
typedef struct odbdncdgn {
short ctrl_word;
short can_word;
char nc_file[16];
unsigned short read_ptr;
unsigned short write_ptr;
unsigned short empty_cnt;
unsigned long total_size;
} ODBDNCDGN;

ctrl_word Data that shows an operation demand from a CNC


is set.

can_word Data that shows an operation suspension demand


from a CNC is set.

nc_file A programs number is set.

read_ptr A read pointer of a DNC operation buffer is


set.

write_ptr A write pointer of a DNC operation buffer is


set.

empty_cnt The number that a read pointer caught up with


a write pointer is set. This number becomes a
total from at the time of the power supply
input.

total_size The total of the character number of the NC


part program that was done an output is set.
This value is cleared by cnc_dncstart2().

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 CNC data window" in "General
Description".)

121
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The extended driver/library function is
necessary.

EW_PARAM CNC parameter error


Must be set the following to CNC parameter.
Series 150
7713#0 = 1
Series 160/180/210,NC board
8706#1 = 1

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150
0000#0 --- influenced by setting
7713#0 = 1 -+- must be set
0020 = 15 -+

Series 160/180/210,NC board


0000#0 -+- influenced by setting
8706#0 -+
8706#1 = 1 -+- must be set
0020 = 15 -+

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

122
(17) Start Uploading NC Program

Function Name:
cnc_upstart

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_upstart(unsigned short FlibHndl,
short number);
Description:
Notices the start of uploading NC program to the library.
(This function must be executed before cnc_upload/cnc_cupload.)

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

number Specify program number

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
Series150
- cnc_upstart function has been executed.
Terminate an uploading by using cnc_upend
function.
Series160/180/210,NC board
- cnc_upstart function has been executed.
Terminate an uploading by using cnc_upend
function.
- alarm (PS000, PS101) in CNC side
Reset the alarm on CNC.
EW_DATA Data error
Program(number) is not found.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press

123
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

124
(18) Upload NC Program

Function Name:
cnc_upload

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).

The procedure of uploading is as follows.

+-------------------+
| 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)

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 '%'.
Only '%' for series 150, and nothing for Series 160/180/210,NC board
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.


Series 150
1st time "%\nO1234\nG1F0.3W10.\nM30\n%" (24 characters)
2nd and after "%" (1 character)
Series 160/180/210,NC board
1st time "%\nO1234\nG1F0.3W10.\nM30\n%" (24 characters)
2nd and after "" (0 character)

125
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.


Series 150
1st time "%\nO1234\nG1" (10 characters)
2nd time "F0.3W10.\nM" (10 characters)
3rd time "30\n%" (4 characters)
4th and after "%" (1 character)
Series 160/180/210,NC board
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.
See "Library handle" for details.

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.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC cnc_upstart function has not been executed.
EW_LENGTH Data block length error
The read number of characters of NC program
(*number) is 0.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

127
(19) Upload NC Program (Conditional)

Function Name:
cnc_cupload

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_cupload(unsigned short FlibHndl,
ODBUP *upld,unsigned short *number);
Description:
Read NC program registered for the tape memory in CNC (program memory).

As for MMC4 data window library, this function is functionally the same
as cnc_upload function quite.

Refer "cnc_upload" function for format of input data, etc.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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.
In case of this variable(*number) is 0, it is shown that there
is no value input any further.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC cnc_upstart function has not been executed.
EW_LENGTH Data block length error
The read number of characters of NC program
(*number) is 0.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

129
(20) End of Uploading NC Program

Function Name:
cnc_upend

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_upend(unsigned short FlibHndl);

Description:
Notices the end of uploading NC program to the library.
(This function must be executed after cnc_upload/cnc_cupload.)

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC cnc_upstart function has not been executed.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

130
(21) Read Buffer Status for Downloading/Verification NC Program

Function Name:
cnc_buff

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_buff(unsigned short FlibHndl,ODBBUF *buffer);

Description:
Read the number of empty buffers used for register/verification.

If there is no space for buffer, this returns error(EW_BUFFER), and


otherwise, this function set the number of empty buffer.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

buffer Pointer to the ODBBUF structure including the empty situation.


The ODBBUF structure is as follows.
typedef struct odbbuf {
short dummy[2] ; /* Not used. */
short data ; /* Empty counter.(1 - 3) */
} ODBBUF ;

ODBBUF 0+---------+
| dummy[0]|
2+---------+
| dummy[1]|
4+---------+
| data |
6+---------+

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_RESET Reset or stop request
'RESET or STOP' was pushed.
Call 'cnc_dwnend' or 'cnc_vrfend' function.
EW_BUFFER Buffer empty
There is no space with buffer.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

131
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

132
(22) Search Specified Program

Function Name:
cnc_search

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_search(unsigned short FlibHndl,short number);

Description:
Searches the number of NC program registered in program memory of CNC.

In the case of Series 150, search is made to wait under below


condition.
- Edit processing in the CNC side (include background edit processing)
- downloading, verifying

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

number Specify program number.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
Series160/180/210,NC board
- 'OP' signal(DO)<F000#7> on
(only EDIT mode or MEMORY mode)
Automatic operation is being executed in CNC.
- downloading, verifying
Terminate a downloading, verifying by using
cnc_dwnend, cnc_vrfend function.
- alarm (PS000, PS101) in CNC side
Reset the alarm on CNC.
EW_DATA Data error
Program(number) is not found.
EW_PROT Program is protected from editing.
(Series 160/180/210,NC board)

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

133
CNC option: There is no need of CNC option for this function.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 none

Series 160/180/210,NC board


3202#0,#4,#6 -+- influenced by setting
3210,3211 -+

CNC mode: The behavior of this function depends on the CNC mode.

Series 150 EDIT mode :foreground search


Other mode :background search

Series 160/180/210,NC board


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.)

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

134
(23) Delete All Programs

Function Name:
cnc_delall

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_delall(unsigned short FlibHndl);

Description:
Deletes all NC programs registered in CNC.
The protected program cannot be deleted.
In the case of Series 150, deletion is made to wait under the following
condition.
- Edit processing in the CNC side(include background edit processing)
- downloading, verifying

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

number Specify program number.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
Series160/180/210,NC board
- background edit processing in CNC side
Terminate background edit.
- downloading, verifying
Terminate a downloading, verifying by using
cnc_dwnend, cnc_vrfend function.
- alarm (PS000, PS101) in CNC side
Reset the alarm on CNC.
- MEMORY, MDI mode in CNC side
Change CNC mode except MEMORY, MDI mode.
- '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
- Protection KEY(DI) turns off.
- CNC parameter is a state of write-protection
(O8000-/O9000- protection, encoding).

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

135
CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function relates to the following mode.

Series 150 none

Series 160/180/210,NC board


It is possible to use in other than MEM,MDI mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

136
(24) Delete Specified Program

Function Name:
cnc_delete

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_delete(unsigned short FlibHndl,short number);

Description:
Deletes the specified NC program registered in CNC.
The program which is executed or selected in foreground by CNC cannot
be deleted. And the protected program cannot be deleted.
In the case of Series 150, deletion is made to wait under the following
condition.
- Edit processing in the CNC side (include background edit processing)
- downloading, verifying

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

number Specify program number.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
Series160/180/210,NC board
- background edit processing in CNC side
Terminate background edit.
- downloading, verifying
Terminate a downloading, verifying by using
cnc_dwnend, cnc_vrfend function.
- alarm (PS000, PS101) in CNC side
Reset the alarm on CNC.
- MDI mode in CNC side
Change CNC mode except MDI mode.
- 'OP' signal(DO)<F000#7> on
(only EDIT mode or MEMORY mode)
Automatic operation is being executed in CNC.
- foreground program selected by CNC
Change selected program in CNC.
EW_DATA Data error
- Program(number) is not found.
Series150
- Foreground program selected by CNC
Change selected program in CNC.
EW_PROT Write protection in CNC side
- Protection KEY(DI) turns off.
- CNC parameter is a state of write-protection
(O8000-/O9000- protection, encoding).

137
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function relates to the following mode.

Series 150 none


Series 160/180/210,NC board
It is possible to use in other than MDI mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

138
(25) Read Program Directory

Function Name:
cnc_rdprogdir

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdprogdir(unsigned short FlibHndl,short type,
short datano_s,short datano_e,short length,PRGDIR *prgdir);
Description:
Reads the list of program numbers (program directory) of all
NC programs registered in CNC.

Program numbers, comments and character numbers of programs included in


specified program number range are read with ASCII string format.
Specify the start program number to be read in "datano_s" and the end
one in "datano_e". Store "datano_s=1" and "datano_e"=9999 to read all
programs.
Specify the format of program list in "type".

As for type=1 in series 150, the range specification is invalid and


all programs are always read.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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)

139
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')
Oxxxx Program number. This is a ASCII string
without the leading '0' of numeric part
sorted in numeric order.("O1" - "O9999")
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 all cases, when no program is registered or there is no program


in the specified range, only '%' is stored.
A null character('\x00') is not added at the end of each strings
stored in the buffer.

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

type Contents to be read


-------+-----------------------------------------------------------
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"

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Length of the block (length) is illegal.
EW_NUMBER Data number error
Start program number (datano_s) or end program
number (datano_e) is illegal.
EW_ATTRIB Data attribute error
Output format (type) is illegal.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

141
(26) Read Program Directory (2)

Function Name:
cnc_rdprogdir2

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdprogdir2(unsigned short FlibHndl,
short type,short *top_prog, short *num_prog, PRGDIR2 *buf);
Description:
Reads the program directory of all the programs registered in the CNC.

Reads specified number of "Program Number","Comment" and "Program size


(number of characters)" data of the registered programs in the CNC,
starting from the program with the specified Program number.

This function is the improved version of the function cnc_rdprogdir().


It has the function to specify the number of programs to read and
gives fixed length output.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

type Specify the type of the program directory to read.


0 : "Program number" only
1 : "Program number" and "Comment"
2 : "Program number", "Comment" and "Program size"

top_prog
Pointer to the starting program number.
The program number of the first program actually read is stored
after this function call.

num_prog
Pointer to the number of programs to be read.
Actual number of programs being read is stored after this func-
tion call.

buf
Pointer to the PRGDIR 2 structure where program directory data
are returned to. The PRGDIR 2 structure is as follows.

typedef struct prgdir2 {


int number;
long length;
char comment[51];
char dummy;
} PRGDIR2;

number Program number


Program number is returned.

length Program size


Program size is returned.
Valid when 2 is specified for the arguments "type".

142
comment Comment
The "Comment" stored next to the "Program number"
in the CNC is returned. The maximum length of the
comment stored is 48 characters (50 characters includ-
ing leading "(" and trailing ")"). When the "Comment"
is longer than 48 characters, the part after the 48th
character is ignored. When no "Comment" is registered
only parentheses ("()") are returned. The "Comment"
character string is terminated with NULL character.
Valid when 1 or 2 is specified for the argument "type".

When no programs are registered or no programs match the


specified condition, "0" is returned to "num_prog".

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
The number of readout(num_prog) is wrong.
EW_NUMBER Data number error
The start number of program(top_prog) is wrong.
EW_ATTRIB Data attribute error
Output format(type) is wrong.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

143
(27) Read Program Information

Function Name:
cnc_rdproginfo

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdproginfo(unsigned short FlibHndl,
short type,short length,ODBNC *prginfo);
Description:
Reads the management data of NC programs already registered in CNC.

The management data of NC program are


Amount of registered programs,
Amount of available programs,
Character number of used memory,
Character number of unused memory.

This function returns these data with binary format or ASCII string
format.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

type Specify the output format.


0 : binary
1 : ASCII

length Specify the length of data block.


Series 150
16 : binary
35 : ASCII
Series 160/180/210,NC board
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 ;

144
- 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
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'.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Length of the block (length) is illegal.
EW_ATTRIB Data attribute error
Output format (type) is illegal.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

145
(28) Read Program Number under Execution

Function Name:
cnc_rdprgnum

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdprgnum(unsigned short FlibHndl,
ODBPRO *prgnum);
Description:
Reads program number of the program which is being currently selected
in CNC.

As for Series 160/180/210,NC board, 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
Identify the process which uses the library.
See "Library handle" for details.

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.(invalid in */
} ODBPRO ; /* case of Series150) */

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_PARAM CNC parameter error
(Only Series150)7613#0=0 when CNC is turned on.
Set CNC parameter again.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

146
CNC parameter: This function relates to the following CNC parameter.
See the manual of CNC parameter for details.

Series 150 7613#0=1 --- must be set

Series 160/180/210,NC board none

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

147
(29) Read Sequence Number under Execution

Function Name:
cnc_rdseqnum

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdseqnum(unsigned short FlibHndl,
ODBSEQ *seqnum);
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
Identify the process which uses the library.
See "Library handle" for details.

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 ;

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_PARAM CNC parameter error
(Only Series150)7613#0=0 when CNC is turned on.
Set CNC parameter again.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7613#0=1 --- must be set

Series 160/180/210,NC board none

CNC mode: This function can be used in any CNC mode.

148
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

149
(30) Search Specified Sequence Number

Function Name:
cnc_seqsrch

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_seqsrch(unsigned short FlibHndl,long seq_no);

Description:
Searches the specified sequence number of the selected program in CNC.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.
seq_no Specify sequence number.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_DATA Data error
The specified sequence number does not exist.
EW_NOOPT No option
The extended driver/library function is
necessary.
EW_MODE CNC mode error
See the paragraph of CNC mode.
EW_REJECT CNC execution denied
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function relates to the following mode.


Series 150 It is possible to use in MEM,TAPE mode.
Series 160/180/210,NC board It is possible to use in MEM mode.
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

150
(31) Rewind Cursor of NC Program

Function Name:
cnc_rewind

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rewind(unsigned short FlibHndl);

Description:
Sets cursor to the top of selected NC program in CNC.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The extended driver/library function is necessary.
EW_MODE CNC mode error
See the paragraph of CNC mode.
EW_REJECT CNC execution denied
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function relates to the following mode.

Series 150 It is possible to use in MEM,EDIT,MDI mode.


Series 160/180/210,NC board
It is possible to use in other than MDI mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

151
(32) Read Block Counter

Function Name:
cnc_rdblkcount

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdblkcount(unsigned short FlibHndl,
long *prog_bc);
Description:
Read the value of block counter.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

prog_bc Specify the address of the variable to store with the block
counter.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The program restarting function and the
extended driver/library function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The program restarting function and the extended driver/library
function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

152
(33) Read Program under Execution

Function Name:
cnc_rdexecprog

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.
See "Library handle" for details.

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.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Length of the block (*length) is illegal.
EW_NOOPT No option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7710#7=1 --- must be set


Series 160/180/210,NC board none

CNC mode: This function can be used in any CNC mode.

153
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

154
(34) 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);
Description:
Outputs NC program for MDI operation to CNC.

Refer description of "cnc_dnc" function for format of output data.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

length Specify the number of characters of NC program to write.


Series 150 1 ,.., 199
Series 160/180/210,NC board 1 ,.., 500

data Specify the top address of NC program data.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
Series160/180/210,NC board
- background edit processing in CNC side
Terminate background edit processing in CNC side.
- alarm (PS000, PS101) in CNC side
Reset the alarm on CNC.
EW_LENGTH Data block length error
Length of the block (length) is illegal.
EW_DATA Data error
A character which is unavailable for CNC
program is detected.
EW_NOOPT No option
The extended driver/library function is necessary.
EW_MODE CNC mode error
Set CNC mode to MDI.
EW_REJECT CNC execution denied(MDI operation in progress)

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function must be used in MDI mode.

155
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

156
(35) Read Execution Pointer for MDI Operation

Function Name:
cnc_rdmdipntr

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdmdipntr(unsigned short FlibHndl,
ODBMDIP *mdip);
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.

In Series 150, it is invalid excluding pre-read block pointer.


(0 can be read at any time)

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 ;

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The extended driver/library function is
necessary.
EW_MODE CNC mode error
Set CNC mode to MDI.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

157
CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function must be used in MDI mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

158
(36) Write Execution Pointer for MDI Operation

Function Name:
cnc_wrmdipntr

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrmdipntr(unsigned short FlibHndl,
long crntpntr);
Description:
Specify the execution starting pointer for MDI operation.
(It is impossible to operate the execution pointer directly)

Register the MDI program previously according to the cnc_wrmdiprog()


function when executing this function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

crntpntr
Specify the block pointer to execute first.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_DATA Data error
The specification of the block point to execute
first(crntpntr) is illegal.
EW_NOOPT No option
The extended driver/library function is
necessary.
EW_MODE CNC mode error
Set CNC mode to MDI.
EW_REJECT CNC execution denied
- Edit processing in the CNC side.
- MDI program is not registered.
Register the MDI program previously according
to the cnc_wrmdiprog() function.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function must be used in MDI mode.

159
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

160
(37) Read Processing Time Stamp Data

Function Name:
cnc_rdproctime

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdproctime(unsigned short FlibHndl,
ODBPTIME *buf);
Description:
Reads processing time stamp data of CNC programs measured by the CNC.
When no processing time stamp data are available, 0 is returned in the
element "num" of the structure ODBPTIME.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

buf Pointer to the ODBPTIME structure where returned data are


stored. The ODBPTIME structure is as follows.

typedef struct odbptime {


short num;
struct{
long prg_no;
short hour;
char minute;
char second;
}data[10];
} ODBPTIME;

num The number of processing time stamp data.


The number of measured processing time stamp data is
returned.
Valid range : 0 to 10

prg_no Program number


Valid range: 1 to 9999

hour Hour part of the processing time stamp data.


Valid range: 0 to 999

minute Minute part of the processing time stamp data.


Valid range: 0 to 59

second Second part of the processing time stamp data.


Valid range: 0 to 59

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The machining time stamp option and the
extended driver/library option are necessary.

161
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the machining time stamp option and the
extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

162
(38) Read Directory for Processing Time Stamp Data

Function Name:
cnc_rdprgdirtime

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdprgdirtime(unsigned short FlibHndl,
long *top_prog, short *num_prog, PRGDIRTM *buf);
Description:
Reads specified number of "Program Number","Comment" and "Processing
time" data of the registered programs in the CNC, starting from the
program with the specified Program number.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

top_prog
Pointer to the starting program number.
The program number of the first program actually read is stored
after this function call.

num_prog
Pointer to the number of programs to be read.
Actual number of programs being read is stored after this
function call. When no programs are registered or no programs
match the specified condition, "0" is returned.
Valid number range is from 1 to 963.

buf
Pointer to the PRGDIRTM structure where program directory data
are returned. The PRGDIRTM structure is as follows.

typedef struct prgdirtm {


long prg_no;
char comment[51];
char cuttime[13];
} PRGDIRTM;

prg_no Program number


Program number is returned.

comment Comment
The "Comment" stored next to the "Program number"
in the CNC is returned. The maximum length of the
comment stored is 48 characters (50 characters includ-
ing leading "(" and trailing ")"). When the "Comment"
is longer than 48 characters, the part after the 48th
character is ignored. When no "Comment" is registered
only parentheses ("()") are returned. The "Comment"
character string is terminated with NULL character.

163
cuttime Processing time
The "Processing time" measured by the "Processing time
stamp function" is returned. The maximum length of the
"Processing time" data is 10 characters ( 12 characters
including leading and trailing parentheses ). The
character string is terminated with NULL character.
- Format: (hhhHmmMssS)+NULL
(3 digits+H, 2 digits+M, 2 digits+S)
In the following cases, only parentheses ("()+NULL")
are returned.
1. When no "Processing time" data exist.
2. When "Comment" of the program is longer than
48 characters.
3. When the format of the !Processing time" data is
changed to the format other than "hhhHmmMssS".
When there are more than two "Processing time" data,
the first "Processing time" data is returned.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
The number of readout(num_prog) is wrong.
EW_NUMBER Data number error
The start number of program(top_prog) is wrong.
EW_NOOPT No option
The machining time stamp option and the
extended driver/library option are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the machining time stamp option and the
extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

164
1.1.9 Function Reference Related to NC File Data

(1) Read Tool Offset Value

Function Name:
cnc_rdtofs

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdtofs(unsigned short FlibHndl,short number,
short type,short length,ODBTOFS *tofs);
Description:
Reads the tool offset value specified by "number", "type".
The offset value is stored in "data" of "ODBTOFS" with signed binary
format.

The unit of offset value is as follows.

Series 150
| Linear axis |Rotation axis
6007#0 6004#0 6002#1 6002#0| mm input |inch input|
(ONM) (OUF) (OFN) (ORG)| [mm]| [inch]| [deg]
---------------------------+----------+----------+-------------
0 0 0 1 0.01 0.001 0.01
0 0 0 0 0.001 0.0001 0.001
0 0 1 0 0.0001 0.00001 0.0001
0 1 0 0 0.00001 0.000001 0.00001
1 0 0 0 0.000001 0.0000001 0.000001

Series 160/180/210,NC board


| Linear axis |Rotation axis
1004#1 1004#0| mm input |inch input|
(ISC) (ISA)| [mm]| [inch]| [deg]
---------------------------+----------+----------+-------------
(IS-B) 0 0 0.001 0.0001 0.001
(IS-C) 1 0 0.0001 0.00001 0.0001

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

number Specify the tool offset number.


The available number of tool offset can be got by
cnc_rdtofsinfo() function.

165
type Specify the tool offset type.(see the following table)
- Machining Center Series (M series)
+--------+-------------+-----------+
| |Cutter radius|Tool length|
+--------+-------------+-----------+
|Wear | 0 | 2 |
+--------+-------------+-----------+
|Geometry| 1 | 3 |
+--------+-------------+-----------+
Specify "cutter radius" in case of no distinction of cutter
radius/tool length, and "wear" in case of no distinction of
wear/geometry.

- Lathe Series (T series)


+--------+------+------+------+-------------------+------+
| |X axis|Z axis|Nose R|imaginary tool nose|Y axis|
+--------+------+------+------+-------------------+------+
|Wear | 0 | 2 | 4 | 6 | 8 |
+--------+------+------+------+-------------------+------+
|Geometry| 1 | 3 | 5 | 7 | 9 |
+--------+------+------+------+-------------------+------+
Specify "wear" in case of no distinction of wear/geometry.

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 ;

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
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.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

166
CNC option: This function relates to the following CNC option.

Series 150
M Tool offset extension (32)/99/200/499/999 sets
Tool offset memory (A)/B/C
Extended tool offset value
(number of offset is half of the above sets.)
T Tool offset extension (32)/64/160 sets
Tool offset memory (A)/B
Cutter radius compensation
Extended tool offset value
(number of offset is half of the above sets.)
TT Tool offset extension (16)/32/80 sets(each path)
Tool offset memory (A)/B
Cutter radius compensation

Series 160/180
M series
Tool offset extension (32)/64/99/200/400/499/999 sets
Tool offset memory (A)/B/C
T series
Tool offset extension (16)/32/64/99 sets
Geometry/wear offset
Cutter radius compensation
Y axis offset

Series 210,NC board


M series
Tool offset extension (32)/64/99 sets
T series
Tool offset extension (16)/32/64 sets

* ( ) : Basic

CNC parameter: This function relates to the following CNC parameters.


See the manual of CNC parameter for details.

Series 150 6002#0,#1, 6004#0, 6007#0

Series 160/180/210,NC board


1004#0,#1

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

167
(2) Write Tool Offset Value

Function Name:
cnc_wrtofs

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrtofs(unsigned short FlibHndl,short number,
short type,short length,long data);
Description:
Writes the tool offset value specified by "number", "type".
The offset value must be stored in "data" with signed binary format.

The unit of offset value is as follows.

Series 150
| Linear axis |Rotation axis
6007#0 6004#0 6002#1 6002#0| mm input |inch input|
(ONM) (OUF) (OFN) (ORG)| [mm]| [inch]| [deg]
---------------------------+----------+----------+-------------
0 0 0 1 0.01 0.001 0.01
0 0 0 0 0.001 0.0001 0.001
0 0 1 0 0.0001 0.00001 0.0001
0 1 0 0 0.00001 0.000001 0.00001
1 0 0 0 0.000001 0.0000001 0.000001

Series 160/180/210,NC board


| Linear axis |Rotation axis
1004#1 1004#0| mm input |inch input|
(ISC) (ISA)| [mm]| [inch]| [deg]
---------------------------+----------+----------+-------------
(IS-B) 0 0 0.001 0.0001 0.001
(IS-C) 1 0 0.0001 0.00001 0.0001

The available range of offset value is as follows.

Series 150
| Linear axis |Rotation axis
6007#0 6004#0 6002#1 6002#0 mm input | inch input |
(ONM) (OUF) (OFN) (ORG) [mm] | [inch] | [deg]
--------------------------+--------------+--------------+--------------
0 0 0 1 +- 999.99 +- 99.999 +- 999.99
(+-9999.99) (+-999.999) (+-9999.99)
0 0 0 0 +- 999.999 +- 99.9999 +- 999.999
(+-9999.999) (+-999.9999) (+-9999.999)
0 0 1 0 +- 999.9999 +- 99.99999 +- 999.9999
(+-9999.9999) (+-999.99999) (+-9999.9999)
0 1 0 0 +- 99.99999 +- 9.999999 +- 99.999999
(+-9999.99999) (+-999.999999) (+-9999.99999)
1 0 0 0 +- 9.999999 +- 0.9999999 +- 9.999999
(+- 999.999999)(+- 99.9999999)(+- 999.999999)

* ( ) : Extended tool offset value option

168
Series 160/180/210,NC board
| Linear axis |Rotation axis
1004#1 1004#0 mm input | inch input |
(ISC) (ISA) [mm] | [inch] | [deg]
-------------------+--------------+--------------+--------------
(IS-B) 0 0 +- 999.999 +- 99.9999 +- 999.999
(+- 99.999) (+- 9.9999) (+- 99.999)
(IS-C) 1 0 +- 999.9999 +- 99.99999 +- 999.9999
(+- 99.9999) (+- 9.99999) (+- 99.9999)

* ( ) : Wear offset

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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.(see the following table)


- Machining Center Series (M series)
+--------+-------------+-----------+
| |Cutter radius|Tool length|
+--------+-------------+-----------+
|Wear | 0 | 2 |
+--------+-------------+-----------+
|Geometry| 1 | 3 |
+--------+-------------+-----------+
Specify "cutter radius" in case of no distinction of cutter
radius/tool length, and "wear" in case of no distinction of
wear/geometry.

- Lathe Series (T series)


+--------+------+------+------+-------------------+------+
| |X axis|Z axis|Nose R|imaginary tool nose|Y axis|
+--------+------+------+------+-------------------+------+
|Wear | 0 | 2 | 4 | 6 | 8 |
+--------+------+------+------+-------------------+------+
|Geometry| 1 | 3 | 5 | 7 | 9 |
+--------+------+------+------+-------------------+------+
Specify "wear" in case of no distinction of wear/geometry.

length Specify the data block length(size of ODBTOFS structure=8).

data Set the tool offset value.

169
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 CNC data window" in
"General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Size(length) is less than 8.
EW_NUMBER Data number error
Offset number(number) is wrong.
EW_ATTRIB Data attribute error
Offset type(type) is wrong.
EW_DATA Data error
(Series 150) Offset data(data) is out of range.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function relates to the following CNC option.

Series 150
M Tool offset extension (32)/99/200/499/999 sets
Tool offset memory (A)/B/C
Extended tool offset value
(number of offset is half of the above sets.)
T Tool offset extension (32)/64/160 sets
Tool offset memory (A)/B
Cutter radius compensation
Extended tool offset value
(number of offset is half of the above sets.)
TT Tool offset extension (16)/32/80 sets(each path)
Tool offset memory (A)/B
Cutter radius compensation

Series 160/180
M series
Tool offset extension (32)/64/99/200/400/499/999 sets
Tool offset memory (A)/B/C
T series
Tool offset extension (16)/32/64/99 sets
Geometry/wear offset
Cutter radius compensation
Y axis offset

Series 210,NC board


M series
Tool offset extension (32)/64/99 sets
T series
Tool offset extension (16)/32/64 sets

* ( ) : Basic

CNC parameter: This function relates to the following CNC parameters.


See the manual of CNC parameter for details.

Series 150 6002#0,#1, 6004#0, 6007#0

Series 160/180/210,NC board


1004#0,#1

170
CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

171
(3) Read Tool Offset Value (Area Specified)

Function Name:
cnc_rdtofsr

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdtofsr(unsigned short FlibHndl,
short s_number,short type,short e_number,short length,
IODBTO *tofsr);
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
Identify the process which uses the library.
See "Library handle" for details.

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.
typedef struct iodbto {
short datano_s; /* start offset number */
short type; /* offset type */
short datano_e; /* end offset number */
union {
long m_ofs[N]; /* M series individual */
long m_ofs_a[N]; /* M series Memory A all */
long m_ofs_b[2*N]; /* M series Memory B all */
long m_ofs_c[4*N]; /* M series Memory C all */
short t_tip[N]; /* T series individual,direction*/
/* of imaginary tool nose */
long t_ofs[N]; /* T series individual */
struct {
short tip;
long data[4];
} t_ofs_a[N]; /* T series Memory A all */
struct {
short tip;
long data[8];
} t_ofs_b[N]; /* T series Memory B all */
} u ;
} IODBTO ; /* N is number of the offset value. */

172
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.

- Machining Series/Tool offset Memory A

Type Length Attribute Offset type Member to be stored in


----+------+----------+----------------------+------------------------
0 6+4*N individual Tool offset buf.u.m_ofs[i]
----+------+----------+----------------------+------------------------
-1 6+4*N all Tool offset buf.u.m_ofs_a[i]

- Machining Series/Tool offset Memory B

Type Length Attribute Offset type Member to be stored in


----+------+----------+----------------------+------------------------
0 6+4*N individual Tool geometry offset buf.u.m_ofs[i]
1 6+4*N individual Tool wear offset buf.u.m_ofs[i]
----+------+----------+----------------------+------------------------
-2 6+8*N all Tool geometry offset buf.u.m_ofs_b[8*i+0]
Tool wear offset buf.u.m_ofs_b[8*i+4]

- Machining Series/Tool offset Memory C

Type Length Attribute Offset type Member to be stored in


----+------+----------+----------------------+------------------------
0 6+4*N individual Tool length/geometry buf.u.m_ofs[i]
1 6+4*N individual Tool length/wear buf.u.m_ofs[i]
2 6+4*N individual Cutter radius/geometry buf.u.m_ofs[i]
3 6+4*N individual Cutter radius/wear buf.u.m_ofs[i]
----+------+----------+----------------------+------------------------
-3 6+16*N all Tool length/geometry buf.u.m_ofs_c[16*i+0]
Tool length/wear buf.u.m_ofs_c[16*i+4]
Cutter radius/geometry buf.u.m_ofs_c[16*i+8]
Cutter radius/wear buf.u.m_ofs_c[16*i+12]

- Lathe Series/Tool offset Memory A

Type Length Attribute Offset type Member to be stored in


----+------+----------+----------------------+------------------------
0 6+2*N individual Direction of imaginary
tool nose buf.u.t_tip[i]
1 6+4*N individual X-axis offset buf.u.t_ofs[i]
2 6+4*N individual Y-axis offset buf.u.t_ofs[i]
3 6+4*N individual Z-axis offset buf.u.t_ofs[i]
4 6+4*N individual Nose radius offset buf.u.t_ofs[i]
----+------+----------+----------------------+------------------------
-1 6+18*N all Direction of imaginary
tool nose buf.u.t_ofs_a[i].tip
X-axis offset buf.u.t_ofs_a[i].data[0]
Y-axis offset buf.u.t_ofs_a[i].data[1]
Z-axis offset buf.u.t_ofs_a[i].data[2]
Nose radius offset buf.u.t_ofs_a[i].data[3]

173
- Lathe Series/Tool offset Memory B

Type Length Attribute Offset type Member to be stored in


----+------+----------+----------------------+------------------------
0 6+2*N individual Direction of imaginary
tool nose buf.t.t_tip[i]
1 6+4*N individual X-axis geometry offset buf.t.t_ofs[i]
2 6+4*N individual Y-axis geometry offset buf.t.t_ofs[i]
3 6+4*N individual Z-axis geometry offset buf.t.t_ofs[i]
4 6+4*N individual Nose radius
geometry offset buf.t.t_ofs[i]
5 6+4*N individual X-axis wear offset buf.t.t_ofs[i]
6 6+4*N individual Y-axis wear offset buf.t.t_ofs[i]
7 6+4*N individual Z-axis wear offset buf.t.t_ofs[i]
8 6+4*N individual Nose radius
wear offset buf.t.t_ofs[i]
----+------+----------+----------------------+------------------------
-2 6+34*N all Direction of imaginary
tool nose buf.t.t_ofs_b[i].tip
X-axis geometry offset buf.t.t_ofs_b[i].data[0]
Y-axis geometry offset buf.t.t_ofs_b[i].data[1]
Z-axis geometry offset buf.t.t_ofs_b[i].data[2]
Nose radius
geometry offset buf.t.t_ofs_b[i].data[3]
X-axis wear offset buf.t.t_ofs_b[i].data[4]
Y-axis wear offset buf.t.t_ofs_b[i].data[5]
Z-axis wear offset buf.t.t_ofs_b[i].data[6]
Nose radius
wear offset buf.t.t_ofs_b[i].data[7]

N is number of offset to be read, i = 0,..,(N-1).

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 CNC data window" in
"General Description".)
--------------------------------------------------------------
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.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

174
CNC option: This function relates to the following CNC option.

Series 150
M Tool offset extension (32)/99/200/499/999 sets
Tool offset memory (A)/B/C
Extended tool offset value
(number of offset is half of the above sets.)
T Tool offset extension (32)/64/160 sets
Tool offset memory (A)/B
Cutter radius compensation
Extended tool offset value
(number of offset is half of the above sets.)
TT Tool offset extension (16)/32/80 sets(each path)
Tool offset memory (A)/B
Cutter radius compensation

Series 160/180
M series
Tool offset extension (32)/64/99/200/400/499/999 sets
Tool offset memory (A)/B/C
T series
Tool offset extension (16)/32/64/99 sets
Geometry/wear offset
Cutter radius compensation
Y axis offset

Series 210,NC board


M series
Tool offset extension (32)/64/99 sets
T series
Tool offset extension (16)/32/64 sets

* ( ) : Basic

CNC parameter: This function relates to the following CNC parameters.


See the manual of CNC parameter for details.

Series 150 6002#0,#1, 6004#0, 6007#0

Series 160/180/210,NC board


1004#0,#1

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

175
(4) Write Tool Offset Value (Area Specified)

Function Name:
cnc_wrtofsr

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrtofsr(unsigned short FlibHndl,short length,
IODBTO *tofsr);
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
Identify the process which uses the library.
See "Library handle" for details.

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]; /* M series individual */
long m_ofs_a[N]; /* M series Memory A all */
long m_ofs_b[2*N]; /* M series Memory B all */
long m_ofs_c[4*N]; /* M series Memory C all */
short t_tip[N]; /* T series individual,direction*/
/* of imaginary tool nose */
long t_ofs[N]; /* T series individual */
struct {
short tip;
long data[4];
} t_ofs_a[N]; /* T series Memory A all */
struct {
short tip;
long data[8];
} t_ofs_b[N]; /* T series Memory B 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.

176
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.

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 CNC data window" in
"General Description".)
--------------------------------------------------------------
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(datano_s,datano_e) is wrong.
EW_ATTRIB Data attribute error
Offset type(type) is wrong.
EW_DATA Data error
(Series 150) Offset data(data,etc.) is out of range.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function relates to the following CNC option.

Series 150
M Tool offset extension (32)/99/200/499/999 sets
Tool offset memory (A)/B/C
Extended tool offset value
(number of offset is half of the above sets.)
T Tool offset extension (32)/64/160 sets
Tool offset memory (A)/B
Cutter radius compensation
Extended tool offset value
(number of offset is half of the above sets.)
TT Tool offset extension (16)/32/80 sets(each path)
Tool offset memory (A)/B
Cutter radius compensation

Series 160/180
M series
Tool offset extension (32)/64/99/200/400/499/999 sets
Tool offset memory (A)/B/C
T series
Tool offset extension (16)/32/64/99 sets
Geometry/wear offset
Cutter radius compensation
Y axis offset

Series 210,NC board


M series
Tool offset extension (32)/64/99 sets
T series
Tool offset extension (16)/32/64 sets
* ( ) : Basic

177
CNC parameter: This function relates to the following CNC parameters.
See the manual of CNC parameter for details.

Series 150 6002#0,#1, 6004#0, 6007#0

Series 160/180/210,NC board


1004#0,#1

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

178
(5) Read Tool Offset Information

Function Name:
cnc_rdtofsinfo

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.
See "Library handle" for details.

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
0:memory type A
1:memory type B
2:memory type C(except T series)

use_no Available number of tool offset

Series 150
M Number of offset 32/99/200/499/999 sets
* In case of the extended tool offset value,
the number of offset is half of the above sets.
T Number of offset 32/64/160 sets
* In case of the extended tool offset value,
the number of offset is half of the above sets.
TT Number of offset 16/32/80(each path)
Series 160/180
M series
Number of offset 32/64/99/200/400/499/999 sets
T series
Number of offset 16/32/64/99 sets
Series 210,NC board
M series
Number of offset 32/64/99 sets
T series
Number of offset 16/32/64 sets

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 CNC data window" in
"General Description".)

179
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
This function needs the extended driver/
library option.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option, and
relates to the following CNC option.

Series 150
M Tool offset extension (32)/99/200/499/999 sets
Tool offset memory (A)/B/C
Extended tool offset value
(number of offset is half of the above sets.)
T Tool offset extension (32)/64/160 sets
Tool offset memory (A)/B
Cutter radius compensation
Extended tool offset value
(number of offset is half of the above sets.)
TT Tool offset extension (16)/32/80 sets(each path)
Tool offset memory (A)/B
Cutter radius compensation
Series 160/180
M series
Tool offset extension (32)/64/99/200/400/499/999 sets
Tool offset memory (A)/B/C
T series
Tool offset extension (16)/32/64/99 sets
Geometry/wear offset
Cutter radius compensation
Y axis offset
Series 210,NC board
M series
Tool offset extension (32)/64/99 sets
T series
Tool offset extension (16)/32/64 sets
* ( ) : Basic

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

180
(6) Read Work Zero Offset Value

Function Name:
cnc_rdzofs

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdzofs(unsigned short FlibHndl,short number,
short axis,short length,IODBZOFS *zofs);
Description:
Reads the work zero offset value specified by "number", "axis".
The offset value is stored in "data[0]" of "IODBZOFS" with signed
binary format.

Reads the offset value for all axes once by specifying 'ALL_AXES' in
'axis'. The offset value for each axis is stored in "data" array of
"IODBZOFS".

The place of decimal point can be got by cnc_getfigure() function.

The unit of offset value is as follows.

Series 150
| Linear axis |Rotation axis
1009#1 1004#5 1004#1 1004#0| mm input |inch input|
(ISE) (ISD) (ISF) (ISR)| [mm]| [inch]| [deg]
---------------------------+----------+----------+-------------
(IS-A) 0 0 0 1 0.01 0.001 0.01
(IS-B) 0 0 0 0 0.001 0.0001 0.001
(IS-C) 0 0 1 0 0.0001 0.00001 0.0001
(IS-D) 0 1 0 0 0.00001 0.000001 0.00001
(IS-E) 1 0 0 0 0.000001 0.0000001 0.000001

Series 160/180/210,NC board


| Linear axis |Rotation axis
1004#1 1004#0| mm input |inch input|
(ISC) (ISA)| [mm]| [inch]| [deg]
---------------------------+----------+----------+-------------
(IS-B) 0 0 0.001 0.0001 0.001
(IS-C) 1 0 0.0001 0.00001 0.0001

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

number Specify the work zero offset number.

Series 150
0 : External work zero offset value
1,..,6 : Work zero offset value of G54 through G59
7,..,54 : Work zero offset value of G54.1P1 through G54.1P48

181
Series 160/180
M series
0 : External work zero offset value
1,..,6 : Work zero offset value of G54 through G59
7,..,306: Work zero offset value of G54.1P1 through G54.1P300
T series
0 : External work zero offset value
1,..,6 : Work zero offset value of G54 through G59

Series 210,NC board


M series
0 : External work zero offset value
1,..,6 : Work zero offset value of G54 through G59

axis Specify the axis number.


ALL_AXES : assigns all axes(ALL_AXES=-1)
1,..,m : assigns 1 axis(m=current controlled axes)

length Specify the data block length(size of IODBZOFS structure).

1 axis all axes


IODBZOFS 0 +-------+ --- 0 +-------+ ---
|datano | ^ |datano | ^
2 +-------+ | 2 +-------+ |
|type | length |type | length
4 +-------+-------+ | 4 +-------+-------+ |
| data[0] | v |data[0] :1st | |
8 +---------------+--- 8 +---------------+ |
= = |
4+4x(n-1) +---------------+ |
|data[n-1] :n-th| v
4+4xn +---------------+---

Series 150 : n = Maximum controlled axes


* The data for current controlled axes are valid.
Series 160/180/210,NC board : n = Current controlled axes

zofs Pointer to the IODBZOFS structure including the work zero


offset value. The IODBZOFS structure is as follows.

typedef struct iodbzofs {


short datano; /* offset number */
short type; /* axis number */
long data[MAX_AXIS]; /* offset data value */
} IODBZOFS ; /* MAX_AXIS : max. controlled axes */

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 CNC data window" in
"General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Size of IODBZOFS structure(length) is wrong.
EW_NUMBER Data number error
Offset number(number) is wrong.
EW_ATTRIB Data attribute error
Axis number(axis) is wrong.
EW_NOOPT No option
(Series160/180 This function needs the work zero offset
/210,NC board) option.

182
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function relates to the following CNC option.

Series 150 Work zero offset 48 sets


Series 160/180
M series
Work zero offset
Work zero offset 48 sets
Work zero offset 300 sets
T series
Work zero offset
Series 210,NC board M series
Work zero offset

CNC parameter: This function relates to the following CNC parameters.


See the manual of CNC parameter for details.

Series 150 1004#0,#1,#5, 1009#1


Series 160/180/210,NC board
1004#0,#1

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

183
(7) Write Work Zero Offset Value

Function Name:
cnc_wrzofs

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrzofs(unsigned short FlibHndl,short length,
IODBZOFS *zofs);
Description:
Writes the work zero offset value specified by "datano", "type".
The offset value must be stored in "data[0]" of "IODBZOFS" with signed
binary format.

Writes the offset value for all axes once by specifying 'ALL_AXES' in
'type'. The offset value for each axis must be stored in "data" array
of "IODBZOFS".

The unit of offset value is the same as "Read work zero offset value
(cnc_rdzofs)". See the description of cnc_rdzofs() function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

length Specify the data block length(size of IODBZOFS structure).

1 axis all axes


IODBZOFS 0 +-------+ --- 0 +-------+ ---
|datano | ^ |datano | ^
2 +-------+ | 2 +-------+ |
|type | length |type | length
4 +-------+-------+ | 4 +-------+-------+ |
| data[0] | v |data[0] :1st | |
8 +---------------+ --- 8 +---------------+ |
= = |
4+4x(n-1) +---------------+ |
|data[n-1] :n-th| v
4+4xn +---------------+ ---

Series 150 : n = Maximum controlled axes


* The data for current controlled axes are valid.
Series 160/180/210,NC board : n = Current controlled axes

zofs Pointer to the IODBZOFS structure including the work zero


offset value. The IODBZOFS structure is as follows.
typedef struct iodbzofs {
short datano; /* offset number */
short type; /* axis number */
long data[MAX_AXIS]; /* offset data value */
} IODBZOFS ; /* MAX_AXIS : max. controlled axes */

datano Specify the work zero offset number.

Series 150
0 : External work zero offset value
1,..,6 : Work zero offset value of G54 through G59
7,..,54 : Work zero offset value of G54.1P1 through G54.1P48

184
Series 160/180
M series
0 : External work zero offset value
1,..,6 : Work zero offset value of G54 through G59
7,..,306: Work zero offset value of G54.1P1 through G54.1P300
T series
0 : External work zero offset value
1,..,6 : Work zero offset value of G54 through G59

Series 210,NC board


M series
0 : External work zero offset value
1,..,6 : Work zero offset value of G54 through G59

type Specify the axis number.


ALL_AXES : assigns all axes(ALL_AXES=-1)
1,..,m : assigns 1 axis(m=current controlled axes)

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 CNC data window" in
"General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Size of IODBZOFS structure(length) is wrong.
EW_NUMBER Data number error
Offset number(datano) is wrong.
EW_ATTRIB Data attribute error
Axis number(type) is wrong.
EW_DATA Data error
(Series 150) Offset data(data) is out of range.
EW_NOOPT No option
(Series160/180 This function needs the work zero offset
/210,NC board) option.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function relates to the following CNC option.

Series 150 Work zero offset 48 sets

Series 160/180
M series
Work zero offset
Work zero offset 48 sets
Work zero offset 300 sets
T series
Work zero offset

Series 210,NC board M series


Work zero offset

185
CNC parameter: This function relates to the following CNC parameters.
See the manual of CNC parameter for details.

Series 150 1004#0,#1,#5, 1009#1

Series 160/180/210,NC board


1004#0,#1

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

186
(8) Read Work Zero Offset Value (Area Specified)

Function Name:
cnc_rdzofsr

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdzofsr(unsigned short FlibHndl,
short s_number,short axis,short e_number,short length,
IODBZOR *zofsr);
Description:
Reads the work zero offset value specified by "s_number", "e_number",
"axis". The offset value is stored in "data" array of "IODBZOR" with
signed binary format.

Reads the offset value for all axes once by specifying 'ALL_AXES' in
'axis'.

The place of decimal point can be got by cnc_getfigure() function.

The unit of offset value is the same as "Read work zero offset value
(cnc_rdzofs)". See the description of cnc_rdzofs() function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_number
Specify the start work zero offset number.

Series 150
0 : External work zero offset value
1,..,6 : Work zero offset value of G54 through G59
7,..,54 : Work zero offset value of G54.1P1 through G54.1P48

Series 160/180
M series
0 : External work zero offset value
1,..,6 : Work zero offset value of G54 through G59
7,..,306: Work zero offset value of G54.1P1 through G54.1P300
T series
0 : External work zero offset value
1,..,6 : Work zero offset value of G54 through G59

Series 210,NC board


M series
0 : External work zero offset value
1,..,6 : Work zero offset value of G54 through G59

e_number
Specify the end work zero offset number.

axis Specify the axis number.


ALL_AXES : assigns all axes(ALL_AXES=-1)
1,..,m : assigns 1 axis(m=current controlled axes)

187
length Specify the data block length(size of IODBZOR structure).
(6+4*(number of axes)*(number of offset))

1 axis all axes


IODBZOR 0 +-------+ --- 0 +-------+ ---
|datano_s ^ |datano_s ^
2 +-------+ | 2 +-------+ |
|type | length |type | length
4 +-------+ | 4 +-------+ |
|datano_e | |datano_e |
6 +-------+-------+ | 6 +-------+-------+ |-+
| data[0] | | |data[0] :1st | | s
10 +---------------+ | 10 +---------------+ | t
= = | = = | a
6+4x(K-1) +---------------+ | 6+4x(n-1) +---------------+ | r
| data[K-1] | v |data[n-1] :n-th| | t
6+4xK +---------------+ --- 6+4xn +---------------+ |-+
= = |
6+4xnx(K-1) +---------------+ |-+
|data[n*(K-1)] | | |
+---------------+ | e
= = | n
6+4x(nxK-1) +---------------+ | d
|data[n*K-1] | v |
6+4xnxK +---------------+ ---+

n = Maximum controlled axes


* The data for current controlled axes are valid.
K = Number of offset to be read

zofsr Pointer to the IODBZOR structure including the work zero offset
value. The IODBZOR structure is as follows.

typedef struct iodbzor {


short datano_s; /* start offset number */
short type; /* axis number */
short datano_e; /* end offset number */
long data[MAX_AXIS*K]; /* offset data value */
} IODBZOR ; /* MAX_AXIS : max. controlled axes */
/* K : number of offset */

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 CNC data window" in
"General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Size of IODBZOR structure(length) is wrong.
EW_NUMBER Data number error
Offset number(s_number,e_number) is wrong.
EW_ATTRIB Data attribute error
Axis number(axis) is wrong.
EW_NOOPT No option
(Series160/180 This function needs the work zero offset
/210,NC board) option.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

188
CNC option: This function relates to the following CNC option.

Series 150 Work zero offset 48 sets


Series 160/180
M series
Work zero offset
Work zero offset 48 sets
Work zero offset 300 sets
T series
Work zero offset
Series 210,NC board
M series
Work zero offset

CNC parameter: This function relates to the following CNC parameters.


See the manual of CNC parameter for details.

Series 150 1004#0,#1,#5, 1009#1


Series 160/180/210,NC board
1004#0,#1

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

189
(9) Write Work Zero Offset Value (Area Specified)

Function Name:
cnc_wrzofsr

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrzofsr(unsigned short FlibHndl,short length,
IODBZOR *zofsr);
Description:
Writes the work zero offset value specified by "datano_s", "datano_e",
"type". The offset value must be stored in "data" array of "IODBZOR"
with signed binary format.

Writes the offset value for all axes once by specifying 'ALL_AXES' in
'type'.

The unit of offset value is the same as "Read work zero offset value
(cnc_rdzofs)". See the description of cnc_rdzofs() function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

length Specify the data block length(size of IODBZOR structure).


(6+4*(number of axes)*(number of offset))

1 axis all axes


IODBZOR 0 +-------+ --- 0 +-------+ ---
|datano_s ^ |datano_s ^
2 +-------+ | 2 +-------+ |
|type | length |type | length
4 +-------+ | 4 +-------+ |
|datano_e | |datano_e |
6 +-------+-------+ | 6 +-------+-------+ |-+
| data[0] | | |data[0] :1st | | s
10 +---------------+ | 10 +---------------+ | t
= = | = = | a
6+4x(K-1) +---------------+ | 6+4x(n-1) +---------------+ | r
| data[K-1] | v |data[n-1] :n-th| | t
6+4xK +---------------+ --- 6+4xn +---------------+ |-+
= = |
6+4xnx(K-1) +---------------+ |-+
|data[n*(K-1)] | | |
+---------------+ | e
= = | n
6+4x(nxK-1) +---------------+ | d
|data[n*K-1] | v |
6+4xnxK +---------------+ ---+

n = Maximum controlled axes


* The data for current controlled axes are valid.
K = Number of offset to be written

190
zofsr Pointer to the IODBZOR structure including the work zero offset
value. The IODBZOR structure is as follows.

typedef struct iodbzor {


short datano_s; /* start offset number */
short type; /* axis number */
short datano_e; /* end offset number */
long data[MAX_AXIS*K]; /* offset data value */
} IODBZOR ; /* MAX_AXIS : max. controlled axes */
/* K : number of offset */

datano_s
Specify the start work zero offset number.

Series 150
0 : External work zero offset value
1,..,6 : Work zero offset value of G54 through G59
7,..,54 : Work zero offset value of G54.1P1 through G54.1P48

Series 160/180
M series
0 : External work zero offset value
1,..,6 : Work zero offset value of G54 through G59
7,..,306: Work zero offset value of G54.1P1 through G54.1P300
T series
0 : External work zero offset value
1,..,6 : Work zero offset value of G54 through G59

Series 210,NC board


M series
0 : External work zero offset value
1,..,6 : Work zero offset value of G54 through G59

datano_e
Specify the end work zero offset number.

type Specify the axis number.


ALL_AXES : assigns all axes(ALL_AXES=-1)
1,..,m : assigns 1 axis(m=current controlled axes)

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 CNC data window" in
"General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Size of IODBZOR structure(length) is wrong.
EW_NUMBER Data number error
Offset number(datano_s,datano_e) is wrong.
EW_ATTRIB Data attribute error
Axis number(type) is wrong.
EW_DATA Data error
(Series 150) Offset data(data) is out of range.
EW_NOOPT No option
(Series160/180 This function needs the work zero offset
/210,NC board) option.

191
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function relates to the following CNC option.

Series 150 Work zero offset 48 sets


Series 160/180
M series
Work zero offset
Work zero offset 48 sets
Work zero offset 300 sets
T series
Work zero offset
Series 210,NC board
M series
Work zero offset

CNC parameter: This function relates to the following CNC parameters.


See the manual of CNC parameter for details.

Series 150 1004#0,#1,#5, 1009#1


Series 160/180/210,NC board
1004#0,#1

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

192
(10) Read Work Zero Offset Information (Area Specified)

Function Name:
cnc_rdzofsinfo

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdzofsinfo(unsigned short FlibHndl,&use_no);

Description:
Reads the available number of work zero offset.
It is stored in "use_no" with signed binary format.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

use_no Available number of work zero offset

Series 150 7/55 sets

Series 160/180
M series 7/55/307 sets
T series 7 sets

Series 210,NC board


M series 7 sets

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 CNC data window" in
"General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
This function needs the work zero offset
option(Series 160/180/210,NC board) and the
extended driver/library option.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option, and
relates to the following CNC option.

Series 150 Work zero offset 48 sets

Series 160/180
M series
Work zero offset
Work zero offset 48 sets
Work zero offset 300 sets
T series
Work zero offset

193
Series 210,NC board
M series
Work zero offset

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

194
(11) Read Parameter

Function Name:
cnc_rdparam

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdparam(unsigned short FlibHndl,short number,
short axis,short length,IODBPSD *param);
Description:
Reads the parameter specified by "number","axis"(only for the parameter
with axis). The data format depends on each parameter. The format of
Byte/Word/2-Word parameter is generally signed binary.
Reads the parameter for all axes once by specifying 'ALL_AXES' in
'axis'. The parameter for each axis is stored in each array of
"IODBPSD".

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.

Parameter type Use Byte size


--------------------------+---------------------------------+---------
Bit parameter Every bits have each definition. 1
Bit parameter with axis Every bits have each definition. 1
(each axis)
Byte parameter 1-byte data is stored. 1
Byte parameter with axis 1-byte data is stored.(each axis) 1
Word parameter 2-byte data is stored. 2
Word parameter with axis 2-byte data is stored.(each axis) 2
2-Word parameter 4-byte data is stored. 4
2-Word parameter with axis 4-byte data is stored.(each axis) 4

It is impossible to read any bit parameter bit by bit.


8 bits(i.e. 1 byte) which belong to the same parameter number are read
at the same time.

See the "PARAMETER MANUAL" of CNC for details of each parameter.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

number Specify the parameter number.


See the "PARAMETER MANUAL" of CNC about available parameter
number. It can be got by cnc_rdparanum() function and
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)

195
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.

no axis/1 axis all axes


IODBPSD 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 +---------------+ ---

Series 150 : n = Maximum controlled axes


Series 160/180/210,NC board : n = Current controlled axes

In case of Series 160/180/210,NC board, the spindle parameters


have an axis attribute, and the data for number of spindle are
valid.

param Pointer to the IODBPSD structure including the parameter.


The IODBPSD structure is as follows.

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(only Series 150)
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)

196
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 CNC data window" in
"General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Size of IODBPSD structure(length) is wrong.
EW_NUMBER Data number error
Parameter number(number) is wrong.
EW_ATTRIB Data attribute error
Axis number(axis) is wrong.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

197
(12) Write Parameter

Function Name:
cnc_wrparam

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrparam(unsigned short FlibHndl,short length,
IODBPSD *param);
Description:
Writes the parameter specified by "datano","type"(only for the parameter
with axis). The data format depends on each parameter. The format of
Byte/Word/2-Word parameter is generally signed binary.

Writes the parameter for all axes once by specifying 'ALL_AXES' in


'type'. The parameter for each axis must be stored in each array of
"IODBPSD".

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.

Parameter type Use Byte size


--------------------------+---------------------------------+---------
Bit parameter Every bits have each definition. 1
Bit parameter with axis Every bits have each definition. 1
(each axis)
Byte parameter 1-byte data is stored. 1
Byte parameter with axis 1-byte data is stored.(each axis) 1
Word parameter 2-byte data is stored. 2
Word parameter with axis 2-byte data is stored.(each axis) 2
2-Word parameter 4-byte data is stored. 4
2-Word parameter with axis 4-byte data is stored.(each axis) 4

It is impossible to write any bit parameter bit by bit.


8 bits(i.e. 1 byte) which belong to the same parameter number are
written at the same time.

PW000 alarm(Series 150), PS000 alarm(Series 160/180/210,NC board):


"PLEASE TURN OFF POWER" may be issued when some specific parameters
are written.

In case of Series 150, the error(Return:EW_PROT) is returned when the


locked parameter such as parameter more than 9000 is written.

See the "PARAMETER MANUAL" of CNC for details of each parameter.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

length Specify the data block length(size of IODBPSD structure).


(4+(byte size of parameter)*(number of axis))

198
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.

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 +---------------+ ---

Series 150 : n = Maximum controlled axes


Series 160/180/210,NC board : n = Current controlled axes

In case of Series 160/180/210,NC board, the spindle parameters


have an axis attribute, and the data for number of spindle are
valid.

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_rdparanum()
function and 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)

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 CNC data window" in
"General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Size of IODBPSD structure(length) is wrong.
EW_NUMBER Data number error
Parameter number(datano) is wrong.

199
EW_ATTRIB Data attribute error
Axis number(type) is wrong.
EW_NOOPT No option
(Series160/180 There is no option required for the specified
/210,NC board) parameter.
EW_PROT Write operation is prohibited.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: In case of Series 150, there is no need of CNC option for this
function.
In case of Series 160/180/210,NC board, there may be need of
CNC option for some specific parameters.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

200
(13) Read Parameter (Area Specified)

Function Name:
cnc_rdparar

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdparar(unsigned short FlibHndl,
(short *)&s_number,short axis,(short *)&e_number,
(short *)&length,(void *)param);
Description:
Reads the parameter specified by "s_number","e_number","axis"(only for
the parameter with axis). The data format depends on each parameter.
The format of Byte/Word/2-Word parameter is generally signed binary.

Reads the parameter for all axes specified range by specifying


'ALL_AXES' in 'axis'.

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.

Parameter type Use Byte size


--------------------------+---------------------------------+---------
Bit parameter Every bits have each definition. 1
Bit parameter with axis Every bits have each definition. 1
(each axis)
Byte parameter 1-byte data is stored. 1
Byte parameter with axis 1-byte data is stored.(each axis) 1
Word parameter 2-byte data is stored. 2
Word parameter with axis 2-byte data is stored.(each axis) 2
2-Word parameter 4-byte data is stored. 4
2-Word parameter with axis 4-byte data is stored.(each axis) 4

It is impossible to read any bit parameter bit by bit.


8 bits(i.e. 1 byte) which belong to the same parameter number are read
at the same time.

See the "PARAMETER MANUAL" of CNC for details of each parameter.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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_rdparanum() function and
cnc_rdparainfo() function.

201
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.

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

In case of Series 160/180/210,NC board, the spindle parameters


have an axis attribute, and the data for number of spindle are
valid.

202
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(only Series 150)
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)

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 CNC data window" in
"General Description".)
--------------------------------------------------------------
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(s_number,e_number) is wrong.
EW_ATTRIB Data attribute error
Axis number(axis) is wrong.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

203
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

204
(14) Write Parameter (Area Specified)

Function Name:
cnc_wrparas

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrparas(unsigned short FlibHndl,short length,
(void *)param);
Description:
Writes all parameters stored in "param".
The data format depends on each parameter. The format of Byte/Word/2-
Word parameter is generally signed binary.

Writes the parameter for all axes once by specifying 'ALL_AXES' in


'type'. The parameter for each axis must be stored in each array of
"IODBPSD".

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.

Parameter type Use Byte size


--------------------------+---------------------------------+---------
Bit parameter Every bits have each definition. 1
Bit parameter with axis Every bits have each definition. 1
(each axis)
Byte parameter 1-byte data is stored. 1
Byte parameter with axis 1-byte data is stored.(each axis) 1
Word parameter 2-byte data is stored. 2
Word parameter with axis 2-byte data is stored.(each axis) 2
2-Word parameter 4-byte data is stored. 4
2-Word parameter with axis 4-byte data is stored.(each axis) 4

It is impossible to write any bit parameter bit by bit.


8 bits(i.e. 1 byte) which belong to the same parameter number are
written at the same time.

PW000 alarm(Series 150), PS000 alarm(Series 160/180/210,NC board):


"PLEASE TURN OFF POWER" may be issued when some specific parameters
are written.

In case of Series 150, the error(Return:EW_PROT) is returned when there


in no emergency stop status in CNC side. It is also returned when the
locked parameter such as parameter more than 9000 is written, but other
parameters are written.

See the "PARAMETER MANUAL" of CNC for details of each parameter.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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))]

205
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.

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

In case of Series 160/180/210,NC board, the spindle parameters


have an axis attribute, and the data for number of spindle are
valid.

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_rdparanum()
function and 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)

206
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 CNC data window" in
"General Description".)
--------------------------------------------------------------
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
(Series160/180 There is no option required for the specified
/210,NC board) parameter.
EW_PROT Write operation is prohibited.
(Series 150) There is no emergency stop status.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: In case of Series 150, there is no need of CNC option for this
function.
In case of Series 160/180/210,NC board, there may be need of
CNC option for some specific parameters.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.


In case of Series 150, there must be the emergency stop status.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

207
(15) Read Parameter Information

Function Name:
cnc_rdparainfo

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdparainfo(unsigned short FlibHndl,
short s_number, unsigned short read_no, ODBPARAIF *paraif);
Description:
Reads the CNC parameter information specified by "s_number" and
"read_no".

The CNC parameter is basically non-continuous, and the attribute like


the type and the size, etc. is different in each number.
Use this function for such as displaying the parameter.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 the parameter information which has
been read actually

prev_no Previous parameter number


Previous effective number of parameter
information which has been read first

next_no Next parameter number


Next effective number of parameter information
which has been read lastly

info[N].prm_no Parameter number


Parameter number which exists actually

208
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,NC board)
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(Only Series160/180/210,NC board)
0 : no spindle 1 : spindle
bit 9 - 15:(reserve)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
Start parameter number(s_number) is wrong.
EW_NOOPT no option
The extended driver/library function is
necessary.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

209
(16) Read Minimum, Maximum, Total Number of Parameter

Function Name:
cnc_rdparanum

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdparanum(unsigned short FlibHndl,
ODBPARANUM *paranum);
Description:
Reads minimum, maximum, total number of the CNC parameter.

The distribution of the parameter is different in each CNC model,


and the new parameter may be added because of the expansion of the CNC
function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

paranum Pointer to the ODBPARANUM structure including the minimum,


maximum, total number of the parameter.
The ODBPARANUM structure is as follows.
typedef struct odbparanum {
unsigned short para_min ; /* minimum number of parameter */
unsigned short para_max ; /* maximum number of parameter */
unsigned short total_no ; /* total number of parameter */
} ODBPARANUM ;

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

210
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

211
(17) Read Setting Data

Function Name:
cnc_rdset

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdset(unsigned short FlibHndl,short number,
short axis,short length,IODBPSD *set);
Description:
Reads the setting data specified by "number","axis"(only for the
setting data with axis). The data format depends on each setting data.
The format of Byte/Word/2-Word setting data is generally signed binary.

Reads the setting data for all axes once by specifying 'ALL_AXES' in
'axis'. The setting data for each axis is stored in each array of
"IODBPSD".

The attribute of setting data depends on the type and axis, and it is
different for each setting data. It is as follows, and can be got by
cnc_rdsetinfo() function.

Setting data type Use Byte size


---------------------------+---------------------------------+---------
Bit setting data Every bits have each definition. 1
Bit setting data with axis Every bits have each definition. 1
(each axis)
Byte setting data 1-byte data is stored. 1
Byte setting data with axis 1-byte data is stored.(each axis) 1
Word setting data 2-byte data is stored. 2
Word setting data with axis 2-byte data is stored.(each axis) 2
2-Word setting data 4-byte data is stored. 4
2-Word setting data with ax.4-byte data is stored.(each axis) 4

It is impossible to read any bit setting data bit by bit.


8 bits(i.e. 1 byte) which belong to the same setting data number are
read at the same time.

This function is the same as "Read parameter(cnc_rdparam)" except that


it cannot read the parameter without setting attribute.

See the "PARAMETER MANUAL" of CNC for details of each setting data.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

number Specify the setting data number.


See the "PARAMETER MANUAL" of CNC about available setting data
number. It can be got by cnc_rdsetnum() function and
cnc_rdsetinfo() 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)

212
length Specify the data block length(size of IODBPSD structure).
(4+(byte size of setting data)*(number of axis))
In case that the size of setting data 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 setting data or 1 axis is 1 or 2
byte.
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 +---------------+---
Series 150 : n = Maximum controlled axes
Series 160/180/210,NC board : n = Current controlled axes

In case of Series 160/180/210,NC board, the spindle setting


data has an axis attribute, and the data for number of spindle
are valid.

set Pointer to the IODBPSD structure including the setting data.


The IODBPSD structure is as follows.
typedef struct iodbpsd {
short datano; /* setting data number */
short type; /* upper byte:type */
/* lower byte:axis */
union {
char cdata; /* bit/byte setting data */
short idata; /* word setting data */
long ldata; /* 2-word setting data */
char cdatas[MAX_AXIS]; /* bit/byte set. data with axis*/
short idatas[MAX_AXIS];/* word setting data with axis */
long ldatas[MAX_AXIS]; /* 2-word set. data with axis */
} u ;
} IODBPSD ; /* MAX_AXIS : max. controlled axes */

datano Setting data number which was read is stored.

type Attribute of setting data which was read is stored.


Upper byte:type(only Series 150)
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)

213
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 CNC data window" in
"General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Size of IODBPSD structure(length) is wrong.

EW_NUMBER Data number error


Setting data number(number) is wrong.

EW_ATTRIB Data attribute error


Axis number(axis) is wrong.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

214
(18) Write Setting Data

Function Name:
cnc_wrset

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrset(unsigned short FlibHndl,short length,
IODBPSD *set);
Description:
Writes the setting data specified by "datano","type"(only for the
setting data with axis). The data format depends on each setting data.
The format of Byte/Word/2-Word setting data is generally signed binary.

Writes the setting data for all axes once by specifying 'ALL_AXES' in
'type'. The setting data for each axis must be stored in each array of
"IODBPSD".

The attribute of setting data depends on the type and axis, and it is
different for each setting data. It is as follows, and can be got by
cnc_rdsetinfo() function.

Setting data type Use Byte size


---------------------------+---------------------------------+---------
Bit setting data Every bits have each definition. 1
Bit setting data with axis Every bits have each definition. 1
(each axis)
Byte setting data 1-byte data is stored. 1
Byte setting data with axis 1-byte data is stored.(each axis) 1
Word setting data 2-byte data is stored. 2
Word setting data with axis 2-byte data is stored.(each axis) 2
2-Word setting data 4-byte data is stored. 4
2-Word setting data with ax.4-byte data is stored.(each axis) 4

It is impossible to write any bit setting data bit by bit.


8 bits(i.e. 1 byte) which belong to the same setting data number are
written at the same time.

This function is the same as "Write parameter(cnc_wrparam)" except that


it cannot write the parameter without setting attribute.

See the "PARAMETER MANUAL" of CNC for details of each setting data.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

length Specify the data block length(size of IODBPSD structure).


(4+(byte size of setting data)*(number of axis))

215
In case that the size of setting data 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 setting data or 1 axis is 1 or 2
byte.
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 +---------------+---

Series 150 : n = Maximum controlled axes


Series 160/180/210,NC board : n = Current controlled axes

In case of Series 160/180/210,NC board, the spindle setting


data has an axis attribute, and the data for number of spindle
are valid.

set Pointer to the IODBPSD structure including the setting data.


The IODBPSD structure is as follows.

typedef struct iodbpsd {


short datano; /* setting data number */
short type; /* axis number */
union {
char cdata; /* bit/byte setting data */
short idata; /* word setting data */
long ldata; /* 2-word setting data */
char cdatas[MAX_AXIS]; /* bit/byte set. data with axis*/
short idatas[MAX_AXIS];/* word setting data with axis */
long ldatas[MAX_AXIS]; /* 2-word set. data with axis */
} u ;
} IODBPSD ; /* MAX_AXIS : max. controlled axes */

datano Specify the setting data number.


See the "PARAMETER MANUAL" of CNC about available
setting data number. It can be got by cnc_rdsetnum()
function and cnc_rdsetinfo() 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)

216
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 CNC data window" in
"General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Size of IODBPSD structure(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
(Series160/180 There is no option required for the specified
/210,NC board) setting data.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: In case of Series 150, there is no need of CNC option for this
function.
In case of Series 160/180/210,NC board, there may be need of
CNC option for some specific setting data.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

217
(19) Read Setting Data (Area Specified)

Function Name:
cnc_rdsetr

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdsetr(unsigned short FlibHndl,
(short *)&s_number,short axis,(short *)&e_number,
(short *)&length,(void *)set);
Description:
Reads the setting data specified by "s_number","e_number","axis"(only
for the setting data with axis). The data format depends on each
setting data. The format of Byte/Word/2-Word setting data is generally
signed binary.

Reads the setting data for all axes specified range by specifying
'ALL_AXES' in 'axis'.

The attribute of setting data depends on the type and axis, and it is
different for each setting data. It is as follows, and can be got by
cnc_rdsetinfo() function.

Setting data type Use Byte size


---------------------------+---------------------------------+---------
Bit setting data Every bits have each definition. 1
Bit setting data with axis Every bits have each definition. 1
(each axis)
Byte setting data 1-byte data is stored. 1
Byte setting data with axis 1-byte data is stored.(each axis) 1
Word setting data 2-byte data is stored. 2
Word setting data with axis 2-byte data is stored.(each axis) 2
2-Word setting data 4-byte data is stored. 4
2-Word setting data with ax.4-byte data is stored.(each axis) 4

It is impossible to read any bit setting data bit by bit.


8 bits(i.e. 1 byte) which belong to the same setting data number are
read at the same time.

This function is the same as "Read parameter(area specified)(cnc_


rdparar)" except that it cannot read the parameter without setting
attribute.

See the "PARAMETER MANUAL" of CNC for details of each setting data.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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. It can be got by cnc_rdsetnum() function and
cnc_rdsetinfo() function.

218
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.

no axis/1 axis all axes


IODBPSD 0 +-------+ --- 0 +-------+ ---
|datano | ^ |datano | ^
2 +-------+ | 2 +-------+ |
|type |length/setting 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

In case of Series 160/180/210,NC board, the spindle setting


data has an axis attribute, and the data for number of spindle
are valid.

219
set Pointer to the area to store the setting data.
Each setting data can be referred by using the IODBPSD
structure.

typedef struct iodbpsd {


short datano; /* setting data number */
short type; /* upper byte:type */
/* lower byte:axis */
union {
char cdata; /* bit/byte setting data */
short idata; /* word setting data */
long ldata; /* 2-word setting data */
char cdatas[MAX_AXIS]; /* bit/byte set. data with axis*/
short idatas[MAX_AXIS];/* word setting data with axis */
long ldatas[MAX_AXIS]; /* 2-word set. data with axis */
} u ;
} IODBPSD ; /* MAX_AXIS : max. controlled axes */

datano Setting data number which was read is stored.

type Attribute of setting data 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)

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 CNC data window" in
"General Description".)
--------------------------------------------------------------
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(s_number,e_number) is
wrong.
EW_ATTRIB Data attribute error
Axis number(axis) is wrong.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

220
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

221
(20) Write Setting Data (Area Specified)

Function Name:
cnc_wrsets

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrsets(unsigned short FlibHndl,
short length,(void *)set);
Description:
Writes all setting data stored in "set".
The data format depends on each setting data. The format of Byte/Word/
2-Word setting data is generally signed binary.

Writes the setting data for all axes once by specifying 'ALL_AXES' in
'type'. The setting data for each axis must be stored in each array of
"IODBPSD".

The attribute of setting data depends on the type and axis, and it is
different for each setting data. It is as follows, and can be got by
cnc_rdsetinfo() function.

Setting data type Use Byte size


---------------------------+---------------------------------+---------
Bit setting data Every bits have each definition. 1
Bit setting data with axis Every bits have each definition. 1
(each axis)
Byte setting data 1-byte data is stored. 1
Byte setting data with axis 1-byte data is stored.(each axis) 1
Word setting data 2-byte data is stored. 2
Word setting data with axis 2-byte data is stored.(each axis) 2
2-Word setting data 4-byte data is stored. 4
2-Word setting data with ax.4-byte data is stored.(each axis) 4

It is impossible to write any bit setting data bit by bit.


8 bits(i.e. 1 byte) which belong to the same setting data number are
written at the same time.

This function is the same as "Write parameter(area specified)(cnc_


wrparas)" except that it cannot write the parameter without setting
attribute.

See the "PARAMETER MANUAL" of CNC for details of each setting data.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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))]

222
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.

no axis/1 axis all axes


IODBPSD 0 +-------+ --- 0 +-------+ ---
|datano | ^ |datano | ^
2 +-------+ | 2 +-------+ |
|type | length/setting 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

In case of Series 160/180/210,NC board, the spindle setting


data has an axis attribute, and the data for number of spindle
are valid.

set Pointer to the area to store the setting data.


Each setting data can be referred by using the IODBPSD
structure.

typedef struct iodbpsd {


short datano; /* setting data number */
short type; /* upper byte:type */
/* lower byte:axis */
union {
char cdata; /* bit/byte setting data */
short idata; /* word setting data */
long ldata; /* 2-word setting data */
char cdatas[MAX_AXIS]; /* bit/byte set. data with axis*/
short idatas[MAX_AXIS];/* word setting data with axis */
long ldatas[MAX_AXIS]; /* 2-word set. data with axis */
} u ;
} IODBPSD ; /* MAX_AXIS : max. controlled axes */

datano Specify the setting data number.


See the "PARAMETER MANUAL" of CNC about available
setting data number. It can be got by cnc_rdsetnum()
function and cnc_rdsetinfo() function.

type Specify the attribute of setting data.


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)

223
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 CNC data window" in
"General Description".)
--------------------------------------------------------------
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
(Series160/180 There is no option required for the specified
/210,NC board) setting data.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: In case of Series 150, there is no need of CNC option for this
function.
In case of Series 160/180/210,NC board, there may be need of
CNC option for some specific setting data.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

224
(21) Read Setting Data Information

Function Name:
cnc_rdsetinfo

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdsetinfo(unsigned short FlibHndl,
short s_number, unsigned short read_no, ODBSETIF *setif);
Description:
Reads the CNC setting data information specified by "s_number" and
"read_no".

The CNC setting data is basically non-continuous, and the attribute


like the type and the size, etc. is different in each number.
Use this function for such as displaying the setting data.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_number
Specify the start setting data number.

read_no Specify the number of the setting data information to read.

setif Pointer to the ODBSETIF structure including the setting data


information. The ODBSETIF structure is as follows.
typedef struct odbsetif {
unsigned short info_no ;
/* number of setting data information */
short prev_no ; /* previous setting data number */
short next_no ; /* next setting data number */
struct {
short set_no ; /* setting data number */
short set_type ; /* attribute of setting data */
} info[N] ; /* N is amount of setting data information */
} ODBSETIF ;

info_no Number of setting data information


Number of the setting data information which
has been read actually

prev_no Previous setting data number


Previous effective number of the setting data
information which has been read first

next_no Next setting data number


Next effective number of the setting data
information which has been read lastly

info[N].set_no Setting data number


The setting data number which exists actually.

225
info[N].set_type Attribute of setting data
The following attributes are set.
bit 0,1 : type attribute
0 : bit type 2 : word type
1 : byte type 3 : 2-word type
bit 2 : axis attribute
0 : without axis
1 : with axis
bit 3 : sign(Only Series160/180/210,NC board)
0 : with sign
1 : without sign
bit 4 : setting input
(always) 1 : enable
bit 5 : write protection
(always) 0 : enable
bit 6 : power must be off after writing
(always) 0 : disable
bit 7 : read protection
0 : enable 1 : disable
bit 8 : spindle parameter Only Series160/180/210,NC board)
0 : no spindle 1 : spindle
bit 9 - 15:(reserve)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
Start setting data number(s_number) is wrong.
EW_NOOPT no option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

226
(22) Read Minimum, Maximum, Total Number of Setting Data

Function Name:
cnc_rdsetnum

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdsetnum(unsigned short FlibHndl,
ODBSETNUM *setnum);
Description:
Reads minimum, maximum, total number of the CNC setting data.

The distribution of the setting data is different in each CNC model,


and the new setting data may be added because of the expansion of the
CNC function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

setnum Pointer to the ODBSETNUM structure including the minimum,


maximum, total number of the setting data.
The ODBSETNUM structure is as follows.
typedef struct odbsetnum {
unsigned short set_min ;
/* minimum number of setting data */
unsigned short set_max ;
/* maximum number of setting data */
unsigned short total_no ;
/* total number of setting data */
} ODBSETNUM ;

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

227
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

228
(23) Read Pitch Error Compensation Data (Area Specified)

Function Name:
cnc_rdpitchr

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdpitchr(unsigned short FlibHndl,
short s_number,short e_number,short length,
IODBPI *pitch);
Description:
Reads the pitch error compensation data specified by "s_number",
"e_number". The data is stored in "data" array of "IODBPI" with signed
binary format.
- Available range of data : -7,...,7

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_number
Specify the start number of the pitch error compensation data.
e_number
Specify the end number of the pitch error compensation data.

length Specify the data block length(size of IODBPI structure).


(6+(number of pitch error compensation data))

IODBPI 0 +-----------+ ---


|datano_s | ^
2 +-----------+ |
|dummy | |
4 +-----------+ |
|datano_e | |
6 +-----+-----+ length
|data[0] |
7 +-----+ |
= = |
6+(N-1) +-----+ |
|data[N-1] v
6+N +-----+ ---
N : Number of pitch error compensation data

pitch Pointer to the IODBPI structure including the pitch error


compensation data. The IODBPI structure is as follows.

typedef struct iodbpi {


short datano_s; /* start number of pitch error data */
short dummy; /* (not used) */
short datano_e; /* end number of pitch error data */
char data[N]; /* pitch error compensation data */
} IODBPI ; /* N : number of pitch error data */

229
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 CNC data window" in
"General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Size of IODBPI structure(length) is wrong.
EW_NUMBER Data number error
Pitch error compensation data number(s_number,
e_number) is wrong.
EW_NOOPT No option
This function needs the pitch error
compensation option.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the pitch error compensation option.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

230
(24) Write Pitch Error Compensation Data (Area Specified)

Function Name:
cnc_wrpitchr

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrpitchr(unsigned short FlibHndl,
short length,IODBPI *pitch);
Description:
Writes the pitch error compensation data specified by "datano_s",
"datano_e". The data must be stored in "data" array of "IODBPI" with
signed binary format.
- Available range of data : -7,...,7

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

length Specify the data block length(size of IODBPI structure).


(6+(number of pitch error compensation data))

IODBPI 0 +-----------+ ---


|datano_s | ^
2 +-----------+ |
|dummy | |
4 +-----------+ |
|datano_e | |
6 +-----+-----+ length
|data[0] |
7 +-----+ |
= = |
6+(N-1) +-----+ |
|data[N-1] v
6+N +-----+ ---
N : Number of pitch error compensation data

pitch Pointer to the IODBPI structure including the pitch error


compensation data. The IODBPI structure is as follows.
typedef struct iodbpi {
short datano_s; /* start number of pitch error data */
short dummy; /* (not used) */
short datano_e; /* end number of pitch error data */
char data[N]; /* pitch error compensation data */
} IODBPI ; /* N : number of pitch error data */

datano_s
Specify the start number of the pitch error compensation
data.
datano_e
Specify the end number of the pitch error compensation
data.

231
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 CNC data window" in
"General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Size of IODBPI structure(length) is wrong.
EW_NUMBER Data number error
Pitch error compensation data number(datano_s,
datano_e) is wrong.
EW_DATA Data error
Pitch error compensation data(data) is out of
range.
EW_NOOPT No option
This function needs the pitch error
compensation option.
EW_PROT Write operation is prohibited.
(Series 150) There is no emergency stop status.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the pitch error compensation option.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.


In case of Series 150, there must be the emergency stop status.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

232
(25) Read Pitch Error Compensation Data Information

Function Name:
cnc_rdpitchinfo

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdpitchinfo(unsigned short FlibHndl,
short &use_no);
Description:
Reads the available number of pitch error compensation data.
It is stored in "use_no" with signed binary format.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

use_no Available number of pitch error compensation data

Series 150 1280

Series 160/180/210,NC board 1024

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 CNC data window" in
"General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
This function needs the pitch error
compensation option and the extended driver/
library option.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the pitch error compensation option and
the extended driver/library option.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

233
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

234
(26) Read Custom Macro Variable

Function Name:
cnc_rdmacro

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdmacro(unsigned short FlibHndl,short number,
short length,ODBM *macro);
Description:
Reads the custom macro variable specified by "number".
The data is stored in "ODBM" with signed binary format.
The kinds of custom macro variable are as follows.
(1) Local variable(#1,..,#33)
The local variables which belong to the macro program just being
executed when the application program calls this function are read.
(2) Common variable(#100,..,#999)
See the description of cnc_rdmacroinfo() function about the
available range of common variables.
(3) System variable(#1000,..,#9999)

It is possible to exchange the type of macro variable by using the


following global variable.
short cnc_macro_type --- 0 : fixed-point type(default)
none zero : floating-point type
- fixed-point type(data format=M*10**(-E))
mcr_val : value of variable(=M)
4-byte binary data with sign
(available range:
Series 150 No limitation
Series 160/180/210,NC board
-99999999,..,99999999)
dec_val : number of places of decimals(=E)
2-byte binary data with sign
(available range:
Series 150 -128,..,127
Series 160/180/210,NC board
-1,0,..,8)
* In case of Series 160/180/210,NC board, specify the
floating-point type when the data is beyond above
limitation, because 'mcr_val' and 'dec_val' are
invalid(=-1) in such case.
- floating-point type(data format=M*2**(-E))
mcr_val : numerical part of variable(=M)
4-byte binary data with sign
(available range:No limitation)
dec_val : exponent part of variable(=E)
2-byte binary data with sign
(available range:-128,..,127)
The value of an undefined variable is called "vacant", and it is as
follows both under fixed-point type and under floating-point type.
mcr_val = 0
dec_val = -1

See "OPERATOR'S MANUAL" of CNC for details of the custom macro variable.

235
Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 | v
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 ;

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 CNC data window" in
"General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Size of ODBM structure(length) is wrong.
EW_NUMBER Data number error
Custom macro variable number(number) is wrong.
EW_NOOPT No option
This function needs the custom macro option.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function relates to the following CNC option.

Series 150 Custom macro


Custom macro common variable 200 sets
Custom macro common variable 300 sets
Custom macro common variable 600 sets

Series 160/180 Custom macro B


Custom macro common variable extension

Series 210 M series,NC board


Custom macro B

236
CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

237
(27) Write Custom Macro Variable

Function Name:
cnc_wrmacro

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrmacro(unsigned short FlibHndl,short number,
short length,long mcr_val,short dec_val);
Description:
Writes the custom macro variable specified by "number".
The data must be stored in "mcr_val", "dec_val" with signed binary
format.
The kind of custom macro variable is as follows.
The local variable cannot be written.
(1) Common variable(#100,..,#999)
See the description of cnc_rdmacroinfo() function about the
available range of common variables.
(2) System variable(#1000,..,#9999)

It is possible to exchange the type of macro variable by using the


following global variable.
short cnc_macro_type --- 0 : fixed-point type(default)
none zero : floating-point type
- fixed-point type(data format=M*10**(-E))
mcr_val : value of variable(=M)
4-byte binary data with sign
(available range:
Series 150 No limitation
Series 160/180/210,NC board
-99999999,..,99999999)
dec_val : number of places of decimals(=E)
2-byte binary data with sign
(available range:
Series 150 -128,..,127
Series 160/180/210,NC board
-1,0,..,8)
* In case of Series 160/180/210,NC board, specify the
floating-point type when the data is beyond above
limitation, because the error(Return:EW_DATA) is
returned in such case.
- floating-point type(data format=M*2**(-E))
mcr_val : numerical part of variable(=M)
4-byte binary data with sign
(available range:No limitation)
dec_val : exponent part of variable(=E)
2-byte binary data with sign
(available range:-128,..,127)

The value of an undefined variable is called "vacant", and it is as


follows both under fixed-point type and under floating-point type.
mcr_val = 0
dec_val = -1

See "OPERATOR'S MANUAL" of CNC for details of the custom macro variable.

238
Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

number Specify the custom macro variable number.

length Specify the data block length(=10).

mcr_val Specify the value of variable/numerical part of variable.

dec_val Specify the number of places of decimals/exponent part of


variable.

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 CNC data window" in
"General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Size(length) is wrong.
EW_NUMBER Data number error
Custom macro variable number(number) is wrong.
EW_DATA Data error
Value of custom macro variable(mcr_val,
dec_val) is out of available range.
EW_NOOPT No option
This function needs the custom macro option.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function relates to the following CNC option.

Series 150 Custom macro


Custom macro common variable 200 sets
Custom macro common variable 300 sets
Custom macro common variable 600 sets

Series 160/180 Custom macro B


Custom macro common variable extension

Series 210 M series,NC board


Custom macro B

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

239
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

240
(28) Read Custom Macro Variable (Area Specified)

Function Name:
cnc_rdmacror

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdmacror(unsigned short FlibHndl,
short s_number,short e_number,short length,
IODBMR *macror);
Description:
Reads the custom macro variable specified by "s_number", "e_number".
The data is stored in "IODBMR" with signed binary format.
The kinds of custom macro variable are as follows.
(1) Local variable(#1,..,#33)
The local variables which belong to the macro program just being
executed when the application program calls this function are read.
(2) Common variable(#100,..,#999)
See the description of cnc_rdmacroinfo() function about the
available range of common variables.

It is possible to exchange the type of macro variable by using the


following global variable.
short cnc_macro_type --- 0 : fixed-point type(default)
none zero : floating-point type
- fixed-point type(data format=M*10**(-E))
mcr_val : value of variable(=M)
4-byte binary data with sign
(available range:
Series 150 No limitation
Series 160/180/210,NC board
-99999999,..,99999999)
dec_val : number of places of decimals(=E)
2-byte binary data with sign
(available range:
Series 150 -128,..,127
Series 160/180/210,NC board
-1,0,..,8)
* In case of Series 160/180/210,NC board, specify the
floating-point type when the data is beyond above
limitation, because 'mcr_val' and 'dec_val' are
invalid(=-1) in such case.
- floating-point type(data format=M*2**(-E))
mcr_val : numerical part of variable(=M)
4-byte binary data with sign
(available range:No limitation)
dec_val : exponent part of variable(=E)
2-byte binary data with sign
(available range:-128,..,127)

The value of an undefined variable is called "vacant", and it is as


follows both under fixed-point type and under floating-point type.
mcr_val = 0
dec_val = -1

See "OPERATOR'S MANUAL" of CNC for details of the custom macro variable.

241
Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 v
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
The first custom macro variable number to be read is
returned.

datano_e
The last custom macro variable number to be read is
returned.

242
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 CNC data window" in
"General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Size of IODBMR structure(length) is wrong.
EW_NUMBER Data number error
Custom macro variable number(s_number,
e_number) is wrong.
EW_NOOPT No option
This function needs the custom macro option.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function relates to the following CNC option.

Series 150 Custom macro


Custom macro common variable 200 sets
Custom macro common variable 300 sets
Custom macro common variable 600 sets

Series 160/180 Custom macro B


Custom macro common variable extension

Series 210 M series,NC board


Custom macro B

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

243
(29) Write Custom Macro Variable (Area Specified)

Function Name:
cnc_wrmacror

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrmacror(unsigned short FlibHndl,
short length,IODBMR *macror);
Description:
Writes the custom macro variable specified by "datano_s", "datano_e".
The data must be stored in "IODBMR" with signed binary format.

The kind of custom macro variable is as follows.


The local variable cannot be written.

(1) Common variable(#100,..,#999)


See the description of cnc_rdmacroinfo() function about the
available range of common variables.

It is possible to exchange the type of macro variable by using the


following global variable.
short cnc_macro_type --- 0 : fixed-point type(default)
none zero : floating-point type
- fixed-point type(data format=M*10**(-E))
mcr_val : value of variable(=M)
4-byte binary data with sign
(available range:
Series 150 No limitation
Series 160/180/210,NC board
-99999999,..,99999999)
dec_val : number of places of decimals(=E)
2-byte binary data with sign
(available range:
Series 150 -128,..,127
Series 160/180/210,NC board
-1,0,..,8)
* In case of Series 160/180/210,NC board, specify the
floating-point type when the data is beyond above
limitation, because the error(Return:EW_DATA) is
returned in such case.
- floating-point type(data format=M*2**(-E))
mcr_val : numerical part of variable(=M)
4-byte binary data with sign
(available range:No limitation)
dec_val : exponent part of variable(=E)
2-byte binary data with sign
(available range:-128,..,127)

The value of an undefined variable is called "vacant", and it is as


follows both under fixed-point type and under floating-point type.
mcr_val = 0
dec_val = -1

See "OPERATOR'S MANUAL" of CNC for details of the custom macro variable.

244
Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 v
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.

245
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 CNC data window" in
"General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Size of IODBMR structure(length) is wrong.
EW_NUMBER Data number error
Custom macro variable number(datano_s,
datano_e) is wrong.
EW_DATA Data error
Value of custom macro variable(mcr_val,
dec_val) is out of available range.
EW_NOOPT No option
This function needs the custom macro option.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function relates to the following CNC option.

Series 150 Custom macro


Custom macro common variable 200 sets
Custom macro common variable 300 sets
Custom macro common variable 600 sets

Series 160/180 Custom macro B


Custom macro common variable extension

Series 210 M series,NC board


Custom macro B

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

246
(30) Read Custom Macro Variable Information

Function Name:
cnc_rdmacroinfo

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.
See "Library handle" for details.

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

Series 150
M/T 0 : 100,..,149, 500,..,549
1 : 100,..,199, 500,..,599
2 : 100,..,199, 500,..,699
3 : 100,..,199, 500,..,999

TT 0 : 100,..,149, 500,..,524
1 : 100,..,149, 500,..,549
2 : 100,..,149, 500,..,599
3 : 100,..,149, 500,..,749

Series 160/180
0 : 100,..,149, 500,..,531
1 : 100,..,199, 500,..,999

Series 210,NC board


0 : 100,..,149, 500,..,531

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 CNC data window" in
"General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
This function needs the custom macro option
and the extended driver/library option.

247
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the custom macro option and the extended
driver/library option.
This function relates to the following CNC option.

Series 150 Custom macro


Custom macro common variable 200 sets
Custom macro common variable 300 sets
Custom macro common variable 600 sets

Series 160/180 Custom macro B


Custom macro common variable extension

Series 210 M series,NC board


Custom macro B

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

248
(31) Get Type of Custom Macro Variable

Function Name:
cnc_getmactype

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_getmactype(unsigned short FlibHndl,
&macro_type);
Description:
Gets the type of custom macro variable which is used by cnc_rdmacro,
cnc_wrmacro, cnc_rdmacror, cnc_wrmacror function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

macro_type
Type of custom macro variable
0 : fixed-point type(default)
none zero : floating-point type

Return: EW_OK is returned on successful completion, otherwise any value except


EW_OK is returned.

Others : EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

(As for the details, see "Return status of CNC data window" in "General
Description".)

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

249
(32) Set Type of Custom Macro Variable

Function Name:
cnc_setmactype

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_setmactype(unsigned short FlibHndl,
short macro_type);
Description:
Changes the type of custom macro variable which is used by cnc_rdmacro,
cnc_wrmacro, cnc_rdmacror, cnc_wrmacror function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

macro_type
Type of custom macro variable
0 : fixed-point type(default)
none zero : floating-point type

Return: EW_OK is returned on successful completion, otherwise any value except


EW_OK is returned.

Others : EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

(As for the details, see "Return status of CNC data window" in "General
Description".)

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

250
(33) Read P Code Macro Variable

Function Name:
cnc_rdpmacro

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdpmacro(unsigned short FlibHndl,long number,
ODBPM *pmacro);
Description:
Reads the P code macro variable(variable for the macro-executor)
specified by "number". The data is stored in "ODBPM" with signed
binary format.

It is possible to exchange the type of P code macro variable by using


the following global variable. In case of the integer type variable,
this indication is invalid and always regarded as the fixed-point type.

short cnc_pmacro_type --- 0 : fixed-point type(default)


none zero : floating-point type

- fixed-point type(data format=M*10**(-E))


mcr_val : value of variable(=M)
4-byte binary data with sign
(available range:
Series 150 No limitation
Series 160/180/210,NC board
-99999999,..,99999999
integer type : -32768,..,32767)
dec_val : number of places of decimals(=E)
2-byte binary data with sign
(available range:
Series 150 -128,..,127
Series 160/180/210,NC board
-1,0,..,8
integer type : 0)
* In case of Series 160/180/210,NC board, specify the
floating-point type when the data of floating-point
type variable is beyond above limitation, because
'mcr_val' and 'dec_val' are invalid(=-1) in such case.
- floating-point type(data format=M*2**(-E))
mcr_val : numerical part of variable(=M)
4-byte binary data with sign
(available range:No limitation)
dec_val : exponent part of variable(=E)
2-byte binary data with sign
(available range:-128,..,127)

The value of an undefined variable is called "vacant", and it is as


follows both under fixed-point type and under floating-point type.
mcr_val = 0
dec_val = -1

See the "PROGRAMING MANUAL" of the macro-executor for details of the P


code macro variable.

251
Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

number Specify the P code macro variable number.


See the description of cnc_rdpmacroinfo() function about the
available range.

pmacro Pointer to the ODBPM structure including the P code macro


variable. The ODBPM structure is as follows.
typedef struct odbpm {
long datano ; /* P code macro variable number */
short dummy ; /* (not used) */
long mcr_val ; /* value of P code macro */
short dec_val ; /* number of places of decimals */
} ODBPM ;

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 CNC data window" in
"General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER Data number error
P code macro variable number(number) is wrong.
EW_NOOPT No option
This function needs the macro-executor option.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the macro-executor option.


In case of Series 160/180, this function relates to the high-
speed cycle cutting option.

CNC parameter: This function doesn't relate to CNC parameter. But, this
function relates to the compile parameter of the macro-executor.
See the "PROGRAMING MANUAL" of the macro-executor for details
of the compile parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

252
(34) Write P Code Macro Variable

Function Name:
cnc_wrpmacro

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrpmacro(unsigned short FlibHndl,long number,
long mcr_val,short dec_val);
Description:
Writes the P code macro variable(variable for the macro-executor)
specified by "number". The data must be stored in "mcr_val","dec_val"
with signed binary format.

It is possible to exchange the type of P code macro variable by using


the following global variable. In case of the integer type variable,
this indication is invalid and always regarded as the fixed-point type.

short cnc_pmacro_type --- 0 : fixed-point type(default)


none zero : floating-point type

- fixed-point type(data format=M*10**(-E))


mcr_val : value of variable(=M)
4-byte binary data with sign
(available range:
Series 150 No limitation
Series 160/180/210,NC board
-99999999,..,99999999
integer type : -32768,..,32767)
dec_val : number of places of decimals(=E)
2-byte binary data with sign
(available range:
Series 150 -128,..,127
Series 160/180/210,NC board
-1,0,..,8
integer type : 0)
* In case of Series 160/180/210,NC board, specify the
floating-point type when the data of floating-point
type variable is beyond above limitation, because the
error(Return:EW_DATA) is returned in such case.
- floating-point type(data format=M*2**(-E))
mcr_val : numerical part of variable(=M)
4-byte binary data with sign
(available range:No limitation)
dec_val : exponent part of variable(=E)
2-byte binary data with sign
(available range:-128,..,127)

The value of an undefined variable is called "vacant", and it is as


follows both under fixed-point type and under floating-point type.
mcr_val = 0
dec_val = -1

See the "PROGRAMING MANUAL" of the macro-executor for details of the P


code macro variable.

253
Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

number Specify the P code macro variable number.


See the description of cnc_rdpmacroinfo() function about the
available range.

mcr_val Specify the value of variable/numerical part of variable.

dec_val Specify the number of places of decimals/exponent part of


variable.

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 CNC data window" in
"General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER Data number error
P code macro variable number(number) is wrong.
EW_DATA Data error
Value of P code macro variable(mcr_val,
dec_val) is out of available range.
EW_NOOPT No option
This function needs the macro-executor option.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the macro-executor option.


In case of Series 160/180, this function relates to the high-
speed cycle cutting option.

CNC parameter: This function doesn't relate to CNC parameter. But, this
function relates to the compile parameter of the macro-executor.
See the "PROGRAMING MANUAL" of the macro-executor for details
of the compile parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

254
(35) Read P Code Macro Variable (Area Specified)

Function Name:
cnc_rdpmacror

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdpmacror(unsigned short FlibHndl,
long s_number,long e_number,unsigned short length,
IODBPR *pmacror);
Description:
Reads the P code macro variable(variable for the macro-executor)
specified by "s_number", "e_number". The data is stored in "IODBPR"
with signed binary format.

It is possible to exchange the type of P code macro variable by using


the following global variable. In case of the integer type variable,
this indication is invalid and always regarded as the fixed-point type.

short cnc_pmacro_type --- 0 : fixed-point type(default)


none zero : floating-point type
- fixed-point type(data format=M*10**(-E))
mcr_val : value of variable(=M)
4-byte binary data with sign
(available range:
Series 150 No limitation
Series 160/180/210,NC board
-99999999,..,99999999
integer type : -32768,..,32767)
dec_val : number of places of decimals(=E)
2-byte binary data with sign
(available range:
Series 150 -128,..,127
Series 160/180/210,NC board
-1,0,..,8
integer type : 0)
* In case of Series 160/180/210,NC board, specify the
floating-point type when the data of floating-point
type variable is beyond above limitation, because
'mcr_val' and 'dec_val' are invalid(=-1) in such case.
- floating-point type(data format=M*2**(-E))
mcr_val : numerical part of variable(=M)
4-byte binary data with sign
(available range:No limitation)
dec_val : exponent part of variable(=E)
2-byte binary data with sign
(available range:-128,..,127)

The value of an undefined variable is called "vacant", and it is as


follows both under fixed-point type and under floating-point type.
mcr_val = 0
dec_val = -1

See the "PROGRAMING MANUAL" of the macro-executor for details of the P


code macro variable.

255
Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_number
Specify the start P code macro variable number.
See the description of cnc_rdpmacroinfo() function about the
available range.

e_number
Specify the end P code macro variable number.

length Specify the data block length(size of IODBPR structure).


(10+6*(Number of P code macro variable)

IODBPR 0 +-----------------------+ ---


|datano_s | ^
4 +-----------+-----------+ |
|dummy | |
6 +-----------+-----------+ |
|datano_e | |
10 +-----------------------+ |
|data[0].mcr_val | length
14 +-----------+-----------+ |
|data[0].dec_val |
16 +-----------+-----------+ |
= = |
10+6*(N-1) +-----------+-----------+ |
|data[N-1].mcr_val | |
+-----------+-----------+ |
|data[N-1].dec_val v
10+6*N +-----------+ ---

N : Number of P code macro variable

pmacror Pointer to the IODBPR structure including the P code macro


variable. The IODBPR structure is as follows.

typedef struct iodbpr {


long datano_s; /* start P code macro variable number*/
short dummy; /* (not used) */
long datano_e; /* end P code macro variable number */
struct {
long mcr_val; /* value of P code macro */
short dec_val; /* number of places of decimals */
} data[N]; /* N:Number of P code macro variable */
} IODBPR;

datano_s
The first P code macro variable number to be read is
returned.

datano_e
The last P code macro variable number to be read is
returned.

256
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 CNC data window" in
"General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Size of IODBPR structure(length) is wrong.
EW_NUMBER Data number error
P code macro variable number(s_number,
e_number) is wrong.
EW_NOOPT No option
This function needs the macro-executor option.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the macro-executor option.


In case of Series 160/180, this function relates to the high-
speed cycle cutting option.

CNC parameter: This function doesn't relate to CNC parameter.


But, this function relates to the compile parameter of the
macro-compiler.
See the "PROGRAMING MANUAL" of the macro-executor for details
of the compile parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

257
(36) Write P Code Macro Variable (Area Specified)

Function Name:
cnc_wrpmacror

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrpmacror(unsigned short FlibHndl,
unsigned short length,IODBPR *pmacror);
Description:
Writes the P code macro variable(variable for the macro-executor)
specified by "datano_s", "datano_e". The data must be stored in
"IODBPR" with signed binary format.

It is possible to exchange the type of P code macro variable by using


the following global variable. In case of the integer type variable,
this indication is invalid and always regarded as the fixed-point type.

short cnc_pmacro_type --- 0 : fixed-point type(default)


none zero : floating-point type

- fixed-point type(data format=M*10**(-E))


mcr_val : value of variable(=M)
4-byte binary data with sign
(available range:
Series 150 No limitation
Series 160/180/210,NC board
-99999999,..,99999999
integer type : -32768,..,32767)
dec_val : number of places of decimals(=E)
2-byte binary data with sign
(available range:
Series 150 -128,..,127
Series 160/180/210,NC board
-1,0,..,8
integer type : 0)
* In case of Series 160/180/210,NC board, specify the
floating-point type when the data of floating-point
type variable is beyond above limitation, because the
error(Return:EW_DATA) is returned in such case.
- floating-point type(data format=M*2**(-E))
mcr_val : numerical part of variable(=M)
4-byte binary data with sign
(available range:No limitation)
dec_val : exponent part of variable(=E)
2-byte binary data with sign
(available range:-128,..,127)

The value of an undefined variable is called "vacant", and it is as


follows both under fixed-point type and under floating-point type.
mcr_val = 0
dec_val = -1

See the "PROGRAMING MANUAL" of the macro-executor for details of the P


code macro variable.

258
Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

length Specify the data block length(size of IODBPR structure).


(10+6*(Number of P code macro variable)

IODBPR 0 +-----------------------+ ---


|datano_s | ^
4 +-----------+-----------+ |
|dummy | |
6 +-----------+-----------+ |
|datano_e | |
10 +-----------------------+ |
|data[0].mcr_val | length
14 +-----------+-----------+ |
|data[0].dec_val |
16 +-----------+-----------+ |
= = |
10+6*(N-1) +-----------+-----------+ |
|data[N-1].mcr_val | |
+-----------+-----------+ |
|data[N-1].dec_val v
10+6*N +-----------+ ---

N : Number of P code macro variable

pmacror Pointer to the IODBPR structure including the P code macro


variable. The IODBPR structure is as follows.

typedef struct iodbpr {


long datano_s; /* start P code macro variable number*/
short dummy; /* (not used) */
long datano_e; /* end P code macro variable number */
struct {
long mcr_val; /* value of P code macro */
short dec_val; /* number of places of decimals */
} data[N]; /* N:Number of P code macro variable */
} IODBPR;

datano_s
Specify the start P code macro variable number.

datano_e
Specify the end P code 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.

259
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 CNC data window" in
"General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Size of IODBPR structure(length) is wrong.
EW_NUMBER Data number error
P code macro variable number(datano_s,
datano_e) is wrong.
EW_DATA Data error
Value of P code macro variable(mcr_val,
dec_val) is out of available range.
EW_NOOPT No option
This function needs the macro-executor option.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the macro-executor option.


In case of Series 160/180, this function relates to the high-
speed cycle cutting option.

CNC parameter: This function doesn't relate to CNC parameter.


But, this function relates to the compile parameter of the
macro-compiler.
See the "PROGRAMING MANUAL" of the macro-executor for details
of the compile parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

260
(37) Read P Code Macro Variable Information

Function Name:
cnc_rdpmacroinfo

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdpmacroinfo(unsigned short FlibHndl,
ODBPMINF *pminf);
Description:
Reads the available number of the P code macro variable(variable for
the macro-executor) and the type of it. Those are stored in "ODBPMINF"
with signed binary format.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

pminf Pointer to the ODBPMINF structure including the P code macro


variable information. The ODBPMINF structure is as follows.

The following parameters are not the CNC parameter, but the
compile parameter of the macro-compiler.
See the "PROGRAMING MANUAL" of the macro-executor for details
of the compile parameter.

- Series 150
typedef struct odbpminf {
short use_no1; /* number of variables(30000,...) */
short use_no2; /* number of variables(40000,...) */
short v2_type1;/* type of variables(30000,...) */
short v2_type2;/* type of variables(40000,...) */
} ODBPMINF;

use_no1 Number of usable P code macro variables(30000,...)


(parameter No.8549 x 100)

use_no2 Number of usable P code macro variables(40000,...)


- parameter No.8509#0=0(floating-point type)
(parameter No.8550 x 10)
- parameter No.8509#0=1(integer type)
(parameter No.8550 x 30)
v2_type1
Type of P code macro variables(30000,...)
This is always the integer type.
In case of 'use_no1=0', this is invalid.
1 : Type B(integer type)
v2_type2
Type of P code macro variables(40000,...)
In case of 'use_no2=0', this is invalid.
0 : Type A(floating-point type)
1 : Type B(integer type)

261
- Series 160/180/210,NC board
typedef struct odbpminf {
short use_no1; /* number of variables(10000,...) */
short use_no2; /* number of variables(20000,...) */
short v2_type; /* type of variables(20000,...) */
} ODBPMINF;

use_no1 Number of usable P code macro variables(10000,...)


(parameter No.9037 x 100)

'6000' is returned in case of some series/version of


CNC control software, but the usable number is an above
value.

use_no2 Number of usable P code macro variables(20000,...)

* Type A/B
- parameter No.9002#3=0(floating-point type)
(parameter No.9044 x 12)
- parameter No.9002#3=1(integer type)
(parameter No.9044 x 30)

* Type C/high-speed cycle cutting


(except Series 210,NC board)
(use_no2(=1,2,4,...) x 65536)

v2_type Type of P code macro variables(20000,...)


In case of 'use_no2=0', this is invalid.
0 : Type A(floating-point type)
1 : Type B(integer type)
2 : Type C(integer type)/high-speed cycle cutting
(except Series 210,NC board)

Type of P code macro variables(10000,...) is always


the floating-point type.

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 CNC data window" in
"General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
This function needs the macro-executor option
and the extended driver/library option.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the macro-executor option and the extended
driver/library option.
In case of Series 160/180, this function relates to the high-
speed cycle cutting option.

CNC parameter: This function doesn't relate to CNC parameter.


But, this function relates to the compile parameter of the
macro-compiler.
See the "PROGRAMING MANUAL" of the macro-executor for details
of the compile parameter.

CNC mode: This function can be used in any CNC mode.

262
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

263
(38) Get Type of P Code Macro Variable

Function Name:
cnc_getpmactype

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_getpmactype(unsigned short FlibHndl,
&pmacro_type);
Description:
Gets the type of P code macro variable which is used by cnc_rdpmacro,
cnc_wrpmacro, cnc_rdpmacror, cnc_wrpmacror function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

pmacro_type
Type of P code macro variable
0 : fixed-point type(default)
none zero : floating-point type

Return: EW_OK is returned on successful completion, otherwise any value except


EW_OK is returned.

Others : EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

(As for the details, see "Return status of CNC data window" in "General
Description".)

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

264
(39) Set Type of P Code Macro Variable

Function Name:
cnc_setpmactype

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_setpmactype(unsigned short FlibHndl,
short pmacro_type);
Description:
Changes the type of P code macro variable which is used by cnc_rdpmacro,
cnc_wrpmacro, cnc_rdpmacror, cnc_wrpmacror function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

pmacro_type
Type of P code macro variable
0 : fixed-point type(default)
none zero : floating-point type

Return: EW_OK is returned on successful completion, otherwise any value except


EW_OK is returned.

Others : EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

(As for the details, see "Return status of CNC data window" in "General
Description".)

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

265
(40) Read M Code Group Data

Function Name:
cnc_rdmgrpdata

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdmgrpdata(unsigned short FlibHndl,
short s_no, short *num, ODBMGRP *buf);
Description:
Reads specified number of M code group data starting from the specified
number.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_no Specify starting number from which the data is read.


Valid range is from 0 to 499.

num Pointer to the number of data to be read.


Specify the number of data to be read before function call and
actual number of data being read is stored after the function
call.
Valid range is from 1 to 500.

buf Pointer to the ODBMGRP structure where returned data are stored.
The ODBMGRP structure is as follows.

typedef struct odbmgrp {


long m_code;
short grp_no;
char m_name[21];
char dummy;
} ODBMGRP;

m_code M code
M code is returned.

* In case of Series 160/180, -1 is returned when


no M code is assigned to the number.

grp_no M code group number


M code group number is returned.

m_name M code name


M code name is returned.
ASCII character string ( max. 20 characters) with
trailing NULL code is stored.

* Not used in case of Series 160/180.

266
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
The number indication(num) is wrong.
EW_NUMBER Data number error
The start number(s_no) is wrong.
EW_NOOPT No option
The M code group option and the extended
driver/library option are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the M code group option and the extended
driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

267
(41) Write M Code Group Data

Function Name:
cnc_wrmgrpdata

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrmgrpdata(unsigned short FlibHndl,
IDBMGRP *buf);
Description:
Writes specified number of M code group data starting from specified number.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

buf Pointer to the IDBMGRP structure which specifies the M code


group data to be written.
The IDBMGRP structure is as follows.

typedef struct idbmgrp {


short s_no;
short dummy;
short num;
short group[N];
} IDBMGRP;
/* N stands for the number of M code group data being written.
(Max. 500) */

s_no Specify starting number.


Valid range is from 0 to 499.

num Specify the number of the data to be written.


Valid range is from 1 to 500.

group Specify M code group number to be written


Valid range is from 0 to 127.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
The number indication(num) is wrong.
EW_NUMBER Data number error
The start number(s_no) is wrong.
EW_DATA Data error
The number of M code group is wrong.
The detailed status is set in the global
variable 'short cnc_errno'.
0 : error except EW_DATA
1 : error of M code group number
The wrong array number is set in the global
variable 'short cnc_errdtno'.

268
EW_NOOPT No option
The M code group option and the extended
driver/library option are necessary.
EW_PROT Write protection(only Series 150)
'Parameter write enable' of CNC parameter is 0.
EW_MODE CNC mode error
The mode is not MDI.
EW_REJECT CNC execution denial
MDI operation is in progress.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the M code group option and the extended
driver/library option.

CNC parameter: This function relates to the following CNC parameter.

Series 150 8000#0=1

Series 160/180 8900#0=1

CNC mode: It is possible to use in MDI mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

269
(42) Read M Code Group Data (Executing, Executed M Code)

Function Name:
cnc_rdexecmcode

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdexecmcode(unsigned short FlibHndl,
short s_no, short *num, ODBEXEM *buf);
Description:
Reads specified number of executing or executed M codes, starting from
the M code group with specified number.
This function is available for Series 150 only. Not available for
Series 160/180.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_no Specify M code group number.

num Pointer to the number of M code groups to be read.


Specify the number of M code groups to be read before function
call and actual number of M code groups being read is stored
after the function call.

buf Pointer to the ODBEXEM structure where returned data are stored.
The ODBEXEM structure is as follows.

typedef struct odbexem {


short grp_no;
short mem_no;
struct{
long no;
short flag;
}m_code[5];
char m_name[21];
char dummy;
} ODBEXEM;

m_name M code name.


The name of the latest M code command in the group is
returned.
ASCII character string ( max. 20 characters) with
trailing NULL code is stored.

grp_no M code group number


M code group number is returned.

mem_no The number of the M codes memorized.


The number of the M codes memorized in the group is
returned.

270
m_code[N].no ‚l code
The latest five M codes in the group are returned.
(N: 0,..,4)

m_code[N].flag Executed / Executing flag


Flags to indicate whether above M codes in m_code[N].no
are executed or executing.
0 : executed
1 : executing
Executed / Executing flags for latest five M codes in
the group are returned.
(N: 0,..,4)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
The number indication(num) is wrong.
EW_NUMBER Data number error
The start number(s_no) is wrong.
EW_NOOPT No option
The M code group option and the extended
driver/library option are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the M code group option and the extended
driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

271
(43) Read M Code Group Data (for Program Restart)

Function Name:
cnc_rdrstrmcode

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdrstrmcode(unsigned short FlibHndl,
short s_no, short *num, ODBRSTRM *buf);
Description:
Reads specified number of executing or executed M codes, starting from
the M code group with specified number.
This function is available for Series 150 only. Not available for
Series 160/180.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_no Specify M code group number.

num Pointer to the number of M code groups to be read.


Specify the number of M code groups to be read before function
call and actual number of M code groups being read is stored
after the function call

buf Pointer to the ODBRSTRM structure where returned data are


stored. The ODBRSTRM structure is as follows.

typedef struct odbrstrm {


short grp_no;
short mem_no;
struct{
long no;
short flag;
}m_code[5];
} ODBRSTRM;

grp_no M code group number


M code group number is returned.

mem_no The number of the M codes memorized.


The number of the M codes memorized in the group is
returned.

m_code[N].no ‚l code
The latest five M codes in the group are returned.
(N: 0,..,4)

272
m_code[N].flag Executed / Executing / Program restart flag
Flags to indicate whether above M codes in m_code[N].no
are executed, executing or specified during Program
restart operation.
0 : executed
1 : executing
2 : specified during Program restart operation
Executed / Executing / Program restart flags for latest
five M codes in the group are returned.
(N: 0,..,4)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
The number indication(num) is wrong.
EW_NUMBER Data number error
The start number(s_no) is wrong.
EW_NOOPT No option
The M code group option, the program restart
option and the extended driver/library option
are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the M code group option, the program
restart option and the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

273
(44) Read Interference Check Data (Area Specified)

Function Name:
cnc_rdintchk

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdintchk(unsigned short FlibHndl,
short s_number,short type,short e_number,short length,
IODBINT *intchk);
Description:
Reads the coordinate value of interference check area specified by
"s_number","e_number","type".
The coordinate value is stored in "data" array of "IODBINT" with
signed binary format.
All value can be read at a time by specifying ALL_AXES for "axis".

The places of decimal points can be got by cnc_getfigure() function.

The unit of coordinate value is the same as "Read work zero offset
value(cnc_rdzofs)". See the description of cnc_rdzofs() function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_number
Specify the start interference check data number.
The available number of interference check data can be got by
cnc_rdintinfo() function.

e_number
Specify the end interference check data number.

type Specify the type of coordinate.


ALL_AXES : assigns all coordinates(ALL_AXES=-1)
0,..,m : assigns 1 coordinate(TT:m=7, MM:m=5)

In case of 1 coordinate, 'type' is as follows.

TT type coordinate MM type coordinate


-------+---------- -------+----------
0 X (area 1) 0 X
1 Z (area 1) 1 Y
2 I (area 1) 2 Z
3 K (area 1) 3 I
4 X (area 2) 4 J
5 Z (area 2) 5 K
6 I (area 2)
7 K (area 2)

274
length Specify the data block length(size of IODBINT structure).

TT (6+4*(number of coordinate)*(number of data))

1 coordinate all coordinates


IODBINT 0 +-------+ --- 0 +-------+ ---
|datano_s ^ |datano_s ^
2 +-------+ | 2 +-------+ |
|type | length |type | length
4 +-------+ | 4 +-------+ |
|datano_e | |datano_e |
6 +-------+-------+ | 6 +-------+-------+ |-+
| data[0] | | |data[0] | | s
10 +---------------+ | 10 +---------------+ | t
= = | = = | a
6+4*(K-1) +---------------+ | 34 +---------------+ | r
| data[K-1] | v |data[7] | | t
6+4*K +---------------+ --- 38 +---------------+ |-+
= = |
6+32*(K-1) +---------------+ |-+
|data[8*(K-1)] | | |
+---------------+ | e
= = | n
6+4*(8*K-1) +---------------+ | d
|data[8*K-1] | v |
6+32*K +---------------+ ---+

K : Number of data to be read

MM
1 coordinate all coordinates
IODBINT 0 +-------+ --- 0 +-------+ ---
|datano_s ^ |datano_s ^
2 +-------+ | 2 +-------+ |
|type | length |type | length
4 +-------+ | 4 +-------+ |
|datano_e | |datano_e |
6 +-------+-------+ | 6 +-------+-------+ |
| data[0] | v |data[0] | |
10 +---------------+ --- 10 +---------------+ |
= = |
26 +---------------+ |
|data[5] | v
30 +---------------+ ---

intchk Pointer to the IODBINT structure for the coordinate value of


interference check data. The IODBINT structure is as follows.
typedef struct iodbint {
short datano_s; /* start data number */
short type; /* coordinate type */
short datano_e; /* end data number */
long data[8*K]; /* coordinate value */
} IODBINT ; /* K : number of data to be read */

* In case of all coordinate, refer to length, type for


sequence of data.

275
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except MM/TT.
EW_LENGTH Data block length error
Size of IODBINT structure(length) is wrong.
EW_NUMBER Data number error
Data number(s_number,e_number) is wrong.
EW_ATTRIB Data attribute error
Type of coordinate(type) is wrong.
EW_NOOPT No option
The tool post interference check option(TT) or
the multi-path interference check option(MM),
and the extended driver/library option are
necessary.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the tool post interference check option(TT)
or the multi-path interference check option(MM), and the
extended driver/library option.
And, this function relates to the following CNC option.

Series 150 TT Tool offset extension (16)/32/80 sets(each path)


Series 160/180 TT Tool offset extension (16)/32/64 sets(each path)
* ( ) : Basic

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7605#0,#1,#2,#3,#4,#7


7682,7683
1004#0,#1,#5, 1009#1
Series 160/180 8140#0,#1,#2,#3,#4,#5
8151,8152
8141,..,8149
0000#2, 1004#1

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

276
(45) Write Interference Check Data (Area Specified)

Function Name:
cnc_wrintchk

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrintchk(unsigned short FlibHndl,
short length,IODBINT *intchk);
Description:
Writes the coordinate value of interference check area specified by
"datano_s","datano_e","type".
The coordinate value must be stored in "data" array of "IODBINT" with
signed binary format.
All value can be written at a time by specifying ALL_AXES for "type".

The unit of coordinate value is the same as "Read work zero offset
value(cnc_rdzofs)". See the description of cnc_rdzofs() function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

length Specify the data block length(size of IODBINT structure).

TT (6+4*(number of coordinate)*(number of data))

1 coordinate all coordinates


IODBINT 0 +-------+ --- 0 +-------+ ---
|datano_s ^ |datano_s ^
2 +-------+ | 2 +-------+ |
|type | length |type | length
4 +-------+ | 4 +-------+ |
|datano_e | |datano_e |
6 +-------+-------+ | 6 +-------+-------+ |-+
| data[0] | | |data[0] | | s
10 +---------------+ | 10 +---------------+ | t
= = | = = | a
6+4*(K-1) +---------------+ | 34 +---------------+ | r
| data[K-1] | v |data[7] | | t
6+4*K +---------------+ --- 38 +---------------+ |-+
= = |
6+32*(K-1) +---------------+ |-+
|data[8*(K-1)] | | |
+---------------+ | e
= = | n
6+4*(8*K-1) +---------------+ | d
|data[8*K-1] | v |
6+32*K +---------------+ ---+

K : Number of data to be written

277
MM
1 coordinate all coordinates
IODBINT 0 +-------+ --- 0 +-------+ ---
|datano_s ^ |datano_s ^
2 +-------+ | 2 +-------+ |
|type | length |type | length
4 +-------+ | 4 +-------+ |
|datano_e | |datano_e |
6 +-------+-------+ | 6 +-------+-------+ |
| data[0] | v |data[0] | |
10 +---------------+ --- 10 +---------------+ |
= = |
26 +---------------+ |
|data[5] | v
30 +---------------+ ---

intchk Pointer to the IODBINT structure for the coordinate value of


interference check data. The IODBINT structure is as follows.
typedef struct iodbint {
short datano_s; /* start data number */
short type; /* coordinate type */
short datano_e; /* end data number */
long data[8*K]; /* coordinate value */
} IODBINT ; /* K : number of data to be written */

datano_s
Specify the start interference check data number.
The available number of interference check data can be
got by cnc_rdintinfo() function.

datano_e
Specify the end interference check data number.

type Specify the type of coordinate.


ALL_AXES : assigns all coordinates(ALL_AXES=-1)
0,..,m : assigns 1 coordinate(TT:m=7, MM:m=5)

In case of 1 coordinate, 'type' is as follows.

TT type coordinate MM type coordinate


-------+---------- -------+----------
0 X (area 1) 0 X
1 Z (area 1) 1 Y
2 I (area 1) 2 Z
3 K (area 1) 3 I
4 X (area 2) 4 J
5 Z (area 2) 5 K
6 I (area 2)
7 K (area 2)

data Specify the coordinate value of interference check data.


Refer to length, type for sequence of data.

278
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except MM/TT.
EW_LENGTH Data block length error
Size of IODBINT structure(length) is wrong.
EW_NUMBER Data number error
Data number(datano_s,datano_e) is wrong.
EW_ATTRIB Data attribute error
Type of coordinate(type) is wrong.
EW_DATA Data error
Coordinate value of interference check area
(data) is out of range.
Data number is set in the global variable
'short cnc_errno', and type of coordinate is
set in 'short cnc_errdtno'.
EW_NOOPT No option
The tool post interference check option(TT) or
the multi-path interference check option(MM),
and the extended driver/library option are
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the tool post interference check option(TT)
or the multi-path interference check option(MM), and the
extended driver/library option.
And, this function relates to the following CNC option.

Series 150 TT Tool offset extension (16)/32/80 sets(each path)

Series 160/180 TT Tool offset extension (16)/32/64 sets(each path)


* ( ) : Basic

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7605#0,#1,#2,#3,#4,#7


7682,7683
1004#0,#1,#5, 1009#1

Series 160/180 8140#0,#1,#2,#3,#4,#5


8151,8152
8141,..,8149
0000#2, 1004#1

CNC mode: This function can be used in any CNC mode.

279
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

280
(46) Read Interference Check Data Information

Function Name:
cnc_rdintinfo

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdintinfo(unsigned short FlibHndl,
short *intinf);
Description:
Reads the available number of interference check data.
It is stored in "intinf" with binary format.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

intinf Pointer to the available number of interference check data.


The available number is as follows.

Series 150
TT 16/32/80 sets(each path)
Series 160/180
MM 1 set(each path)
TT 16/32/64 sets(each path)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except MM/TT.
EW_NOOPT No option
The tool post interference check option(TT) or
the multi-path interference check option(MM),
and the extended driver/library option are
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the tool post interference check option(TT)
or the multi-path interference check option(MM), and the
extended driver/library option.
And, this function relates to the following CNC option.

Series 150 TT Tool offset extension (16)/32/80 sets(each path)

Series 160/180 TT Tool offset extension (16)/32/64 sets(each path)


* ( ) : Basic

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

281
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

282
(47) Read Setting Data for High-Speed and High-Precision Machining

Function Name:
cnc_rdhpccset

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdhpccset(unsigned short FlibHndl,
IODBHPST *hpst);
Description:
Reads setting data for High-speed and high-precision machining.
The data is stored in each member of IODBHPST structure.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

hpst Pointer to the IODBHPST structure for the setting data for
High-speed and high-precision machining.
The IODBHPST structure is as follows.

typedef struct iodbhpst {


short slct; /* flag of valid data */
short hpcc; /* high precision contour control */
short multi; /* multi buffer */
short ovr1; /* override by Z-axis down */
short ign_f; /* ignore feed at program */
short foward; /* feed forward */
long max_f; /* maximum feed of high precision */
/* contour control */
short ovr2; /* override at area 2 */
short ovr3; /* override at area 3 */
short ovr4; /* override at area 4 */
long reserve[7]; /* (not used) */
} IODBHPST ;

slct Flag of valid data is set.

bit 0 : high precision contour control


bit 1 : multi buffer
bit 2 : override by Z-axis down
bit 3 : ignore feed at program
bit 4 : feed forward
bit 5 : maximum feed ofhigh precision contour control
bit 6 : override at area 2
bit 7 : override at area 3
bit 8 : override at area 4
bit 9 : (not used)
bit10 : (not used)
bit11 : (not used)
bit12 : (not used)
bit13 : (not used)
bit14 : (not used)
bit15 : (not used)
* When some bit is 0, its data is invalid since no
option.

283
hpcc Valid/invalid of high precision contour
control is set.
0 : invalid
1 : valid

multi Valid/invalid of multi buffer is set.


0 : invalid
1 : valid

ovr1 Valid/invalid of override by Z-axis down is set.


0 : invalid
1 : valid

ign_f Valid/invalid of ignore feed at program is set.


0 : invalid
1 : valid

foward Valid/invalid of feed forward is set.


0 : invalid
1 : valid

max_f Maximum feed of high precision contour control


is set.

ovr2 Override at area 2 is set.

ovr3 Override at area 3 is set.

ovr4 Override at area 4 is set.

reserve[7] (not used)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at 150T/150TT.
EW_NOOPT No option
The extended driver/library option is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option, and
it is influenced by the high precision contour control option
and the RISC option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

284
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

285
(48) Write Setting Data for High-Speed and High-Precision Machining

Function Name:
cnc_wrhpccset

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrhpccset(unsigned short FlibHndl,
IODBHPST *hpst);
Description:
Writes setting data for high-speed and high-precision machining.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

hpst Pointer to the IODBHPST structure for the setting data for
High-speed and high-precision machining.
The IODBHPST structure is as follows.

typedef struct iodbhpst {


short slct; /* flag of valid data */
short hpcc; /* high precision contour control */
short multi; /* multi buffer */
short ovr1; /* override by Z-axis down */
short ign_f; /* ignore feed at program */
short foward; /* feed forward */
long max_f; /* maximum feed of high precision */
/* contour control */
short ovr2; /* override at area 2 */
short ovr3; /* override at area 3 */
short ovr4; /* override at area 4 */
long reserve[7]; /* (not used) */
} IODBHPST ;

slct Flag of valid data must be set.


bit 0 : high precision contour control
bit 1 : multi buffer
bit 2 : override by Z-axis down
bit 3 : ignore feed at program
bit 4 : feed forward
bit 5 : maximum feed ofhigh precision contour control
bit 6 : override at area 2
bit 7 : override at area 3
bit 8 : override at area 4
bit 9 : (not used)
bit10 : (not used)
bit11 : (not used)
bit12 : (not used)
bit13 : (not used)
bit14 : (not used)
bit15 : (not used)
* When some bit is 1, its data is written.

286
hpcc Specify valid/invalid of high precision contour
control.
0 : invalid
1 : valid

multi Specify valid/invalid of multi buffer.


0 : invalid
1 : valid

ovr1 Specify valid/invalid of override by Z-axis


down.
0 : invalid
1 : valid

ign_f Specify valid/invalid of ignore feed at program.


0 : invalid
1 : valid

foward Specify valid/invalid of feed forward.


0 : invalid
1 : valid

max_f Specify maximum feed of high precision contour


control.

ovr2 Specify override at area 2.

ovr3 Specify override at area 3.

ovr4 Specify override at area 4.

reserve[7] (not used)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at 150T/150TT.
EW_DATA Data error
Setting data for high-speed and high-precision
machining(IODBHPST) is wrong.
The detailed status is set in the global
variable 'short cnc_errno'.
1 : hpcc
2 : multi
3 : ovr1
4 : ign_f
5 : foward
6 : max_f
7 : ovr2
8 : ovr3
9 : ovr4
EW_NOOPT No option
The extended driver/library option is
necessary.

287
EW_PROT Write protection
- Protection KEY(DI/KEY2) is off.
- CNC parameter is a state of write-protection.
EW_MODE CNC mode error
The mode is not MDI.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option, and
it is influenced by the high precision contour control option
and the RISC option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: It is possible to use in MDI mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

288
(49) Set Setting Data for High-Speed and High-Precision Machining Automatically

Function Name:
cnc_hpccatset

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_hpccatset(unsigned short FlibHndl);

Description:
Sets setting data for high-speed and high-precision machining
automatically.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at 150T/150TT.
EW_NOOPT No option
The extended driver/library option is
necessary.
EW_PROT Write protection
- Protection KEY(DI/KEY2) is off.
- CNC parameter is a state of write-protection.
EW_PARAM CNC parameter error
Setting data cannot be set automatically.
EW_MODE CNC mode error
The mode is not MDI.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option, and
it is influenced by the high precision contour control option
and the RISC option.

CNC parameter: This function does not relate to CNC parameter.

Series150 1517#0 --- influenced by setting

CNC mode: It is possible to use in MDI mode.

289
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

290
(50) Read Tuning Data (Parameter Input) for High-Speed and High-Precision
Machining

Function Name:
cnc_rdhpcctupr

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdhpcctupr(unsigned short FlibHndl,
IODBHPPR *hppr);
Description:
Reads tuning data(parameter input) for high-speed and high-precision
machining. The data is stored in each member of IODBHPPR structure.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

hppr Pointer to the IODBHPPR structure for the tuning data(parameter


input) for high-speed and high-precision machining.
The IODBHPPR structure is as follows.

typedef struct iodbhppr {


struct {
short slct; /* flag of valid data */
short diff; /* flag of data status */
short fine; /* fine level */
short acc_lv; /* acceleration/deceleration level*/
long max_f; /* maximum feed */
short bipl; /* time constant for before IPL */
short aipl; /* time constant for after IPL */
long corner; /* difference of corner feed */
short clamp; /* clamp by acceleration */
long radius; /* radius of feed clamp by radius */
/* of cercle */
long max_cf; /* maximum feed of feed clamp by */
/* radius of cercle */
long min_cf; /* minimum feed of feed clamp by */
/* radius of cercle */
long foward; /* coefficient of feed forward */
long reserve[5]; /* (not used) */
}tune[3]
} IODBHPPR ;

hppr.tune[0].slct,...,hppr.tune[0].reserve
: tuning data for fine level
hppr.tune[1].slct,...,hppr.tune[1].reserve
: tuning data for medium level
hppr.tune[2].slct,...,hppr.tune[2].reserve
: tuning data for rough level

291
slct Flag of valid data is set.

bit 0: fine level


bit 1: acceleration/deceleration level
bit 2: maximum feed
bit 3: time constant for before IPL
bit 4: time constant for after IPL
bit 5: difference of corner feed
bit 6: clamp by acceleration
bit 7: radius of feed clamp by radius of cercle
bit 8: maximum feed of feed clamp by radius of cercle
bit 9: minimum feed of feed clamp by radius of cercle
bit10: coefficient of feed forward
bit11: (not used)
bit12: (not used)
bit13: (not used)
bit14: (not used)
bit15: (not used)
* When some bit is 0, its data is invalid since no
option.

diff Each bit indicates that its data is common for


all axes, or not.
bit 0 : (not used)
bit 1 : (not used)
bit 2 : (not used)
bit 3 : (not used)
bit 4 : time constant for after IPL
bit 5 : difference of corner feed
bit 6 : clamp by acceleration
bit 7 : (not used)
bit 8 : (not used)
bit 9 : (not used)
bit10 : coefficient of feed forward
bit11 : (not used)
bit12 : (not used)
bit13 : (not used)
bit14 : (not used)
bit15 : (not used)

* When some bit is 0, it is common data for all axes.

fine Fine level is set.

acc_lv Acceleration/deceleration level is set.

max_f Maximum feed is set.

bipl Time constant for before IPL is set.

aipl Time constant for after IPL is set.

corner Difference of corner feed is set.

clamp Clamp by acceleration is set.

radius Radius of feed clamp by radius of cercle is set.

292
max_cf Maximum feed of feed clamp by radius of cercle
is set.

min_cf Minimum feed of feed clamp by radius of cercle


is set.

foward Coefficient of feed forward is set.

reserve[5] (not used)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at 150T/150TT.
EW_NOOPT No option
The extended driver/library option is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

293
(51) Write Tuning Data (Parameter Input) for High-Speed and High-Precision
Machining

Function Name:
cnc_wrhpcctupr

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrhpcctupr(unsigned short FlibHndl,
IODBHPPR *hppr);
Description:
Writes tuning data(parameter input) for high-speed and high-precision
machining.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

hppr Pointer to the IODBHPPR structure for the tuning data(parameter


input) for high-speed and high-precision machining.
The IODBHPPR structure is as follows.

typedef struct iodbhppr {


struct {
short slct; /* flag of valid data */
short diff; /* (not used) */
short fine; /* fine level */
short acc_lv; /* acceleration/deceleration level*/
long max_f; /* maximum feed */
short bipl; /* time constant for before IPL */
short aipl; /* time constant for after IPL */
long corner; /* difference of corner feed */
short clamp; /* clamp by acceleration */
long radius; /* radius of feed clamp by radius */
/* of cercle */
long max_cf; /* maximum feed of feed clamp by */
/* radius of cercle */
long min_cf; /* minimum feed of feed clamp by */
/* radius of cercle */
long foward; /* coefficient of feed forward */
long reserve[5]; /* (not used) */
}tune[3]
} IODBHPPR ;

hppr.tune[0].slct,...,hppr.tune[0].reserve
: tuning data for fine level
hppr.tune[1].slct,...,hppr.tune[1].reserve
: tuning data for medium level
hppr.tune[2].slct,...,hppr.tune[2].reserve
: tuning data for rough level

294
slct Flag of valid data must be set.

bit 0 : fine level


bit 1 : acceleration/deceleration level
bit 2 : maximum feed
bit 3 : time constant for before IPL
bit 4 : time constant for after IPL
bit 5 : difference of corner feed
bit 6 : clamp by acceleration
bit 7 : radius of feed clamp by radius of cercle
bit 8 : maximum feed of feed clamp by radius of cercle
bit 9 : minimum feed of feed clamp by radius of cercle
bit10 : coefficient of feed forward
bit11 : (not used)
bit12 : (not used)
bit13 : (not used)
bit14 : (not used)
bit15 : (not used)
* When some bit is 1, its data is written.

diff (not used)

fine Specify fine level.

acc_lv Specify acceleration/deceleration level.

max_f Specify maximum feed.

bipl Specify time constant for before IPL.

aipl Specify time constant for after IPL.

corner Specify difference of corner feed.

clamp Specify clamp by acceleration.

radius Specify radius of feed clamp by radius of


cercle.

max_cf Specify maximum feed of feed clamp by radius


of cercle.

min_cf Specify minimum feed of feed clamp by radius


of cercle.

foward Specify coefficient of feed forward.

reserve[5] (not used)‚Å‚·•B

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at 150T/150TT.

295
EW_DATA Data error
Tuning data for high-speed and high-precision
machining(IODBHPPR) is wrong.
The detailed status is set in the global
variable 'short cnc_errno'.
1 : fine
2 : acc_lv
3 : max_f
4 : bipl
5 : aipl
6 : corner
7 : clamp
8 : radius
9 : max_cf
10 : min_cf
11 : foward
EW_NOOPT No option
The extended driver/library option is
necessary.
EW_PROT Write protection
- Protection KEY(DI/KEY2) is off.
- CNC parameter is a state of write-protection.
EW_MODE CNC mode error
The mode is not MDI.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: It is possible to use in MDI mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

296
(52) Read Tuning Data (Acc./Dec. Input) for High-Speed and High-Precision
Machining

Function Name:
cnc_rdhpcctuac

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdhpcctuac(unsigned short FlibHndl,
IODBHPAC *hpac);
Description:
Reads tuning data(acc./dec. input) for high-speed and high-precision
machining. The data is stored in each member of IODBHPAC structure.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

hpac Pointer to the IODBHPAC structure for the tuning data(acc./dec.


input) for high-speed and high-precision machining.
The IODBHPAC structure is as follows.

typedef struct iodbhpac {


struct {
short slct; /* flag of valid data */
short diff; /* flag of data status */
short fine; /* fine level */
short acc_lv; /* acceleration/deceleration level*/
long bipl; /* acceleration for before IPL */
short aipl; /* time constant for after IPL */
long corner; /* difference of corner feed */
long clamp; /* acceleration for clamp */
long c_acc; /* acceleration of feed clamp by */
/* radius of cercle */
long foward; /* coefficient of feed forward */
long reserve[8]; /* (not used) */
}tune[3]
} IODBHPAC ;

hpac.tune[0].slct,...,hpac.tune[0].reserve
: tuning data for fine level
hpac.tune[1].slct,...,hpac.tune[1].reserve
: tuning data for medium level
hpac.tune[2].slct,...,hpac.tune[2].reserve
: tuning data for rough level

slct Flag of valid data is set.


bit 0 : fine level
bit 1 : acceleration/deceleration level
bit 2 : acceleration for before IPL
bit 3 : time constant for after IPL
bit 4 : difference of corner feed
bit 5 : acceleration for clamp
bit 6 : acceleration of feed clamp by radius of cercle
bit 7 : coefficient of feed forward
bit 8 : (not used)
bit 9 : (not used)

297
bit10 : (not used)
bit11 : (not used)
bit12 : (not used)
bit13 : (not used)
bit14 : (not used)
bit15 : (not used)
* When some bit is 0, its data is invalid since no option.

diff Each bit indicates that its data is common for


all axes, or not.
bit 0 : (not used)
bit 1 : (not used)
bit 2 : (not used)
bit 3 : time constant for after IPL
bit 4 : difference of corner feed
bit 5 : acceleration for clamp
bit 6 : (not used)
bit 7 : coefficient of feed forward
bit 8 : (not used)
bit 9 : (not used)
bit10 : (not used)
bit11 : (not used)
bit12 : (not used)
bit13 : (not used)
bit14 : (not used)
bit15 : (not used)
* When some bit is 0, it is common data for all axes.

fine Fine level is set.

acc_lv Acceleration/deceleration level is set.

bipl Acceleration for before IPL is set.

aipl Time constant for after IPL is set.

corner Difference of corner feed is set.

clamp Acceleration for clamp is set.

c_acc Acceleration of feed clamp by radius of cercle


is set.

foward Coefficient of feed forward is set.

reserve[8] (not used)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at 150T/150TT.
EW_NOOPT No option
The extended driver/library option is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

298
CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

299
(53) Write Tuning Data (Acc./Dec. Input) for High-Speed and High-Precision
Machining

Function Name:
cnc_wrhpcctuac

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrhpcctuac(unsigned short FlibHndl,
IODBHPAC *hpac);
Description:
Writes tuning data(acc./dec. input) for high-speed and high-precision
machining.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

hpac Pointer to the IODBHPAC structure for the tuning data(acc./dec.


input) for high-speed and high-precision machining.
The IODBHPAC structure is as follows.

typedef struct iodbhpac {


struct {
short slct; /* flag of valid data */
short diff; /* (not used) */
short fine; /* fine level */
short acc_lv; /* acceleration/deceleration level*/
long bipl; /* acceleration for before IPL */
short aipl; /* time constant for after IPL */
long corner; /* difference of corner feed */
long clamp; /* acceleration for clamp */
long c_acc; /* acceleration of feed clamp by */
/* radius of cercle */
long foward; /* coefficient of feed forward */
long reserve[8]; /* (not used) */
}tune[3]
} IODBHPAC ;

hpac.tune[0].slct,...,hpac.tune[0].reserve
: tuning data for fine level
hpac.tune[1].slct,...,hpac.tune[1].reserve
: tuning data for medium level
hpac.tune[2].slct,...,hpac.tune[2].reserve
: tuning data for rough level

slct Flag of valid data must be set.

bit 0 : fine level


bit 1 : acceleration/deceleration level
bit 2 : acceleration for before IPL
bit 3 : time constant for after IPL
bit 4 : difference of corner feed
bit 5 : acceleration for clamp
bit 6 : acceleration of feed clamp by radius of cercle
bit 7 : coefficient of feed forward
bit 8 : (not used)
bit 9 : (not used)

300
bit10 : (not used)
bit11 : (not used)
bit12 : (not used)
bit13 : (not used)
bit14 : (not used)
bit15 : (not used)

* When some bit is 1, its data is written.

diff (not used)

fine Specify fine level.

acc_lv Specify acceleration/deceleration level.

bipl Specify acceleration for before IPL.

aipl Specify time constant for after IPL.

corner Specify difference of corner feed.

clamp Specify acceleration for clamp.

c_acc Specify acceleration of feed clamp by radius


of cercle.

foward Specify coefficient of feed forward.

reserve[8] (not used)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at 150T/150TT.
EW_DATA Data error
Tuning data for high-speed and high-precision
machining(IODBHPAC) is wrong.
The detailed status is set in the global
variable 'short cnc_errno'.
1 : fine
2 : acc_lv
3 : bipl
4 : aipl
5 : corner
6 : clamp
7 : c_acc
8 : foward
EW_NOOPT No option
The extended driver/library option is
necessary.
EW_PROT Write protection
- Protection KEY(DI/KEY2) is off.
- CNC parameter is a state of write-protection.
EW_MODE CNC mode error
The mode is not MDI.

301
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: It is possible to use in MDI mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

302
(54) Tune Up Tuning Data for High-Speed and High-Precision Machining
Automatically

Function Name:
cnc_hpccattune

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_hpccattune(unsigned short FlibHndl,
short fine,short *stat);
Description:
Tunes up tuning data for high-speed and high-precision machining
automatically.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

fine Specify the fine level which is used at automatic tuning-up.


0 : fine
1 : medium
2 : rough

stat Detailed status at automatic tuning-up is set.

bit 0 : Time constant for after IPL has been set to


maximum value.
bit 1 : Time constant for after IPL has been set to
minimum value.
bit 2 : Coefficient of feed forward has been set to
maximum value.
bit 3 : Coefficient of feed forward has been set to
minimum value.
bit 4 : (not used)
bit 5 : (not used)
bit 6 : (not used)
bit 7 : (not used)
bit 8 : (not used)
bit 9 : (not used)
bit10 : (not used)
bit11 : (not used)
bit12 : (not used)
bit13 : (not used)
bit14 : (not used)
bit15 : (not used)

* When some bit is 1, it indicates above status.

303
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at 150T/150TT.
EW_DATA Data error
Fine level(fine) is wrong.

EW_NOOPT No option
The extended driver/library option is
necessary.
EW_PROT Write protection
- Protection KEY(DI/KEY2) is off.
- CNC parameter is a state of write-protection.
EW_PARAM CNC parameter error
Setting data cannot be tuned up automatically.
EW_MODE CNC mode error
The mode is not MDI.
EW_REJECT CNC execution denial
Setting data(fine level, max. feedrate, time
constant before interpolation) are not set.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.


Series150 1517#1, #2, #3 --- influenced by setting

CNC mode: It is possible to use in MDI mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

304
(55) Read Fine Level for High-Speed and High-Precision Machining

Function Name:
cnc_hpccactfine

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_hpccactfine(unsigned short FlibHndl,
short *fine);
Description:
Reads fine level for high-speed and high-precision machining.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

fine Current fine level is set.


0 : fine
1 : medium
2 : rough

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at 150T/150TT.
EW_NOOPT No option
The extended driver/library option is
necessary.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

305
(56) Select Fine Level for High-Speed and High-Precision Machining

Function Name:
cnc_hpccselfine

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_hpccselfine(unsigned short FlibHndl,
short fine);
Description:
Selects fine level for high-speed and high-precision machining.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

fine Specify the fine level.


0 : fine
1 : medium
2 : rough

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at 150T/150TT.
EW_DATA Data error
Fine level(fine) is wrong.
EW_NOOPT No option
The extended driver/library option is
necessary.
EW_PROT Write protection
CNC parameter is a state of write-protection.
EW_MODE CNC mode error
The mode is not MDI.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: It is possible to use in MDI mode.

306
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

307
(57) Read Active Fixture Offset

Function Name:
cnc_rdactfixofs

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdactfixofs(unsigned short FlibHndl,
short axis,IODBZOFS *fixofs);
Description:
Reads the active fixture offset number and the active fixture offset
value specified by "axis". The offset number is stored in "type" of
"IODBZOFS" with binary format, and the offset value is stored in "data"
array of "IODBZOFS" with signed binary format. The value for all axes
can be read at a time by specifying 'ALL_AXES' in 'axis'.

The places of decimal points can be got by cnc_getfigure() function.

The unit of active fixture offset value is the same as "Read work zero

offset value(cnc_rdzofs)". See the description of cnc_rdzofs()


function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

axis Specify the axis number.


ALL_AXES : assigns all axes(ALL_AXES=-1)
1,..,m : assigns 1 axis(m=current controlled axes)

fixofs Pointer to the IODBZOFS structure for the active fixture


offset value. The IODBZOFS structure is as follows.
typedef struct iodbzofs {
short datano; /* active offset number */
short type; /* axis number */
long data[MAX_AXIS]; /* offset data value */
} IODBZOFS ; /* MAX_AXIS : max. controlled axes */
1 axis all axes
IODBZOFS 0 +-------+ --- 0 +-------+ ---
|datano | ^ |datano | ^
2 +-------+ | 2 +-------+ |
|type | length |type | length
4 +-------+-------+ | 4 +-------+-------+ |
| data[0] | v |data[0] :1st | |
8 +---------------+ --- 8 +---------------+ |
= = |
4+4x(n-1) +---------------+ |
|data[n-1] :n-th| v
4+4xn +---------------+ ---
n = Maximum controlled axes
* The data for current controlled axes are valid.

308
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at 150T/150TT.
EW_ATTRIB Data attribute error
Axis number(axis) is wrong.
EW_NOOPT No option
The rotary table dynamic fixture offset option
and the extended driver/library option are
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the rotary table dynamic fixture offset
option and the extended driver/library option.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 1004#0,#1,#5, 1009#1

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

309
(58) Read Fixture Offset Value (Area Specified)

Function Name:
cnc_rdfixofs

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdfixofs(unsigned short FlibHndl,
short s_number,short axis,short e_number,short length,
IODBZOR *fixofsr);
Description:
Reads the fixture offset value specified by "s_number", "e_number",
"axis". The offset value is stored in "data" array of "IODBZOR" with
signed binary format.
The value for all axes can be read at a time by specifying 'ALL_AXES'
in 'axis'.

The places of decimal points can be got by cnc_getfigure() function.

The unit of fixture offset value is the same as "Read work zero offset
value(cnc_rdzofs)". See the description of cnc_rdzofs() function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_number
Specify the start fixture offset number.
Available number is from 1 to 8.

e_number
Specify the end fixture offset number.
Available number is from 1 to 8.

axis Specify the axis number.


ALL_AXES : assigns all axes(ALL_AXES=-1)
1,..,m : assigns 1 axis(m=current controlled axes)

310
length Specify the data block length(size of IODBZOR structure).
(6+4*(number of axes)*(number of offset))

1 axis all axes


IODBZOR 0 +-------+ --- 0 +-------+ ---
|datano_s ^ |datano_s ^
2 +-------+ | 2 +-------+ |
|type | length |type | length
4 +-------+ | 4 +-------+ |
|datano_e | |datano_e |
6 +-------+-------+ | 6 +-------+-------+ |-+
| data[0] | | |data[0] :1st | | s
10 +---------------+ | 10 +---------------+ | t
= = | = = | a
6+4x(K-1) +---------------+ | 6+4x(n-1) +---------------+ | r
| data[K-1] | v |data[n-1] :n-th| | t
6+4xK +---------------+ --- 6+4xn +---------------+ |-+
= = |
6+4xnx(K-1) +---------------+ |-+
|data[n*(K-1)] | | |
+---------------+ | e
= = | n
6+4x(nxK-1) +---------------+ | d
|data[n*K-1] | v |
6+4xnxK +---------------+ ---+

n = Maximum controlled axes


* The data for current controlled axes are valid.
K = Number of offset to be read

fixofsr Pointer to the IODBZOR structure for the fixture offset value.
The IODBZOR structure is as follows.

typedef struct iodbzor {


short datano_s; /* start offset number */
short type; /* axis number */
short datano_e; /* end offset number */
long data[MAX_AXIS*K]; /* offset data value */
} IODBZOR ; /* MAX_AXIS : max. controlled axes */
/* K : number of offset */

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at 150T/150TT.
EW_LENGTH Data block length error
Size of IODBZOR structure(length) is wrong.
EW_NUMBER Data number error
Fixture offset number(s_number,e_number) is
wrong.
EW_ATTRIB Data attribute error
Axis number(axis) is wrong.
EW_NOOPT No option
The rotary table dynamic fixture offset option
and the extended driver/library option are
necessary.

311
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the rotary table dynamic fixture offset
option and the extended driver/library option.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 1004#0,#1,#5, 1009#1

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

312
(59) Write Fixture Offset Value (Area Specified)

Function Name:
cnc_wrfixofs

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrfixofs(unsigned short FlibHndl,
short length,IODBZOR *fixofsr);
Description:
Writes the fixture offset value specified by "datano_s", "datano_e",
"type". The offset value must be stored in "data" array of "IODBZOR"
with signed binary format.
The value for all axes can be written at a time by specifying
'ALL_AXES' in 'type'.

The unit of offset value is the same as "Read work zero offset value
(cnc_rdzofs)". See the description of cnc_rdzofs() function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

length Specify the data block length(size of IODBZOR structure).


(6+4*(number of axes)*(number of offset))

1 axis all axes


IODBZOR 0 +-------+ --- 0 +-------+ ---
|datano_s ^ |datano_s ^
2 +-------+ | 2 +-------+ |
|type | length |type | length
4 +-------+ | 4 +-------+ |
|datano_e | |datano_e |
6 +-------+-------+ | 6 +-------+-------+ |-+
| data[0] | | |data[0] :1st | | s
10 +---------------+ | 10 +---------------+ | t
= = | = = | a
6+4x(K-1) +---------------+ | 6+4x(n-1) +---------------+ | r
| data[K-1] | v |data[n-1] :n-th| | t
6+4xK +---------------+ --- 6+4xn +---------------+ |-+
= = |
6+4xnx(K-1) +---------------+ |-+
|data[n*(K-1)] | | |
+---------------+ | e
= = | n
6+4x(nxK-1) +---------------+ | d
|data[n*K-1] | v |
6+4xnxK +---------------+ ---+
n = Maximum controlled axes
* The data for current controlled axes are valid.
K = Number of offset to be written

313
fixofsr Pointer to the IODBZOR structure for the fixture offset value.
The IODBZOR structure is as follows.

typedef struct iodbzor {


short datano_s; /* start offset number */
short type; /* axis number */
short datano_e; /* end offset number */
long data[MAX_AXIS*K]; /* offset data value */
} IODBZOR ; /* MAX_AXIS : max. controlled axes */
/* K : number of offset */

datano_s
Specify the start fixture offset number.
Available number is from 1 to 8.

datano_e
Specify the end fixture offset number.
Available number is from 1 to 8.

type Specify the axis number.


ALL_AXES : assigns all axes(ALL_AXES=-1)
1,..,m : assigns 1 axis(m=current controlled axes)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at 150T/150TT.
EW_LENGTH Data block length error
Size of IODBZOR structure(length) is wrong.
EW_NUMBER Data number error
Fixture offset number(datano_s,datano_e) is
wrong.
EW_ATTRIB Data attribute error
Axis number(type) is wrong.
EW_NOOPT No option
The rotary table dynamic fixture offset option
and the extended driver/library option are
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the rotary table dynamic fixture offset
option and the extended driver/library option.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 1004#0,#1,#5, 1009#1

CNC mode: This function can be used in any CNC mode.

314
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

315
(60) Read Work Coordinate Shift Value

Function Name:
cnc_rdwkcdshft

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdwkcdshft(unsigned short FlibHndl,
short axis,short length,IODBWCSF *wkcdshft);
Description:
Reads the work coordinate shift value specified by "axis".
The work coordinate shift value are stored in "data" array of "IODBWCSF"
with signed binary format.
The value for all axes can be read at a time by specifying ALL_AXES for
"axis".

The places of decimal points can be got by cnc_getfigure() function.

The unit of work coordinate shift value is as follows.


Series 160/180/210
| Linear axis |Rotation axis
1004#1 1004#0| mm input |inch input|
(ISC) (ISA)| [mm]| [inch]| [deg]
-------------------------+----------+----------+-------------
(IS-B) 0 0 0.001 0.0001 0.001
(IS-C) 1 0 0.0001 0.00001 0.0001

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

axis Specify the axis number.


ALL_AXES : assigns all axes(ALL_AXES=-1)
1,..,m : assigns 1 axis(m=current controlled axes)

length Specify the data block length(size of IODBWCSF structure).

1 axis all axes


IODBWCSF 0 +-------+ --- 0 +-------+ ---
|dummy | ^ |dummy | ^
2 +-------+ | 2 +-------+ |
|type | length |type | length
4 +-------+-------+ | 4 +-------+-------+ |
| data[0] | v | data[0] | |
8 +---------------+ --- 8 +---------------+ |
= = |
4+4x(n-1) +---------------+ |
| data[n-1] | v
4+4xn +---------------+ ---
* 'n' is current controlled axes.

316
wkcdshft
Pointer to the IODBWCSF structure for the work coordinate shift
value. The IODBWCSF structure is as follows.

typedef struct iodbwcsf {


short dummy; /* (not used) */
short type; /* axis number */
long data[MAX_AXIS];/* work coordinate shift value*/
} IODBWCSF ; /* MAX_AXIS : max. controlled axes */

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at M series.
EW_LENGTH Data block length error
Size of IODBWCSF structure(length) is wrong.
EW_ATTRIB Data attribute error
Axis number(axis) is wrong.
EW_NOOPT No option
The extended driver/library option is
necessary.
EW_PARAM CNC parameter error
CNC parameter '1201#6' must be 0.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 160/180/210 1201#6=0 --- must be set

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

317
(61) Write Work Coordinate Shift Value

Function Name:
cnc_wrwkcdshft

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrwkcdshft(unsigned short FlibHndl,
short length,IODBWCSF *wkcdshft);
Description:
Writes the work coordinate shift value specified by "type".
The work coordinate shift value must be stored in "data" array of
"IODBWCSF" with signed binary format. The value for all axes can be
written at a time by specifying ALL_AXES for "type".

The unit of work coordinate shift value is the same as "Read work
coordinate shift value(cnc_rdwkcdshft)". See the description of
cnc_rdwkcdshft() function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

length Specify the data block length(size of IODBWCSF structure).


1 axis all axes
IODBWCSF 0 +-------+ --- 0 +-------+ ---
|dummy | ^ |dummy | ^
2 +-------+ | 2 +-------+ |
|type | length |type | length
4 +-------+-------+ | 4 +-------+-------+ |
| data[0] | v | data[0] | |
8 +---------------+ --- 8 +---------------+ |
= = |
4+4x(n-1) +---------------+ |
| data[n-1] | v
4+4xn +---------------+ ---
* 'n' is current controlled axes.

wkcdshft
Pointer to the IODBWCSF structure for the work coordinate shift
value. The IODBWCSF structure is as follows.
typedef struct iodbwcsf {
short dummy; /* (not used) */
short type; /* axis number */
long data[MAX_AXIS];/* work coordinate shift value*/
} IODBWCSF ; /* MAX_AXIS : max. controlled axes */

type Specify the axis number.


ALL_AXES : assigns all axes(ALL_AXES=-1)
1,..,m : assigns 1 axis(m=current controlled axes)

data Specify the work coordinate shift value to be written.


data[0],...,data[m-1] : assigns all axes
data[0] : assigns 1 axis

318
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at M series.
EW_LENGTH Data block length error
Size of IODBWCSF structure(length) is wrong.
EW_ATTRIB Data attribute error
Axis number(type) is wrong.
EW_DATA Data error
Work coordinate shift value(data) is out of
range.
Axis number is set in the global variable
'short cnc_errdtno'.
EW_NOOPT No option
The extended driver/library option is
necessary.
EW_PROT Write protection
CNC parameter '3290#3' must be 0.
EW_PARAM CNC parameter error
CNC parameter '1201#6' must be 0.
EW_REJECT CNC execution denial
STL(DO) is on.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 160/180/210 1201#6=0 -+- must be set


3290#3=0 -+-

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

319
(62) Read Work Coordinate Shift Measured Value

Function Name:
cnc_rdwkcdsfms

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdwkcdsfms(unsigned short FlibHndl,
short axis,short length,IODBWCSF *wkcdsfms);
Description:
Reads the work coordinate shift measured value specified by "axis".
The work coordinate shift measured value are stored in "data" array of
"IODBWCSF" with signed binary format.
The value for all axes can be read at a time by specifying ALL_AXES for
"axis".

The places of decimal points can be got by cnc_getfigure() function.

The unit of work coordinate shift measured value is the same as "Read
work coordinate shift value(cnc_rdwkcdshft)". See the description of
cnc_rdwkcdshft() function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

axis Specify the axis number.


ALL_AXES : assigns all axes(ALL_AXES=-1)
1,..,m : assigns 1 axis(m=current controlled axes)

length Specify the data block length(size of IODBWCSF structure).


1 axis all axes
IODBWCSF 0 +-------+ --- 0 +-------+ ---
|dummy | ^ |dummy | ^
2 +-------+ | 2 +-------+ |
|type | length |type | length
4 +-------+-------+ | 4 +-------+-------+ |
| data[0] | v | data[0] | |
8 +---------------+ --- 8 +---------------+ |
= = |
4+4x(n-1) +---------------+ |
| data[n-1] | v
4+4xn +---------------+ ---
* 'n' is current controlled axes.

wkcdsfms
Pointer to the IODBWCSF structure for the work coordinate shift
measured value. The IODBWCSF structure is as follows.
typedef struct iodbwcsf {
short dummy; /* (not used) */
short type; /* axis number */
long data[MAX_AXIS];/* work coordinate shift */
/* measured value */
} IODBWCSF ; /* MAX_AXIS : max. controlled axes */

320
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at M series.
EW_LENGTH Data block length error
Size of IODBWCSF structure(length) is wrong.
EW_ATTRIB Data attribute error
Axis number(axis) is wrong.
EW_NOOPT No option
The extended driver/library option is
necessary.
EW_PARAM CNC parameter error
CNC parameter '1201#6' must be 0.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 160/180/210 1201#6=0 --- must be set

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

321
(63) Write Work Coordinate Shift Measured Value

Function Name:
cnc_wrwkcdsfms

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrwkcdsfms(unsigned short FlibHndl,
short length,IODBWCSF *wkcdsfms);
Description:
Writes the work coordinate shift measured value specified by "type".
The work coordinate shift measured value must be stored in "data" array
of "IODBWCSF" with signed binary format. The value for all axes can be
written at a time by specifying ALL_AXES for "type".

The unit of work coordinate shift measured value is the same as "Read
work coordinate shift value(cnc_rdwkcdshft)". See the description of
cnc_rdwkcdshft() function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

length Specify the data block length(size of IODBWCSF structure).


1 axis all axes
IODBWCSF 0 +-------+ --- 0 +-------+ ---
|dummy | ^ |dummy | ^
2 +-------+ | 2 +-------+ |
|type | length |type | length
4 +-------+-------+ | 4 +-------+-------+ |
| data[0] | v | data[0] | |
8 +---------------+ --- 8 +---------------+ |
= = |
4+4x(n-1) +---------------+ |
| data[n-1] | v
4+4xn +---------------+ ---
* 'n' is current controlled axes.

wkcdsfms
Pointer to the IODBWCSF structure for the work coordinate shift
measured value. The IODBWCSF structure is as follows.
typedef struct iodbwcsf {
short dummy; /* (not used) */
short type; /* axis number */
long data[MAX_AXIS];/* work coordinate shift */
/* measured value */
} IODBWCSF ; /* MAX_AXIS : max. controlled axes */
type Specify the axis number.
ALL_AXES : assigns all axes(ALL_AXES=-1)
1,..,m : assigns 1 axis(m=current controlled axes)
data Specify the work coordinate shift measured value to be
written.
data[0],...,data[m-1] : assigns all axes
data[0] : assigns 1 axis

322
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at M series.
EW_LENGTH Data block length error
Size of IODBWCSF structure(length) is wrong.
EW_ATTRIB Data attribute error
Axis number(type) is wrong.
EW_DATA Data error
Work coordinate shift measured value(data) is
out of range.
Axis number is set in the global variable
'short cnc_errdtno'.
EW_NOOPT No option
The extended driver/library option is
necessary.
EW_PROT Write protection
CNC parameter '3290#3' must be 0.
EW_PARAM CNC parameter error
CNC parameter '1201#6' must be 0.
EW_REJECT CNC execution denial
STL(DO) is on.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 160/180/210 1201#6=0 -+- must be set


3290#3=0 -+-

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

323
(64) Read Tool Offset Value for B Axis (Area Specified)

Function Name:
cnc_rdbtofsr

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdbtofsr(unsigned short FlibHndl,
short s_number,short type, short e_number,
short length,IODBBTO *btofsr);
Description:
Reads the tool offset value for B axis specified by "s_number",
"e_number","type".
The offset value is stored in "IODBBTO" 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
Identify the process which uses the library.
See "Library handle" for details.

s_number
Specify the start tool offset number.
The available number is 1,...,9.
'This number + aux. function number which can be got by
cnc_rdbtofsinfo() function + 1' means the tool offset number
for B axis which is used by NC command or display.

e_number
Specify the end tool offset number.
The available number is 1,...,9.

type Specify the tool offset type.(see the following table)

length Specify the data block length.(see the following table)

btofsr Pointer to the IODBBTO structure including the tool offset


value. The IODBBTO structure is as follows.

typedef struct iodbbto {


short datano_s; /* start offset number */
short type; /* offset type */
short datano_e; /* end offset number */
long ofs[M]; /* offset value */
} IODBBTO ; /* Individual, Memory A all */
/* M is number of the offset value. */
/* Memory B all */
/* M is number of the offset value x 2. */

324
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.

- Tool offset Memory A

Type Length Attribute Offset type Member to be stored in


----+------+----------+----------------------+------------------------
0 6+4*N individual Tool offset btofsr.ofs[i]
----+------+----------+----------------------+------------------------
-1 6+4*N all Tool offset btofsr.ofs[i]

- Tool offset Memory B

Type Length Attribute Offset type Member to be stored in


----+------+----------+----------------------+------------------------
0 6+4*N individual Tool geometry offset btofsr.ofs[i]
1 6+4*N individual Tool wear offset btofsr.ofs[i]
----+------+----------+----------------------+------------------------
-2 6+8*N all Tool geometry offset btofsr.ofs[8*i+0]
Tool wear offset btofsr.ofs[8*i+4]

N is number of offset to be read, i = 0,..,(N-1).

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at M series.
EW_LENGTH Data block length error
Size of IODBBTO structure(length) is wrong.
EW_NUMBER Data number error
Offset number(s_number,e_number) is wrong.
EW_ATTRIB Data attribute error
Offset type(type) is wrong.
EW_NOOPT No option
The B axis option and the extended driver/
library option are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the B axis option and the extended driver/
library option.
And, this function relates to the following CNC option.

Series 160/180 Geometry/wear offset

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 160/180 1004#1

CNC mode: This function can be used in any CNC mode.

325
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

326
(65) Write Tool Offset Value for B Axis (Area Specified)

Function Name:
cnc_wrbtofsr

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrbtofsr(unsigned short FlibHndl,
short length,IODBBTO *btofsr);
Description:
Writes the tool offset value for B axis specified by "datano_s",
"datano_e","type".
The offset value must be stored in "IODBBTO" 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
Identify the process which uses the library.
See "Library handle" for details.

length Specify the data block length.

btofsr Pointer to the IODBBTO structure including the tool offset


value. The IODBBTO structure is as follows.
typedef struct iodbbto {
short datano_s; /* start offset number */
short type; /* offset type */
short datano_e; /* end offset number */
long ofs[M]; /* offset value */
} IODBBTO ; /* Individual, Memory A all */
/* M is number of the offset value. */
/* Memory B all */
/* M is number of the offset value x 2. */
datano_s
Specify the start tool offset number.
The available number is 1,...,9.
'This number + aux. function number which can be got by
cnc_rdbtofsinfo() function + 1' means the tool offset
number for B axis which is used by NC command or
display.

datano_e
Specify the end tool offset number.
The available number is 1,...,9.

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 for B axis(area specified)(cnc_rdbtofsr)". See the description of
cnc_rdbtofsr() function.

327
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at M series.
EW_LENGTH Data block length error
Size of IODBBTO structure(length) is wrong.
EW_NUMBER Data number error
Offset number(datano_s,datano_e) is wrong.
EW_ATTRIB Data attribute error
Offset type(type) is wrong.
EW_NOOPT No option
The B axis option and the extended driver/
library option are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the B axis option and the extended driver/
library option.
And, this function relates to the following CNC option.

Series 160/180 Geometry/wear offset

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 160/180 1004#1

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

328
(66) Read Tool Offset Information for B Axis

Function Name:
cnc_rdbtofsinfo

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdbtofsinfo(unsigned short FlibHndl,
ODBBTLINF *btlinf);
Description:
Reads the memory type of tool offset for B axis, the available number
and the auxiliary function number which means offset cancel.
These are stored in "ofs_type", "use_no" and "sub_no" of "ODBBTLINF"
with binary format.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

btlinf Pointer to the ODBBTLINF structure for the tool offset


information for B axis. The ODBBTLINF structure is as follows.

typedef struct odbbtlinf {


short ofs_type; /* memory type */
short use_no; /* available number */
short sub_no; /* aux. function number */
} ODBBTLINF ;

ofs_type
Memory type of tool offset for B axis
0:memory type A
1:memory type B

use_no Available number of tool offset for B axis

sub_no Auxiliary function number which means offset cancel


(CNC parameter 8257)
The tool offset auxiliary function number is from next
number of this number to this number + 9.

Ex.) 8257=50 : 51,...,59

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at M series.
EW_NOOPT No option
The B axis option and the extended driver/
library option are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

329
CNC option: This function needs the B axis option and the extended driver/
library option.
And, this function relates to the following CNC option.

Series 160/180 Geometry/wear offset

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 160/180 8257

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

330
(67) Read Command Data for B Axis

Function Name:
cnc_rdbaxis

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdbaxis(unsigned short FlibHndl,
ODBBAXIS *baxis);
Description:
Reads the command data for B axis(current command, next command).

The unit of command data is as follows.

Series 160/180
| Linear axis |Rotation axis
1004#1| mm input |inch input|
(ISC)| [mm]| [inch]| [deg]
--------------------+----------+----------+-------------
(IS-B) 0 0.001 0.0001 0.001
(IS-C) 1 0.0001 0.00001 0.0001

The unit of speed is as follows.

Series 160/180
| mm input |inch input
| [mm]| [inch]
-------------+----------+----------
G98[mm/min] 1 0.01
G99[mm/rev] 0.01 0.0001 (both IS-B/IS-C)

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

baxis Pointer to the ODBBAXIS structure for the command data for B
axis. The ODBBAXIS structure is as follows.

typedef struct odbbaxis {


short flag ; /* existence of command */
short command ; /* command */
unsigned short speed ; /* speed */
long sub_data ; /* supplement of command */
} ODBBAXIS ;

ODBBAXIS baxis[2] ;
baxis[0] : current command data
baxis[1] : next command data

flag existence of command


0 : non 1 : existence

331
command command
Attributes are as follows.
bit 0,1,2 : command code
0 : G00 4 : M
1 : G01 5 : S
2 : G04 6 : T
3 : G28
bit 3,..,11 : (reserve)
bit 12 : G99/G98 (for display of speed)
0 : G98 1 : G99
bit 13,.,15 : (reserve)

speed speed
valid at current command data and G01 mode

sub_data supplement of command


G00, G01 : motion value
G04 : dwell time
G28 : (invalid)
M, S, T : command code

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at M series.
EW_NOOPT No option
The B axis option and the extended driver/
library option are necessary.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the B axis option and the extended driver/
library option.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.
Series 160/180 1004#1

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

332
1.1.10 Function Reference Related to Tool Life Management Data

(1) Read Tool Life Management Data (Tool Group Number)

Function Name:
cnc_rdgrpid

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdgrpid(unsigned short FlibHndl,
short number,ODBTLIFE1 *grpid);
Description:
Reads the tool group number in which the specified tool is registered.

When the same tool number exists in two or more tool groups,
the smallest group number is stored.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

number Specify the tool number.

grpid Pointer to the ODBTLIFE1 structure including the tool group


number.
The ODBTLIFE1 structure is as follows.
typedef struct odbtlife1 {
short dummy ; /* Not used. */
short type ; /* Tool number. */
long data ; /* Tool group number. */
} ODBTLIFE1 ;

The tool group number in which the specified tool number is registered
is stored in "grpid.data" with binary format. The currently used tool
group number is stored by specifying "0" in "number". However, in case
that any tool group number has never be specified since power-on, "0"
is stored.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_ATTRIB data attribute error
The specification of tool number(number) is
wrong.
EW_NOOPT no option
The tool life management function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

333
CNC option: The tool life management function is necessary.
This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

334
(2) Read Tool Life Management Data (Number of Tool Groups)

Function Name:
cnc_rdngrp

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdngrp(unsigned short FlibHndl,
ODBTLIFE2 *ngrp);
Description:
Reads the amount of tool group registered tool.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

ngrp Pointer to the ODBTLIFE2 structure including the amount of tool


group.
The ODBTLIFE2 structure is as follows.
typedef struct odbtlife2 {
short dummy[2] ; /* Not used. */
long data ; /* Tool group number. */
} ODBTLIFE2 ;

The amount of registered group is stored in "ngrp.data" with binary


format.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The tool life management function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The tool life management function is necessary.


This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

335
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

336
(3) Read Tool Life Management Data (Number of Tools)

Function Name:
cnc_rdntool

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdntool(unsigned short FlibHndl,
short number,ODBTLIFE3 *ntool);
Description:
Reads the amount of tools which are registered in the specified tool
group.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

number Specify the tool group number.

ntool Pointer to the ODBTLIFE3 structure including the amount of


tools.
The ODBTLIFE3 structure is as follows.
typedef struct odbtlife3 {
short datano ; /* Tool group number. */
short dummy ; /* Not used. */
long data ; /* Amount of tool. */
} ODBTLIFE3 ;

The amount of tools which are registered in the specified tool group is
stored in "ntool.data" with binary format.
The amount of tools which are registered in the currently used tool
group number is stored by specifying "0" in "number". However, in case
that any tool group number has never be specified since power-on, "0"
is stored.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The specification of tool group number(number)
is wrong.
EW_NOOPT no option
The tool life management function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

337
CNC option: The tool life management function is necessary.
This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

338
(4) Read Tool Life Management Data (Tool Life)

Function Name:
cnc_rdlife

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdlife(unsigned short FlibHndl,
short number,ODBTLIFE3 *life);
Description:
Reads the tool life value of the specified tool group.

The unit of the tool life value is either [minute] or [count].


The parameter LTM(Series150:7400#3,Series160/180/210,NC board:6800#2)
determines which unit is used.
For M Series, it is possible to specify the tool life counter type
(time or count) by G10 command to every tool group.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

number Specify the tool group number with binary format.

life Pointer to the ODBTLIFE3 structure including the tool life


value.
The ODBTLIFE3 structure is as follows.
typedef struct odbtlife3 {
short datano ; /* Tool group number. */
short dummy ; /* Not used. */
long data ; /* Tool life value. */
} ODBTLIFE3 ;

The tool life value of the specified tool group is stored in


"life.data" with binary format.
The tool life value of the currently used tool group number is stored
by specifying "0" in "number". However, in case that any tool group
number has never be specified since power-on, "0" is stored.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The specification of tool group number(number)
is wrong.
EW_NOOPT no option
The tool life management function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

339
CNC option: The tool life management function is necessary.
This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

340
(5) Read Tool Life Management Data (Tool Life Counter)

Function Name:
cnc_rdcount

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdcount(unsigned short FlibHndl,
short number,ODBTLIFE3 *count);
Description:
Reads the tool life counter of the specified tool group.

The unit of the tool life counter is either [minute] or [count].


The parameter LTM(Series150:7400#3,Series160/180/210,NC board:6800#2)
determines which unit is used.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

number Specify the tool group number with binary format.

count Pointer to the ODBTLIFE3 structure including the tool life


counter.
The ODBTLIFE3 structure is as follows.
typedef struct odbtlife3 {
short datano ; /* Tool group number. */
short dummy ; /* Not used. */
long data ; /* Tool life counter. */
} ODBTLIFE3 ;

The tool life counter of the specified tool group is stored in


"count.data "with binary format.
The tool life counter of the currently used tool group number
is stored by specifying "0" in "number". However, in case that
any tool group number has never be specified since power-on,
"0" is stored.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The specification of tool group number(number)
is wrong.
EW_NOOPT no option
The tool life management function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

341
CNC option: The tool life management function is necessary.
This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

342
(6) Read Tool Life Management Data (Tool Length Number-1)

Function Name:
cnc_rd1length

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rd1length(unsigned short FlibHndl,
short grp_num,short tool_num,ODBTLIFE4 *tl_len1);
Description:
Reads the tool length compensation number of the specified tool group
and tool number.
This function is effective for only M Series. "0" is always read for
T Series.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

grp_num Specify the tool group number with binary format.

tool_num
Specify the tool number with binary format.

tl_len1 Pointer to the ODBTLIFE4 structure including the tool length


compensation number. The ODBTLIFE4 structure is as follows.
typedef struct odbtlife4 {
short datano ; /* Tool group number. */
short type ; /* Tool number. */
long data ; /* Tool length compensation number.
(always 0 in T Series) */
} ODBTLIFE4 ;

The tool length compensation number of the specified tool is stored in


"tl_len1.data" with binary format.
The currently used tool group and tool are referenced by specifying "0"
in "grp_num" and "tool_num".
However, in case that any tool group number
has never be specified since power-on, "0" is stored.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The specification of tool group number(grp_num)
is wrong.
EW_ATTRIB data attribute error
The specification of tool number(tool_num) is
wrong.
EW_NOOPT no option
The tool life management function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

343
CNC option: The tool life management function is necessary.
This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting


Series 160/180/210,NC board
6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

344
(7) Read Tool Life Management Data (Tool Length Number-2)

Function Name:
cnc_rd2length

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rd2length(unsigned short FlibHndl,
short grp_num,short tuse_num,ODBTLIFE4 *tl_len2);
Description:
Reads the tool length compensation number of the specified tool group
and tool use-order number.

This function is effective for only M Series. "0" is always read for
T Series.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

grp_num Specify the tool group number with binary format.

tuse_num
Specify the tool use-order number with binary format.

tl_len2 Pointer to the ODBTLIFE4 structure including the tool length


compensation number.
The ODBTLIFE4 structure is as follows.
typedef struct odbtlife4 {
short datano ; /* Tool group number. */
short type ; /* Tool use-order number. */
long data ; /* Tool length compensation number.
(always 0 in T Series) */
} ODBTLIFE4 ;

The tool length compensation number of the specified tool is stored in


"tl_len2.data" with binary format.
The currently used tool group and tool are referenced by specifying "0"
in "grp_num".
However, in case that any tool group number has never be specified
since power-on, "0" is stored.
In the case of specifying "0" in "tuse_num", either the currently used
tool for already used tool group or the first tool for not-used tool
group is referenced.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The specification of tool group number(grp_num)
is wrong.
EW_ATTRIB data attribute error
The specification of tool use-order number
(tuse_num) is wrong.

345
EW_NOOPT no option
The tool life management function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The tool life management function is necessary.


This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

346
(8) Read Tool Life Management Data (Cutter Compensation No.-1)

Function Name:
cnc_rd1radius

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rd1radius(unsigned short FlibHndl,
short grp_num,short tool_num,ODBTLIFE4 *radius1);
Description:
Reads the cutter radius compensation number of the specified tool group
and tool number.
This function is effective for only M Series. "0" is always read for T
Series.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

grp_num Specify the tool group number with binary format.

tool_num
Specify the tool number with binary format.

radius1 Pointer to the ODBTLIFE4 structure including the cutter radius


compensation number. The ODBTLIFE4 structure is as follows.
typedef struct odbtlife4 {
short datano ; /* Tool group number. */
short type ; /* Tool number. */
long data ; /* Cutter radius compensation number.
(always 0 in T Series) */
} ODBTLIFE4 ;

The cutter radius compensation number of the specified tool is stored


in "radius1.data" with binary format.
The currently used tool group and tool are referenced by specifying "0"
in "grp_num" and "tool_num".
However, in case that any tool group number has never be specified
since power-on, "0" is stored.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The specification of tool group number(grp_num)
is wrong.
EW_ATTRIB data attribute error
The specification of tool number(tool_num) is
wrong.
EW_NOOPT no option
The tool life management function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

347
CNC option: The tool life management function is necessary.
This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting


Series 160/180/210,NC board
6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

348
(9) Read Tool Life Management Data (Cutter Compensation No.-2)

Function Name:
cnc_rd2radius

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rd2radius(unsigned short FlibHndl,
short grp_num,short tuse_num,ODBTLIFE4 *radius2);
Description:
Reads the cutter radius compensation number of the specified tool group
and tool use-order number.

This function is effective for only M Series. "0" is always read for
T Series.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

grp_num Specify the tool group number with binary format.

tuse_num
Specify the tool use-order number with binary format.

radius2 Pointer to the ODBTLIFE4 structure including the cutter radius


compensation number.
The ODBTLIFE4 structure is as follows.
typedef struct odbtlife4 {
short datano ; /* Tool group number. */
short type ; /* Tool use-order number. */
long data ; /* Cutter radius compensation number.
(always 0 in T Series) */
} ODBTLIFE4 ;

The cutter radius compensation number of the specified tool is stored


in "radius2.data" with binary format.
The currently used tool group and tool are referenced by specifying "0"
in "grp_num".
However, in case that any tool group number has never be specified
since power-on, "0" is stored.
In the case of specifying "0" in "tuse_num", either the currently used
tool for already used tool group or the first tool for not-used tool
group is referenced.

349
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The specification of tool group number(grp_num)
is wrong.
EW_ATTRIB data attribute error
The specification of tool use-order number
(tuse_num) is wrong.
EW_NOOPT no option
The tool life management function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The tool life management function is necessary.


This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

350
(10) Read Tool Life Management Data (Tool Information-1)

Function Name:
cnc_t1info

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_t1info(unsigned short FlibHndl,short grp_num,
short tool_num,ODBTLIFE4 *tinfo1);
Description:
Reads the tool information of the specified tool group and tool number.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

grp_num Specify the tool group number with binary format.

tool_num
Specify the tool number with binary format.

tinfo1 Pointer to the ODBTLIFE4 structure including the tool


information.
The ODBTLIFE4 structure is as follows.
typedef struct odbtlife4 {
short datano ; /* Tool group number. */
short type ; /* Tool number. */
long data ; /* Tool information. */
} ODBTLIFE4 ;

The tool information of the specified tool is stored in "tinfo1.data"


with binary format as follows.

buf.data Tool information


---------------+------------------------
0 (Undermentioned reference)
1 This tool is registered.
2 This tool has expired.
3 This tool was skipped.

The currently used tool group and tool are referenced by specifying "0"
in "grp_num" and "tool_num".
However, in case that any tool group number has never be specified
since power-on, "0" is stored.

351
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The specification of tool group number(grp_num)
is wrong.
EW_ATTRIB data attribute error
The specification of tool number(tool_num) is
wrong.
EW_NOOPT no option
The tool life management function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The tool life management function is necessary.


This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

352
(11) Read Tool Life Management Data (Tool Information-2)

Function Name:
cnc_t2info

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_t2info(unsigned short FlibHndl,short grp_num,
short tuse_num,ODBTLIFE4 *tinfo2);
Description:
Reads the tool information of the specified tool group and tool
use-order number.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

grp_num Specify the tool group number with binary format.

tuse_num
Specify the tool use-order number with binary format.

tinfo2 Pointer to the ODBTLIFE4 structure including the tool


information.
The ODBTLIFE4 structure is as follows.
typedef struct odbtlife4 {
short datano ; /* Tool group number. */
short type ; /* Tool use-order number. */
long data ; /* Tool information. */
} ODBTLIFE4 ;

The tool information of the specified tool is stored in "tinfo2.data"


with binary format as follows.

buf.data Tool information


---------------+------------------------
0 (Undermentioned reference)
1 This tool is registered.
2 This tool has expired.
3 This tool was skipped.

The currently used tool group and tool are referenced by specifying "0"
in "grp_num".
However, in case that any tool group number has never be specified
since power-on, "0" is stored.
In the case of specifying "0" in "tuse_num", either the currently used
tool for already used tool group or the first tool for not-used tool
group is referenced.

353
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The specification of tool group number(grp_num)
is wrong.
EW_ATTRIB data attribute error
The specification of tool use-order number
(tuse_num) is wrong.
EW_NOOPT no option
The tool life management function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The tool life management function is necessary.


This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

354
(12) Read Tool Life Management Data (Tool Number)

Function Name:
cnc_toolnum

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_toolnum(unsigned short FlibHndl,
short grp_num,short tuse_num,ODBTLIFE4 *toolnum);
Description:
Reads the tool number of the specified tool group and tool use-order
number.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

grp_num Specify the tool group number with binary format.

tuse_num
Specify the tool use-order number with binary format.

toolnum Pointer to the ODBTLIFE4 structure including the tool number.


The ODBTLIFE4 structure is as follows.
typedef struct odbtlife4 {
short datano ; /* Tool group number. */
short type ; /* Tool use-order number. */
long data ; /* Tool number. */
} ODBTLIFE4 ;

The tool number of the specified tool is stored in "toolnum.data" with


binary format.
The currently used tool group and tool are referenced by specifying "0"
in "grp_num".
However, in case that any tool group number
has never be specified since power-on, "0" is stored.
In the case of specifying "0" in "tuse_num", either the currently used
tool for already used tool group or the first tool for not-used tool
group is referenced.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The specification of tool group number(grp_num)
is wrong.
EW_ATTRIB data attribute error
The specification of tool use-order number
(tuse_num) is wrong.
EW_NOOPT no option
The tool life management function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

355
CNC option: The tool life management function is necessary.
This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting


Series 160/180/210,NC board
6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

356
(13) Read Tool Life Management Data (Tool Number, Tool Life, Tool Life Counter)
(Area Specified)

Function Name:
cnc_rdtoolrng

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdtoolrng(unsigned short FlibHndl,
short s_number,short e_number,short length,IODBTR *toolnum);
Description:
Reads the amount of tool, the tool life value and the tool life counter
within the specified tool group range.

The unit of the tool life value and the tool life counter is either
[minute] or [count].
The parameter LTM(Series150:7400#3,Series160/180/210,NC board:6800#2)
determines which unit is used.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_number
Specify the start tool group number with binary format.

e_number
Specify the end tool group number with binary format.

length Specify the length of the data block(size of IODBTR structure)

IODBTR 0+---------+ ---


| datano_s| ^
2+---------+ |
| dummy | |
4+---------+ |
| datano_e| length
6+---------+---------+ |
| data[0] | |
18+-------------------+ |
= = |
6+12*(N-1)+-------------------+ |
| data[N-1] | v
6+12*N+-------------------+ ---

data 0+-----------+
| ntool |
4+-----------+
| life |
8+-----------+
| count |
12+-----------+
N is number of the tool group to be read.

357
toolnum Pointer to the IODBTR structure including the amount of tool,
the tool life value and the tool life counter.
The IODBTR structure is as follows.
typedef struct iodbtr {
short datano_s ; /* Start group number. */
short dummy ; /* Not used. */
short datano_e ; /* End group number. */
struct {
long ntool ; /* Amount of tool. */
long life ; /* Tool life value. */
long count ; /* Tool life counter. */
} data[N] ;
} IODBTR ; /* N is number of tool groups to be read. */
The amount of tool, the tool life value and the tool life counter are
stored in each "toolnum.data[i].ntool", "toolnum.data[i].life" and
"toolnum.data[i].count" with binary format.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH data block length error
Size of IODBTR structure(length) is wrong.
EW_NUMBER data number error
The specification of tool group number
(s_number,e_number) is wrong.
EW_NOOPT no option
The tool life management function is necessary.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The tool life management function is necessary.


This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.
Series 150 7400#0,#1 --- influenced by setting
Series 160/180/210,NC board
6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.


Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

358
(14) Read Tool Life Management Data (All Data within Group)

Function Name:
cnc_rdtoolgrp

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdtoolgrp(unsigned short FlibHndl,
short grp_num,short length,ODBTG *toolgrp);
Description:
Reads the various tool information of the specified tool group in the
lump. The unit of the tool life value and the tool life counter is
either [minute] or [count].
The parameter LTM(Series150:7400#3,Series160/180/210,NC board:6800#2)
determines which unit is used.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

grp_num Specify the tool group number with binary format. The currently
used tool group is referenced by specifying "0" in "grp_num".
length Specify the length of the data block(size of ODBTG structure)
ODBTG 0+---------+ ---
| grp_num | ^
2+---------+ |
| dummy[0]| |
4+---------+ |
| dummy[1]| |
6+---------+---------+ |
| ntool | |
10+-------------------+ length
| life | |
14+-------------------+ |
| count | |
18+-------------------+ |
= data[0] = |
38+-------------------+ |
= = |
18+20*(N-1)+-------------------+ |
| data[N-1] | v
18+20*N+-------------------+ ---
data 0+-----------+ N is amount of tool.
| tuse_num |
4+-----------+
| tool_num |
8+-----------+
| length_num|
12+-----------+
| radius_num|
16+-----------+
| tinfo |
20+-----------+

359
toolgrp Pointer to the ODBTG structure including the various tool
information. The ODBTG structure is as follows.
typedef struct odbtg {
short grp_num ; /* Tool group number. */
short dummy[2] ; /* Not used. */
long ntool ; /* Amount of tool. */
long life ; /* Tool life value. */
long count ; /* Tool life counter. */
struct {
long tuse_num ; /* Tool use-order number */
long tool_num ; /* Tool number */
long length_num ; /* Tool length compensation no.*/
long radius_num ; /* Cutter radius compensation no.*/
long tinfo ; /* Tool information. */
} data[N] ;
} ODBTG ; /* N is amount of tool. */

The following information are stored in "toolgrp" with binary format.

toolgrp.ntool Amount of tool.


toolgrp.life Tool life value.
toolgrp.count Tool life counter.
toolgrp.data[i].tuse_num Tool use-order number.
toolgrp.data[i].tool_num Tool number.
toolgrp.data[i].length_num Tool length compensation number.
(always 0 in T series)
toolgrp.data[i].radius_num Cutter radius compensation number.
(always 0 in T series)
toolgrp.data[i].tinfo Tool information.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH data block length error
Size of ODBTG structure(length) is wrong.
EW_NUMBER data number error
The specification of tool group number(grp_num)
is wrong.
EW_NOOPT no option
The tool life management function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The tool life management function is necessary.


This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

360
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

361
(15) Write Tool Life Management Data (Tool Life Counter) (Area Specified)

Function Name:
cnc_wrcountr

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrcountr(unsigned short FlibHndl,
short length,IDBWRC *wrcount);
Description:
Alters the tool life counter within the specified tool group range.

The unit of the tool life counter is either [minute] or [count].


The parameter LTM(Series150:7400#3,Series160/180/210,NC board:6800#2)
determines which unit is used.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

length Specify the length of the data block(size of IDBWRC structure)

IDBWRC 0+---------+ ---


| datano_s| ^
2+---------+ |
| dummy | |
4+---------+ |
| datano_e| |
6+---------+---------+ |
| | |
| data[0] | length
| | |
18+-------------------+ |
= = |
6+12*(N-1)+-------------------+ |
| | |
| data[N-1] | |
| | v
6+12*N+-------------------+ ---

data 0+-----------+
| dummy[0] |
4+-----------+
| dummy[1] |
8+-----------+
| count |
12+-----------+

N is number of the tool group to be written.


wrcount Pointer to the IDBWRC structure to be set the tool life
counter. The IDBWRC structure is as follows.
typedef struct idbwrc {
short datano_s ; /* Start tool group number. */
short dummy ; /* Not used. */
short datano_e ; /* End tool group number. */
struct {
long dummy[2] ; /* Not used. */
long count ; /* Tool life counter. */
} data[N] ;
} IDBWRC ; /* N is number of tool groups to be written. */

362
Store the start tool group number in "wrcount.datano_s" with binary
format.
Store the end tool group number in "wrcount.datano_e" with binary format.
Store the tool life counter in "wrcount.data[i].count" with binary
format.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH data block length error
Size of IDBWRC structure(length) is wrong.
EW_NUMBER data number error
The specification of tool group number
(datano_s,datano_e) is wrong.
EW_NOOPT no option
The tool life management function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The tool life management function is necessary.


This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

363
(16) Read Tool Life Management Data (Used Tool Group Number)

Function Name:
cnc_rdusegrpid

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdusegrpid(unsigned short FlibHndl,
ODBUSEGR *usegrpid);
Description:
Read the used tool group number.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

usegrpid
Pointer to the ODBUSEGR structure including the used tool group
number.
The ODBUSEGR structure is as follows.
typedef struct odbusegr {
short datano; /* Not used */
short type; /* Not used */
long next; /* Number of tool group to be used next */
long use; /* Number of tool group currently in use */
long slct; /* Number of tool group currently selected */
} ODBUSEGR ;

Number of tool group to be used next


number of tool group for which life count operation is
to be started next.
Number of tool group currently in use
number of tool group for which life count operation is
currently being performed.
Number of tool group currently selected
number of tool group for which life count operation is
currently being performed or for which the last life
count operation was performed.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The tool life management function and the
extended driver/library function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

364
CNC option: The tool life management function and
the extended driver/library function is necessary.
This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

365
(17) Read Tool Life Management Data (Maximum Number of Tool Groups)

Function Name:
cnc_rdmaxgrp

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdmaxgrp(unsigned short FlibHndl,
ODBLFNO *maxgrp);
Description:
Read the maximum number of tool group.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

maxgrp Pointer to the ODBLFNO structure including the maximum number


of tool group. The ODBLFNO structure is as follows.

typedef struct odblfno {


short datano; /* Not used. */
short type; /* Not used. */
short data; /* Maximum number of tool group */
} ODBLFNO ;

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The tool life management function and the
extended driver/library function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The tool life management function and


the extended driver/library function is necessary.
This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

366
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

367
(18) Read Tool Life Management Data (Maximum Number of Tool within Group)

Function Name:
cnc_rdmaxtool

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdmaxtool(unsigned short FlibHndl,
ODBLFNO *maxtool);
Description:
Read the maximum number of tool within group.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

maxtool Pointer to the ODBLFNO structure including the maximum number


of tool group.
The ODBLFNO structure is as follows.
typedef struct odblfno {
short datano; /* Not used. */
short type; /* Not used. */
short data /* Maximum number of tool within group. */
} ODBLFNO ;

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The tool life management function and the
extended driver/library function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The tool life management function and


the extended driver/library function is necessary.
This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

368
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

369
(19) Read Tool Life Management Data (Used Tool No. within Group)

Function Name:
cnc_rdusetlno

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdusetlno(unsigned short FlibHndl,
short s_grp,short e_grp,short length,ODBTLUSE *usetlno);
Description:
Read the tool use-order number in groups.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_grp Specify the start tool group number with binary format.

e_grp Specify the end tool group number with binary format.

length Specify the length of the data block(size of ODBTLUSE structure)

ODBTLUSE 0+---------+ ---


| s_grp | ^
2+---------+ |
| dummy | |
4+---------+ |
| e_grp | |
6+---------+---------+ length
| data[0] | |
10+-------------------+ |
= = |
6+4*(N-1)+-------------------+ |
| data[N-1] | v
6+4*N+-------------------+ ---

N is number of the tool group to be read.

usetlno Pointer to the ODBTLUSE structure including the tool use-order


number. The ODBTLUSE structure is as follows.
typedef struct odbtluse {
short s_grp; /* Start tool group number. */
short dummy; /* Not used. */
short e_grp; /* End tool group number. */
long data[N]; /* Tool use-order number in groups. */
} ODBTLUSE ; /* N is number of tool groups to be read. */

The following information are stored in "usetlno" with binary format.

usetlno.s_grp start tool group number


usetlno.e_grp end tool group number
usetlno.data[i] Tool use-order number in groups

370
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH data block length error
Size of ODBTLUSE structure(length) is wrong.
EW_NUMBER data number error
The specification of tool group number
(s_grp,e_grp) is wrong.
EW_NOOPT no option
The tool life management function and the
extended driver/library function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The tool life management function and


the extended driver/library function is necessary.
This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

371
(20) Read Tool Life Management Data (Tool Data1)

Function Name:
cnc_rd1tlifedata

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rd1tlifedata(unsigned short FlibHndl,
short grp_no,short tool_no,IODBTD *tld1);
Description:
Reads the various tool information of the specified tool group and
tool number.
The following information are acquired.
Tool length compensation number.(always 0 in T series)
Cutter radius compensation number.(always 0 in T series)
Tool information 0 : (Undermentioned reference)
1 : This tool is registered.
2 : This tool has expired.
3 : This tool was skipped.

The currently used tool group and tool are referenced by specifying "0"
in "grp_num" and "tool_no".
However, in case that any tool group number has never be specified
since power-on, "0" is stored.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

grp_no Specify the tool group number with binary format.

tool_no Specify the tool number with binary format.

tld1 Pointer to the IODBTD structure including the various tool


information. The IODBTD structure is as follows.
typedef struct iodbtd {
short datano; /* Tool group number. */
short type; /* Not used. */
long tool_num; /* Tool number. */
long h_code; /* Tool length compensation number. */
long d_code; /* Cutter radius compensation number. */
long tool_inf; /* Tool information. */
} IODBTD ;

The following information are stored in "tld1" with binary format.

tld1.datano Tool group number.


tld1.tool_num Tool number.
tld1.h_code Tool length compensation number.
(always 0 in T series)
tld1.d_code Cutter radius compensation number.
(always 0 in T series)
tld1.tool_inf Tool information.

372
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The specification of tool group number(grp_num)
is wrong.
EW_ATTRIB data attribute error
The specification of tool number(tool_no) is
wrong.
EW_NOOPT no option
The tool life management function and the
extended driver/library function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The tool life management function and


the extended driver/library function is necessary.
This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

373
(21) Read Tool Life Management Data (Tool Data 2)

Function Name:
cnc_rd2tlifedata

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rd2tlifedata(unsigned short FlibHndl,
short grp_no,short use_no,IODBTD *tld2);
Description:
Reads the various tool information of the specified tool group and
tool use-order number. The following information are acquired.
- Tool length compensation number(always 0 in T series)
- Cutter radius compensation number(always 0 in T series)
- Tool information 0 : (Undermentioned reference)
1 : This tool is registered.
2 : This tool has expired.
3 : This tool was skipped.

The currently used tool group and tool are referenced by specifying "0"
in "grp_num". However, in case that any tool group number has never be
specified since power-on, "0" is stored. In the case of specifying "0"
in "use_no", either the currently used tool for already used tool group
or the first tool for not-used tool group is referenced.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

grp_no Specify the tool group number with binary format.

use_no Specify the tool use-order number with binary format.

tld2 Pointer to the IODBTD structure including the various tool


information. The IODBTD structure is as follows.
typedef struct iodbtd {
short datano; /* Tool group number. */
short type; /* Tool use-order number. */
long tool_num; /* Tool number. */
long h_code; /* Tool length compensation number. */
long d_code; /* Cutter radius compensation number. */
long tool_inf; /* Tool information. */
} IODBTD ;

The following information are stored in "tld2" with binary format.


tld1.datano Tool group number.
tld2.type Tool use-order number.
tld1.tool_num Tool number.
tld1.h_code Tool length compensation number
(always 0 in T series)
tld1.d_code Cutter radius compensation number.
(always 0 in T series)
tld1.tool_inf Tool information.

374
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The specification of tool group number(grp_no)
is wrong.
EW_ATTRIB data attribute error
The specification of tool use-order
number(use_no) is wrong.
EW_NOOPT no option
The tool life management function and the
extended driver/library function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The tool life management function and


the extended driver/library function is necessary.
This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

375
(22) Write Tool Life Management Data (Tool Data 1)

Function Name:
cnc_wr1tlifedata

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wr1tlifedata(unsigned short FlibHndl,
IODBTD *tld1);
Description:
Write the various tool information of the specified tool group and
tool number.
The following information are updated.
Tool number.
Tool length compensation number.
Cutter radius compensation number.
Tool information 1 : This tool is registered.
2 : This tool has expired.
3 : This tool was skipped.

This function is not available for T/TT system.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

tld1 Pointer to the IODBTD structure to be set the various tool


information.
The IODBTD structure is as follows.
typedef struct iodbtd {
short datano; /* Tool group number. */
short type; /* Tool number(present). */
long tool_num; /* Tool number(update). */
long h_code; /* Tool length compensation number. */
long d_code; /* Cutter radius compensation number. */
long tool_inf; /* Tool information. */
} IODBTD ;

datano Specify the tool group number.

type Specify the (present) tool number.

tool_num Specify the (update) tool number.

h_code Specify the tool length compensation number.

d_code Specify the cutter radius compensation number.

tool_inf Specify the tool information.


1 : This tool is registered.
2 : This tool has expired.
3 : This tool was skipped.

376
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The specification of tool group number(datano)
is wrong.
EW_ATTRIB data attribute error
The specification of (present) tool number
(type) is wrong.
EW_DATA data error
Detailed status are set in global variable
cnc_errno (short).
0 : Completion status other than EW_DATA
1 : (Update) tool number(tool_num) error
2 : Tool length compensation number(h_code)
error
3 : Cutter compensation number(d_code) error
4 : Tool information(tool_inf) error
EW_NOOPT no option
The tool life management function and the
extended driver/library function is necessary.
EW_REJECT CNC execution denied

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The tool life management function and


the extended driver/library function is necessary.
This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.
Series 150 7400#0,#1 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

377
(23) Write Tool Life Management Data (Tool Data 2)

Function Name:
cnc_wr2tlifedata

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wr2tlifedata(unsigned short FlibHndl,
IODBTD *tld2);
Description:
Write the various tool information of the specified tool group and
tool number.
The following information are updated.
Tool number.
Tool length compensation number.
Cutter radius compensation number.
Tool information 1 : This tool is registered.
2 : This tool has expired.
3 : This tool was skipped.

This function is not available for T/TT system.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

tld2 Pointer to the IODBTD structure to be set the various tool


information.
The IODBTD structure is as follows.
typedef struct iodbtd {
short datano; /* Tool group number. */
short type; /* Tool use-order number. */
long tool_num; /* Tool number. */
long h_code; /* Tool length compensation number. */
long d_code; /* Cutter radius compensation number. */
long tool_inf; /* Tool information. */
} IODBTD ;

datano Specify the tool group number.

type Specify the tool use-order number.

tool_num Specify the tool number.

h_code Specify the tool length compensation number.

d_code Specify the cutter radius compensation number.

tool_inf Specify the tool information.


1 : This tool is registered.
2 : This tool has expired.
3 : This tool was skipped.

378
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The specification of tool group number(datano)
is wrong.
EW_ATTRIB data attribute error
The specification of tool use-order number
(type) is wrong.
EW_DATA data error
Detailed status are set in global variable
cnc_errno (short).
0 : Completion status other than EW_DATA
1 : Tool number(tool_num) error
2 : Tool length compensation number(h_code)
error
3 : Cutter compensation number(d_code) error
4 : Tool information(tool_inf) error
EW_NOOPT no option
The tool life management function and the
extended driver/library function is necessary.
EW_REJECT CNC execution denied

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The tool life management function and


the extended driver/library function is necessary.
This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

379
(24) Read Tool Life Management Data (Tool Group Information)

Function Name:
cnc_rdgrpinfo

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdgrpinfo(unsigned short FlibHndl,
short s_grp,short e_grp,short length,IODBTGI *grpinfo);
Description:
Read the tool group information. The following information are acquired.
- Amount of tool
- Tool life value
- Tool life counter
- Type of tool life counter(0 : count, 1 : minute)
The unit of the tool life value is either [minute] or [count].
The parameter LTM(Series150:7400#3,Series160/180/210,NC board:6800#2)
determines which unit is used.
For M Series, it is possible to specify the tool life counter type
(time or count) by G10 command to every tool group.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_grp Specify the start tool group number with binary format.

e_grp Specify the end tool group number with binary format.

length Specify the length of the data block(size of IODBTGI structure)


IODBTGI 0+---------+ ---
| s_grp | ^
2+---------+ |
| dummy | |
4+---------+ |
| e_grp | |
6+---------+---------+ length
| data[0] | |
22+-------------------+ |
= = |
6+16*(N-1)+-------------------+ |
| data[N-1] | v
6+16*N+-------------------+ ---
data 0+-------------+
| n_tool |
4+-------------+
| count_value |
8+-------------+
| counter |
12+-------------+
| count_type |
16+-------------+
N is number of the tool group to be read.

380
grpinfo Pointer to the IODBTGI structure including the tool group
information. The IODBTGI structure is as follows.
typedef struct iodbtgi {
short s_grp; /* Start tool group number. */
short dummy; /* Not used. */
short e_grp; /* End tool group number. */
struct {
long n_tool; /* Amount of tool. */
long count_value; /* Tool life value. */
long counter; /* Tool life counter. */
long count_type; /* Tool life counter type. */
} data[N];
} IODBTGI ; /* N is number of tool group to be read. */

The following information are stored in "grpinfo" with binary format.

grpinfo.s_grp Start tool group number


grpinfo.e_grp End tool group number
grpinfo.data[i].n_tool Amount of tool
grpinfo.data[i].count_value Tool life value
grpinfo.data[i].counter Tool life counter
grpinfo.data[i].count_type Tool life counter type
0 : count
1 : minute

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH data block length error
Size of IODBTGI structure(length) is wrong.
EW_NUMBER data number error
The specification of tool group number
(s_grp,e_grp) is wrong.
EW_NOOPT no option
The tool life management function and the
extended driver/library function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The tool life management function and


the extended driver/library function is necessary.
This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1,#3 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1,#2 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

381
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

382
(25) Write Tool Life Management Data (Tool Group Information)

Function Name:
cnc_wrgrpinfo

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrgrpinfo(unsigned short FlibHndl,
short length,IODBTGI *grpinfo);
Description:
Write the tool group information.
The following information are updated.
Tool life value.
Tool life counter.
Type of tool life counter
0 : count
1 : minute

This function is not available for T/TT system.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

length Specify the length of the data block(size of IODBTGI structure)

IODBTGI 0+---------+ ---


| s_grp | ^
2+---------+ |
| dummy | |
4+---------+ |
| e_grp | |
6+---------+---------+ length
| data[0] | |
22+-------------------+ |
= = |
6+16*(N-1)+-------------------+ |
| data[N-1] | v
6+16*N+-------------------+ ---

data 0+-------------+
| n_tool |
4+-------------+
| count_value |
8+-------------+
| counter |
12+-------------+
| count_type |
16+-------------+

N is number of the tool group to be written.

383
grpinfo Pointer to the IODBTGI structure to be set the tool group
information. The IODBTGI structure is as follows.
typedef struct iodbtgi {
short s_grp; /* Start tool group number. */
short dummy; /* Not used. */
short e_grp; /* End tool group number. */
struct {
long n_tool; /* Not used. */
long count_value; /* Tool life value. */
long counter; /* Tool life counter. */
long count_type; /* Tool life counter type. */
} data[N];
} IODBTGI ; /* N is number of tool group to be written. */

s_grp Specify the start tool group number.

e_grp Specify the end tool group number.

count_value Specify the tool life value.

counter Specify the tool life counter.

count_type Specify the tool life counter type.


0 : count
1 : minute

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH data block length error
Size of IODBTGI structure(length) is wrong.
EW_NUMBER data number error
The specification of tool group number
(s_grp,e_grp) is wrong.
EW_DATA data error
Detaild status are set in global variable
cnc_errno (short).
0 : Completion status other than EW_DATA
1 : Tool life value(count_value) error
2 : Tool life counter(counter) error
3 : Tool life counter type(count_type) error
Tool group number including incorrect data
is set in global variable cnc_errdtno (short).
EW_NOOPT no option
The tool life management function and the
extended driver/library function is necessary.
EW_REJECT CNC execution denied

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

384
CNC option: The tool life management function and
the extended driver/library function is necessary.
This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1,#3 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1,#2 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

385
(26) Delete Tool Life Management Data (Tool Group)

Function Name:
cnc_deltlifegrp

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_deltlifegrp(unsigned short FlibHndl,
short number);
Description:
Delete the tool group.
All information on the specified group is cleared.

This function is not available for Series 150 T/TT.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

number Specify the tool group number.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The specification of tool group number(number)
is wrong.
EW_NOOPT no option
The tool life management function and the
extended driver/library function is necessary.
EW_REJECT CNC execution denied

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The tool life management function and


the extended driver/library function is necessary.
This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

386
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

387
(27) Insert Tool Life Management Data (Tool Data)

Function Name:
cnc_instlifedt

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_instlifedt(unsigned short FlibHndl,
IDBITD *inst);
Description:
Insert the tool data.
Tool information is set with "life remaining."
Added data is inserted after the already specified tool use sequence
numbers.

If a tool is added to an unregistered tool group, the tool group itself


is registered. In this case, the life value, life counter, H code,
and D code are set to 0, and the life counter assumes the parameter
setting.

This function is not available for T/TT system.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

inst Pointer to the IDBITD structure to be set the tool data.


The IDBITD structure is as follows.
typedef struct idbitd {
short datano; /* Tool group number. */
short type; /* Tool use-order number. */
long data; /* Tool number. */
} IDBITD ;

datano Specify the tool group number with binary format.

type Specify the tool use-order number with binary format.

data Specify the tool number with binary format.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The specification of tool group number(datano)
is wrong.
EW_ATTRIB data attribute error
The specification of tool use-order
number(type) is wrong.
EW_DATA data error
The specification of tool number(data)
is wrong.
EW_NOOPT no option
The tool life management function and the
extended driver/library function is necessary.

388
EW_OVRFLOW memory overflow
The number of the maximum tool which was able
to be registered was exceeded.
EW_REJECT CNC execution denied

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The tool life management function and


the extended driver/library function is necessary.
This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

389
(28) Delete Tool Life Management Data (Tool Data)

Function Name:
cnc_deltlifedt

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_deltlifedt(unsigned short FlibHndl,
short grp_num,short ent_num);

Description:
Delete the tool data.

When the tool number data is deleted, all subsequent tool data is
shifted up to fill the deleted space, as shown below.

Tool use+-------------+ Tool use+-------------+


sequence| Tool number | sequence|Tool number |
number | | number | |
+-------------+ Tool number 020 +-------------+
1 | 010 | is deleted. 1 | 010 |
+-------------+ +-------------+
2 | 020 | ----------------> 2 | 030 |
+-------------+ +-------------+
3 | 030 | 3 | 040 |
+-------------+ +-------------+
| : | | : |

This function is not available for T/TT system.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

grp_num Specify the tool group number with binary format.

ent_num Specify the tool use-order number with binary format.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The specification of tool group number(grp_num)
is wrong.
EW_ATTRIB data attribute error
The specification of tool use-order
number(ent_num) is wrong.
EW_NOOPT no option
The tool life management function and the
extended driver/library function is necessary.
EW_REJECT CNC execution denied

390
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The tool life management function and


the extended driver/library function is necessary.
This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting

Series 160/180/210,NC board


6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

391
(29) Clear Tool Life Management Data (Tool Life Counter, Tool Information)
(Area Specified)

Function Name:
cnc_clrcntinfo

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_clrcntinfo(unsigned short FlibHndl,
short grpno_s,short grpno_e);
Description:
Clear the tool life counter and the tool information.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

grpno_s Specify the start tool group number with binary format.

grpno_e Specify the end tool group number with binary format.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The specification of tool group number
(grpno_s,grpno_e) is wrong.
EW_NOOPT no option
The tool life management function and the
extended driver/library function is necessary.
EW_REJECT CNC execution denied

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The tool life management function and


the extended driver/library function is necessary.
This function is influenced by 512(M Series)/128(T Series)
pairs of the tool life management.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 7400#0,#1 --- influenced by setting


Series 160/180/210,NC board
6800#0,#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

392
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

393
1.1.11 Function Reference Related to History Data

(1) Stop Logging Operation History Data

Function Name:
cnc_stopophis

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.
See "Library handle" for details.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The extended driver/library function is
necessary.
EW_PARAM CNC parameter error(only Series 160/180/210)
Set CNC parameter No.3112#5 to '0'.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function relates to the following parameter.


See the manual of CNC parameter for details.
Series 160/180/210 3112#5=0 --- must be off

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

394
(2) Restart Logging Operation History Data

Function Name:
cnc_startophis

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.
See "Library handle" for details.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The extended driver/library function is
necessary.
EW_PARAM CNC parameter error(only Series 160/180/210)
Set CNC parameter No.3112#5 to '0'.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function relates to the following parameter.


See the manual of CNC parameter for details.

Series 160/180/210 3112#5=0 --- must be off

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

395
(3) Read Number of Operation History Data

Function Name:
cnc_rdophisno

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdophisno(unsigned short FlibHndl,
unsigned short *hisno);
Description:
Reads the number of operation history data.
It is necessary to stop sampling the operation history data by using
cnc_stopophis() function before this function is used.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.
hisno Pointer to the variable by which the number of operation
history data is stored.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC cnc_stopophis function has not been executed.
EW_NOOPT No option
The extended driver/library function is
necessary.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function relates to the following parameter.


See the manual of CNC parameter for details.
Series 150 0015#3=1 --- must be on
Series 160/180/210 3112#5=0 --- must be off

CNC mode: This function can be used in any CNC mode.


Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

396
(4) Read Operation History Data

Function Name:
cnc_rdophistry

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);
Description:
Reads the operation history data.
The structure of the operation history data is different according to
kind of the record(rec_type).
When the operation history data is accessed, it is necessary to use a
structure corresponding to the kind.

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.

It is necessary to execute "Restart logging operation history data"


(cnc_startophis) to make the sampling stop time of the history data a
minimum as soon as the lead ends.

The record number of the beginning/end is an applied number of each


record of the operation history data.
The record number is effective from the execution of "Stop logging
operation history data" to the execution of "Restart logging operation
history data".

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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).

397
ODBHIS 0 +---------+ ---
| s_no | ^
2 +---------+ |
| type | |
4 +---------+ |
| e_no | |
6 +---------+---------+ length
| data[0] | |
14 +-------------------+ |
= = |
6+8*(n-1) +-------------------+ |
| data[n] | v
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 +-----------------------+

398
data.rec_date 0 +-----------------------+
| rec_type |
2 +-----------+-----------+
| year |
3 +-----------+
| month |
4 +-----------+
| day |
5 +-----------+
| pw_flg |
6 +-----------+
| dummy[0] |
7 +-----------+
| dummy[1] |
8 +-----------+

data.rec_time 0 +-----------------------+
| rec_type |
2 +-----------+-----------+
| hour |
3 +-----------+
| minute |
4 +-----------+
| second |
5 +-----------+
| pw_flg |
6 +-----------+
| dummy[0] |
7 +-----------+
| dummy[1] |
8 +-----------+

his Pointer to the ODBHIS structure by which the operation history


data is stored. The ODBHIS structure is as follows.

typedef struct odbhis {


unsigned s_no; /* Start record number */
short type; /* Not used */
unsigned e_no; /* Most recently entered */
/* record number */
union {
struct {
short rec_type; /* Record type */
short alm_grp; /* Alarm type */
short alm_no; /* Alarm number */
char axis_no; /* Axis number */
char dummy; /* Not used */
} rec_alm; /* Structure of alarm */
/* record */
struct {
short rec_type; /* Record type */
char key_code; /* Key code */
char pw_flag; /* Power-on flag */
char dummy[4]; /* Not used */
} rec_mdi; /* Structure of */
/* MDI key record */

399
struct {
short rec_type; /* Record type */
char sig_name; /* Signal name */
char sig_old; /* Bit pattern before a */
/* transition */
char sig_new; /* Bit pattern after a */
/* transition */
char dummy; /* Not used */
short sig_no; /* Signal number */
} rec_sgn; /* Structure of signal */
/* record */
struct {
short rec_type; /* Record type */
char year; /* Year */
char month; /* Month */
char day; /* Day */
char pw_flag; /* Power-on flag */
char dummy[2]; /* Not used */
} rec_date; /* Structure of date */
/* record */
struct {
short rec_type; /* record type */
char hour; /* Hour */
char minute; /* Minute */
char second; /* Second */
char pw_flag; /* Power-on flag */
char dummy[2]; /* Not used */
} rec_time; /* Structure of Time */
/* record */
} data[N]; /* N : Number of record */
} ODBHIS ;
rec_type Record type
0 : MDI key history
1 : Signal history
2 : Alarm history
3 : Date history
4 : Time history
5 : MDI key history for SUB (only Series 160/180/210)
6 : Signal history for SUB (only Series 160/180/210)
7 : Alarm history for SUB (only Series 160/180/210)
alm_grp Alarm type
Series 150
bit 0 : Background P/S (BG)
bit 1 : Foreground P/S (PS)
bit 2 : Over heat alarm (OH)
bit 3 : Sub-CPU error (SB)
bit 4 : Syncronized error (SN)
bit 5 : Parameter switch on (SW)
bit 6 : Over travel, external data (OT)
bit 7 : PMC error (PC)
bit 8 : External alarm message (EX)
bit 9 : (Not used)
bit 10 : Serious P/S (SR)
bit 11 : (Not used)
bit 12 : Servo alarm (SV)
bit 13 : I/O error (IO)
bit 14 : Power off parameter set (PW)
bit 15 : (Not used)

400
Series 160/180/210
bit 0 : P/S 100
bit 1 : P/S 000
bit 2 : P/S 101
bit 3 : P/S others
bit 4 : Over travel
bit 5 : Over heat
bit 6 : Servo alarm
bit 7 : (Not used)
bit 8 : APC alarm
bit 9 : Spindle alarm
bit 10 : P/S 5000,.., punchpress alarm
bit 11 : Laser alarm
bit 12 : (Not used)
bit 13 : Rigid tap alarm
bit 14 : (Not used)
bit 15 : External alarm message
alm_no Alarm number
axis_no Axis number(only Series 150)
"0" is stored for an unrelated alarm to the
axis.
key_code Key code
pw_flag Power-on flag
1 : For power on
0 : Usually, "0" is stored
sig_name Signal name
1 : X
2 : G
3 : Y
4 : F
sig_old Bit pattern before a transition
sig_new Bit pattern after a transition
sig_no Signal number
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
year Year (from 0 to 99)
month Month (from 1 to 12)
data Date (from 1 to 31)
hour Hour (from 0 to 23)
minute Minute (from 0 to 59)
second Second (from 0 to 59)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC cnc_stopophis function has not been executed.
EW_LENGTH Data block length error
Size of ODBHIS structure(length) is wrong.
(e_no-s_no+1) * sizeof(data[0]) + 6 < length
EW_NOOPT No option
The extended driver/library function is
necessary.

401
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function relates to the following parameter.


See the manual of CNC parameter for details.
Series 150 0015#3=1 --- influenced by setting
Series 160/180/210 3112#5=0 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

402
(5) Read Number of Alarm History Data

Function Name:
cnc_rdalmhisno

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdalmhisno(unsigned short FlibHndl,
unsigned short *hisno);
Description:
Reads the number of alarm history the data.
It is necessary to stop sampling the alarm history data by using
cnc_stopophis() function before this function is used.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

hisno Pointer to the variable by which the number of alarm history


data is stored.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC cnc_stopophis function has not been executed.
EW_NOOPT No option
The extended driver/library function is
necessary.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function relates to the following parameter.


See the manual of CNC parameter for details.
Series 160/180/210 3112#5=0 --- influenced by setting

CNC mode: This function can be used in any CNC mode.


Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

403
(6) Read Alarm History Data

Function Name:
cnc_rdalmhistry

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);
Description:
Reads the alarm history data.
The unit of one alarm history data is called a record.

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.

It is necessary to execute "Restart logging operation history data"


(cnc_startophis) to make the sampling stop time of the history data a
minimum as soon as the read ends.

The record number of the beginning/end is an applied number of each


record of the alarm history data.
This record number is effective from the execution of "Stop logging
operation history data" to the execution of "Restart logging operation
history data".

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 +-------------------+ -+-

404
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 +-------------+

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 */
char month; /* Month */
char day; /* Day */
char hour; /* Hour */
char minute; /* Minute */
char second; /* Second */
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 ;

405
alm_grp Alarm type
Series 150
bit 0 : Background P/S
bit 1 : Foreground P/S
bit 2 : Over heat alarm
bit 3 : Sub-CPU error
bit 4 : Synchronized error
bit 5 : Parameter switch on
bit 6 : Over travel, external data
bit 7 : PMC error
bit 8 : External alarm message
bit 9 : (Not used)
bit 10 : Serious P/S
bit 11 : (Not used)
bit 12 : Servo alarm
bit 13 : I/O error
bit 14 : Power off parameter set
bit 15 : (Not used)
Series 160/180/210
Not used
alm_no Alarm number
Macro alarm : bit15=1(only Series 150)
axis_no Axis number(from 1 to maximum controlled axis)
It is unused for an unrelated alarm to the axis.
year Year (from 0 to 99)
month Month (from 1 to 12)
data Day (from 1 to 31)
hour Hour (from 0 to 23)
minute Minute (from 0 to 59)
second Second (from 0 to 59)
len_msg Length of alarm message (from 0 to 32)
alm_msg Alarm message

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC cnc_stopophis function has not been executed.
EW_LENGTH Data block length error
Size of ODBAHIS structure(length) is wrong.
(e_no-s_no+1) * sizeof(data[0]) + 6 < length
EW_NOOPT No option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function relates to the following parameter.


See the manual of CNC parameter for details.

Series 160/180/210 3112#5=0 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

406
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

407
(7) Clear Operation History Data

Function Name:
cnc_clearophis

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_clearophis(unsigned short FlibHndl,
short slct);
Description:
Clears the opeation history data and the alarm history data.
Both the operation history and the alarm history are always cleared
in Series 150.
It is possible to be selected the operation history or the alarm
history by setting "slct" in Series 160/180/210.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

slct Specify the kind of the cleared history data.


(only Series 160/180/210)
0 : the operation history data
1 : the alarm history data

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_ATTRIB Data attribute error
The specification of "kind of the cleared
history data" (slct) is wrong.
EW_PARAM CNC parameter error
CNC parameter should be as follows.
(Series 150) 0015#4=1
(Series 160/180/210) 3112#5=0
EW_NOOPT No option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function relates to the following parameter.


See the manual of CNC parameter for details.

Series 150 0015#4=1 --- must be on

Series 160/180/210 3112#5=0 --- must be off

CNC mode: This function can be used in any CNC mode.

408
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

409
(8) Read Signals Related Operation History

Function Name:
cnc_rdhissgnl

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdhissgnl(unsigned short FlibHndl,
IODBSIG *sig);
Description:
Reads the target signal for the operation history.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

410
CNC option: This function needs the extended driver/library option.

CNC parameter: This function relates to the following parameter.


See the manual of CNC parameter for details.

Series 150 0015#3=1 --- influenced by setting

Series 160/180/210 3112#5=0 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

411
(9) Write Signals Related Operation History

Function Name:
cnc_wrhissgnl

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrhissgnl(unsigned short FlibHndl,
IODBSIG *sig);
Description:
Writes the operation history object signal.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_ATTRIB Data attribute error
The specification of "Number of signals"(type)
is wrong.

412
EW_DATA Data error
Detail status are set in global variable
cnc_errno (short).
0 : Completion status other than <5>
1 : Registration number error
2 : Signal number error
3 : Signal address error
The array number that the wrong data is
included in cnc_errdtno (short) of a global
variable.
EW_NOOPT No option
The extended driver/library function is
necessary.
EW_PARAM CNC parameter error
CNC parameter should be as follows.
(Series 150) 0013#5=1
(Series 160/180/210) 3112#5=0

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function relates to the following parameter.


See the manual of CNC parameter for details.

Series 150 0013#5=1 --- must be on

Series 160/180/210 3112#5=0 --- must be off

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

413
(10) Stop Logging External Operator's Message History Data

Function Name:
cnc_stopomhis

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_stopomhis(unsigned short FlibHndl);

Description:
Stops logging the external operator's message history data.

The sequence of reading the external operator's message history data is


as follows.
+-------------------+
| cnc_stopomhis() | stop logging
+---------+---------+ (must be done)
|
+---------+---------+
| cnc_rdomhisinfo() | read history data information
+---------+---------+
|
+---------+---------+
| cnc_rdomhistry() | read history data
+---------+---------+
|
+---------+---------+
| cnc_startomhis() | restart logging
+-------------------+ (must be done)

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The external message option or the external
data input option, and the extended driver/
library option are necessary.
EW_PARAM CNC parameter error
CNC parameter '3112#2' must be 1.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the external message option or the external
data input option, and the extended driver/library option.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 160/180/210 3112#2=1 --- must be set

414
CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

415
(11) Restart Logging External Operator's Message History Data

Function Name:
cnc_startomhis

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_startomhis(unsigned short FlibHndl);

Description:
Restarts logging the external operator's message history data.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The external message option or the external
data input option, and the extended driver/
library option are necessary.
EW_PARAM CNC parameter error
CNC parameter '3112#2' must be 1.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the external message option or the external
data input option, and the extended driver/library option.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 160/180/210 3112#2=1 --- must be set

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

416
(12) Read External Operator's Message History Data Information

Function Name:
cnc_rdomhisinfo

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdomhisinfo(unsigned short FlibHndl,
ODBOMIF *hisif);
Description:
Reads the maximum number, current number and maximum string length of
external operator's message history data.
It is necessary to stop logging the external operator's message history
data by using cnc_stopomhis() function before this function is used.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

hisif Pointer to the ODBOMIF structure for the maximum number,


current number and maximum string length of external operator's
message history data. The ODBOMIF structure is as follows.

typedef struct odbomif {


unsigned short om_max ; /* maximum number */
unsigned short om_sum ; /* current number */
unsigned short om_char ; /* maximum string length */
} ODBOMIF ; /* of external operator's */
/* message history data */

3113#7 3113#6 max.number max.length(including 'NULL')


-------+-------+----------+----------------------------
0 0 8 256
0 1 10 201
1 0 18 101
1 1 32 51

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC cnc_stopomhis function has not been executed.
EW_NOOPT No option
The external message option or the external
data input option, and the extended driver/
library option are necessary.
EW_PARAM CNC parameter error
CNC parameter '3112#2' must be 1.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the external message option or the external
data input option, and the extended driver/library option.

417
CNC parameter: This function relates to the following CNC parameter.
See the manual of CNC parameter for details.

Series 160/180/210 3112#2=1 --- must be set

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

418
(13) Read External Operator's Message History Data

Function Name:
cnc_rdomhistry

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdomhistry(unsigned short FlibHndl,
unsigned short s_no,unsigned short &number,ODBOMHIS *his);
Description:
Reads the external operator's message history data.

Because the external operator's message history data is recorded


automatically by CNC, it is necessary to stop logging by using
cnc_stopomhis() function before this function is used.

In order to minimize the time which the logging has been stopped,
restart logging by using cnc_startomhis() function as soon as reading
history data has been finished

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_no Specify the beginning record number.(0, 1, 2,...)

number Specify the pointer to the number of history data to be read.


Set the number of history data to be read at a time, and this
function returns the number of history data to be read actually.

his Pointer to the ODBOMIF structure for the external operator's


message history data. The ODBOMIF structure is as follows.
typedef struct odbomhis {
short om_no; /* operator's message number */
short year; /* year */
short month; /* month */
short day; /* day */
short hour; /* hour */
short minute; /* minute */
short second; /* second */
char om_msg[256]; /* operator's message */
} ODBOMHIS ;

om_no operator's message number


year year (0,...,99)
month month (1,...,12)
day day (1,...,31)
hour hour (0,...,23)
minute minute (0,...,59)
second second (0,...,59)
om_msg operator's message
The last character is 'NULL(\0)'.

419
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC cnc_stopomhis function has not been executed.
EW_LENGTH Data block length error
Number of data(number) is wrong.
EW_NUMBER Data number error
Start number(s_no) is wrong.
EW_NOOPT No option
The external message option or the external
data input option, and the extended driver/
library option are necessary.
EW_PARAM CNC parameter error
CNC parameter '3112#2' must be 1.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the external message option or the external
data input option, and the extended driver/library option.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 160/180/210 3112#2=1 --- must be set


3113#6,7 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

420
(14) Clear External Operator's Message History Data

Function Name:
cnc_clearomhis

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_clearomhis(unsigned short FlibHndl);

Description:
Clears the external operator's message history data.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 CNC data window" in "General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The external message option or the external
data input option, and the extended driver/
library option are necessary.
EW_PARAM CNC parameter error
CNC parameter '3112#2', '3113#0' must be 1.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the external message option or the external
data input option, and the extended driver/library option.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 160/180/210 3112#2=1 --- must be set


3113#0=1 --- must be set

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

421
1.1.12 Function Reference Related to Servo/Spindle

(1) Read Loop Gain for Servo Adjustment

Function Name:
cnc_rdloopgain

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdloopgain(unsigned short FlibHndl, long *gain);

Description:
Reads "The servo adjustment loop gain".

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

gain Specify the address of the array to store the loop gain for
servo adjustment. The number of array must be equal to the
number of maximum controlled axis. The data within the number
of controlled axis is valid.
long gain[MAX_AXIS] ; /* MAX_AXIS : max. controlled axes */

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 CNC data window" in "General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The extended driver/library function is
necessary.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.


CNC parameter: This function does not relate to CNC parameter.
CNC mode: This function can be used in any CNC mode.
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

422
(2) Read Real Current for Servo Adjustment

Function Name:
cnc_rdcurrent

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdcurrent(unsigned short FlibHndl,
short *crrnt);
Description:
Reads "The servo adjustment real current".

When the following parameter is '0', '0' is always returned.


Series 150 1979
Series 160/180/210,NC board 2086

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

crrnt Specify the address of the array to store the real current for
servo adjustment. The number of array must be equal to the
number of maximum controlled axis. The data within the number
of controlled axis is valid.
short crrnt[MAX_AXIS] ; /* MAX_AXIS : max. controlled axes */

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function relates to the following CNC parameters.


See the manual of CNC parameter for details.

Series 150 1979 --- influenced by setting

Series 160/180/210,NC board


2086 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

423
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

424
(3) Read Real Speed for Servo Adjustment

Function Name:
cnc_rdsrvspeed

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdsrvspeed(unsigned short FlibHndl,
long *speed);
Description:
Reads "The servo adjustment real speed".

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

speed Specify the address of the array to store the real speed for
servo adjustment. The number of array must be equal to the
number of maximum controlled axis. The data within the number
of controlled axis is valid.
long speed[MAX_AXIS] ; /* MAX_AXIS : max. controlled axes */

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

425
(4) Read Number of Spindle

Function Name:
cnc_rdnspdl

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdnspdl(unsigned short FlibHndl,short *spdl);

Description:
Reads the number of spindles which CNC can control.
It is not the number of mounted spindles.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

spdl Specify the address of the variable to store the number of


spindles.
Series 150 : 0 <--> 2
Series 160/180 : 0 <--> 3
Series 210,NC board : 0 <--> 1

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The serial spindle function(only Series 150)
and the extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The serial spindle function(only Series 150) and the extended
driver/library function is necessary.

CNC parameter: This function relates to the following CNC parameters.


See the manual of CNC parameter for details.

Series 150 Parameters concerning the serial spindle output


function and the Cs contouring control function.
Parameters concerning the spindle control function.

Series 160/180/210,NC board


Parameters concerning the spindle control function.

CNC mode: This function can be used in any CNC mode.

426
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

427
(5) Read Operation Mode for Spindle Adjustment

Function Name:
cnc_rdopmode

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdopmode(unsigned short FlibHndl,
short *mode);
Description:
Reads "The operation mode for spindle adjustment".

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

mode Specify the address of the array to store the operation mode
for spindle adjustment.
The number of array must be equal to the following.
Series 150 : 2
Series 160/180/210,NC board : 3
The data within the number of spindles acquired by
"cnc_rdnspdl()" is valid.
short mode[N] ; /* N : max. spindle number */

The meaning of the operation mode for the spindle adjustment is


as follows.
0 : Others
1 : Normal operation
2 : Orientation
3 : Synchronous control
4 : Rigid tapping
5 : Cs contouring control
6 : Spindle positioning control
(only Series 160T/180T)

* "Others" within above-mentioned mode shows the status which


CNC does not control the spindle.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The serial spindle function and the extended
driver/library function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

428
CNC option: The following functions are necessary for this function.
The serial spindle function
The extended driver/library function

This function relates to the following CNC options.


The spindle orientation function
The rigid tapping function
The Cs contouring control function
The spindle positioning function(only Series 160T/180T)
The multi spindle control(only Series 160T/180T)

CNC parameter: This function relates to the following CNC parameters.


See the manual of CNC parameter for details.

Series 150 Parameters concerning the serial spindle output


function and the Cs contouring control function.
Parameters concerning the spindle control function.

Series 160/180/210,NC board


Parameters concerning the spindle control function.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

429
(6) Read Position Deflection S for Spindle Adjustment

Function Name:
cnc_rdposerrs

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdposerrs(unsigned short FlibHndl,
long *poserr);
Description:
Reads "The position deflection S for spindle adjustment".

The position deflection S is valid only when the operation mode is as


follows.
Orientation
Rigid tapping
Cs contouring control
Spindle positioning control(only Series 160T/180T)

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

poserr Specify the address of the array to store the position


deflection S for spindle adjustment.
The number of array must be equal to the following.
Series 150 : 2
Series 160/180/210,NC board : 3
The data within the number of spindles acquired by
"cnc_rdnspdl()" is valid.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The serial spindle function and the extended
driver/library function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The following functions are necessary for this function.
The serial spindle function
The extended driver/library function

This function relates to the following CNC options.


The spindle orientation function
The rigid tapping function
The Cs contouring control function
The spindle positioning function(only Series 160T/180T)
The multi spindle control(only Series 160T/180T)

430
CNC parameter: This function relates to the following CNC parameters.
See the manual of CNC parameter for details.

Series 150 Parameters concerning the serial spindle output


function and the Cs contouring control function.
Parameters concerning the spindle control function.

Series 160/180/210,NC board


Parameters concerning the spindle control function.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

431
(7) Read Position Deflection S1, S2 for Spindle Adjustment
(Synchronous Control Mode)

Function Name:
cnc_rdposerrs2

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdposerrs2(unsigned short FlibHndl,
ODBPSER *pser);
Description:
Reads "The position deflection S1, S2 for spindle adjustment" in the
synchronous control mode.

The position deflection S1, S2 is valid only during the synchronous


control mode.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

pser Pointer to the ODBPSER structure including the position


deflection S1, S2 for spindle adjustment.
The ODBPSER structure is as follows.
typedef struct odbpser {
long poserr1 ; /* position deflection S1 */
long poserr2 ; /* position deflection S2 */
} ODBPSER ;

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The serial spindle function and the extended
driver/library function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The following functions are necessary for this function.
The serial spindle function
The extended driver/library function

This function relates to the following CNC options.


The spindle orientation function
The rigid tapping function
The Cs contouring control function
The spindle positioning function(only Series 160T/180T)
The multi spindle control(only Series 160T/180T)

432
CNC parameter: This function relates to the following CNC parameters.
See the manual of CNC parameter for details.

Series 150 Parameters concerning the serial spindle output


function and the Cs contouring control function.
Parameters concerning the spindle control function.

Series 160/180 Parameters concerning the spindle control function.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

433
(8) Read Position Deflection Z of Tapping Axis for Spindle Adjustment
(Rigid Tapping Mode)

Function Name:
cnc_rdposerrz

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdposerrz(unsigned short FlibHndl,
long *poserrz);
Description:
Reads "The position deflection Z for spindle adjustment" in the rigid
tapping mode.

The position deflection Z is valid only during the rigid tapping mode.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

poserrz Specify the address of the variable to store the position


deflection Z of tapping axis for spindle adjustment.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The serial spindle function and the extended
driver/library function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The following functions are necessary for this function.
The serial spindle function
The extended driver/library function

This function relates to the following CNC options.


The spindle orientation function
The rigid tapping function
The Cs contouring control function
The spindle positioning function(only Series 160T/180T)
The multi spindle control(only Series 160T/180T)

CNC parameter: This function relates to the following CNC parameters.


See the manual of CNC parameter for details.

Series 150 Parameters concerning the serial spindle output


function and the Cs contouring control function.
Parameters concerning the spindle control function.

Series 160/180/210,NC board


Parameters concerning the spindle control function.

434
CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

435
(9) Read Synchronous Error for Spindle Adjustment (Synchronous Control Mode)

Function Name:
cnc_rdsynerrsy

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdsynerrsy(unsigned short FlibHndl,
long *synerr);
Description:
Reads "The synchronous error for spindle adjustment" in the synchronous
control mode.

The synchronous error in the rigid tapping mode is able to be acquired


by "cnc_rdsynerrrg()".

This synchronous error is valid only during the synchronous control


mode.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

synerr Specify the address of the variable to store the synchronous


error in the synchronous control mode.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The serial spindle function and the extended
driver/library function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The following functions are necessary for this function.
The serial spindle function
The extended driver/library function

This function relates to the following CNC options.


The spindle orientation function
The rigid tapping function
The Cs contouring control function
The spindle positioning function(only Series 160T/180T)
The multi spindle control(only Series 160T/180T)

436
CNC parameter: This function relates to the following CNC parameters.
See the manual of CNC parameter for details.

Series 150 Parameters concerning the serial spindle output


function and the Cs contouring control function.
Parameters concerning the spindle control function.

Series 160/180 Parameters concerning the spindle control function.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

437
(10) Read Synchronous Error for Spindle Adjustment (Rigid Tapping Mode)

Function Name:
cnc_rdsynerrrg

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdsynerrrg(unsigned short FlibHndl,
long *synerr);
Description:
Reads "The synchronous error for spindle adjustment" in the rigid
tapping mode.

The synchronous error in the synchronous control mode is able to be


acquired by "cnc_rdsynerrsy()".

This synchronous error is valid only during the rigid tapping mode.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

synerr Specify the address of the variable to store the synchronous


error in the rigid tapping mode.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The serial spindle function and the extended
driver/library function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The following functions are necessary for this function.
The serial spindle function
The extended driver/library function

This function relates to the following CNC options.


The spindle orientation function
The rigid tapping function
The Cs contouring control function
The spindle positioning function(only Series 160T/180T)
The multi spindle control(only Series 160T/180T)

438
CNC parameter: This function relates to the following CNC parameters.
See the manual of CNC parameter for details.

Series 150 Parameters concerning the serial spindle output


function and the Cs contouring control function.
Parameters concerning the spindle control function.

Series 160/180/210,NC board


Parameters concerning the spindle control function.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

439
(11) Read Spindle Alarm for Spindle Monitor

Function Name:
cnc_rdspdlalm

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdspdlalm(unsigned short FlibHndl,
char *alm_no);
Description:
Reads the alarm number corresponding to the message of "spindle alarm
for spindle monitor".

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

alm_no Specify the address of the array to store the alarm number for
"spindle alarm for spindle monitor".
The number of array must be equal to the following.
Series 150 : 2
Series 160/180/210,NC board : 3

The data within the number of spindles acquired by


"cnc_rdnspdl()" is valid.
char alarm_no[N] ; /* N : max. spindle number */

The messages for alarm number 1,..,38 are as follows.


The alarm except the following doesn't have the message.

01 : MOTOR OVERHEAT 25 : SERIAL TRANS.STOP


02 : SPEED ERR.EXCESS 26 : CS-VEL.DISCONNECT
03 : FUSE IN DC LINK 27 : POSITION CODER DISCONNECT
04 : FUSE IN AC INPUT 28 : CS-POSITION DISCONNECT
05 : FUSE ON P.C.B. 29 : OVERLOAD
07 : OVER SPEED 30 : INPUT OVER CURRENT
09 : HEATSINK OVERHEAT 31 : PG DISCONNECT
10 : LOW VOLTAGE 32 : SERIAL RAM ERROR
11 : DC LINK OVER VOLTAGE 33 : DC LINK LOW VOLTAGE
12 : DC LINK OVER CURRENT 34 : PARAMETER SETTING ERROR
13 : MEMORY ERROR 35 : GEAR RATIO SETTING ERROR
18 : SUM CHECK ERROR 36 : ERR.COUNT.OVERFLOW
19 : U PHASE OFFSET 37 : SPEED DETECTION
20 : V PHASE OFFSET 38 : MG SENSOR SIGNAL
24 : SERIAL DATA ERROR

440
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The serial spindle function and the extended
driver/library function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The following functions are necessary for this function.
The serial spindle function
The extended driver/library function

This function relates to the following CNC options.


The spindle orientation function
The rigid tapping function
The Cs contouring control function
The spindle positioning function(only Series 160T/180T)
The multi spindle control(only Series 160T/180T)

CNC parameter: This function relates to the following CNC parameters.


See the manual of CNC parameter for details.

Series 150 Parameters concerning the serial spindle output


function and the Cs contouring control function.
Parameters concerning the spindle control function.

Series 160/180/210,NC board


Parameters concerning the spindle control function.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

441
(12) Read Control Input Signal for Spindle Monitor

Function Name:
cnc_rdctrldi

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdctrldi(unsigned short FlibHndl,
ODBSPDI *spdi);
Description:
Reads "control input signal for spindle monitor".

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

spdi Pointer to the ODBSPDI structure array including the control


input signal for spindle monitor.
The number of array must be equal to the following.
Series 150 : 2
Series 160/180/210,NC board : 3
The data within the number of spindles acquired by
"cnc_rdnspdl()" is valid.
ODBSPDI spdi[N] ; /* N : max. spindle number */

The ODBSPDI structure is as follows.


typedef struct odbspdi {
char sgnl1 ; /* control input signal 1 */
char sgnl2 ; /* control input signal 2 */
char sgnl3 ; /* control input signal 3 */
char sgnl4 ; /* control input signal 4 */
} ODBSPDI ;

sgnl1 control input signal 1


#7 #6 #5 #4 #3 #2 #1 #0
+-----+-----+-----+-----+-----+-----+-----+-----+
| MRDY| ORCM| SFR | SRV | CTH1| CTH2| TLMH| TLML|
+-----+-----+-----+-----+-----+-----+-----+-----+
TLML : TORQUE LIMIT LOW SRV : REVERSE ROTATION
TLMH : TORQUE LIMIT HIGH SFR : OBVERSE ROTATION
CTH2 : CLUTCH/GEAR RATIO ORCM : ORIENTATION
CTH1 : CLUTCH/GEAR RATIO MRDY : MACHINE READY

sgnl2 control input signal 2


#7 #6 #5 #4 #3 #2 #1 #0
+-----+-----+-----+-----+-----+-----+-----+-----+
| RCH | RSL | INTG| SOCN| MCFN| SPSL| *ESP| ARST|
+-----+-----+-----+-----+-----+-----+-----+-----+
ARST : ALARM RESET SIGNAL SOCN : SOFT START STOP CANCEL
*ESP : EMERGENCY STOP INTG : SPEED INTEGRATION CONTROL SIGNAL
SPSL : SPINDLE SELECT RSL : OUTPUT SWITCH DEMAND SIGNAL
MCFN : POWER LINE SWITCH SIGNAL RCH : POWER LINE STAT SIGNAL

442
sgnl3 control input signal 3
#7 #6 #5 #4 #3 #2 #1 #0
+-----+-----+-----+-----+-----+-----+-----+-----+
| | | | | DEFM| NRRO| ROTA| INDX|
+-----+-----+-----+-----+-----+-----+-----+-----+
INDX : ORIENTATION STOP POSITION CHANGE
ROTA : ORIENTATION STOP POSITION CHANGE-ROTATION DIRECTION
NRRO : ORIENTATION STOP POSITION CHANGE-NEAR ROTATE
DEFM : DIFFERENCE VELOCITY MODE

sgnl4 control input signal 4


#7 #6 #5 #4 #3 #2 #1 #0
+-----+-----+-----+-----+-----+-----+-----+-----+
| | | | | | | | |
+-----+-----+-----+-----+-----+-----+-----+-----+

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The serial spindle function(only Series 150)
and the extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The following functions are necessary for this function.
The serial spindle function(only Series 150)
The extended driver/library function

This function relates to the following CNC options.


The spindle orientation function
The rigid tapping function
The Cs contouring control function
The spindle positioning function(only Series 160T/180T)
The multi spindle control(only Series 160T/180T)

CNC parameter: This function relates to the following CNC parameters.


See the manual of CNC parameter for details.

Series 150 Parameters concerning the serial spindle output


function and the Cs contouring control function.
Parameters concerning the spindle control function.

Series 160/180/210,NC board


Parameters concerning the spindle control function.

CNC mode: This function can be used in any CNC mode.

443
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

444
(13) Read Control Output Signal for Spindle Monitor

Function Name:
cnc_rdctrldo

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdctrldo(unsigned short FlibHndl,
ODBSPDO *spdo);
Description:
Reads "control output signal for spindle monitor".

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

spdo Pointer to the ODBSPDO structure array including the control


input signal for spindle monitor.
The number of array must be equal to the following.
Series 150 : 2
Series 160/180/210,NC board : 3
The data within the number of spindles acquired by
"cnc_rdnspdl()" is valid.
ODBSPDO spdo[N] ; /* N : max. spindle number */

The ODBSPDO structure is as follows.


typedef struct odbspdo {
char sgnl1 ; /* control output signal 1 */
char sgnl2 ; /* control output signal 2 */
char sgnl3 ; /* control output signal 3 */
char sgnl4 ; /* control output signal 4 */
} ODBSPDO ;

sgnl1 control output signal 1


#7 #6 #5 #4 #3 #2 #1 #0
+-----+-----+-----+-----+-----+-----+-----+-----+
| ORAR| TLM | LDT2| LDT1| SAR | SDT | SST | ALM |
+-----+-----+-----+-----+-----+-----+-----+-----+
ALM : ALARM SIGNAL LDT1 : LOAD DETECT SIGNAL1
SST : SPEED ZERO SIGNAL LDT2 : LOAD DETECT SIGNAL2
SDT : SPEED DETECT SIGNAL TLM : TORQUE LIMITING SIGNAL
SAR : SPEED ARRIVE SIGNAL ORAR : ORIENTATION FINISH SIGNAL

sgnl2 control output signal 2


#7 #6 #5 #4 #3 #2 #1 #0
+-----+-----+-----+-----+-----+-----+-----+-----+
| | | | | RCFN| RCHP| CFIN| CHP |
+-----+-----+-----+-----+-----+-----+-----+-----+
CHP : POWER LINE SWITCH SIGNAL
CFIN : SPINDLE CHANGE FINISH SIGNAL
RCHP : OUTPUT CHANGE SIGNAL
RCFN : OUTPUT CHANGE FINISH SIGNAL

sgnl3 control output signal 3


#7 #6 #5 #4 #3 #2 #1 #0
+-----+-----+-----+-----+-----+-----+-----+-----+
| | | | | | | | |
+-----+-----+-----+-----+-----+-----+-----+-----+

445
sgnl4 control output signal 4
#7 #6 #5 #4 #3 #2 #1 #0
+-----+-----+-----+-----+-----+-----+-----+-----+
| | | | | | | | |
+-----+-----+-----+-----+-----+-----+-----+-----+

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The serial spindle function(only Series 150)
and the extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The following functions are necessary for this function.
The serial spindle function(only Series 150)
The extended driver/library function

This function relates to the following CNC options.


The spindle orientation function
The rigid tapping function
The Cs contouring control function
The spindle positioning function(only Series 160T/180T)
The multi spindle control(only Series 160T/180T)

CNC parameter: This function relates to the following CNC parameters.


See the manual of CNC parameter for details.

Series 150 Parameters concerning the serial spindle output


function and the Cs contouring control function.
Parameters concerning the spindle control function.

Series 160/180/210,NC board


Parameters concerning the spindle control function.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

446
(14) Read Waveform Diagnosis Parameter

Function Name:
cnc_rdwaveprm

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdwaveprm(unsigned short FlibHndl,
IODBWAVE *wave);
Description:
Reads the waveform diagnosis parameter setting.

In case of using this function, the waveform diagnosis screen of CNC


must not be used. If used, the behavior of this function is not
guaranteed.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

wave Pointer to the IODBWAVE structure including the waveform


diagnosis parameter. The IODBWAVE structure is as follows.
typedef struct iodbwave {
short condition ; /* condition */
char trg_adr ; /* trigger address */
char trg_bit ; /* trigger bit */
short trg_no ; /* trigger number */
short delay ; /* delay time */
short t_range ; /* sampling time */
struct {
short kind ; /* kind of waveform data */
union {
#ifdef M_AXIS2 /* Series 150 : maximum axis=24 */
long axis ; /* axis information */
#else
short axis ; /* axis information */
#endif
struct { /* machine signal */
char adr ; /* kind of PMC address */
char bit ; /* bit number */
short no ; /* number of PMC address */
} io ;
} u ;
} ch[12] ;
} IODBWAVE ;

447
condition condition
One of the following condition is stored.
0 : The sampling of the data is started by
cnc_wavestart() function, and stopped after
sampling during the sampling time.
1 : The sampling of the data is started when the
trigger of the next item rose after calling
cnc_wavestart() function, and stopped after
sampling during the sampling time.
2 : The sampling of the data is started when the
trigger of the next item fell after calling
cnc_wavestart() function, and stopped after
sampling during the sampling time.
100 : The sampling of the data is started by
cnc_wavestart() function, and stopped when a servo
alarm has occurred.
101 : The sampling of the data is started by
cnc_wavestart() function, and stopped when a servo
alarm has occurred or the trigger has risen.
102 : The sampling of the data is started by
cnc_wavestart() function, and stopped when a servo
alarm has occurred or the trigger has fallen.

* In case of Series 160/180, the waveform data under the


condition 100,101,102 is backupped even if the power is
off.

trg_adr trigger address


The kind of PMC address which corresponds to machine signal
for a trigger is stored with ASCII code.
It is valid when condition is 1/2/101/102.
Kind of stored PMC address : "G","F","Y","X"

trg_bit trigger bit


The bit number of PMC address which corresponds to machine
signal for a trigger is stored.
It is valid when condition is 1/2/101/102.
Range of stored bit number : 0 - 7

trg_no trigger number


The PMC address number which corresponds to machine signal
for a trigger is stored.
It is valid when condition is 1/2/101/102.
Range of stored number is shown in pmc_rdpmcrng function
reference.

delay delay time


After the stop condition has been satisfied and this delay
time has passed, the sampling is stopped.
range
Series 150 0<-->32000
Series 160/180 0<-->32760
unit 1msec
It is valid when the condition is 100/101/102.

448
t_range sampling time
sampling time is stored.
range
Series 150 25/50/100/200/400/800 show the
following time respectively.
500/1000/2000/4000/8000/16000
Series 160/180 10<-->8192
unit 1msec
It is valid when the condition is 0/1/2.

ch[n].kind kind of waveform data


(n is channel number 0<-->11)

An available channel and the kind of the waveform data are


as follows according to the CNC model and the condition.

condition : 100/101/102

channel No (n) ch[n].kind (kind of waveform data)


---------------+---------------------------------------
Series 160/180 Series 150
---------------+-------------------+-------------------
0 0 0<->2, 4<->7
1 1 0<->2, 4<->7
2 2 0<->2, 4<->7
3 5 0<->2, 4<->7
4 6 not used
5 7 not used

condition : 0/1/2

channel No (n) ch[n].kind (kind of waveform data)


---------------+---------------------------------------
Series 160/180 Series 150
---------------+-------------------+-------------------
6 0<->3,5<->7,9<->13 0<->2,4<->7,9<->11
7 0<->3,5<->7,9<->13 0<->2,4<->7,9<->11
8 not used 13
9 not used 13
10 not used 13
11 not used 13

* If "-1" is stored in ch[n].kind, the data of its channel


is invalid. (The value of "kind" concerning an unused
channel is indefinite.)
* Select a following member of union properly according to
the value of ch[n].kind.
ch[n].u.axis -- kind : except '13'
ch[n].u.io ---- kind : '13'

449
- Kind of waveform data

number meaning unit Series160/180 Series 150


------+---------------------+---------------+-------------+-------------
0/1/2 100-102 0/1/2 100-102
------+---------------------+---------------+------+------+------+------

-1 No data -- O O O O
------+---------------------+---------------+------+------+------+------
0 Servo error Pulse(detection O O O O
(8msec) unit)
------+---------------------+---------------+------+------+------+------
1 Number of servo Pulse(detection O O O O
pulses to be generated unit)
------+---------------------+---------------+------+------+------+------
2 Servo torque %(max. current O O O O
ratio)
------+---------------------+---------------+------+------+------+------
3 Servo error Pulse(detection O X X X
(2msec) unit)
------+---------------------+---------------+------+------+------+------
4 Number of servo Pulse(detection X X O O
pulses after unit)
acceleration,deceleration
------+---------------------+---------------+------+------+------+------
5 Actual speed RPM O O X X
+---------------+------+------+------+------
Pulse(detection X X O O
unit)
------+---------------------+---------------+------+------+------+------
6 Value of the electric %(max. current O O O O
current command for ratio)
servo
------+---------------------+---------------+------+------+------+------
7 Data during heat %(OVC alarm O O O O
simulation ratio)
------+---------------------+---------------+------+------+------+------
9 Composite speed for Pulse(detection O X X X
for 1st,2nd,3rd axis unit)
+---------------------+---------------+------+------+------+------
Composite speed for MM/MIN or RPM X X O X
all axes
------+---------------------+---------------+------+------+------+------
10 Spindle speed %(max. spin O X X X
ratio)
+---------------+------+------+------+------
RPM X X O X
------+---------------------+---------------+------+------+------+------
11 Load meter for %(max. output O X O X
spindle ratio)
------+---------------------+---------------+------+------+------+------
12 Difference of spindle Pulse(detection O X X X
conversion error unit)
------+---------------------+---------------+------+------+------+------
13 on/off state of -- O X O X
specified machine
signal
O:available,X:not available

450
ch[n].u.axis axis information of waveform data
Axis information of waveform data is stored.
It is valid when the kind of waveform data is expect '13'.

Axis information of Series 150 and Series 160/180 are as


follows.

Series 150

Each bit according to the kind of waveform data is


as follows.

- Maximum axis <= 15


15 <-------------------------> 0 bit
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

kind of waveform data is 0 <--> 7


bit 0 ON : first axis designation
bit 1 ON : second axis designation
:
:
bit14 ON : 15-th axis designation
bit15 : not used

kind of waveform data is 9


bit 0 ON : first path designation
bit 1 ON : second path designation(only 150TT)
bit 2<->15: not used

kind of waveform data is 10,11


bit 0 ON : first spindle designation
bit 1 ON : second spindle designation
bit 2<->15: not used

- Maximum axis = 24
31 <----------.....----------> 0 bit
+-+-+-+-+-+-+-.....-+-+-+-+-+-+-+
+-+-+-+-+-+-+- -+-+-+-+-+-+-+

kind of waveform data is 0 <--> 7


bit 0 ON : first axis designation
bit 1 ON : second axis designation
:
:
bit22 ON : 23-th axis designation
bit23 ON : 24-th axis designation
bit24<->31: not used

kind of waveform data is 9


bit 0 ON : first path designation
bit 1 ON : second path designation(only 150TT)
bit 2<->31: not used

kind of waveform data is 10,11


bit 0 ON : first spindle designation
bit 1 ON : second spindle designation
bit 2<->31: not used

451
Series 160/180

Each bit according to channel number is as follows.


15 <-------------------------> 0 bit
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

channel 0 <--> 5

bit0 ON : first axis designation


bit1 ON : second axis designation
:
:
bit7 ON : eighth axis designation
bit8<->15: not used

channel 6, 7

The kind of waveform data is 0<-->3, 5<-->7


bit0 ON : first axis designation
bit1 ON : second axis designation
:
:
bit7 ON : eighth axis designation
bit8<->15: not used

The kind of waveform data is 10<-->11


bit0 ON : first spindle designation
bit1 ON : second spindle designation
bit2 ON : third spindle designation
bit3<->15: not used

ch[n].u.io.adr Kind of PMC address of machine signal


The kind of PMC address which corresponds to machine signal
to trace is stored with ASCII code.
It is valid only when condition is 0/1/2 and the kind of
waveform data is 13.
Kind of stored PMC address : "G","F","Y","X"

ch[n].u.io.bit bit number of machine signal


The bit number of PMC address which corresponds to machine
signal to trace is stored.
It is valid only when condition is 0/1/2 and the kind of
waveform data is 13.
Range of stored bit number : 0 - 7

ch[n].u.io.no number of PMC address of machine signal


The PMC address number which corresponds to machine signal
to trace is stored.
It is valid only when condition is 0/1/2 and the kind of
waveform data is 13.
Range of stored number is shown in pmc_rdpmcrng function
reference.

452
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The extended driver/library function is
necessary.
EW_PARAM CNC parameter error
(Only 3112#0=0 when CNC is turned on.
Series160/180) set 3112#0=1 and reboot.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function relates to the following CNC parameters.


See the manual of CNC parameter for details.

Series 150 none


Series 160/180 3112#0=1 --- must be set

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

453
(15) Write Waveform Diagnosis Parameter

Function Name:
cnc_wrwaveprm

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrwaveprm(unsigned short FlibHndl,
IODBWAVE *wave);
Description:
Writes the waveform diagnosis parameter.

In case of using this function, the waveform diagnosis screen of CNC


must not be used. If used, the behavior of this function is not
guaranteed.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

wave Pointer to the IODBWAVE structure including the waveform


diagnosis parameter. The IODBWAVE structure is as follows.
typedef struct iodbwave {
short condition ; /* condition */
char trg_adr ; /* trigger address */
char trg_bit ; /* trigger bit */
short trg_no ; /* trigger number */
short delay ; /* delay time */
short t_range ; /* sampling time */
struct {
short kind ; /* kind of waveform data */
union {
#ifdef M_AXIS2 /* Series 150 : maximum axis=24 */
long axis ; /* axis information */
#else
short axis ; /* axis information */
#endif
struct { /* machine signal */
char adr ; /* kind of PMC address */
char bit ; /* bit number */
short no ; /* number of PMC address */
} io ;
} u ;
} ch[12] ;
} IODBWAVE ;

454
condition condition
One of the following condition should be specified.
0 : The sampling of the data is started by
cnc_wavestart() function, and stopped after
sampling during the sampling time.
1 : The sampling of the data is started when the
trigger of the next item rose after calling
cnc_wavestart() function, and stopped after
sampling during the sampling time.
2 : The sampling of the data is started when the
trigger of the next item fell after calling
cnc_wavestart() function, and stopped after
sampling during the sampling time.
100 : The sampling of the data is started by
cnc_wavestart() function, and stopped when a servo
alarm has occurred.
101 : The sampling of the data is started by
cnc_wavestart() function, and stopped when a servo
alarm has occurred or the trigger has risen.
102 : The sampling of the data is started by
cnc_wavestart() function, and stopped when a servo
alarm has occurred or the trigger has fallen.

* In case of Series 160/180, the waveform data under the


condition 100,101,102 is backupped even if the power is
off.

trg_adr trigger address


Specify the kind of PMC address which corresponds to
machine signal for a trigger with ASCII code.
It is valid when condition is 1/2/101/102.
Kind of stored PMC address : "G","F","Y","X"
- NULL(0x00) invalidates the setting.

trg_bit trigger bit


Specify the bit number of PMC address which corresponds to
machine signal for a trigger.
It is valid when condition is 1/2/101/102.
Range of stored bit number : 0 - 7

trg_no trigger number


Specify the PMC address number which corresponds to
machine signal for a trigger.
It is valid when condition is 1/2/101/102.
Range of stored number is shown in pmc_rdpmcrng function
reference.

delay delay time


After the stop condition has been satisfied and this delay
time has passed, the sampling is stopped.
range
Series 150 0<-->32000
Series 160/180 0<-->32760
unit 1msec
It is valid when the condition is 100/101/102.

455
t_range sampling time
sampling time is stored.
range
Series 150 25/50/100/200/400/800 show the
following time respectively.
500/1000/2000/4000/8000/16000
Series 160/180 10<-->8192
unit 1msec
It is valid when the condition is 0/1/2.

ch[n].kind kind of waveform data


( n is channel number 0<-->11)

Specify the number in the table of "Kind of waveform data"


on the next page.

An available channel and the kind of the waveform data are


as follows according to the CNC model and the condition.

condition : 100/101/102

channel No (n) ch[n].kind (kind of waveform data)


---------------+---------------------------------------
Series 160/180 Series 150
---------------+-------------------+-------------------
0 0 0<->2, 4<->7
1 1 0<->2, 4<->7
2 2 0<->2, 4<->7
3 5 0<->2, 4<->7
4 6 not used
5 7 not used

condition : 0/1/2

channel No (n) ch[n].kind (kind of waveform data)


---------------+---------------------------------------
Series 160/180 Series 150
---------------+-------------------+-------------------
6 0<->3,5<->7,9<->13 0<->2,4<->7,9<->11
7 0<->3,5<->7,9<->13 0<->2,4<->7,9<->11
8 not used 13
9 not used 13
10 not used 13
11 not used 13

* If "-1" is stored in ch[n].kind, the data of its channel


is invalid. (The value of "kind" concerning an unused
channel is indefinite.)
* Select a following member of union properly according to
the value of ch[n].kind.
ch[n].u.axis -- kind : except '13'
ch[n].u.io ---- kind : '13'

456
- Kind of waveform data

number meaning unit Series160/180 Series 150


------+---------------------+---------------+-------------+-------------
0/1/2 100-102 0/1/2 100-102
------+---------------------+---------------+------+------+------+------
-1 No data -- O O O O
------+---------------------+---------------+------+------+------+------
0 Servo error Pulse(detection O O O O
(8msec) unit)
------+---------------------+---------------+------+------+------+------
1 Number of servo Pulse(detection O O O O
pulses to be generated unit)
------+---------------------+---------------+------+------+------+------
2 Servo torque %(max. current O O O O
ratio)
------+---------------------+---------------+------+------+------+------
3 Servo error Pulse(detection O X X X
(2msec) unit)
------+---------------------+---------------+------+------+------+------
4 Number of servo Pulse(detection X X O O
pulses after unit)
acceleration,deceleration
------+---------------------+---------------+------+------+------+------
5 Actual speed RPM O O X X
+---------------+------+------+------+------
Pulse(detection X X O O
unit)
------+---------------------+---------------+------+------+------+------
6 Value of the electric %(max. current O O O O
current command for ratio)
servo
------+---------------------+---------------+------+------+------+------
7 Data during heat %(OVC alarm O O O O
simulation ratio)
------+---------------------+---------------+------+------+------+------
9 Composite speed for Pulse(detection O X X X
for 1st,2nd,3rd axis unit)
+---------------------+---------------+------+------+------+------
Composite speed for MM/MIN or RPM X X O X
all axes
------+---------------------+---------------+------+------+------+------
10 Spindle speed %(max. spin O X X X
ratio)
+---------------+------+------+------+------
RPM X X O X
------+---------------------+---------------+------+------+------+------
11 Load meter for %(max. output O X O X
spindle ratio)
------+---------------------+---------------+------+------+------+------
12 Difference of spindle Pulse(detection O X X X
conversion error unit)
------+---------------------+---------------+------+------+------+------
13 on/off state of -- O X O X
specified machine
signal
O:available,X:not available

457
ch[n].u.axis axis information of waveform data
Specify the axis information of waveform data.
It is valid when the kind of waveform data is expect '13'.
'0' invalidates the setting of its channel.

Axis information of Series 150 and Series 160/180 are as


follows.

Series 150

Each bit according to the kind of waveform data is


as follows.
Plural bits cannot be set.
In case that condition is 0/1/2, channel number 6, 7
are valid.
In case that condition is 100/101/102, channel number
0,..,3 are valid.
Channel 0 and 1, channel 2 and 3 must be set the same.
If not, channel 0 and 2 is valid.

- Maximum axis <= 15


15 <-------------------------> 0 bit
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

kind of waveform data is 0 <--> 7


bit 0 ON : first axis designation
bit 1 ON : second axis designation
:
:
bit14 ON : 15-th axis designation
bit15 : not used

kind of waveform data is 9


bit 0 ON : first path designation
bit 1 ON : second path designation(only 150TT)
bit 2<->15: not used

kind of waveform data is 10,11


bit 0 ON : first spindle designation
bit 1 ON : second spindle designation
bit 2<->15: not used

- Maximum axis = 24
31 <----------.....----------> 0 bit
+-+-+-+-+-+-+-.....-+-+-+-+-+-+-+
+-+-+-+-+-+-+- -+-+-+-+-+-+-+

kind of waveform data is 0 <--> 7


bit 0 ON : first axis designation
bit 1 ON : second axis designation
:
:
bit22 ON : 23-th axis designation
bit23 ON : 24-th axis designation
bit24<->31: not used

kind of waveform data is 9


bit 0 ON : first path designation
bit 1 ON : second path designation(only 150TT)
bit 2<->31: not used

458
kind of waveform data is 10,11
bit 0 ON : first spindle designation
bit 1 ON : second spindle designation
bit 2<->31: not used

Series 160/180

Each bit according to channel number is as follows.


15 <-------------------------> 0 bit
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

channel 0 <--> 5
bit0 ON : first axis designation
bit1 ON : second axis designation
:
:
bit7 ON : eighth axis designation
bit8<->15: not used
* Plural axes can be set by turning on two or
more bits.

channel 6, 7
The kind of waveform data is 0<-->3, 5<-->7
bit0 ON : first axis designation
bit1 ON : second axis designation
:
:
bit7 ON : eighth axis designation
bit8<->15: not used
* Plural axes cannot be set.

The kind of waveform data is 10<-->11


bit0 ON : first spindle designation
bit1 ON : second spindle designation
bit2 ON : third spindle designation
bit3<->15: not used
* Plural spindles cannot be set.

ch[n].u.io.adr Kind of PMC address of machine signal


Specify the kind of PMC address which corresponds to
machine signal to trace with ASCII code.
It is valid only when condition is 0/1/2 and the kind of
waveform data is 13.
Kind of stored PMC address : "G","F","Y","X"
- NULL(0x00) invalidates the setting.

ch[n].u.io.bit bit number of machine signal


Specify the bit number of PMC address which corresponds to
machine signal to trace.
It is valid only when condition is 0/1/2 and the kind of
waveform data is 13.
Range of stored bit number : 0 - 7

ch[n].u.io.no number of PMC address of machine signal


Specify the PMC address number which corresponds to machine
signal to trace.
It is valid only when condition is 0/1/2 and the kind of
waveform data is 13.
Range of specified number is shown in pmc_rdpmcrng function
reference.

459
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_DATA data error
Detaild status are set in global variable
cnc_errno (short).
0 : Error except EW_DATA
1 : Start condition(condition) error
2 : Trigger condition(trg_adr) error
3 : Trigger bit(trg_bit) error
4 : Trigger number(trg_no) error
5 : Delay time(delay) error
6 : Sampling time(t_range) error
7 : Kind of waveform data(ch[n].kind) error
8 : Axis information of waveform data
(ch[n].u.axis) error
9 : Kind of PMC address of machine signal
(ch[n].u.io.adr) error
10 : Bit number of PMC address of machine signal
(ch[n].u.io.bit) error
11 : PMC address number of machine signal
(ch[n].u.io.bit) error
Channel number(0 - 11) including incorrect data
is set in global variable cnc_errdtno (short).
(In case that a date is not related to channel,
-1 is set)

EW_NOOPT no option
The extended driver/library function is
necessary.

EW_PARAM CNC parameter error


(Only 3112#0=0 when CNC is turned on.
Series160/180) set 3112#0=1 and reboot.

EW_REJECT CNC execution denied


The waveform diagnosis data is being sampled.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function relates to the following CNC parameters.


See the manual of CNC parameter for details.

Series 150 none


Series 160/180 3112#0=1 --- must be set

CNC mode: This function can be used in any CNC mode.

460
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

461
(16) Start Sampling Waveform Diagnosis Data

Function Name:
cnc_wavestart

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wavestart(unsigned short FlibHndl);

Description:
Starts a sampling of the waveform diagnosis data.

In case of using this function, the waveform diagnosis screen of CNC


must not be used. If used, the behavior of this function is not
guaranteed.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The extended driver/library function is
necessary.
EW_PARAM CNC parameter error
(Only 3112#0=0 when CNC is turned on.
Series160/180) set 3112#0=1 and reboot.
EW_REJECT CNC execution denied
The waveform diagnosis parameter is not set
correctly.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function relates to the following CNC parameters.


See the manual of CNC parameter for details.

Series 150 none


Series 160/180 3112#0=1 --- must be set

CNC mode: This function can be used in any CNC mode.

462
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

463
(17) Stop Sampling Waveform Diagnosis Data

Function Name:
cnc_wavestop

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wavestop(unsigned short FlibHndl);

Description:
Stops a sampling of the waveform diagnosis data.
In case of using this function, the waveform diagnosis screen of CNC
must not be used. If used, the behavior of this function is not guaranteed.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 CNC data window" in "General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The extended driver/library function is
necessary.
EW_PARAM CNC parameter error
(Only 3112#0=0 when CNC is turned on.
Series160/180) set 3112#0=1 and reboot.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function relates to the following CNC parameters.


See the manual of CNC parameter for details.
Series 150 none
Series 160/180 3112#0=1 --- must be set

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

464
(18) Read Sampling Status of Waveform Diagnosis Data

Function Name:
cnc_wavestat

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wavestat(unsigned short FlibHndl,
short *stat);
Description:
Reads the sampling status of the waveform diagnosis data.

In case of using this function, the waveform diagnosis screen of CNC


must not be used. If used, the behavior of this function is not
guaranteed.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

stat Specify the address of the variable to store the sampling


status of waveform diagnosis data.
0 : sampling completed
1 : during sampling

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The extended driver/library function is
necessary.
EW_PARAM CNC parameter error
(Only 3112#0=0 when CNC is turned on.
Series160/180) set 3112#0=1 and reboot.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function relates to the following CNC parameters.


See the manual of CNC parameter for details.

Series 150 none


Series 160/180 3112#0=1 --- must be set

CNC mode: This function can be used in any CNC mode.

465
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

466
(19) Read Waveform Diagnosis Data

Function Name:
cnc_rdwavedata

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdwavedata(unsigned short FlibHndl,
short channel,short axis,long rd_pntr,long *number,
ODBWVDT *wvdt);
Description:
Reads waveform diagnosis data.

In case of using this function, the waveform diagnosis screen of CNC


must not be used. If used, the behavior of this function is not
guaranteed.
In case that the waveform diagnosis parameter is changed, the correct
data cannot be read if cnc_wavestart() function is not executed.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

channel Specify the channel number to read.


The available range of number is as follows.
Series 150 : 0<-->3, 6<-->11
Series 160/180 : 0<-->7

axis Specify axis number of data to read.(1<-->number of controlled


axis) This is invalid except channel number 0 <--> 5.
In case of Series 150, this is not used.

rd_pntr Specify the start pointer to read.

example)
In case of the top, '0' should be specified.
In case of the 10th from the top, '9' should be specified.

number Specify the address of the variable which shows the number of
data of the waveform diagnosis data.
Set the read number of data to this variable(*number).
After executing this function, the number of data which has
been read actually is set.

The maximum data number which can be sampled is shown in the


following table according to the condition and the CNC model.

model Series 160/180 Series 150


---------+-----------------------+------------------------
condition 0/1/2 100/101/102 0/1/2 100/101/102
---------+-----------+-----------+-----------+------------
maximum prm.15#6=
number 4096 8192 0:1000 2000
(n) 1:5000

467
wvdt Pointer to the ODBWVDT structure including the waveform
diagnosis data. The ODBWVDT structure is as follows.
typedef struct odbwvdt {
short channel ; /* channel number */
short kind ; /* kind of waveform data */
union {
short axis ; /* axis number of waveform data */
struct { /* machine signal */
char adr ; /* kind of PMC address */
char bit ; /* bit number */
short no ; /* PMC address number */
} io ;
} u ;
char year ; /* year (0<->99) */
char month ; /* month (1<->12) */
char day ; /* day (1<->31) */
char hour ; /* hour (0<->23) */
char minute ; /* minute (0<->59) */
char second ; /* second (0<->59) */
short t_cycle ; /* sampling cycle (msec) */
short data[8192] ; /* waveform diagnosis data */
} ODBWVDT ;

channel channel number


The channel number which has been read actually is set.

kind kind of waveform data


Refer to the kind of waveform data in cnc_rdwaveprm()
function.

- In case that "kind" is except 13(machine signal)

axis axis number of waveform data

Series 150

kind of waveform data is 0 <--> 7


1 <--> number of controlled axis : axis number

kind of waveform data is 9


1 <--> number of path : path number

kind of waveform data is 10, 11


1 <--> number of spindle : spindle number

Series 160/180

channel number 0 <--> 5


1 <--> number of controlled axis : axis number

channel number is 6,7 and kind of waveform data is


0 <--> 3, 5 <--> 7
1 <--> number of controlled axis : axis number

channel number is 6,7 and kind of waveform data is 10,11


1 <--> number of spindle : spindle number

468
- In case that "kind" is 13(machine signal)

adr kind of PMC address of machine signal


The kind of the PMC address which is traced is stored
with ASCII.
kind of PMC address to be set : G, F, Y, X

bit bit number of machine signal


The bit number of PMC address which is traced is stored.
range of bit number which is stored : 0 <--> 7

no number of PMC address of machine signal


The PMC address number which is traced is stored.
The range of stored number is shown in pmc_rdpmcrng().

year year (0<->99)


month month (0<->12)
day day (0<->31)
hour hour (0<->23)
minute minute (0<->59)
second second (0<->59)
If condition is 0/1/2, these are the date when sampling
is started.
If condition is 100/101/102, these are the date when
sampling is stopped.

t_cycle sampling cycle (msec)

model Series 160/180 Series 150


-------+-----------------------+------------------------
condition 0/1/2 100/101/102 0/1/2 100/101/102
-------+-----------+-----------+-----------+------------
cycle 2 8 2/4/8/16 8

data waveform diagnosis data


The data which is specified by "kind" is stored.
(In case of kind=13, this is 0/1. Othewise, this is
binary data)
Concerning the unit, etc., refer to the kind of the
waveform data in cnc_rdwaveprm() function.

Summary of the reading data

- In case that "kind" is except 13(machine signal)

structure size kind effecitve range


member (binary)
---------------+----+-----------------------+------------------
channel 2 channel number 0 ...
kind 2 kind of waveform data 0 <--> 12
axis 2 axis number of 1 <--> number of
waveform data controlled axis
(dummy) 2
year 1 year 0 <--> 99
month 1 month 0 <--> 12
day 1 dat 0 <--> 31
hour 1 hour 0 <--> 23
minute 1 minute 0 <--> 59
second 1 second 0 <--> 59
t_cycle 2 sampling cycle 2/4/8/16 (ms)

469
data[0] 2 waveform diagnosis data
data[1] 2 waveform diagnosis data
: : :
data[n-1] 2 waveform diagnosis data

- In case that "kind" is 13(machine signal)

structure size kind effecitve range


member (binary)
---------------+----+-----------------------+------------------
channel 2 channel number 6 ...
kind 2 kind of waveform data 13
adr 1 kind of PMC address ASCII code
of machine signal (G,F,Y,X)
bit 1 bit number of 0 <--> 7
machine signal
no 2 PMC address number 0 ...
of machine signal
year 1 year 0 <--> 99
month 1 month 0 <--> 12
day 1 day 0 <--> 31
hour 1 hour 0 <--> 23
minute 1 minute 0 <--> 59
second 1 second 0 <--> 59
t_cycle 2 sampling cycle Series 150
:2/4/8/16ms
Series 160/180:2ms
data[0] 2 waveform diagnosis data 0 or 1
data[1] 2 waveform diagnosis data 0 or 1
: : : :
data[n-1] 2 waveform diagnosis data 0 or 1

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC function is not executed
cnc_wavestop function has not been executed.
EW_LENGTH data block length error
The amount of data(*number) is less than 1.
EW_NUMBER data number error
Channel number(channel) is out of range.
EW_ATTRIB data attribute error
Axis number(axis) is out of range.
EW_DATA data error
Start pointer to read(rd_pntr) is out of range.
EW_NOOPT no option
The extended driver/library function is
necessary.
EW_PARAM CNC parameter error
(Only 3112#0=0 when CNC is turned on.
Series160/180) set 3112#0=1 and reboot.
EW_BUFFER buffer empty
There is no specified waveform diagnosis data.
(The case that the condition of a waveform
diagnosis does not correspond to the specified
channel number is included.)

470
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function relates to the following CNC parameters.


See the manual of CNC parameter for details.
Series 150 none
Series 160/180 3112#0=1 --- must be set

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

471
1.1.13 Function Reference Related to Data Server, DNC1, DNC2,
OSI-Ethernet

(1) Transfer File from Host to Data Server

Function Name:
cnc_dtsvftpget

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dtsvftpget(unsigned short FlibHndl,
char *net_file,char *nc_file);
Description:
Orders the data server to get file from the host computer.
Therefore, normal finish of this function shows that getting file from
the host computer has been started.
The result of getting file must be got by "cnc_dtsvftpstat()".

Don't use the data sever function(except DNC operation) at the CNC side
until either EW_OK or EW_DTSRVR of the completion status is got by
"cnc_dtsvftpstat()" after this function had been finished.

Req. ret=EW_BUSYret=EW_OK
/EW_DTSRVR
v v v
GET processing +---------------+
of file ----------+ +-----------------

prohibition term of using +-------------------+


data server ----------+ +-------------

* "Req." shows start request for getting file by


this function.
"ret=" is the completion status when
"cnc_dtsvftpstat()" is done.

Throughout the prohibition term, the completion status of the


following function is EW_BUSY.

cnc_dtsvftpget()
cnc_dtsvftpput()
cnc_dtsvdelete()
cnc_dtsvrdpgdir()
cnc_dtsvrdset()
cnc_dtsvwrset()
cnc_dtsvchkdsk()
cnc_dtsvhdformat()

Therefore, it is necessary to get either EW_OK or EW_DTSRVR of the


completion status by "cnc_dtsvftpstat()" when this function had
been executed.

472
Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

net_file
Specify the pointer to the file name in the host computer.

About the specification of the file name of the host computer:


- Use ASCII code.
- The last character of the file name must be 'NULL'.
- The maximum length of the file name is 256 including
'NULL'.
- It is impossible to specify the path.
(Specify the path by using "cnc_dtsvwrset()".)
- The lowercase can be used.
- The wild-card('*','?') cannot be used.

nc_file Specify the pointer to the file name in the data server.

About the specification of the file name of the data server:


- Use ASCII code.
- The last character of the file name must be 'NULL'.
- It is impossible to specify the path.
(The file is made in the directory "\PROG" of the
data server)
- The wild-card('*','?') cannot be used.
- Specify the MS-DOS form.
(file name 8 char.+'.'+extension 3 char.+'NULL',
total is within 13 char.)
<ex.> "XXXXXXXX.XXX" + "NULL"

However, the "O" number is managed as a file name now.


<ex.> "O0001" + "NULL"

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
Try again because data server is processing.
(There is a possibility of forgetting to call
"cnc_dtsvftpstat()" function.)
EW_NOOPT No option
- The extended driver/library function is
necessary.
- The data server board(hardware) is necessary.
EW_DTSRVR Data server error
The detailed status is set in the global
variable 'short cnc_errno'.
1 <--> 498 : data server error
499 : data server system error

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

473
CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

474
(2) Transfer File from Data Server to Host

Function Name:
cnc_dtsvftpput

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dtsvftpput(unsigned short FlibHndl,
char *net_file,char *nc_file);
Description:
Orders the data server to put file to the host computer.
Therefore, normal finish of this function shows that putting file to
the host computer has been started.
The result of putting file must be got by "cnc_dtsvftpstat()".

Don't use the data sever function(except DNC operation) at the CNC side
until either EW_OK or EW_DTSRVR of the completion status is got by
"cnc_dtsvftpstat()" after this function had been finished.

Req. ret=EW_BUSY ret=EW_OK


/EW_DTSRVR
v v v
PUT processing +---------------+
of file ----------+ +-----------------

prohibition term of using +-------------------+


data server ----------+ +-------------

* "Req." shows start request for getting file by


this function.
"ret=" is the completion status when
"cnc_dtsvftpstat()" is done.

Throughout the prohibition term, the completion status of the


following function is EW_BUSY.

cnc_dtsvftpget()
cnc_dtsvftpput()
cnc_dtsvdelete()
cnc_dtsvrdpgdir()
cnc_dtsvrdset()
cnc_dtsvwrset()
cnc_dtsvchkdsk()
cnc_dtsvhdformat()

Therefore, it is necessary to get either EW_OK or EW_DTSRVR of the


completion status by "cnc_dtsvftpstat()" when this function had
been executed.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

475
net_file
Specify the pointer to the file name in the host computer.

About the specification of the file name of the host computer:


- Use ASCII code.
- The last character of the file name must be 'NULL'.
- The maximum length of the file name is 256 including
'NULL'.
- It is impossible to specify the path.
(Specify the path by using "cnc_dtsvwrset()".)
- The lowercase can be used.
- The wild-card('*','?') cannot be used.

nc_file Specify the pointer to the file name in the data server.

About the specification of the file name of the data server:


- Use ASCII code.
- The last character of the file name must be 'NULL'.
- It is impossible to specify the path.
(The file is regarded as existing in the directory
"\PROG" of the data server)
- The wild-card('*','?') cannot be used.
- Specify the MS-DOS form.
(file name 8 char.+'.'+extension 3 char.+'NULL',
total is within 13 char.)
<ex.> "XXXXXXXX.XXX" + "NULL"

However, the "O" number is managed as a file name now.


<ex.> "O0001" + "NULL"

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
Try again because data server is processing.
(There is a possibility of forgetting to call
"cnc_dtsvftpstat()" function.)
EW_NOOPT No option
- The extended driver/library function is
necessary.
- The data server board(hardware) is necessary.
EW_DTSRVR Data server error
The detailed status is set in the global
variable 'short cnc_errno'.
1 <--> 498 : data server error
499 : data server system error

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

476
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

477
(3) Read Status of File Transfer between Host and Data Server

Function Name:
cnc_dtsvftpstat

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dtsvftpstat(unsigned short FlibHndl);

Description:
The execution result of "cnc_dtsvftpput()", "cnc_dtsvftpget()" function
can be got only once.
The completion status is as follows when this function is executed.

ret=EW_FUNC Req. ret=EW_BUSY ret=EW_OK ret=EW_FUNC


/EW_DTSRVR
v v v v v
processing +---------------+
of GET/PUT ----------+ +-----------------

* "Req." shows start request for putting/getting file


by "cnc_dtsvftpput()"/"cnc_dtsvftpget()" function.
"ret=" is the completion status when this function
is done.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
Try again because data server is processing.
EW_FUNC Function is not executed
- "PUT/GET" of file is not executed
Execute either "cnc_dtsvftpput()" or
"cnc_dtsvftpget()" beforehand.
EW_NOOPT No option
- The extended driver/library function is
necessary.
- The data server board(hardware) is necessary.
EW_DTSRVR Data server error
The detailed status is set in the global
variable 'short cnc_errno'.
1 <--> 498 : data server error
499 : data server system error

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

478
CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

479
(4) Read Directory in Data Server

Function Name:
cnc_dtsvrdpgdir

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dtsvrdpgdir(unsigned short FlibHndl,
char *nc_file,short number,ODBDSDIR *dsdir);
Description:
Reads the directory information in the data server.

If this function is executed while "cnc_dtsvftpput()" or


"cnc_dtsvftpget()" is executing(until the completion status is got by
"cnc_dtsvftpstat()"), EW_BUSY is returned.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

nc_file Specify the pointer to the first file name to read.


If 'NULL'(first character is 'NULL') is specified, it is
interpreted that the first file is specified.
If the specified file does not exist, it is interpreted that
the next file in alphabetical order which exists in the
directory is specified.
However, if the specified file is backward than the last file,
it is interpreted that the last file is specified.

<ex.> It is assumed that 15 files which consists of "O0001"<-->


"O0010" and "O0016"<-->"O0020" are registered in the data
server. In this case, if settings are as follows, the
information of 3 files starting from "O0016" is got.

nc_file = "O0013", number = 3

Aboutthe specification of the file name of the data server:


-Use ASCII code.
-The last character of the file name must be 'NULL'.
-It is impossible to specify the path.
(The file is regarded as existing in the directory
"\PROG" of the data server)
- The wild-card('*','?') cannot be used.
- Specify the MS-DOS form.
(file name 8 char.+'.'+extension 3 char.+'NULL',
total is within 13 char.)
<ex.> "XXXXXXXX.XXX" + "NULL"

However, the "O" number is managed as a file name now.


<ex.> "O0001" + "NULL"

number Specify the number of directory.


effective range : 1 <= number <= 32

480
dsdir Pointer to the ODBDSDIR structure including the directory
information in the data server.
The ODBDSDIR structure is as follows.
typedef struct odbdsdir {
long file_num ; /* number of files in hard disk */
long remainder ; /* remainder capacity of hard disk */
short data_num ; /* number of directory */
struct {
char file_name[16] ; /* file name */
char comment[64] ; /* comment */
long size ; /* file size */
char date[16] ; /* update date */
} data[32] ;
} ODBDSDIR ;

file_num Number of files registered in hard disk of the


data server

remainder The remainder capacity of hard disk of the data


server(byte)

data_num Number of directory

file_name File name

comment Comment
The comment just behind the file name is stored
by ASCII code. The character string is
terminated by 'NULL' and 64 characters or less
are stored including 'NULL'. However, LF is not
included.

size File size(byte)

date Update date of file


This is stored by the ASCII character string of
following form.
The character string is terminated by 'NULL'.

date = "11-11-11 11:11" + "NULL"


year | day | minute
month hour

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
Try again because data server is processing.
(The unexecution of "cnc_dtsvftpstat()" is
included.)
EW_NUMBER Data number error
The number of directory to read is wrong.
EW_NOOPT No option
- The extended driver/library function is
necessary.
- The data server board(hardware) is necessary.

481
EW_DTSRVR Data server error
The detailed status is set in the global
variable 'short cnc_errno'.
1 <--> 498 : data server error
499 : data server system error

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

482
(5) Delete File in Data Server

Function Name:
cnc_dtsvdelete

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dtsvdelete(unsigned short FlibHndl,
char *nc_file);
Description:
Deletes the file in the data server.

If this function is executed while "cnc_dtsvftpput()" or


"cnc_dtsvftpget()" is executing(until the completion status is got by
"cnc_dtsvftpstat()"), EW_BUSY is returned.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

nc_file Specify the pointer of the file name in the data server.

About the specification of the file name of the data server:


- Use ASCII code.
- The last character of the file name must be 'NULL'.
- It is impossible to specify the path.
(The file is regarded as existing in the directory
"\PROG" of the data server)
- The wild-card('*','?') can be used.
- Specify the MS-DOS form.
(file name 8 char.+'.'+extension 3 char.+'NULL',
total is within 13 char.)
<ex.> "XXXXXXXX.XXX" + "NULL"

However, the "O" number is managed as a file name now.


<ex.> "O0001" + "NULL"

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
Try again because data server is processing.
(The unexecution of "cnc_dtsvftpstat()" is
included.)
EW_NOOPT No option
- The extended driver/library function is
necessary.
- The data server board(hardware) is necessary.
EW_DTSRVR Data server error
The detailed status is set in the global
variable 'short cnc_errno'.
1 <--> 498 : data server error
499 : data server system error

483
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

484
(6) Download from Data Server to CNC

Function Name:
cnc_dtsvdownload

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dtsvdownload(unsigned short FlibHndl,
char *nc_file);
Description:
Orders the CNC to download file from the data server.
Therefore, normal finish of this function shows that downloading file
from the data server has been started.
The result of downloading file must be got by "cnc_dtsvupdnstat()".

Don't use the data sever function(except DNC operation) at the CNC side
until either EW_OK or EW_DTSRVR of the completion status is got by
"cnc_dtsvupdnstat()" after this function had been finished.

Req. ret=EW_BUSY ret=EW_OK


/EW_DTSRVR
v v v
processing +---------------+
of download ----------+ +-----------------

prohibition term of using +-------------------+


data server ----------+ +-------------

* "Req." shows start request for download by


this function.
"ret=" is the completion status when
"cnc_dtsvupdnstat()" is done.

Throughout the prohibition term, the completion status of the


following function is EW_BUSY.

cnc_dwnstart()
cnc_vrfstart()
cnc_dncstart()
cnc_delete()
cnc_delall()
cnc_search()
cnc_dtsvdownload()
cnc_dtsvupload()

Therefore, it is necessary to get either EW_OK or EW_DTSRVR of the


completion status by "cnc_dtsvupdnstat()" when this function had
been executed.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

nc_file Specify the pointer to the file name in the data server for
download.
Specify as follows using ASCII code.
"O" + <4 figures> + "NULL"

485
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
- download/upload function has been executed on
CNC side. Try again.
(The unexecution of "cnc_dtsvftpstat()" is
included.)
- alarm(PS000, PS101) in CNC side(only Series
160/180)
Reset the alarm on CNC.
- I/O channel number of CNC doesn't indicate
the data server.
Set I/O channel number as the data server.
* Series 150 : Param.No.0020=14, 0022=14
* Series 160/180 : Param.No.0020=5
- background edit processing(Series 150/160/180)
or MDI mode(Series 160/180) in CNC side
Terminate background edit processing or
change mode to any mode except MDI in CNC
side.
* In case of Series 150 and Param.No.2217#5
=0, EW_BUSY isn't returned and execution
is waited until B.G. edit is terminated.
EW_NUMBER File name(nc_file[]) is wrong.
EW_NOOPT No option
- The extended driver/library function is
necessary.
- The data server board(hardware) is necessary.
CNC parameter error(only Series 160/180)
- Set param.No.0900#0 to 0.
EW_DTSRVR Data server error
The detailed status is set in the global
variable 'short cnc_errno'.
1 <--> 498 : data server error
499 : data server system error

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function relates to the following CNC parameter.


See the manual of DATA SERVER parameter for details.

Series 150 0020=14 ---+- must be set


0022=14 ---+
2217#5 ----- influenced by setting

Series 160/180 0020=5 ---+- must be set


0900#0=0 ---+

CNC mode: It is possible to use in other than MDI mode.

486
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

487
(7) Upload from CNC to Data Server

Function Name:
cnc_dtsvupload

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dtsvupload(unsigned short FlibHndl,
char *nc_file);
Description:
Orders the CNC to upload file from the data server.
Therefore, normal finish of this function shows that uploading file
from the data server has been started.
The result of uploading file must be got by "cnc_dtsvupdnstat()".

Don't use the data sever function(except DNC operation) at the CNC side
until either EW_OK or EW_DTSRVR of the completion status is got by
"cnc_dtsvupdnstat()" after this function had been finished.

Req. ret=EW_BUSY ret=EW_OK


/EW_DTSRVR
v v v
processing +---------------+
of upload ----------+ +-----------------

prohibition term of using +-------------------+


data server ----------+ +-------------

* "Req." shows start request for upload by


this function.
"ret=" is the completion status when
"cnc_dtsvupdnstat()" is done.

Throughout the prohibition term, the completion status of the


following function is EW_BUSY.

cnc_dwnstart()
cnc_vrfstart()
cnc_dncstart()
cnc_delete()
cnc_delall()
cnc_search()
cnc_dtsvdownload()
cnc_dtsvupload()

Therefore, it is necessary to get either EW_OK or EW_DTSRVR of the


completion status by "cnc_dtsvupdnstat()" when this function had
been executed.

488
Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

nc_file Specify the pointer to the file name in the data server for
upload.
Specify as follows using ASCII code.
"O" + <4 figures> + "NULL"

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
- download/upload function has been executed on
CNC side. Try again.
(The unexecution of "cnc_dtsvftpstat()" is
included.)
- alarm(PS000, PS101) in CNC side(only Series
160/180)
Reset the alarm on CNC.
- I/O channel number of CNC doesn't indicate
the data server.
Set I/O channel number to the data server.
* Series 150 : Param.No.0021=14, 0023=14
* Series 160/180 : Param.No.0020=5
- background edit processing(Series 150/160/180)
or MDI mode(Series 160/180) in CNC side
Terminate background edit processing or
change mode to any mode except MDI in CNC
side.
* In case of Series 150 and Param.No.2217#5
=0, EW_BUSY isn't returned and execution
is waited until B.G. edit is terminated.
EW_NUMBER File name(nc_file[]) is wrong.
EW_NOOPT No option
- The extended driver/library function is
necessary.
- The data server board(hardware) is necessary.
CNC parameter error(only Series 160/180)
- Set param.No.0900#0 to 0.
EW_DTSRVR Data server error
The detailed status is set in the global
variable 'short cnc_errno'.
1 <--> 498 : data server error
499 : data server system error

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

489
CNC parameter: This function relates to the following CNC parameter.
See the manual of DATA SERVER parameter for details.

Series 150 0021=14 ---+- must be set


0023=14 ---+
2217#5 ----- influenced by setting

Series 160/180 0020=5 ---+- must be set


0900#0=0 ---+

CNC mode: It is possible to use in other than MDI mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

490
(8) Cancel Upload/Download between Data Server and CNC

Function Name:
cnc_dtsvcnclupdn

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dtsvcnclupdn(unsigned short FlibHndl);

Description:
Cancels the following if it is executing.
- Download from data server to CNC
- Upload from CNC to data server
Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Upload/download is not executed
- Upload/download between data server and CNC
is not executed now.
EW_NOOPT No option
- The extended driver/library function is
necessary.
- The data server board(hardware) is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

491
(9) Read Upload/Download Status between Data Server and CNC

Function Name:
cnc_dtsvupdnstat

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dtsvupdnstat(unsigned short FlibHndl);

Description:
The execution result of "cnc_dtsvdownload()", "cnc_dtsvupload()"
function can be got only once.
The completion status is as follows when this function is executed.

ret=EW_FUNC Req. ret=EW_BUSY ret=EW_OK ret=EW_FUNC


/EW_DTSRVR
v v v v v
processing of +---------------+
download/upload ----------+ +-----------------

* "Req." shows start request for download/upload file


by "cnc_dtsvdownload()"/"cnc_dtsvupload()" function.
"ret=" is the completion status when this function
is done.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_RESET Reset or stop request
- As 'RESET or STOP' was pushed, upload/
download was forced to cancel.
EW_BUSY Busy
- As upload/download is executing, try again.
EW_FUNC Function is not executed
- upload/download is not executed
Execute either "cnc_dtsvdownload()" or
"cnc_dtsvupload()" beforehand.
EW_DATA Data error
- file has already existed
The file which replaced by upload/download
is write-protected.
- file does not exist
The indicated file does not exist.
EW_NOOPT No option
- The extended driver/library function is
necessary.
- The data server board(hardware) is necessary.

492
EW_PROT Write protection in CNC side(download)
- Protection KEY(DI/KEY3) is off.
- CNC parameter is a state of write-protection.
(O8000-/O9000- protection, encoding).
EW_OVRFLOW Memory overflow
- Because free area is lacking in CNC memory,
make enough free area.
- The total number of program exceeded the
limit of registrable program in CNC.
EW_DTSRVR Data server error
The detailed status is set in the global
variable 'short cnc_errno'.
1 <--> 498 : data server error
499 : data server system error

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

493
(10) Get DNC Operation File Name in Data Server

Function Name:
cnc_dtsvgetdncpg

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dtsvgetdncpg(unsigned short FlibHndl,
char *nc_file);
Description:
Gets the file name for DNC operation in the data server.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

nc_file Specify the pointer to the file name for DNC operation.
The file name is as follows.
"O" + <4 figures> + "NULL"

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
- The extended driver/library function is
necessary.
- The data server board(hardware) is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

494
(11) Set DNC Operation File Name in Data Server

Function Name:
cnc_dtsvsetdncpg

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dtsvsetdncpg(unsigned short FlibHndl,
char *nc_file);
Description:
Set the file name for DNC operation in the data server.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

nc_file Specify the pointer to the file name in the data server.

Specify as follows using ASCII code.


"O" + <4 figures> + "NULL"

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
- alarm(PS000, PS101) in CNC side(only Series
160/180)
Reset the alarm on CNC.
EW_NOOPT No option
- The extended driver/library function is
necessary.
- The data server board(hardware) is necessary.
CNC parameter error(only Series 160/180)
- Set param.No.0900#0 to 0.
EW_DTSRVR Data server error
The detailed status is set in the global
variable 'short cnc_errno'.
1 <--> 498 : data server error
499 : data server system error

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function relates to the following CNC parameter.


See the manual of DATA SERVER parameter for details.

Series 160/180 0900#0=0 ----- must be set

CNC mode: This function can be used in any CNC mode.

495
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

496
(12) Read Setting Data for Data Server

Function Name:
cnc_dtsvrdset

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dtsvrdset(unsigned short FlibHndl,
IODBDSSET *set);
Description:
Read setting data in the data server.

If this function is executed while "cnc_dtsvftpput()" or


"cnc_dtsvftpget()" is executing(until the completion status is got by
"cnc_dtsvftpstat()"), EW_BUSY is returned.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

set Pointer to the IODBDSSET structure including the setting data


in the data server. The IODBDSSET structure is as follows.

typedef struct iodbdsset {


char host_ip[16] ;
char host_uname[32] ;
char host_passwd[32] ;
char host_dir[128] ;
char dtsv_mac[13] ;
char dtsv_ip[16] ;
char dtsv_mask[16] ;
} IODBDSSET ;

host_ip[16] Current IP address of host computer is stored


by ASCII code(max. 16 characters including
'NULL').

host_uname[32] Current user name of host computer, which is


used to login by means of 'FTP', is stored
by ASCII code(max. 32 characters including
'NULL').

host_passwd[32] (not used)

host_dir[128] Current directory of host computer, which is


accessed by data server, is stored by ASCII
code(max. 128 characters including 'NULL').

dtsv_mac[13] Current MAC address of data server board is


stored by ASCII code(max. 13 characters
including 'NULL').

dtsv_ip[16] Current IP address of data server board is


stored by ASCII code (max. 16 characters
including 'NULL').

dtsv_mask[16] Mask address of current IP address of network


is stored by ASCII code(max. 16 characters
including 'NULL').

497
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
Try again because data server is processing.
(There is a possibility of forgetting to call
"cnc_dtsvftpstat()" function.)
EW_NOOPT No option
- The extended driver/library function is
necessary.
- The data server board(hardware) is necessary.
EW_DTSRVR Data server error
The detailed status is set in the global
variable 'short cnc_errno'.
1 <--> 498 : data server error
499 : data server system error

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

498
(13) Write Setting Data for Data Server

Function Name:
cnc_dtsvwrset

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dtsvwrset(unsigned short FlibHndl,
IODBDSSET *set);
Description:
Writes setting data in the data server.

If this function is executed while "cnc_dtsvftpput()" or


"cnc_dtsvftpget()" is executing(until the completion status is got by
"cnc_dtsvftpstat()"), EW_BUSY is returned.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

set Pointer to the IODBDSSET structure including the setting data


in the data server. The IODBDSSET structure is as follows.

typedef struct iodbdsset {


char host_ip[16] ;
char host_uname[32] ;
char host_passwd[32] ;
char host_dir[128] ;
char dtsv_mac[13] ;
char dtsv_ip[16] ;
char dtsv_mask[16] ;
} IODBDSSET ;

host_ip[16] Specify the IP address of host computer by


ASCII code(max. 16 characters including 'NULL').

host_uname[32] Specify the user name of host computer, which


is used to login by means of 'FTP', by ASCII
code(max. 32 characters including 'NULL').

host_passwd[32] Specify the password for above user name by


ASCII code(max. 32 characters including 'NULL').

host_dir[128] Specify the directory of host computer, which


is accessed by data server, by ASCII code(max.
128 characters including 'NULL').

dtsv_mac[13] Specify the MAC address of data server board by


ASCII code(max. 13 characters including 'NULL').

dtsv_ip[16] Specify the IP address of data server board by


ASCII code (max. 16 characters including
'NULL').

dtsv_mask[16] Specify the MASK address of the IP address of


the network by ASCII code(max. 16 characters
including 'NULL').

499
* The last character of above each string must be 'NULL'.
If not, the behavior of this function isn't guaranteed.
* Above MAC address, IP address and MASK address are invalid
until the power turns off and on.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
Try again because data server is processing.
(There is a possibility of forgetting to call
"cnc_dtsvftpstat()" function.)
EW_NOOPT No option
- The extended driver/library function is
necessary.
- The data server board(hardware) is necessary.
EW_DTSRVR Data server error
The detailed status is set in the global
variable 'short cnc_errno'.
1 <--> 498 : data server error
499 : data server system error

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

500
(14) Check Hard Disk on Data Server

Function Name:
cnc_dtsvchkdsk

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dtsvchkdsk(unsigned short FlibHndl);

Description:
Checks the hard disk on the data server whether there is an error
sector etc. or not.

If this function is executed while "cnc_dtsvftpput()" or


"cnc_dtsvftpget()" is executing(until the completion status is got by
"cnc_dtsvftpstat()"), EW_BUSY is returned.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
Try again because data server is processing.
(There is a possibility of forgetting to call
"cnc_dtsvftpstat()" function.)
EW_NOOPT No option
- The extended driver/library function is
necessary.
- The data server board(hardware) is necessary.
EW_DTSRVR Data server error
The detailed status is set in the global
variable 'short cnc_errno'.
1 <--> 498 : data server error
499 : data server system error

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

501
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

502
(15) Format Hard Disk on Data Server

Function Name:
cnc_dtsvhdformat

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dtsvhdformat(unsigned short FlibHndl);

Description:
Formats the hard disk on the data server.

If this function is executed while "cnc_dtsvftpput()" or


"cnc_dtsvftpget()" is executing(until the completion status is got by
"cnc_dtsvftpstat()"), EW_BUSY is returned.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
Try again because data server is processing.
(There is a possibility of forgetting to call
"cnc_dtsvftpstat()" function.)
EW_NOOPT No option
- The extended driver/library function is
necessary.
- The data server board(hardware) is necessary.
EW_DTSRVR Data server error
The detailed status is set in the global
variable 'short cnc_errno'.
1 <--> 498 : data server error
499 : data server system error

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

503
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

504
(16) Save I/F Buffer for Data Server

Function Name:
cnc_dtsvsavecram

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dtsvsavecram(unsigned short FlibHndl);

Description:
Saves the content of the interface buffer for the data server to the
file by the name of "COMMON.RAM" in the hard disk of the data server.
This is the function for purposes of maintenance.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 CNC data window" in "General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
Try again because data server is processing.
EW_NOOPT No option
- The extended driver/library function is
necessary.
- The data server board(hardware) is necessary.
EW_DTSRVR Data server error
The detailed status is set in the global
variable 'short cnc_errno'.
1 <--> 498 : data server error
499 : data server system error
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.


CNC parameer: tThis function does not relate to CNC parameter.
CNC mode: This function can be used in any CNC mode.
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

505
(17) Read I/F Buffer for Data Server

Function Name:
cnc_dtsvrdcram

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dtsvrdcram(unsigned short FlibHndl,long addr,
long *size,char *cram);
Description:
Read the content of the interface buffer for the data server.
This is the function for purposes of maintenance.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

addr Start address


Specify the offset address from top of the interface buffer.
(0x00000000 <--> 0x0000FFFF)

size Pointer to the readout size.


Specify the number of byte of readout.(1 <--> 65536)
The size which has been read actually is stored.

cram Pointer to the content of the interface buffer for the data
server.
The area more than above size is necessary.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
- Size is out of range(1 <--> 65536).
EW_NUMBER Start address error
- Start address is out of range(0x00000000
<--> 0x0000FFFF).
EW_NOOPT No option
- The extended driver/library function is
necessary.
- The data server board(hardware) is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

506
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

507
(18) Read Maintenance Information for Data Server

Function Name:
cnc_dtsvmntinfo

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dtsvmntinfo(unsigned short FlibHndl,
ODBDSMNT *minfo);
Description:
Read the following maintenance information for the data server.
This is the function for purposes of maintenance.

- Count which the buffer between the data server and CNC has become
empty during downloading CNC program from the data server to CNC
- Total size downloaded from the data server to CNC
- Read pointer used by the data server
- Write pointer used by the data server

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

minfo Pointer to the ODBDSMNT structure including the maintenance


information for the data server.
The ODBDSMNT structure is as follows.

typedef struct odbdsmnt {


long empty_cnt ;
long total_size ;
long read_ptr ;
long write_ptr ;
} ODBDSMNT ;

empty_cnt Count which the buffer between the data server


and CNC has become empty during downloading CNC
program from the data server to CNC is stored.

total_size Total size downloaded from the data server to


CNC is stored.

read_ptr Read pointer used by the data server is stored.

write_ptr Write pointer used by the data server is


stored.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
- The extended driver/library function is
necessary.
- The data server board(hardware) is necessary.

508
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

509
(19) Get Mode of Data Server

Function Name:
cnc_dtsvgetmode

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dtsvgetmode(unsigned short FlibHndl,
short *dsmode);
Description:
Gets the current mode of the data server(storage mode/buffer mode).

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

dsmode Pointer to the mode of the data server.


0 : storage mode
1 : buffer mode

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
- The extended driver/library function is
necessary.
- The data server board(hardware) is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

510
(20) Set Mode of Data Server

Function Name:
cnc_dtsvsetmode

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dtsvsetmode(unsigned short FlibHndl,
short dsmode);
Description:
Sets the current mode of the data server(storage mode/buffer mode).

If the mode of the data server is changed, all the data in hard disk
of the data server is erased.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

dsmode Specify the mode of the data server.


0 : storage mode
1 : buffer mode

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Busy
- Try again because data server is processing.
EW_DATA Mode indication error
- The mode indication of data server is
neither 0 nor 1.
EW_NOOPT No option
- The extended driver/library function is
necessary.
- The data server board(hardware) is necessary.
CNC parameter error(only Series 160/180)
- Set param.No.0900#0 to 0.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function relates to the following CNC parameter.


See the manual of DATA SERVER parameter for details.

Series 160/180 0900#0=0 ----- must be set

CNC mode: This function can be used in any CNC mode.

511
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

512
(21) Read Error Message for Data Server

Function Name:
cnc_dtsvrderrmsg

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_dtsvrderrmsg(unsigned short FlibHndl,
short slct,char *errmsg);
Description:
Read error message occurred in the data server.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

slct Selection of message


Specify the following message.
0 : error message of data server
1 : system error message of data server

errmsg Pointer to the error message.


The maximum length of the message is 481 byte including 'NULL'.
The error message is stored in accordance with a screen image
of 12 lines x 40 characters, and the last character is 'NULL'.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_ATTRIB Message selection error
- The selection of message is neither 0 nor 1.
EW_NOOPT No option
- The extended driver/library function is
necessary.
- The data server board(hardware) is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

513
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

514
(22) Read DNC File Name for DNC1,DNC2,OSI-Ethernet

Function Name:
cnc_rddncfname

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rddncfname(unsigned short FlibHndl,
char *FileName);
Description:
Reads name of the file in the host computer for DNC operation
using DNC1, DNC2 or OSI-Ethernet function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.
FileName
Name of the file in the host computer for DNC operation is
returned. The file name is terminated with NULL character and
maximum length of the file name is 65 characters including NULL
character. FileName area must have enough space to store 65
characters, otherwise the operation of this function is not
guaranteed.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable(only Series 150)
This function cannot be used at 150TT.
EW_NOOPT No option
The DNC1, DNC2, OSI-Ethernet option, and the
extended driver/library option are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the DNC1, DNC2, OSI-Ethernet option and the
extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

515
Available CNC: DNC1, OSI-Ethernet
+---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+
DNC2
+---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

516
(23) Write DNC File Name for DNC1,DNC2,OSI-Ethernet

Function Name:
cnc_wrdncfname

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrdncfname(unsigned short FlibHndl,
char *FileName);
Description:
Writes name of the file in the host computer for DNC operation using
DNC1, DNC2 or OSI-Ethernet function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.
FileName
Specify name of the file for DNC operation in the host
computer. The file name must be terminated with NULL character
and its length must be less than or equal to 65 characters
including NULL character.
The operation of this function is not guaranteed, if the file
name is not terminated with NULL character.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable(only Series 150)
This function cannot be used at 150TT.
EW_NOOPT No option
The DNC1, DNC2, OSI-Ethernet option, and the
extended driver/library option are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the DNC1, DNC2, OSI-Ethernet option and the
extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: It is possible to use in MDI mode.

517
Available CNC: DNC1, OSI-Ethernet
+---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+
DNC2
+---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

518
(24) Read Communication Parameter for DNC1,DNC2,OSI-Ethernet

Function Name:
cnc_rdcomparam

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdcomparam(unsigned short FlibHndl,
IODBCPRM *odb);
Description:
Reads communication parameters for DNC1, DNC2 or OSI-Ethernet function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.
odb
Pointer to the IODBCPRM structure where communication para-
meters are returned to.
The IODBCPRM structure is as follows.
typedef struct {
char NcApli[65] ;
char Dummy1 ;
char HostApli[65] ;
char Dummy2 ;
unsigned long StatPstv ;
unsigned long StatNgtv ;
unsigned long Statmask ;
unsigned long AlarmStat ;
unsigned long PsclHaddr ;
unsigned long PsclLaddr ;
unsigned short SvcMode1 ;
unsigned short SvcMode2 ;
long FileTout ;
long RemTout ;
} IODBCPRM ;

NcApli CNC application name


NULL terminated character string with maximum
length of 65 characters including NULL.
This is valid only for OSI-Ethernet.
Dummy1 not used
HostApli Host application name
NULL terminated character string with maximum
length of 65 characters including NULL.
This is valid only for OSI-Ethernet.
Dummy2 not used

StatPstv Status report mask (positive edge)


Status report mask bits, which enable or mask
reporting CNC status information to DNC1,DNC2,
OSI-Ethernet board, are returned.
If any of the following bits is "1",
corresponding status information is reported
when its state changes from "0" to "1".
Bit type data.
0 : mask report
1 : enable report

519
DNC1, DNC2
BIT00 : [RWD] Rewind signal
BIT01 : [AL ] Alarm signal
BIT02 : [RST] Reset state signal
BIT03 : [SPL] Automatic operation
suspend-in-progress signal
BIT04 : [STL ] Automatic operation start
in-progress signal
BIT05 : [OP ] Automatic operation
in-progress signal
BIT06 : [SA ] Servo ready
BIT07 : [MA ] CNC ready
BIT08 : [M00 ] Decoded M00 signal (HEAD2)
BIT09 : [M01 ] Decoded M01 signal ( •V )
BIT10 : [M02 ] Decoded M02 signal ( •V )
BIT11 : [M30 ] Decoded M30 signal ( •V )
BIT12 : [M00 ] Decoded M00 signal (HEAD1)
BIT13 : [M01 ] Decoded M01 signal ( •V )
BIT14 : [M02 ] Decoded M02 signal ( •V )
BIT15 : [M30 ] Decoded M30 signal ( •V )
* BIT08 to BIT11 are valid when two-path
control function is available, and not used
when two-path control is not available.
* BIT16 to BIT31 are not used.
OSI-Ethernet
BIT00 : (not used)
BIT01 : [SPL ] Automatic operation
suspend-in-progress signal
BIT02 : [STL ] Automatic operation start
in-progress signal
BIT03 : (not used)
BIT04 : [MBDT1 ] Optional block skip check
signal
BIT05 : (not used)
BIT06 : (not used)
BIT07 : (not used)
BIT08 : (not used)
BIT09 : [EFALM ] Excess error alarm (stop &
moving)
BIT10 : [PSALM ] P/S alarm
BIT11 : [M00/M01] Decoded M00/M01 signal
BIT12 : [M02 ] Decoded M02 signal
BIT13 : (not used)
BIT14 : [M30 ] Decoded M30 signal
BIT15 : (not used)
BIT16 : (not used)
BIT17 : (not used)
BIT18 : (not used)
BIT19 : (not used)
BIT20 : (not used)
BIT21 : (not used)
BIT22 : (not used)
BIT23 : (not used)
BIT24 : (not used)
BIT25 : (not used)
BIT26 : (not used)
BIT27 : (not used)
BIT28 : [AL ] Alarm signal
BIT29 : [OP ] Automatic operation
in-progress signal
BIT30 : [SA ] Servo ready
BIT31 : [MA ] CNC ready

520
StatNgtv Status report mask (negative edge)
Status report mask bits, which enable or mask
reporting CNC status information to DNC1,DNC2,
OSI-Ethernet board, are returned.
If any of the following bits is "1",
corresponding status information is reported
when its state changes from "1" to "0".
Bit type data.
0 : mask report
1 : enable report

Definition of each bit is same as "StatPstv".


StatMask not used
AlarmStat Alarm status
Bit type data
Series 150
BIT00 : BACKGROUND P/S ALARM
BIT01 : FOREGROUND P/S ALARM
BIT02 : OVER HEAT ALARM
BIT03 : (not used)
BIT04 : (not used)
BIT05 : PARAMETER ENABLE SWITCH ON
BIT06 : OVER TRAVEL ALARM
BIT07 : PMC ALARM
BIT08 : EXTERNAL ALARM MESSAGE
BIT09 : (not used)
BIT10 : SERIOUS P/S ALARM
BIT11 : (not used)
BIT12 : SERVO ALARM
BIT13 : I/O ERROR
BIT14 : POWER MUST BE OFF
BIT15 : (not used)
BIT16 : BATTERY ALARM
* BIT17 to BIT31 are not used.
Series 160/180
BIT00 : (not used)
BIT01 : P/S ALARM
BIT02 : OVER HEAT ALARM
BIT03 : (not used)
BIT04 : (not used)
BIT05 : P/S 100 ALARM
BIT06 : OVER TRAVEL ALARM
BIT07 : (not used)
BIT08 : (not used)
BIT09 : (not used)
BIT10 : (not used)
BIT11 : (not used)
BIT12 : SERVO ALARM
BIT13 : P/S 101 ALARM
BIT14 : P/S 000 ALARM
BIT15 : (not used)
BIT16 : BATTERY ALARM
* BIT17 to BIT31 are not used.

PsclHaddr Pascal stack address (upper limit)


Series 150
Upper limit physical address of the area, where
writing data is inhibited, is returned.

Series 160/180
not used

521
PsclLaddr Pascal stack address (lower limit)
Series 150
Lower limit physical address of the area, where
writing data is inhibited, is returned.
Series 160/180
not used
SvcMode1 Service mode 1
not used
SvcMode2 Service mode 2
Bit type data
Selects the operation of the "read entire file
directory" function of the DNC1 and OSI-Ether-
net option as follows.
BIT00 = 0 : file number and size
= 1 : file number only
* BIT01 to BIT15 are not used
* In case of DNC2 function, this bit is not
used and only file number is obtained by
"read entire file directory" function.
FileTout File request time-out
Time-out value for file request is returned.
When "0" is set for the time-out value,
conventional fixed time value (25.6sec approx.)
is used as the time-out value.
Time-out time is incremented on every 32 msec
internally. Actual time to time-out is cal-
culated as follows.

Tout = ( (FileTout) / 32 + 1 ) x 32 [msec]


~~~~~~~~~~~~~~~~~~~
In calculating underlined part above,
fraction part is discarded.
Series 150
Valid only for OSI-Ethernet. Not used for DNC1
and DNC2.
Series 160/180
Valid for DNC1, DNC2 and OSI-Ethernet all.

RemTout Remote request time-out


Time-out value for remote request is returned.
Refer to "FileTout" for details.
Series 150
Valid only for OSI-Ethernet. Not used for DNC1
and DNC2.
Series 160/180
Valid for DNC1, DNC2 and OSI-Ethernet all.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The DNC1, DNC2, OSI-Ethernet option, and the
extended driver/library option are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

522
CNC option: This function needs the DNC1, DNC2, OSI-Ethernet option and the
extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: DNC1, OSI-Ethernet


+---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+
DNC2
+---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

523
(25) Write Communication Parameter for DNC1,DNC2,OSI-Ethernet

Function Name:
cnc_wrcomparam

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrcomparam(unsigned short FlibHndl,
IODBCPRM *idb);
Description:
Writes communication parameters for DNC1,DNC2 or OSI-Ethernet function.
When communication parameters are written to OSI-Ethernet board
following alarm will occur.
Series 150 PW000
Series 160/180 P/S000

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.
idb
Pointer to the IODBCPRM structure where communication para-
meters are set.
The IODBCPRM structure is as follows.
typedef struct {
char NcApli[65] ;
char Dummy1 ;
char HostApli[65] ;
char Dummy2 ;
unsigned long StatPstv ;
unsigned long StatNgtv ;
unsigned long Statmask ;
unsigned long AlarmStat ;
unsigned long PsclHaddr ;
unsigned long PsclLaddr ;
unsigned short SvcMode1 ;
unsigned short SvcMode2 ;
long FileTout ;
long RemTout ;
} IODBCPRM ;

NcApli CNC application name


NULL terminated character string with maximum
length of 65 characters including NULL can be
specified. This is valid only for OSI-Ethernet.
Dummy1 not used
HostApli Host application name
NULL terminated character string with maximum
length of 65 characters including NULL can be
specified. This is valid only for OSI-Ethernet.
Dummy2 not used

524
StatPstv Status report mask (positive edge)
Set status report mask bits, which enable or
mask reporting CNC status information to DNC1,
DNC2 and OSI-Ethernet board.
If any of the following bits is "1",
corresponding status information is reported
when its state changes from "0" to "1".
Bit type data.
0 : mask report
1 : enable report
DNC1, DNC2
BIT00 : [RWD ] Rewind signal
BIT01 : [AL ] Alarm signal
BIT02 : [RST ] Reset state signal
BIT03 : [SPL ] Automatic operation
suspend-in-progress signal
BIT04 : [STL ] Automatic operation start
in-progress signal
BIT05 : [OP ] Automatic operation
in-progress signal
BIT06 : [SA ] Servo ready
BIT07 : [MA ] CNC ready
BIT08 : [M00 ] Decoded M00 signal (HEAD2)
BIT09 : [M01 ] Decoded M01 signal ( •V )
BIT10 : [M02 ] Decoded M02 signal ( •V )
BIT11 : [M30 ] Decoded M30 signal ( •V )
BIT12 : [M00 ] Decoded M00 signal (HEAD1)
BIT13 : [M01 ] Decoded M01 signal ( •V )
BIT14 : [M02 ] Decoded M02 signal ( •V )
BIT15 : [M30 ] Decoded M30 signal ( •V )
* BIT08 to BIT11 are valid when two-path
control function is available, and not used
when two-path control is not available.
* BIT16 to BIT31 are not used.
OSI-Ethernet
BIT00 : (not used)
BIT01 : [SPL ] Automatic operation
suspend-in-progress signal
BIT02 : [STL ] Automatic operation start
in-progress signal
BIT03 : (not used)
BIT04 : [MBDT1 ] Optional block skip check
signal
BIT05 : (not used)
BIT06 : (not used)
BIT07 : (not used)
BIT08 : (not used)
BIT09 : [EFALM ] Excess error alarm (stop &
moving)
BIT10 : [PSALM ] P/S alarm
BIT11 : [M00/M01] Decoded M00/M01 signal
BIT12 : [M02 ] Decoded M02 signal
BIT13 : (not used)
BIT14 : [M30 ] Decoded M30 signal
BIT15 : (not used)
BIT16 : (not used)
BIT17 : (not used)
BIT18 : (not used)

525
BIT19 : (not
used)
BIT20 : (not
used)
BIT21 : (not
used)
BIT22 : (not
used)
BIT23 : (not
used)
BIT24 : (not
used)
BIT25 : (not
used)
BIT26 : (not
used)
BIT27 : (not
used)
BIT28 : [AL ] Alarm signal
BIT29 : [OP ] Automatic operation
in-progress signal
BIT30 : [SA ] Servo ready
BIT31 : [MA ] CNC ready
StatNgtv Status report mask (negative edge)
Set status report mask bits, which enable or
mask reporting CNC status information to DNC1,
DNC2 and OSI-Ethernet board.
If any of the following bits is "1",
corresponding status information is reported
when its state changes from "1" to "0".
Bit type data.
0 : mask report
1 : enable report

Definition of each bit is same as "StatPstv".


StatMask not used
AlarmStat Alarm status
Bit type data
Series 150
BIT00 : BACKGROUND P/S ALARM
BIT01 : FOREGROUND P/S ALARM
BIT02 : OVER HEAT ALARM
BIT03 : (not used)
BIT04 : (not used)
BIT05 : PARAMETER ENABLE SWITCH ON
BIT06 : OVER TRAVEL ALARM
BIT07 : PMC ALARM
BIT08 : EXTERNAL ALARM MESSAGE
BIT09 : (not used)
BIT10 : SERIOUS P/S ALARM
BIT11 : (not used)
BIT12 : SERVO ALARM
BIT13 : I/O ERROR
BIT14 : POWER MUST BE OFF
BIT15 : (not used)
BIT16 : BATTERY ALARM
* BIT17 to BIT31 are not used.
Series 160/180
BIT00 : (not used)
BIT01 : P/S ALARM
BIT02 : OVER HEAT ALARM
BIT03 : (not used)
BIT04 : (not used)
BIT05 : P/S 100 ALARM
BIT06 : OVER TRAVEL ALARM
BIT07 : (not used)
BIT08 : (not used)

526
BIT09 : (not used)
BIT10 : (not used)
BIT11 : (not used)
BIT12 : SERVO ALARM
BIT13 : P/S 101 ALARM
BIT14 : P/S 000 ALARM
BIT15 : (not used)
BIT16 : BATTERY ALARM
* BIT17 to BIT31 are not used.

PsclHaddr Pascal stack address (upper limit)


Series 150
Set upper limit physical address of the area
where writing data is inhibited.
Series 160/180
not used
PsclLaddr Pascal stack address (lower limit)
Series 150
Set lower limit physical address of the area
where writing data is inhibited.
Series 160/180
not used
SvcMode1 Service mode 1
not used
SvcMode2 Service mode 2
Bit type data
Selects the operation of the "read entire file
directory" function of the DNC1 and OSI-Ether-
net option as follows.
BIT00 = 0 : file number and size
= 1 : file number only
* BIT01 to BIT15 are not used
* In case of DNC2 function, this bit is not
used and only file number is obtained by
"read entire file directory" function.
FileTout File request time-out
Set time-out value for file request.
When "0" is set for the time-out value,
conventional fixed time value (25.6sec approx.)
is used as the time-out value.
Time-out time is incremented on every 32 msec
internally. Actual time to time-out is cal-
culated as follows.

Tout = ( (FileTout) / 32 + 1 ) x 32 [msec]


~~~~~~~~~~~~~~~~~~~
In calculating underlined part above,
fraction part is discarded.
Series 150
Valid only for OSI-Ethernet. Not used for DNC1
and DNC2.
Series 160/180
Valid for DNC1, DNC2 and OSI-Ethernet all.

RemTout Remote request time-out


Set time-out value for remote request.
Refer to "FileTout" for details.
Series 150
Valid only for OSI-Ethernet. Not used for DNC1
and DNC2.
Series 160/180
Valid for DNC1, DNC2 and OSI-Ethernet all.

527
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_DATA Data error(only Series 150)
Time-out parameter(FileTout, RemTout) is wrong.
EW_NOOPT No option
The DNC1, DNC2, OSI-Ethernet option, and the
extended driver/library option are necessary.
EW_PROT Write protection(only Series 150)
Protection KEY(DI/KEY2) is off.
EW_MODE CNC mode error The mode is not MDI.
EW_REJECT CNC execution denial(only Series 150)
MDI operation is in progress.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the DNC1, DNC2, OSI-Ethernet option and the
extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: It is possible to use in MDI mode.


Available CNC: DNC1, OSI-Ethernet
+---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+
DNC2
+---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

528
(26) Read Logging Message for DNC2

Function Name:
cnc_rdcomlogmsg

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdcomlogmsg(unsigned short FlibHndl,
char *logmsg);
Description:
Reads logging message for DNC2.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.
logmsg
Following three types of logging messages are returned.
Each logging messages are separated by a control model depend-
ent delimiting character and terminated with NULL character.
<CCCC> : CCCC Command part of datagram
<NNNN0Xeeee> : NNNN Negative response (Command part of
datagram)
eeee Error code
<Ennn0Xssdd> : Ennn Error code of data link layer
ss Error sub-code (matrix status of
data link layer)
dd Error sub-code (Error data)
Series 150
Maximum 500 characters including NULL are returned.
Delimiting character is ASCII "|".
Series 160/180
Maximum 440 characters including NULL are returned.
Delimiting character is ASCII ":".

* If there are not enough space to store above characters,


the operation of this function is not guaranteed.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable(only Series 160/180)
This function cannot be used at 160TT/180TT.
EW_NOOPT No option
The DNC2 option, and the extended driver/
library option are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the DNC2 option and the extended driver/
library option.

CNC parameter: This function does not relate to CNC parameter.

529
CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

530
(27) Read Operator's Message for DNC1,DNC2

Function Name:
cnc_rdcomopemsg

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdcomopemsg(unsigned short FlibHndl, char *opemsg);

Description:
Reads operator's message for DNC1,DNC2.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.
opemsg
Five operator's messages are returned at maximum.
Each messages are terminated with NULL character and must be
less than 129 characters including NULL character.
The area to store operator's message must be declared as;
char opemsg[5][129] ;.
If it is not declared as above, the operation of this function
is not guaranteed.

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 CNC data window" in "General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The DNC1, DNC2 option, and the extended driver
/library option are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the DNC1, DNC2 option and the extended
driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

531
Available CNC: DNC1
+---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+
DNC2
+---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

532
(28) Read Receipt Message for OSI-Ethernet

Function Name:
cnc_rdrcvmsg

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdrcvmsg(unsigned short FlibHndl,
char *rcvmsg);
Description:
Reads contents of the receive buffer in which received message is
stored. When this function is called, receipt status in CNC is
cleared. The receipt status of CNC becomes ON when it received a
message. It becomes OFF when received message is read by
"cnc_rdrcvmsg()" function or when communication screen of the CNC
is selected.
When a message which requires response is received, following
message is added in the receive buffer if a response is not returned
within predetermined time.

"***** TIME OUT *****"

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.
rcvmsg
receipt message
Series 150
The message is terminated with NULL character and the maximum
length of the message including NULL is 667 characters.
If the size of the area to store message is less than 667
characters, the operation of this function is not guaranteed.
Series 160/180
The message is terminated with NULL character and the maximum
length of the message including NULL is 641 characters.
If the size of the area to store message is less than 641
characters, the operation of this function is not guaranteed.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The OSI-Ethernet option, and the extended
driver/library option are necessary.
EW_REJECT CNC execution denial(only Series 160/180)
OSI-Ethernet is initializing or restarting.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the OSI-Ethernet option and the extended
driver/library option.

533
CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

534
(29) Read Sending Message for OSI-Ethernet

Function Name:
cnc_rdsndmsg

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdsndmsg(unsigned short FlibHndl,
char *sndmsg);
Description:
Reads contents of the transmit buffer in which transmitted message is
stored.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.
sndmsg
sending message
Series 150
The message is terminated with NULL character and the maximum
length of the message including NULL is 667 characters.
If the size of the area to store message is less than 667
characters, the operation of this function is not guaranteed.
Series 160/180
The message is terminated with NULL character and the maximum
length of the message including NULL is 641 characters.
If the size of the area to store message is less than 641
characters, the operation of this function is not guaranteed.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The OSI-Ethernet option, and the extended
driver/library option are necessary.
EW_REJECT CNC execution denial(only Series 160/180)
OSI-Ethernet is initializing or restarting.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the OSI-Ethernet option and the extended
driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

535
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

536
(30) Send Message for OSI-Ethernet

Function Name:
cnc_sendmessage

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_sendmessage(unsigned short FlibHndl,
char *msg);
Description:
Sends message to the host computer.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.
msg
Sending message
Message must be terminated with NULL character.
Maximum length of the message including NULL is as follows.

Series 150 -------- 75 characters


Series 160/180 ---- 81 characters

If the sending message is not terminated with NULL character,


the operation of this function is not guaranteed.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_DATA Data error
'NULL' character has been sent.
EW_NOOPT No option
The OSI-Ethernet option, and the extended
driver/library option are necessary.
EW_REJECT CNC execution denial(only Series 160/180)
OSI-Ethernet is initializing or restarting.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the OSI-Ethernet option and the extended
driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

537
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

538
(31) Clear Message Buffer for OSI-Ethernet

Function Name:
cnc_clrmsgbuff

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_clrmsgbuff(unsigned short FlibHndl, short slct);

Description:
Clears the receive buffer or the transmit buffer.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.
slct
Buffer type
Select the buffer to be cleared.
0: receive buffer
1: transmit buffer

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 CNC data window" in "General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_ATTRIB Data attribute error
Type of buffer(slct) is neither 0 nor 1.
EW_NOOPT No option
The OSI-Ethernet option, and the extended
driver/library option are necessary.
EW_REJECT CNC execution denial(only Series 160/180)
OSI-Ethernet is initializing or restarting.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the OSI-Ethernet option and the extended
driver/library option.

CNC parameter: This function does not relate to CNC parameter.


CNC mode: This function can be used in any CNC mode.
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

539
(32) Read Receipt Status of Message for OSI-Ethernet

Function Name:
cnc_rdrcvstat

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdrcvstat(unsigned short FlibHndl,
unsigned short *rcvstat);
Description:
Obtains receipt status of message for OSI-Ethernet.
The receipt status becomes ON when CNC received a message for
OSI-Ethernet, and becomes OFF when receipt message is read by
"cnc_rdrcvmsg()" function or when communication screen of the CNC
is selected.
When a message which requires response is received, following
message is added in the receive buffer if a response is not returned
within predetermined time.

"***** TIME OUT *****"

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.
rcvstat
Receipt status of message
0: no message is received
1: message is received

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The OSI-Ethernet option, and the extended
driver/library option are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the OSI-Ethernet option and the extended
driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

540
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

541
1.1.14 Function Reference Related to PUNCH PRESS

(1) Read Tool Control Data

Function Name:
cnc_rdtlctldata

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdtlctldata(unsigned short FlibHndl,
IODBTLCTL *tlctl);
Description:
Reads the tool control data.
The data is stored in each member of the IODBTLCTL structure.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

tlctl Pointer to the IODBTLCTL structure including the tool control


data. The IODBTLCTL structure is as follows.

typedef struct iodbtlctl {


short slct; /* Flag of valid data */
short used_tool; /* Number of used tool */
short turret_indx; /* Number of turret index */
long zero_tl_no; /* Zero point tool number */
long t_axis_move; /* Turret axis movement */
long total_punch[2];/* Total number of punch operation*/
short reserve[11]; /* (reserve) */
} IODBTLCTL ;

slct Flag of valid data is set.


bit 0 : Number of used tool
bit 1 : Number of turret index
bit 2 : Zero point tool number
bit 3 : Turret axis movement
bit 4 : Total number of punch operation
bit 5,..,15 : (reserve)
* When some bit is 0, its data is invalid.

used_tool Number of used tool is set. (0,..)

turret_indx Number of turret index is set. (0,..)


(This must be fewer than number of used tool.)

zero_tl_no Zero point tool number is set. (0,..)

t_axis_move Turret axis movement is set.

total_punch Total number of punch operation is set.


total_punch[0] : Lower (0,..,99999999)
total_punch[1] : Upper (0,..,99999999)

reserve (reserve)

542
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160P.
EW_NOOPT No option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function, and
relates to the following function.

Tool data setting function

CNC parameter: This function relates to the following parameter.


See the manual of CNC parameter for details.

Series 160 16265,..,16270

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

543
(2) Write Tool Control Data

Function Name:
cnc_wrtlctldata

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrtlctldata(unsigned short FlibHndl,
IODBTLCTL *tlctl);
Description:
Writes the tool control data.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

tlctl Pointer to the IODBTLCTL structure including the tool control

data. The IODBTLCTL structure is as follows.

typedef struct iodbtlctl {


short slct; /* Flag of data selection */
short used_tool; /* Number of used tool */
short turret_indx; /* Number of turret index */
long zero_tl_no; /* Zero point tool number */
long t_axis_move; /* Turret axis movement */
long total_punch[2];/* Total number of punch operation */
short reserve[11]; /* (reserve) */
} IODBTLCTL ;

slct Flag of data selection must be set.


bit 0 : Number of used tool
bit 1 : Number of turret index
bit 2 : Zero point tool number
bit 3 : Turret axis movement
bit 4 : Total number of punch operation
bit 5,..,15 : (reserve)
* When some bit is 1, its data is written.

used_tool Specify Number of used tool. (0,..)

turret_indx Specify Number of turret index. (0,..)


(This must be fewer than number of used tool.)

zero_tl_no Specify Zero point tool number. (0,..)

t_axis_move Specify Turret axis movement.

total_punch Specify Total number of punch operation.


total_punch[0] : Lower (0,..,99999999)
total_punch[1] : Upper (0,..,99999999)

reserve (reserve)

544
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160P.
EW_DATA Data error
The tool control data is wrong.
The following detailed status is set in the
global variable 'short cnc_errno'.
1 : Error of Number of used tool
2 : Error of Number of turret index
3 : Error of Zero point tool number
4 : Error of Turret axis movement
5 : Error of Total number of punch operation
EW_NOOPT No option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function, and
relates to the following function.

Tool data setting function

CNC parameter: This function relates to the following parameter.


See the manual of CNC parameter for details.

Series 160 16265,..,16270

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

545
(3) Read Tool Data

Function Name:
cnc_rdtooldata

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdtooldata(unsigned short FlibHndl,
short s_no, short *number, IODBTLDT *tldt);
Description:
Reads the tool data.
The data is stored in each member of the IODBTLDT structure.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_no Specify the tool registration number.

1,..,(maximum tool registration number)

number Pointer to the number of tool data.


Specify the number of tool data to be read before function
call, and the number of tool data being read actually is
stored after the function call.

tldt Pointer to the IODBTLDT structure including the tool data.


The IODBTLDT structure is as follows.

typedef struct iodbtldt {


short slct; /* Flag of valid data */
long tool_no; /* Tool number */
long x_axis_ofs; /* X-axis offset */
long y_axis_ofs; /* Y-axis offset */
long turret_pos; /* Turret position */
long chg_tl_no; /* Tool number to be changed */
long punch_count;/* Number of punch operation */
long tool_life; /* Tool life */
long m_tl_radius;/* Radius of multiple tool */
long m_tl_angle; /* Angle of multiple tool */
char tl_shape; /* Tool shape(C) */
long tl_size_i; /* Tool size(I) */
long tl_size_j; /* Tool size(J) */
long tl_angle; /* Tool angle(K) */
long reserve[3]; /* (reserve) */
} IODBTLDT ;

546
slct Flag of valid data is set.
bit 0 : Tool number
bit 1 : X-axis offset
bit 2 : Y-axis offset
bit 3 : Turret position
bit 4 : Tool number to be changed
bit 5 : Number of punch operation
bit 6 : Tool life
bit 7 : Radius of multiple tool
bit 8 : Angle of multiple tool
bit 9 : Tool shape(C)
bit10 : Tool size(I)
bit11 : Tool size(J)
bit12 : Tool angle(K)
bit13,..,15 : (reserve)
* When some bit is 0, its data is invalid.

tool_no Tool number is set. (0,..)

x_axis_ofs X-axis offset is set.

y_axis_ofs Y-axis offset is set.

turret_pos Turret position is set.

chg_tl_no Tool number to be changed is set. (0,..)

punch_count Number of punch operation is set.


(0,..,99999999)

tool_life Tool life is set.


(valid with Tool life management function)

m_tl_radius Radius of multiple tool is set.


(valid with Multiple tool function
& Tool data setting function & 16282#5=0)

m_tl_angle Angle of multiple tool is set.


(valid with Multiple tool function
& Tool data setting function & 16282#5=0)

tl_shape Tool shape(C) is set.


(valid with Graphic function)

tl_size_i Tool size(I) is set.


(valid with Graphic function)

tl_size_j Tool size(J) is set.


(valid with Graphic function)

tl_angle Tool angle(K) is set.


(valid with Graphic function)

reserve (reserve)

547
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160P.
EW_LENGTH Data block length error
Number of data(number) is wrong.
EW_NUMBER Data number error
Start number(s_no) is wrong.
EW_NOOPT No option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function, and
relates to the following functions.

Multiple tool function


Tool data setting function
Tool life management function
Graphic function

CNC parameter: This function relates to the following parameter.


See the manual of CNC parameter for details.

Series 160 16280#0,#1,#2,#3,#4,#5,#6,#7


16281#1,#2,#4
16282#5
16284

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

548
(4) Write Tool Data

Function Name:
cnc_wrtooldata

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrtooldata(unsigned short FlibHndl,
short s_no, short *number, IODBTLDT *tldt);
Description:
Writes the tool data.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_no Specify the tool registration number.

1,..,(maximum tool registration number)

number Pointer to the number of tool data.


Specify the number of tool data to be written before function
call, and the number of tool data being written actually is
stored after the function call.

tldt Pointer to the IODBTLDT structure including the tool data.


The IODBTLDT structure is as follows.

typedef struct iodbtldt {


short slct; /* Flag of data selection */
long tool_no; /* Tool number */
long x_axis_ofs; /* X-axis offset */
long y_axis_ofs; /* Y-axis offset */
long turret_pos; /* Turret position */
long chg_tl_no; /* Tool number to be changed */
long punch_count;/* Number of punch operation */
long tool_life; /* Tool life */
long m_tl_radius;/* Radius of multiple tool */
long m_tl_angle; /* Angle of multiple tool */
char tl_shape; /* Tool shape(C) */
long tl_size_i; /* Tool size(I) */
long tl_size_j; /* Tool size(J) */
long tl_angle; /* Tool angle(K) */
long reserve[3]; /* (reserve) */
} IODBTLDT ;

549
slct Flag of data selection must be set.
bit 0 : Tool number
bit 1 : X-axis offset
bit 2 : Y-axis offset
bit 3 : Turret position
bit 4 : Tool number to be changed
bit 5 : Number of punch operation
bit 6 : Tool life
bit 7 : Radius of multiple tool
bit 8 : Angle of multiple tool
bit 9 : Tool shape(C)
bit10 : Tool size(I)
bit11 : Tool size(J)
bit12 : Tool angle(K)
bit13,..,15 : (reserve)
* When some bit is 1, its data is written.

tool_no Specify Tool number. (0,..)

x_axis_ofs Specify X-axis offset.

y_axis_ofs Specify Y-axis offset.

turret_pos Specify Turret position.

chg_tl_no Specify Tool number to be changed. (0,..)

punch_count Specify Number of punch operation.


(0,..,99999999)

tool_life Specify Tool life.


(valid with Tool life management function)

m_tl_radius Specify Radius of multiple tool.


(valid with Multiple tool function
& Tool data setting function & 16282#5=0)

m_tl_angle Specify Angle of multiple tool.


(valid with Multiple tool function
& Tool data setting function & 16282#5=0)

tl_shape Specify Tool shape(C).


(valid with Graphic function)

tl_size_i Specify Tool size(I).


(valid with Graphic function)

tl_size_j Specify Tool size(J).


(valid with Graphic function)

tl_angle Specify Tool angle(K).


(valid with Graphic function)

reserve (reserve)

550
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160P.
EW_LENGTH Data block length error
Number of data(number) is wrong.
EW_NUMBER Data number error
Start number(s_no) is wrong.
EW_DATA Data error
The tool data is wrong.
The following detailed status is set in the
global variable 'short cnc_errno'.
1 : Error of Tool number
2 : Error of X-axis offset
3 : Error of Y-axis offset
4 : Error of Turret position
5 : Error of Tool number to be changed
6 : Error of Number of punch operation
7 : Error of Tool life
8 : Error of Radius of multiple tool
9 : Error of Angle of multiple tool
10 : Error of Tool shape(C)
11 : Error of Tool size(I)
12 : Error of Tool size(J)
13 : Error of Tool angle(K)
The tool registration number which an error
occurred is set in the global variable
'short cnc_errdtno'.
EW_NOOPT No option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function, and
relates to the following functions.

Multiple tool function


Tool data setting function
Tool life management function
Graphic function

CNC parameter: This function relates to the following parameter.


See the manual of CNC parameter for details.

Series 160 16280#0,#1,#2,#3,#4,#5,#6,#7


16281#1,#2,#4
16282#5
16284

CNC mode: This function can be used in any CNC mode.

551
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

552
(5) Read Multiple Tool Data

Function Name:
cnc_rdmultitldt

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdmultitldt(unsigned short FlibHndl,
short s_no, short *number, IODBMLTTL *mlttl);
Description:
Reads the tool data for the multiple tool.
The data is stored in each member of the IODBMLTTL structure.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_no Specify the tool registration number.


1,..,(maximum tool registration number)

number Pointer to the number of multiple tool data.


Specify the number of multiple tool data to be read before
function call, and the number of multiple tool data being read
actually is stored after the function call.

mlttl Pointer to the IODBMLTTL structure including the multiple tool


data. The IODBMLTTL structure is as follows.
typedef struct iodbmlttl {
short slct; /* Flag of valid data */
short m_tl_no; /* Sub-tool number */
long m_tl_radius;/* Radius of multiple tool */
long m_tl_angle; /* Angle of multiple tool */
long x_axis_ofs; /* X-axis offset */
long y_axis_ofs; /* Y-axis offset */
char tl_shape; /* Tool shape(C) */
long tl_size_i; /* Tool size(I) */
long tl_size_j; /* Tool size(J) */
long tl_angle; /* Tool angle(K) */
long reserve[7]; /* (reserve) */
} IODBMLTTL ;

slct Flag of valid data is set.


bit 0 : Sub-tool number
bit 1 : Radius of multiple tool
bit 2 : Angle of multiple tool
bit 3 : X-axis offset
bit 4 : Y-axis offset
bit 5 : Tool shape(C)
bit 6 : Tool size(I)
bit 7 : Tool size(J)
bit 8 : Tool angle(K)
bit 9,..,15 : (reserve)
* When some bit is 0, its data is invalid.

553
m_tl_no Sub-tool number of multiple tool is set. (0,..)

m_tl_radius Radius of multiple tool is set.


(valid with Tool data setting function)

m_tl_angle Angle of multiple tool is set.

x_axis_ofs X-axis offset is set.


(valid with Tool data setting function)

y_axis_ofs Y-axis offset is set.

tl_shape Tool shape(C) is set.


(valid with Graphic function)

tl_size_i Tool size(I) is set.


(valid with Graphic function)

tl_size_j Tool size(J) is set.


(valid with Graphic function)

tl_angle Tool angle(K) is set.


(valid with Graphic function)

reserve (reserve)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160P.
EW_LENGTH Data block length error
Number of data(number) is wrong.
EW_NUMBER Data number error
Start number(s_no) is wrong.
EW_NOOPT No option
The multiple tool function and the extended
driver/library function are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the multiple tool function and the extended
driver/library function, and relates to the following functions.

Tool data setting function


Graphic function

CNC parameter: This function relates to the following parameter.


See the manual of CNC parameter for details.

Series 160 16282#1,#2,#3,#5,#6


16283#1,#2
16285, 16286

CNC mode: This function can be used in any CNC mode.

554
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

555
(6) Write Multiple Tool Data

Function Name:
cnc_wrmultitldt

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrmultitldt(unsigned short FlibHndl,
short s_no, short *number, IODBMLTTL *mlttl);
Description:
Writes the tool data for the multiple tool.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_no Specify the tool registration number.


1,..,(maximum tool registration number)

number Pointer to the number of multiple tool data.


Specify the number of multiple tool data to be written before
function call, and the number of multiple tool data being
written actually is stored after the function call.

mlttl Pointer to the IODBMLTTL structure including the multiple tool


data. The IODBMLTTL structure is as follows.

typedef struct iodbmlttl {


short slct; /* Flag of data selection */
short m_tl_no; /* Sub-tool number */
long m_tl_radius;/* Radius of multiple tool */
long m_tl_angle; /* Angle of multiple tool */
long x_axis_ofs; /* X-axis offset */
long y_axis_ofs; /* Y-axis offset */
char tl_shape; /* Tool shape(C) */
long tl_size_i; /* Tool size(I) */
long tl_size_j; /* Tool size(J) */
long tl_angle; /* Tool angle(K) */
long reserve[7]; /* (reserve) */
} IODBMLTTL ;

slct Flag of data selection must be set.


bit 0 : Sub-tool number
bit 1 : Radius of multiple tool
bit 2 : Angle of multiple tool
bit 3 : X-axis offset
bit 4 : Y-axis offset
bit 5 : Tool shape(C)
bit 6 : Tool size(I)
bit 7 : Tool size(J)
bit 8 : Tool angle(K)
bit 9,..,15 : (reserve)
* When some bit is 1, its data is written.

556
m_tl_no Specify Sub-tool number of multiple tool.(0,..)

m_tl_radius Specify Radius of multiple tool.


(valid with Tool data setting function)

m_tl_angle Specify Angle of multiple tool.

x_axis_ofs Specify X-axis offset.


(valid with Tool data setting function)

y_axis_ofs Specify Y-axis offset.

tl_shape Specify Tool shape(C).


(valid with Graphic function)

tl_size_i Specify Tool size(I).


(valid with Graphic function)

tl_size_j Specify Tool size(J).


(valid with Graphic function)

tl_angle Specify Tool angle(K).


(valid with Graphic function)

reserve (reserve)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160P.
EW_LENGTH Data block length error
Number of data(number) is wrong.
EW_NUMBER Data number error
Start number(s_no) is wrong.
EW_DATA Data error
The multiple tool data is wrong.
The following detailed status is set in the
global variable 'short cnc_errno'.
1 : Error of Sub-tool number
2 : Error of Radius of multiple tool
3 : Error of Angle of multiple tool
4 : Error of X-axis offset
5 : Error of Y-axis offset
6 : Error of Tool shape(C)
7 : Error of Tool size(I)
8 : Error of Tool size(J)
9 : Error of Tool angle(K)
The tool registration number which an error
occurred is set in the global variable
'short cnc_errdtno'.
EW_NOOPT No option
The multiple tool function and the extended
driver/library function are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

557
CNC option: This function needs the multiple tool function and the extended
driver/library function, and relates to the following functions.

Tool data setting function


Graphic function

CNC parameter: This function relates to the following parameter.


See the manual of CNC parameter for details.

Series 160 16282#1,#2,#3,#5,#6


16283#1,#2
16285, 16286

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

558
(7) Read Safety Zone Data

Function Name:
cnc_rdsafetyzone

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdsafetyzone(unsigned short FlibHndl,
short s_no, short *number, IODBSAFE *safe);
Description:
Reads the safety zone data.
The data is stored in each member of the IODBSAFE structure.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_no Specify the safety zone data number. (1,..,4)

number Pointer to the number of safety zone data.


Specify the number of safety zone data to be read before
function call, and the number of safety zone data being read
actually is stored after the function call.

safe Pointer to the IODBSAFE structure including the safety zone


data. The IODBSAFE structure is as follows.

typedef struct iodbsafe {


short slct; /* Flag of valid data */
long data[3]; /* Safety zone data */
} IODBSAFE ;

slct Flag of valid data is set.


type A type B
------+------
bit 0 : Item X2 W
bit 1 : Item X1 X
bit 2 : Item Y Y
bit 3,..,15 : (not used)
* When some bit is 0, its data is invalid.

data Safety zone data is set.


type A type B
------+------
data[0] : Item X2 W
data[1] : Item X1 X
data[2] : Item Y Y

559
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160P.
EW_LENGTH Data block length error
Number of data(number) is wrong.
EW_NUMBER Data number error
Start number(s_no) is wrong.
EW_NOOPT No option
The safety zone check function and the extended
driver/library function are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the safety zone check function and the
extended driver/library function.

CNC parameter: This function relates to the following parameter.


See the manual of CNC parameter for details.

Series 160 16500#0, 16505,..,16516

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

560
(8) Write Safety Zone Data

Function Name:
cnc_wrsafetyzone

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrsafetyzone(unsigned short FlibHndl,
short s_no, short *number, IODBSAFE *safe);
Description:
Writes the safety zone data.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_no Specify the safety zone data number. (1,..,4)

number Pointer to the number of safety zone data.


Specify the number of safety zone data to be written before
function call, and the number of safety zone data being written
actually is stored after the function call.

safe Pointer to the IODBSAFE structure including the safety zone


data. The IODBSAFE structure is as follows.

typedef struct iodbsafe {


short slct; /* Flag of data selection */
long data[3]; /* Safety zone data */
} IODBSAFE ;

slct Flag of data selection must be set.


type A type B
------+------
bit 0 : Item X2 W
bit 1 : Item X1 X
bit 2 : Item Y Y
bit 3,..,15 : (not used)
* When some bit is 1, its data is written.

data Safety zone data.


type A type B
------+------
data[0] : Item X2 W
data[1] : Item X1 X
data[2] : Item Y Y

561
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160P.
EW_LENGTH Data block length error
Number of data(number) is wrong.
EW_NUMBER Data number error
Start number(s_no) is wrong.
EW_DATA Data error
The safety zone data(data) is wrong.
The following detailed status is set in the
global variable 'short cnc_errno'.
type A type B
------+------
1 : Error of Item X2 W
2 : Error of Item X1 X
3 : Error of Item Y Y
The safety zone data number which an error
occurred is set in the global variable
'short cnc_errdtno'.
EW_NOOPT No option
The safety zone check function and the extended
driver/library function are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the safety zone check function and the
extended driver/library function.

CNC parameter: This function relates to the following parameter.


See the manual of CNC parameter for details.

Series 160 16500#0, 16505,..,16516

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

562
(9) Read Tool Zone Data

Function Name:
cnc_rdtoolzone

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdtoolzone(unsigned short FlibHndl,
short s_no, short *number, IODBTLZN *tlzone);
Description:
Reads the tool zone data.
The data is stored in each member of the IODBTLZN structure.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_no Specify the tool zone data number. (1,..,12)

number Pointer to the number of tool zone data.


Specify the number of tool zone data to be read before
function call, and the number of tool zone data being read
actually is stored after the function call.

tlzone Pointer to the IODBTLZN structure including the tool zone data.
The IODBTLZN structure is as follows.

typedef struct iodbtlzn {


short slct; /* Flag of valid data */
long data[2]; /* Tool zone data */
} IODBTLZN ;

slct Flag of valid data is set.


bit 0 : Item X
bit 1 : Item Y
bit 2,..,15 : (not used)
* When some bit is 0, its data is invalid.

data Tool zone data is set.


data[0] : Item X
data[1] : Item Y

563
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160P.
EW_LENGTH Data block length error
Number of data(number) is wrong.
EW_NUMBER Data number error
Start number(s_no) is wrong.
EW_NOOPT No option
The safety zone check function and the extended
driver/library function are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the safety zone check function and the
extended driver/library function.

CNC parameter: This function relates to the following parameter.


See the manual of CNC parameter for details.

Series 160 16517,..,16532, 16551,..,16558

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

564
(10) Write Tool Zone Data

Function Name:
cnc_wrtoolzone

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrtoolzone(unsigned short FlibHndl,
short s_no, short *number, IODBTLZN *tlzone);
Description:
Writes the tool zone data.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_no Specify the tool zone data number. (1,..,12)

number Pointer to the number of tool zone data.


Specify the number of tool zone data to be written before
function call, and the number of tool zone data being written
actually is stored after the function call.

tlzone Pointer to the IODBTLZN structure including the tool zone data.
The IODBTLZN structure is as follows.

typedef struct iodbtlzn {


short slct; /* Flag of data selection */
long data[2]; /* Tool zone data */
} IODBTLZN ;

slct Flag of data selection must be set.


bit 0 : Item X
bit 1 : Item Y
bit 2,..,15 : (not used)
* When some bit is 1, its data is written.

data Tool zone data.


data[0] : Item X
data[1] : Item Y

565
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160P.
EW_LENGTH Data block length error
Number of data(number) is wrong.
EW_NUMBER Data number error
Start number(s_no) is wrong.
EW_DATA Data error
The tool zone data(data) is wrong.
The following detailed status is set in the
global variable 'short cnc_errno'.
1 : Error of Item X
2 : Error of Item Y
The tool zone data number which an error
occurred is set in the global variable
'short cnc_errdtno'.
EW_NOOPT No option
The safety zone check function and the extended
driver/library function are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the safety zone check function and the
extended driver/library function.

CNC parameter: This function relates to the following parameter.


See the manual of CNC parameter for details.

Series 160 16517,..,16532, 16551,..,16558

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

566
(11) Read Actual Tool Zone Data

Function Name:
cnc_rdacttlzone

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdacttlzone(unsigned short FlibHndl,
ODBACTTLZN *acttlzn);
Description:
Reads the actual tool zone data number and data.
The number and data are stored in each member of the ODBACTTLZN
structure.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

acttlzn Pointer to the ODBACTTLZN structure including the actual number


and data for the tool zone.
The ODBACTTLZN structure is as follows.

typedef struct odbacttlzn {


short act_no; /* Actual tool zone data number */
long data[2]; /* Actual tool zone data */
} ODBACTTLZN ;

slct Flag of valid data is set.


bit 0 : Actual tool zone data number
bit 1 : Item X
bit 2 : Item Y
bit 3,..,15 : (not used)
* When some bit is 0, its data is invalid.

act_no Actual tool zone data number is set.(1,..,12)

data Actual tool zone data is set.


data[0] : Item X
data[1] : Item Y

567
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160P.
EW_NOOPT No option
The safety zone check function and the extended
driver/library function are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the safety zone check function and the
extended driver/library function.

CNC parameter: This function relates to the following parameter.


See the manual of CNC parameter for details.

Series 160 16517,..,16532, 16551,..,16558

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

568
(12) Read Number of Automatic Setting Zone

Function Name:
cnc_rdsetzone

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdsetzone(unsigned short FlibHndl, short *setzone);

Description:
Reads the number of safety zone which is set automatically.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

setzone Pointer to the variable for the number of automatic setting


zone. (0,..,4)

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 CNC data window" in "General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160P.
EW_NOOPT No option
The safety zone check function and the extended
driver/library function are necessary.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the safety zone check function and the
extended driver/library function.

CNC parameter: This function relates to the following parameter.


See the manual of CNC parameter for details.
Series 160 16534

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

569
(13) Write Number of Automatic Setting Zone

Function Name:
cnc_wrsetzone

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrsetzone(unsigned short FlibHndl, short setzone);

Description:
Writes the number of safety zone which is set automatically.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.
setzone Specify the number of automatic setting zone. (0,..,4)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160P.
EW_DATA Data error
The number of automatic setting zone(setzone) is wrong.
EW_NOOPT No option
The safety zone check function and the extended
driver/library function are necessary.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the safety zone check function and the
extended driver/library function.

CNC parameter: This function relates to the following parameter.


See the manual of CNC parameter for details.
Series 160 16534

CNC mode: This function can be used in any CNC mode.


Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

570
1.1.15 Function Reference Related to LASER

(1) Read Cutting Condition File (Cutting Data)

Function Name:
cnc_rdpscdproc

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdpscdproc(unsigned short FlibHndl,
short s_no, short *number, IODBPSCD *pscd);
Description:
Reads the cutting data of the cutting condition file.
The data is stored in each member of the IODBPSCD structure.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_no Specify a cutting data group number.

1 to 10 : cutting data group number

number Pointer to the number of cutting data.


Specify the number of cutting data to be read before function
call, and the number of cutting data being read actually is
stored after the function call.

pscd Pointer to the IODBPSCD structure including the cutting data


of the cutting condition file.
The IODBPSCD structure is as follows.

typedef struct iodbpscd {


short slct; /* Flag of valid data */
long feed; /* Feedrate */
short power; /* Cutting peak power */
short freq; /* Cutting frequency */
short duty; /* Cutting duty */
short g_press; /* Assist gas pressure */
short g_kind; /* Assist gas select */
short g_ready_t; /* Gas setting time */
short displace; /* Reference displace */
long supple; /* Beam radius offset */
short edge_slt; /* Edge cutting select */
short appr_slt; /* Start-up select */
short reserve[5]; /* (reserve) */
} IODBPSCD ;

slct Flag of valid data is set.


bit 0 : Feedrate
bit 1 : Cutting peak power
bit 2 : Cutting frequency
bit 3 : Cutting duty
bit 4 : Assist gas pressure
bit 5 : Assist gas select
bit 6 : Gas setting time
bit 7 : Reference displace
bit 8 : Beam radius offset

571
bit 9 : Edge cutting select
bit10 : Start-up select
bit11,..,15 : (reserve)
* When some bit is 0, its data is invalid.

feed Feedrate is set.


(Setting range: 0 to 99999, Unit: mm/min)

power Cutting peak power for contouring is set.


(Setting range: 0 to 9999, Unit: W)

freq Cutting frequency for contouring is set.


(Setting range: 5 to 2000, Unit: Hz)

duty Cutting duty for contouring is set.


(Setting range: 0 to 100, Unit: %)

g_press Assist gas pressure is set.


(Setting range: 0 to 255, Unit: 0.1Kg/cm2)

g_kind Assist gas select is set.


(Setting range: 1 to 7, Unit: kind)

g_ready_t Gas setting time is set.


(Setting range: 0 to 99, Unit: 0.1second)

displace Reference displace is set.


(Setting range: -9999 to 9999, Unit: 0.001mm)

supple Beam radius offset is set.


(Setting range: -9999 to 9999, Unit: 0.001mm)

edge_slt Edge cutting select is set.


(Setting range: 0, 201 to 205)

appr_slt Start-up select is set.


(Setting range: 0, 201 to 205)

reserve (reserve)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_LENGTH Data block length error
Number of data(number) is wrong.
EW_NUMBER Data number error
Start number(s_no) is wrong.
EW_NOOPT No option
The cutting condition setting function and the
extended driver/library function are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the cutting condition setting function
and the extended driver/library function are necessary.

572
CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

573
(2) Write Cutting Condition File (Cutting Data)

Function Name:
cnc_wrpscdproc

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrpscdproc(unsigned short FlibHndl,
short s_no, short *number, IODBPSCD *pscd);
Description:
Writes the cutting data of the cutting condition file.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_no Specify a cutting data group number.

1 to 10 : cutting data group number

number Pointer to the number of cutting data.


Specify the number of cutting data to be written before
function call, and the number of cutting data being written
actually is stored after the function call.

pscd Pointer to the IODBPSCD structure including the cutting data


of the cutting condition file.
The IODBPSCD structure is as follows.

typedef struct iodbpscd {


short slct; /* Flag of data selection */
long feed; /* Feedrate */
short power; /* Cutting peak power */
short freq; /* Cutting frequency */
short duty; /* Cutting duty */
short g_press; /* Assist gas pressure */
short g_kind; /* Assist gas select */
short g_ready_t; /* Assist gas setting time */
short displace; /* Reference displace */
long supple; /* Beam radius offset */
short edge_slt; /* Edge cutting select */
short appr_slt; /* Start-up select */
short reserve[5]; /* (reserve) */
} IODBPSCD ;

slct Flag of data selection must be set.


bit 0 : Feedrate
bit 1 : Cutting peak power
bit 2 : Cutting frequency
bit 3 : Cutting duty
bit 4 : Assist gas pressure
bit 5 : Assist gas select
bit 6 : Assist gas setting time
bit 7 : Reference displace
bit 8 : Beam radius offset
bit 9 : Edge cutting select
bit10 : Start-up select
bit11,..,15 : (reserve)
* When some bit is 1, its data is written.

574
feed Specify feedrate.
(Setting range: 0 to 99999, Unit: mm/min)

power Specify cutting peak power for contouring.


(Setting range: 0 to 9999, Unit: W)

freq Specify cutting frequency for contouring.


(Setting range: 5 to 2000, Unit: Hz)

duty Specify cutting duty for contouring.


(Setting range: 0 to 100, Unit: %)

g_press Specify assist gas pressure.


(Setting range: 0 to 255, Unit: 0.1Kg/cm2)

g_kind Specify assist gas select.


(Setting range: 1 to 7, Unit: kind)

g_ready_t Specify assist gas setting time.


(Setting range: 0 to 99, Unit: 0.1second)

displace Specify reference displace.


(Setting range: -9999 to 9999, Unit: 0.001mm)

supple Specify beam radius offset.


(Setting range: -9999 to 9999, Unit: 0.001mm)

edge_slt Specify edge cutting select.


(Setting range: 0, 201 to 205)

appr_slt Specify start-up select.


(Setting range: 0, 201 to 205)

reserve (reserve)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_LENGTH Data block length error
Number of data(number) is wrong.
EW_NUMBER Data number error
Start number(s_no) is wrong.
EW_DATA Data error
The cutting data of the cutting condition file
is wrong. The cutting data group number which
an error occurred is set in the global
variable 'short cnc_errno', and the following
detailed status is set in the global variable
'short cnc_errdtno'.
1 : Error of feedrate
2 : Error of cutting peak power
3 : Error of cutting frequency
4 : Error of cutting duty
5 : Error of assist gas pressure

575
6 : Error of assist gas select
7 : Error of assist gas setting time
8 : Error of reference displace
9 : Error of beam radius offset
10 : Error of edge cutting select
11 : Error of start-up select
EW_NOOPT No option
The cutting condition setting function and the
extended driver/library function are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the cutting condition setting function
and the extended driver/library function are necessary.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

576
(3) Read Cutting Condition File (Piercing Data)

Function Name:
cnc_rdpscdpirc

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdpscdpirc(unsigned short FlibHndl,
short s_no, short *number, IODBPIRC *pircing);
Description:
Reads the piercing data of the cutting condition file.
The data is stored in each member of the IODBPIRC structure.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_no Specify a piercing data group number.

101 to 103 : piercing data group number

number Pointer to the number of piercing data.


Specify the number of piercing data to be read before function
call, and the number of piercing data being read actually is
stored after the function call.

pircing Pointer to the IODBPIRC structure including the piercing data


of the cutting condition file.
The IODBPIRC structure is as follows.

typedef struct iodbpirc {


short slct; /* Flag of valid data */
short power; /* Peak power */
short freq; /* Initial frequency */
short duty; /* Initial duty */
short i_freq; /* Step frequency */
short i_duty; /* Step duty */
short step_t; /* Step time */
short step_sum; /* Step number */
long pier_t; /* Piercing time */
short g_press; /* Assist gas pressure */
short g_kind; /* Assist gas select */
short g_time; /* Assist gas setting time */
short def_pos; /* Reference displace */
short reserve[4]; /* (reserve) */
} IODBPIRC ;

slct Flag of valid data is set.


bit 0 : Peak power
bit 1 : Initial frequency
bit 2 : Initial duty
bit 3 : Step frequency
bit 4 : Step duty
bit 5 : Step time
bit 6 : Step number
bit 7 : Piercing time
bit 8 : Assist gas pressure
bit 9 : Assist gas select

577
bit10 : Assist gas setting time
bit11 : Reference displace
bit12,..,15 : (reserve)
* When some bit is 0, its data is invalid.

power Peak power is set.


(Setting range: 0 to 9999, Unit: W)

freq Initial frequency is set.


(Setting range: 5 to 2000, Unit: Hz)

duty Initial duty is set.


(Setting range: 0 to 100, Unit: %)

i_freq Step frequency is set.


(Setting range: 5 to 2000, Unit: Hz)

i_duty Step duty is set.


(Setting range: 0 to 99, Unit: %)

step_t Step time is set.


(Setting range: 0 to 9999, Unit: 0.001second)

step_sum Step number is set.


(Setting range: 0 to 99, Unit: time)

pier_t Piercing time is set.


(Setting range: 1 to 999999, Unit: 0.001sec.)

g_press Assist gas pressure is set.


(Setting range: 0 to 255, Unit: 0.1Kg/cm2)

g_kind Assist gas select is set.


(Setting range: 1 to 7, Unit: kind)

g_time Assist gas setting time is set.


(Setting range: 0 to 99, Unit: 0.1second)

def_pos Reference displace is set.


(Setting range: -9999 to 9999, Unit: 0.001mm)

reserve (reserve)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_LENGTH Data block length error
Number of data(number) is wrong.
EW_NUMBER Data number error
Start number(s_no) is wrong.
EW_NOOPT No option
The cutting condition setting function and the
extended driver/library function are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

578
CNC option: This function needs the cutting condition setting function
and the extended driver/library function are necessary.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

579
(4) Write Cutting Condition File (Piercing Data)

Function Name:
cnc_wrpscdpirc

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrpscdpirc(unsigned short FlibHndl,
short s_no, short *number, IODBPIRC *pircing);
Description:
Writes the piercing data of the cutting condition file.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_no Specify a piercing data group number.

101 to 103 : piercing data group number

number Pointer to the number of piercing data.


Specify the number of piercing data to be written before
function call, and the number of piercing data being written
actually is stored after the function call.

pircing Pointer to the IODBPIRC structure including the piercing data


of the cutting condition file.
The IODBPIRC structure is as follows.

typedef struct iodbpirc {


short slct; /* Flag of data selection */
short power; /* Peak power */
short freq; /* Initial frequency */
short duty; /* Initial duty */
short i_freq; /* Step frequency */
short i_duty; /* Step duty */
short step_t; /* Step time */
short step_sum; /* Step number */
long pier_t; /* Piercing time */
short g_press; /* Assist gas pressure */
short g_kind; /* Assist gas select */
short g_time; /* Assist gas setting time */
short def_pos; /* Reference displace */
short reserve[4]; /* (reserve) */
} IODBPIRC ;

slct Flag of data selection must be set.


bit 0 : Peak power
bit 1 : Initial frequency
bit 2 : Initial duty
bit 3 : Step frequency
bit 4 : Step duty
bit 5 : Step time
bit 6 : Step number
bit 7 : Piercing time
bit 8 : Assist gas pressure
bit 9 : Assist gas select
bit10 : Assist gas setting time

580
bit11 : Reference displace
bit12,..,15 : (reserve)
* When some bit is 1, its data is written.

power Specify peak power.


(Setting range: 0 to 9999, Unit: W)

freq Specify initial frequency.


(Setting range: 5 to 2000, Unit: Hz)

duty Specify initial duty.

(Setting range: 0 to 100, Unit: %)

i_freq Specify step frequency.


(Setting range: 5 to 2000, Unit: Hz)

i_duty Specify step duty.


(Setting range: 0 to 99, Unit: %)

step_t Specify step time.


(Setting range: 0 to 9999, Unit: 0.001second)

step_sum Specify step number.


(Setting range: 0 to 99, Unit: time)

pier_t Specify piercing time.


(Setting range: 1 to 999999, Unit: 0.001sec.)

g_press Specify assist gas pressure.


(Setting range: 0 to 255, Unit: 0.1Kg/cm2)

g_kind Specify assist gas select.


(Setting range: 1 to 7, Unit: kind)

g_time Specify assist gas setting time.


(Setting range: 0 to 99, Unit: 0.1second)

def_pos Specify reference displace.


(Setting range: -9999 to 9999, Unit: 0.001mm)

reserve (reserve)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_LENGTH Data block length error
Number of data(number) is wrong.
EW_NUMBER Data number error
Start number(s_no) is wrong.
EW_DATA Data error
The piercing data of the cutting condition file
is wrong. The piercing data group number which
an error occurred is set in the global
variable 'short cnc_errno', and the following
detailed status is set in the global variable
'short cnc_errdtno'.
581
1 : Error of peak power
2 : Error of initial frequency
3 : Error of initial duty
4 : Error of step frequency
5 : Error of step duty
6 : Error of step time
7 : Error of step number
8 : Error of piercing time
9 : Error of assist gas pressure
10 : Error of assist gas select
11 : Error of assist gas setting time
12 : Error of reference displace
EW_NOOPT No option
The cutting condition setting function and the
extended driver/library function are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the cutting condition setting function
and the extended driver/library function are necessary.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

582
(5) Read Cutting Condition File (Edge Cutting Data)

Function Name:
cnc_rdpscdedge

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdpscdedge(unsigned short FlibHndl,
short s_no, short *number, IODBEDGE *edge);
Description:
Reads the edge cutting data of the cutting condition file.
The data is stored in each member of the IODBEDGE structure.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_no Specify a edge cutting data group number.

201 to 205 : edge cutting data group number

number Pointer to the number of edge cutting data.


Specify the number of edge cutting data to be read before
function call, and the number of edge cutting data being read
actually is stored after the function call.

edge Pointer to the IODBEDGE structure including the edge cutting


data of the cutting condition file.
The IODBEDGE structure is as follows.

typedef struct iodbedge {


short slct; /* Flag of valid data */
short angle; /* Judge angle for edge */
short power; /* Piercing power */
short freq; /* Piercing frequency */
short duty; /* Piercing duty */
long pier_t; /* Piercing time */
short g_press; /* Piercing gas press */
short g_kind; /* Piercing gas select */
long r_len; /* Recovery distance */
short r_feed; /* Recovery feedrate */
short r_freq; /* Recovery frequency */
short r_duty; /* Recovery duty */
short reserve[5]; /* (reserve) */
} IODBEDGE ;

slct Flag of valid data is set.


bit 0 : Judge angle for edge
bit 1 : Piercing power
bit 2 : Piercing frequency
bit 3 : Piercing duty
bit 4 : Piercing time
bit 5 : Piercing gas press
bit 6 : Piercing gas select
bit 7 : Recovery distance
bit 8 : Recovery feedrate
bit 9 : Recovery frequency
bit10 : Recovery duty
bit11,..,15 : (reserve)
* When some bit is 0, its data is invalid.

583
angle Judge angle for edge is set.
(Setting range: 0 to 180, Unit: degree)

power Piercing power (peak value) is set.


(Setting range: 0 to 9999, Unit: W)

freq Piercing frequency is set.


(Setting range: 5 to 2000, Unit: Hz)

duty Piercing duty is set.


(Setting range: 0 to 100, Unit: %)

pier_t Piercing time is set.


(Setting range: 0 to 999999, Unit: 0.001sec.)

g_press Piercing gas press (assist gas pressure) is set.


(Setting range: 0 to 255, Unit: 0.1Kg/cm2)

g_kind Piercing gas select (kind of assist gas) is set.


(Setting range: 1 to 7, Unit: kind)

r_len Recovery distance is set.


(Setting range: 0 to 99999, Unit: 0.001mm)

r_feed Recovery feedrate is set.


(Setting range: 0 to 9999, Unit: mm/min)

r_freq Recovery frequency is set.


(Setting range: 5 to 2000, Unit: Hz)

r_duty Recovery duty is set.


(Setting range: 0 to 100, Unit: %)

reserve (reserve)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_LENGTH Data block length error
Number of data(number) is wrong.
EW_NUMBER Data number error
Start number(s_no) is wrong.
EW_NOOPT No option
The cutting condition setting function,
the edge cutting function and the extended
driver/library function are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the cutting condition setting function,
the edge cutting function and the extended driver/library
function are necessary.

CNC parameter: This function doesn't relate to CNC parameter.

584
CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

585
(6) Write Cutting Condition File (Edge Cutting Data)

Function Name:
cnc_wrpscdedge

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrpscdedge(unsigned short FlibHndl,
short s_no, short *number, IODBEDGE *edge);
Description:
Writes the edge cutting data of the cutting condition file.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_no Specify a edge cutting data group number.

201 to 205 : edge cutting data group number

number Pointer to the number of edge cutting data.


Specify the number of edge cutting data to be written before
function call, and the number of edge cutting data being
written actually is stored after the function call.

edge Pointer to the IODBEDGE structure including the edge cutting


data of the cutting condition file.
The IODBEDGE structure is as follows.

typedef struct iodbedge {


short slct; /* Flag of data selection */
short angle; /* Judge angle for edge */
short power; /* Piercing power */
short freq; /* Piercing frequency */
short duty; /* Piercing duty */
long pier_t; /* Piercing time */
short g_press; /* Piercing gas press */
short g_kind; /* Piercing gas select */
long r_len; /* Recovery distance */
short r_feed; /* Recovery feedrate */
short r_freq; /* Recovery frequency */
short r_duty; /* Recovery duty */
short reserve[5]; /* (reserve) */
} IODBEDGE ;

slct Flag of data selection must be set.


bit 0 : Judge angle for edge
bit 1 : Piercing power
bit 2 : Piercing frequency
bit 3 : Piercing duty
bit 4 : Piercing time
bit 5 : Piercing gas press
bit 6 : Piercing gas select
bit 7 : Recovery distance
bit 8 : Recovery feedrate
bit 9 : Recovery frequency
bit10 : Recovery duty
bit11,..,15 : (reserve)
* When some bit is 1, its data is written.

586
angle Specify judge angle for edge.
(Setting range: 0 to 180, Unit: degree)

power Specify piercing power (peak value).


(Setting range: 0 to 9999, Unit: W)

freq Specify piercing frequency.


(Setting range: 5 to 2000, Unit: Hz)

duty Specify piercing duty.


(Setting range: 0 to 100, Unit: %)

pier_t Specify piercing time.


(Setting range: 0 to 999999, Unit: 0.001sec.)

g_press Specify piercing gas press(assist gas pressure).


(Setting range: 0 to 255, Unit: 0.1Kg/cm2)

g_kind Specify piercing gas select(kind of assist gas).


(Setting range: 1 to 7, Unit: kind)

r_len Specify recovery distance.


(Setting range: 0 to 99999, Unit: 0.001mm)

r_feed Specify recovery feedrate.


(Setting range: 0 to 9999, Unit: mm/min)

r_freq Specify recovery frequency.


(Setting range: 5 to 2000, Unit: Hz)

r_duty Specify recovery duty.


(Setting range: 0 to 100, Unit: %)

reserve (reserve)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_LENGTH Data block length error
Number of data(number) is wrong.
EW_NUMBER Data number error
Start number(s_no) is wrong.
EW_DATA Data error
The edge cutting data of the cutting condition
file is wrong. The edge cutting data group
number which an error occurred is set in the
global variable 'short cnc_errno', and the
following detailed status is set in the global
variable 'short cnc_errdtno'.
1 : Error of judge angle for edge
2 : Error of piercing power
3 : Error of piercing frequency
4 : Error of piercing duty
5 : Error of piercing time
6 : Error of piercing gas press
7 : Error of piercing gas select

587
8 : Error of recovery distance
9 : Error of recovery feedrate
10 : Error of recovery frequency
11 : Error of recovery duty
EW_NOOPT No option
The cutting condition setting function,
the edge cutting function and the extended
driver/library function are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the cutting condition setting function,
the edge cutting function and the extended driver/library
function are necessary.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

588
(7) Read Cutting Condition File (Slope Control Data)

Function Name:
cnc_rdpscdslop

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdpscdslop(unsigned short FlibHndl,
short s_no, short *number, IODBSLOP *slope);
Description:
Reads the slope control data of the cutting condition file.
The data is stored in each member of the IODBSLOP structure.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_no Specify a slope control data group number.

301 to 305 : slope control data group number(UP/DOWN)

number Pointer to the number of slope control data.


Specify the number of slope control data to be read before
function call, and the number of slope control data being read
actually is stored after the function call.

slope Pointer to the IODBSLOP structure including the slope control


data of the cutting condition file.
The IODBSLOP structure is as follows.

typedef struct iodbslop {


long slct; /* Flag of valid data */
long upleng; /* Step(UP) distance */
short upsp[10]; /* Step(UP) power 1 to 10 */
long dwleng; /* Step(DOWN) distance */
short dwsp[10]; /* Step(DOWN) power 1 to 10 */
short reserve[10];/* (reserve) */
} IODBSLOP ;

slct Flag of valid data is set.


bit 0 : Step(UP) distance
bit 1 : Step(UP) power 1
bit 2 : Step(UP) power 2
bit 3 : Step(UP) power 3
bit 4 : Step(UP) power 4
bit 5 : Step(UP) power 5
bit 6 : Step(UP) power 6
bit 7 : Step(UP) power 7
bit 8 : Step(UP) power 8
bit 9 : Step(UP) power 9
bit10 : Step(UP) power10
bit11 : Step(DOWN) distance
bit12 : Step(DOWN) power 1
bit13 : Step(DOWN) power 2
bit14 : Step(DOWN) power 3
bit15 : Step(DOWN) power 4
bit16 : Step(DOWN) power 5
bit17 : Step(DOWN) power 6
bit18 : Step(DOWN) power 7

589
bit19 : Step(DOWN) power 8
bit20 : Step(DOWN) power 9
bit21 : Step(DOWN) power10
bit22,..,31 : (reserve)
* When some bit is 0, its data is invalid.

up_leng Step(UP) distance is set.

upsp Step(UP) power is set.


upsp[0] : Step power 1
upsp[1] : Step power 2
:
upsp[9] : Step power 9
upsp[10] : Step power10

dw_leng Step(DOWN) distance is set.

dwsp Step(DOWN) power is set.


dwsp[0] : Step power 1
dwsp[1] : Step power 2
:
dwsp[9] : Step power 9
dwsp[10] : Step power10

reserve (reserve)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_LENGTH Data block length error
Number of data(number) is wrong.
EW_NUMBER Data number error
Start number(s_no) is wrong.
EW_NOOPT No option
The cutting condition setting function,
the slope control function and the extended
driver/library function are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the cutting condition setting function,
the slope control function and the extended driver/library
function are necessary.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

590
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

591
(8) Write Cutting Condition File (Slope Control Data)

Function Name:
cnc_wrpscdslop

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrpscdslop(unsigned short FlibHndl,
short s_no, short *number, IODBSLOP *slope);
Description:
Writes the slope control data of the cutting condition file.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_no Specify a slope control data group number.

301 to 305 : slope control data group number(UP/DOWN)

number Pointer to the number of slope control data.


Specify the number of slope control data to be written before
function call, and the number of slope control data being
written actually is stored after the function call.

slope Pointer to the IODBSLOP structure including the slope control


data of the cutting condition file.
The IODBSLOP structure is as follows.

typedef struct iodbslop {


long slct; /* Flag of data selection */
long upleng; /* Step(UP) distance */
short upsp[10]; /* Step(UP) power 1 to 10 */
long dwleng; /* Step(DOWN) distance */
short dwsp[10]; /* Step(DOWN) power 1 to 10 */
short reserve[10];/* (reserve) */
} IODBSLOP ;

slct Flag of data selection must be set.


bit 0 : Step(UP) distance
bit 1 : Step(UP) power 1
bit 2 : Step(UP) power 2
bit 3 : Step(UP) power 3
bit 4 : Step(UP) power 4
bit 5 : Step(UP) power 5
bit 6 : Step(UP) power 6
bit 7 : Step(UP) power 7
bit 8 : Step(UP) power 8
bit 9 : Step(UP) power 9
bit10 : Step(UP) power10
bit11 : Step(DOWN) distance
bit12 : Step(DOWN) power 1
bit13 : Step(DOWN) power 2
bit14 : Step(DOWN) power 3
bit15 : Step(DOWN) power 4
bit16 : Step(DOWN) power 5
bit17 : Step(DOWN) power 6
bit18 : Step(DOWN) power 7

592
bit19 : Step(DOWN) power 8
bit20 : Step(DOWN) power 9
bit21 : Step(DOWN) power10
bit22,..,31 : (reserve)
* When some bit is 1, its data is written.

up_leng Specify step(UP) distance.

upsp Specify step(UP) power is set.


upsp[0] : Step power 1
upsp[1] : Step power 2
:
upsp[9] : Step power 9
upsp[10] : Step power10

dw_leng Specify step(DOWN) distance is set.

dwsp Specify step(DOWN) power is set.


dwsp[0] : Step power 1
dwsp[1] : Step power 2
:
dwsp[9] : Step power 9
dwsp[10] : Step power10

reserve (reserve)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_LENGTH Data block length error
Number of data(number) is wrong.
EW_NUMBER Data number error
Start number(s_no) is wrong.
EW_DATA Data error
The slope control data of the cutting condition
file is wrong. The slope control data group
number which an error occurred is set in the
global variable 'short cnc_errno', and the
following detailed status is set in the global
variable 'short cnc_errdtno'.
1 : Error of step(UP) distance
2 : Error of step(UP) power 1
3 : Error of step(UP) power 2
4 : Error of step(UP) power 3
5 : Error of step(UP) power 4
6 : Error of step(UP) power 5
7 : Error of step(UP) power 6
8 : Error of step(UP) power 7
9 : Error of step(UP) power 8
10 : Error of step(UP) power 9
11 : Error of step(UP) power10
12 : Error of step(DOWN) distance
13 : Error of step(DOWN) power 1
14 : Error of step(DOWN) power 2
15 : Error of step(DOWN) power 3

593
16 : Error of step(DOWN) power 4
17 : Error of step(DOWN) power 5
18 : Error of step(DOWN) power 6
19 : Error of step(DOWN) power 7
20 : Error of step(DOWN) power 8
21 : Error of step(DOWN) power 9
22 : Error of step(DOWN) power10
EW_NOOPT No option
The cutting condition setting function,
the slope control function and the extended
driver/library function are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the cutting condition setting function,
the slope control function and the extended driver/library
function are necessary.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

594
(9) Read Duty Data for Power Control

Function Name:
cnc_rdlpwrdty

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdlpwrdty(unsigned short FlibHndl,
IODBLPWDT *pwrdty);
Description:
Reads the duty data for power control.
The data is stored in each member of the IODBLPWDT structure.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

pwrdty Pointer to the IODBLPWDT structure including the duty data for
power control. The IODBLPWDT structure is as follows.

typedef struct iodblpwdt {


short slct; /* Flag of valid data */
short dty_const; /* Constant of duty for power control */
short dty_min; /* Minimum duty for power control */
short reserve[6];/* (reserve) */
} IODBLPWDT ;

slct Flag of valid data is set.


bit 0 : Constant of duty for power control
bit 1 : Minimum duty for power control
bit 2,..,7 : (reserve)
bit 8,..,15 : (not used)
* When some bit is 0, its data is invalid.

dty_const Constant of duty for power control is set.

dty_min Minimum duty for power control is set.

reserve (reserve)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_NOOPT No option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function.

CNC parameter: This function doesn't relate to CNC parameter.

595
CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

596
(10) Write Duty Data for Power Control

Function Name:
cnc_wrlpwrdty

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrlpwrdty(unsigned short FlibHndl,
IODBLPWDT *pwrdty);
Description:
Writes the duty data for power control.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

pwrdty Pointer to the IODBLPWDT structure including the duty data for
power control. The IODBLPWDT structure is as follows.

typedef struct iodblpwdt {


short slct; /* Flag of data selection */
short dty_const; /* Constant of duty for power control */
short dty_min; /* Minimum duty for power control */
short reserve[6];/* (reserve) */
} IODBLPWDT ;

slct Flag of data selection must be set.


bit 0 : Constant of duty for power control
bit 1 : Minimum duty for power control
bit 2,..,7 : (reserve)
bit 8,..,15 : (not used)
* When some bit is 1, its data is written.

dty_const Specify constant of duty for power control.

dty_min Specify minimum duty for power control.

reserve (reserve)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_DATA Data error
The duty data for power control is wrong.
The following detailed status is set in the
global variable 'short cnc_errno'.
1 : Error of constant of duty for power control
2 : Error of minimum duty for power control
EW_NOOPT No option
The extended driver/library function is
necessary.

597
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

598
(11) Read Laser Power Data

Function Name:
cnc_rdlpwrdat

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdlpwrdat(unsigned short FlibHndl,
ODBLOPDT *pwrdat);
Description:
Reads the laser power data.
The data is stored in each member of the ODBLOPDT structure.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

pwrdat Pointer to the ODBLOPDT structure including the laser power


data. The ODBLOPDT structure is as follows.

typedef struct odblopdt {


short slct; /* Flag of valid data */
short pwr_mon; /* Power monitor value */
short pwr_ofs; /* Power offset */
short pwr_act; /* Actual laser power */
long feed_act; /* Actual feedrate */
short reserve[4]; /* (reserve) */
} ODBLOPDT ;

slct Flag of valid data is set.


bit 0 : Power monitor value
bit 1 : Power offset
bit 2 : Actual laser power
bit 3 : Actual feedrate
bit 4,..,7 : (reserve)
bit 8,..,15 : (not used)
* When some bit is 0, its data is invalid.

pwr_mon Power monitor value is set.

pwr_ofs Power offset is set.

pwr_act Actual laser power is set.

feed_act Actual feedrate is set.

reserve (rerserve)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_NOOPT No option
The extended driver/library function is
necessary.

599
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

600
(12) Read Power Compensation Coefficient

Function Name:
cnc_rdlpwrcpst

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdlpwrcpst(unsigned short FlibHndl,
short *pwrcpst);
Description:
Reads the power compensation coefficient.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

pwrcpst Pointer to the variable for the power compensation coefficient.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_NOOPT No option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

601
(13) Write Power Compensation Coefficient

Function Name:
cnc_wrlpwrcpst

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrlpwrcpst(unsigned short FlibHndl, short pwrcpst);

Description:
Writes the power compensation coefficient.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

pwrcpst Specify the power compensation coefficient.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_DATA Data error
The power compensation coefficient(pwrcpst) is
wrong.
EW_NOOPT No option
The extended driver/library function is
necessary.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

602
(14) Read Assist Gas Selection

Function Name:
cnc_rdlagslt

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdlagslt(unsigned short FlibHndl,
IODBLAGSL *agslt);
Description:
Reads the assist gas selection of laser setting data.
The data is stored in each member of the IODBLAGSL structure.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

agslt Pointer to the IODBLAGSL structure including the assist gas


selection of laser setting data.
The IODBLAGSL structure is as follows.

typedef struct iodblagsl {


short slct; /* Flag of valid data */
short ag_slt; /* Assist gas selection */
short agflow_slt; /* Assist gas flow selection */
short reserve[6]; /* (reserve) */
} IODBLAGSL ;

slct Flag of valid data is set.


bit 0 : Assist gas selection
bit 1 : Assist gas flow selection
bit 2,..,7 : (reserve)
bit 8,..,15 : (not used)
* When some bit is 0, its data is invalid.

ag_slt Assist gas selection is set.

agflow_slt Assist gas flow selection is set.

reserve (reserve)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_NOOPT No option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function.

603
CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

604
(15) Write Assist Gas Selection

Function Name:
cnc_wrlagslt

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrlagslt(unsigned short FlibHndl,
IODBLAGSL *agslt);
Description:
Writes the assist gas selection of laser setting data.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

agslt Pointer to the IODBLAGSL structure including the assist gas


selection of laser setting data. The IODBLAGSL structure is:

typedef struct iodblagsl {


short slct; /* Flag of data selection */
short ag_slt; /* Assist gas selection */
short agflow_slt; /* Assist gas flow selection */
short reserve[6]; /* (reserve) */
} IODBLAGSL ;

slct Specify flag of data selection.


bit 0 : Assist gas selection
bit 1 : Assist gas flow selection
bit 2,..,7 : (reserve)
bit 8,..,15 : (not used)
* When some bit is 1, its data is written.

ag_slt Specify assist gas selection.

agflow_slt Specify assist gas flow selection.

reserve (reserve)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_DATA Data error
The assist gas selection of laser setting data
is wrong.
The following detailed status is set in the
global variable 'short cnc_errno'.
1 : Error of assist gas selection
2 : Error of assist gas flow selection
EW_NOOPT No option
The extended driver/library function is
necessary.

605
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

606
(16) Read Assist Gas Flow

Function Name:
cnc_rdlagst

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdlagst(unsigned short FlibHndl,
IODBLAGST *agst);
Description:
Reads the assist gas flow of laser setting data.
The data is stored in each member of the IODBLAGST structure.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

agst Pointer to the IODBLAGST structure including the assist gas


flow of laser setting data.
The IODBLAGST structure is as follows.

typedef struct iodblagst {


struct {
short slct; /* Flag of valid data */
short pre_time; /* Time for previous step */
short pre_press; /* Pressure in previous step */
short proc_press; /* Machining pressure */
short end_time; /* Time for subsequent step */
short end_press; /* Pressure in subsequent step */
short reserve[3]; /* (reserve) */
} gasflow[3] ;
} IODBLAGST ;

agst.gasflow[0] : Assist gas flow 1


agst.gasflow[1] : Assist gas flow 2
agst.gasflow[2] : Assist gas flow 3

slct Flag of valid data is set.


bit 0 : Time for previous step
bit 1 : Pressure in previous step
bit 2 : Machining pressure
bit 3 : Time for subsequent step
bit 4 : Pressure in subsequent step
bit 5,..,7 : (reserve)
bit 8,..,15 : (not used)
* When some bit is 0, its data is invalid.

pre_time Time for previous step is set.

pre_press Pressure in previous step is set.

proc_press Machining pressure is set.

end_time Time for subsequent step is set.

end_press Pressure in subsequent step is set.

reserve (reserve)

607
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_NOOPT No option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

608
(17) Write Assist Gas Flow

Function Name:
cnc_wrlagst

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrlagst(unsigned short FlibHndl,
IODBLAGST *agst);
Description:
Writes the assist gas flow of laser setting data.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

agst Pointer to the IODBLAGST structure including the assist gas


flow of laser setting data.
The IODBLAGST structure is as follows.

typedef struct iodblagst {


struct {
short slct; /* Flag of data selection */
short pre_time; /* Time for previous step */
short pre_press; /* Pressure in previous step */
short proc_press; /* Machining pressure */
short end_time; /* Time for subsequent step */
short end_press; /* Pressure in subsequent step */
short reserve[3]; /* (reserve) */
} gasflow[3] ;
} IODBLAGST ;

agst.gasflow[0] : Assist gas flow 1


agst.gasflow[1] : Assist gas flow 2
agst.gasflow[2] : Assist gas flow 3

slct Specify flag of data selection.


bit 0 : Time for previous step
bit 1 : Pressure in previous step
bit 2 : Machining pressure
bit 3 : Time for subsequent step
bit 4 : Pressure in subsequent step
bit 5,..,7 : (reserve)
bit 8,..,15 : (not used)
* When some bit is 1, its data is written.

pre_time Specify time for previous step.

pre_press Specify pressure in previous step.

proc_press Specify machining pressure.

end_time Specify time for subsequent step.

end_press Specify pressure in subsequent step.

reserve (reserve)

609
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_DATA Data error
The assist gas flow of laser setting data is
wrong.
The following detailed status is set in the
global variable 'short cnc_errno'.
1 : Error of time for previous step
2 : Error of pressure in previous step
3 : Error of machining pressure
4 : Error of time for subsequent step
5 : Error of pressure in subsequent step
EW_NOOPT No option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

610
(18) Read Laser Power for Contouring

Function Name:
cnc_rdledgprc

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdledgprc(unsigned short FlibHndl,
IODBLEGPR *edgepr);
Description:
Reads the laser power for contouring.
The data is stored in each member of the IODBLEGPR structure.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

edgepr Pointer to the IODBLEGPR structure including the laser power


for contouring. The IODBLEGPR structure is as follows.

typedef struct iodblegpr {


short slct; /* Flag of valid data */
short power; /* Peak power */
short freq; /* Pulse frequency */
short duty; /* Pulse duty */
short reserve[5]; /* (reserve) */
} IODBLEGPR ;

slct Flag of valid data is set.


bit 0 : Peak power
bit 1 : Pulse frequency
bit 2 : Pulse duty
bit 3,..,7 : (reserve)
bit 8,..,15 : (not used)
* When some bit is 0, its data is invalid.

power Peak power is set.

freq Pulse frequency is set.

duty Pulse duty is set.

reserve (reserve)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_NOOPT No option
The extended driver/library function is
necessary.

611
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

612
(19) Write Laser Power for Contouring

Function Name:
cnc_wrledgprc

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrledgprc(unsigned short FlibHndl,
IODBLEGPR *edgepr);
Description:
Writes the laser power for contouring.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

edgepr Pointer to the IODBLEGPR structure including the laser power


for contouring. The IODBLEGPR structure is as follows.

typedef struct iodblegpr {


short slct; /* Flag of data selection */
short power; /* Peak power */
short freq; /* Pulse frequency */
short duty; /* Pulse duty */
short reserve[5]; /* (reserve) */
} IODBLEGPR ;

slct Specify flag of data selection.


bit 0 : Peak power
bit 1 : Pulse frequency
bit 2 : Pulse duty
bit 3,..,7 : (reserve)
bit 8,..,15 : (not used)
* When some bit is 1, its data is written.

power Specify peak power.

freq Specify pulse frequency.

duty Specify pulse duty.

reserve (reserve)

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 CNC data window" in "General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_DATA Data error
The laser power for contouring is wrong.
The following detailed status is set in the
global variable 'short cnc_errno'.
1 : Error of peak power
2 : Error of pulse frequency
3 : Error of pulse duty

613
EW_NOOPT No option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

614
(20) Read Laser Power for Piercing

Function Name:
cnc_rdlprcprc

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdlprcprc(unsigned short FlibHndl,
IODBLPCPR *pierpr);
Description:
Reads the laser power for piercing.
The data is stored in each member of the IODBLPCPR structure.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

pierpr Pointer to the IODBLPCPR structure including the laser power


for piercing. The IODBLPCPR structure is as follows.

typedef struct iodblpcpr {


short slct; /* Flag of valid data */
short power; /* Piercing initial peak power */
short freq; /* Piercing initial pulse frequency */
short duty; /* Piercing initial pulse duty */
long time; /* Piercing time */
short reserve[4]; /* (reserve) */
} IODBLPCPR ;

slct Flag of valid data is set.


bit 0 : Piercing initial peak power
bit 1 : Piercing initial pulse frequency
bit 2 : Piercing initial pulse duty
bit 3 : Piercing time
bit 4,..,7 : (reserve)
bit 8,..,15 : (not used)
* When some bit is 0, its data is invalid.

power Piercing initial peak power is set.

freq Piercing initial pulse frequency is set.

duty Piercing initial pulse duty is set.

time Piercing time is set.

reserve (reserve)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_NOOPT No option
The extended driver/library function is
necessary.

615
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

616
(21) Write Laser Power for Piercing

Function Name:
cnc_wrlprcprc

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrlprcprc(unsigned short FlibHndl,
IODBLPCPR *pierpr);
Description:
Writes the laser power for piercing.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

pierpr Pointer to the IODBLPCPR structure including the laser power


for piercing. The IODBLPCPR structure is as follows.

typedef struct iodblpcpr {


short slct; /* Flag of data selection */
short power; /* Piercing initial peak power */
short freq; /* Piercing initial pulse frequency */
short duty; /* Piercing initial pulse duty */
long time; /* Piercing time */
short reserve[4]; /* (reserve) */
} IODBLPCPR ;

slct Specify flag of data selection.


bit 0 : Piercing initial peak power
bit 1 : Piercing initial pulse frequency
bit 2 : Piercing initial pulse duty
bit 3 : Piercing time
bit 4,..,7 : (reserve)
bit 8,..,15 : (not used)
* When some bit is 1, its data is written.

power Specify piercing initial peak power.

freq Specify piercing initial pulse frequency.

duty Specify piercing initial pulse duty.

time Specify piercing time.

reserve (reserve)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_DATA Data error
The laser power for piercing is wrong.
The following detailed status is set in the
global variable 'short cnc_errno'.

617
1 : Error of piercing initial peak power
2 : Error of piercing initial pulse frequency
3 : Error of piercing initial pulse duty
4 : Error of piercing time
EW_NOOPT No option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

618
(22) Read Command Data of Laser

Function Name:
cnc_rdlcmddat

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdlcmddat(unsigned short FlibHndl,
ODBLCMDT *cmddat);
Description:
Reads the command data of laser.
The data is stored in each member of the ODBLCMDT structure.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

cmddat Pointer to the ODBLCMDT structure including the command data


of laser. The ODBLCMDT structure is as follows.

typedef struct iodblcmdt {


short slct; /* Flag of valid data */
long feed; /* Actual feedrate */
short power; /* Actual peak power */
short freq; /* Actual pulse frequency */
short duty; /* Actual pulse duty */
short g_kind; /* Command data of assist gas select */
short g_ready_t; /* Assist gas time */
short g_press; /* Actual assist gas pressure */
short error; /* Command data of reference displace */
long dsplc; /* Command data of tool radius offset */
short reserve[7];/* (reserve) */
} ODBLCMDT ;

slct Flag of valid data is set.


bit 0 : Actual feedrate
bit 1 : Actual peak power
bit 2 : Actual pulse frequency
bit 3 : Actual pulse duty
bit 4 : Command data of assist gas select
bit 5 : Assist gas time
bit 6 : Actual assist gas pressure
bit 7 : Command data of reference displace
bit 8 : Command data of tool radius offset
bit 9,..,15 : (reserve)
* When some bit is 0, its data is invalid.

feed Actual feedrate is set.

power Actual peak power is set.

freq Actual pulse frequency is set.

619
duty Actual pulse duty is set.

g_kind Command data of assist gas select is set.

g_ready_t Assist gas time is set.

g_press Actual assist gas pressure is set.

error Command data of reference displace is set.

dsplc Command data of tool radius offset is set.

reserve (reserve)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_NOOPT No option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

620
(23) Read Command Data of Reference Displace

Function Name:
cnc_rdldsplc

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdldsplc(unsigned short FlibHndl,
short *dsplc);
Description:
Reads the command data of reference displace.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

dsplc Pointer to the variable for the command data of reference


displace.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_NOOPT No option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

621
(24) Write Command Data of Reference Displace

Function Name:
cnc_wrldsplc

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrldsplc(unsigned short FlibHndl,
short dsplc);
Description:
Writes the command data of reference displace.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

dsplc Specify the command data of reference displace.

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 CNC data window" in "General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_DATA Data error
The command data of reference displace(dsplc)
is wrong.
EW_NOOPT No option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

622
(25) Read Error of Z-Axis Tracing

Function Name:
cnc_rdlerrz

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdlerrz(unsigned short FlibHndl,short *errz);

Description:
Reads the error of Z-axis tracing.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

errz Pointer to the variable for the error of Z-axis tracing.


(Output range: -10000 to 10000, Unit: 0.001mm)
(Output range: -3938 to 3938, Unit: 0.0001inch)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_NOOPT No option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

623
(26) Read Active Cutting Number / Piercing Number / Slope Number

Function Name:
cnc_rdlactnum

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdlactnum(unsigned short FlibHndl,
ODBLACTN *actno);
Description:
Reads the active cutting number, active piercing number and active
slope number.
The data is stored in each member of the ODBLACTN structure.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

actno Pointer to the ODBLACTN structure including the active cutting


number, active piercing number and active slope number.
The ODBLACTN structure is as follows.

typedef struct odblactn {


short slct; /* Flag of valid data */
short act_proc; /* Active cutting number */
short act_pirce; /* Active piercing number */
short act_slop; /* Active slope number */
short reserve[5]; /* (reserve) */
} ODBLACTN ;

slct Flag of valid data is set.


bit 0 : Active cutting number
bit 1 : Active piercing number
bit 2 : Active slope number
bit 3,..,7 : (reserve)
bit 8,..,15 : (not used)
* When some bit is 0, its data is invalid.

act_proc Active cutting number is set.


(Output range: 1 to 10, Unit: none)

act_price Active piercing number is set.


(Output range: 101 to 103, Unit: none)

act_slope Active slope number is set.


(Output range: 301 to 305, Unit: none)

reserve (reserve)

624
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_NOOPT No option
The cutting condition setting function and the
extended driver/library function are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the cutting condition setting function
and the extended driver/library function are necessary.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

625
(27) Read Comment Data

Function Name:
cnc_rdlcmmt

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdlcmmt(unsigned short FlibHndl,
ODBLCMMT *comment);
Description:
Reads the comment data of laser.
The data is stored in 'comment' of the ODBLCMMT structure.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

comment Pointer to the ODBLCMMT structure including the comment data


of laser. The ODBLCMMT structure is as follows.

typedef struct odblcmmt {


char comment[25]; /* Comment data */
} ODBLCMMT ;

comment Comment data is set.


This data is terminated with 'NULL'.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_LENGTH Data block length error
The length of a comment exceeds 24 byte.
EW_NOOPT No option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

626
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

627
(28) Read Laser Power Selection

Function Name:
cnc_rdlpwrslt

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdlpwrslt(unsigned short FlibHndl,
short *pwrslt);
Description:
Reads the number of power devices (the number of effective discharge tubes).

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

pwrslt Pointer to the variable for the number of power devices (the
number of effective discharge tubes).
The following status is set.
0 : All tubes are used.
1 : Half of the tubes are used.

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 CNC data window" in "General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_NOOPT No option
The extended driver/library function is
necessary.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

628
(29) Write Laser Power Selection

Function Name:
cnc_wrlpwrslt

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrlpwrslt(unsigned short FlibHndl,
short pwrslt);
Description:
Writes the number of power devices (the number of effective discharge
tubes). Either all tubes or half can be specified.

After changing the setting, turn off the HV, and turn on it. Then the
number of effective discharge tubes is changed.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

pwrslt Specify the number of power devices (the number of effective


discharge tubes).

0 : All tubes are used.


1 : Half of the tubes are used.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_NOOPT No option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

629
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

630
(30) Read Laser Power Control

Function Name:
cnc_rdlpwrctrl

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdlpwrctrl(unsigned short FlibHndl,
short *pwrctrl);
Description:
Reads the on/off of laser power control.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

pwrctrl Pointer to the variable for the on/off of laser power control.
The following status is set.
0 : Off (unavailable)
1 : On (available)

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 CNC data window" in "General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_NOOPT No option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

631
(31) Write Laser Power Control

Function Name:
cnc_wrlpwrctrl

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrlpwrctrl(unsigned short FlibHndl,
short pwrctrl);
Description:
Writes the on/off of laser power control.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

pwrctrl Specify the on/off of laser power control.


0 : Off (unavailable)
1 : On (available)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used except 160L.
EW_NOOPT No option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

632
1.1.16 Function Reference of Servo Learning Data

(1) Start of reading servo learning data

Function Name:
cnc_svdtstartrd

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_svdtstartrd(unsigned short FlibHndl,
short axis);

Description:
Reading the servo learning data of the axis specified with "axis" is
begun.

After this function is executed, the data is stored in the I/F buffer
in CNC.
Get the operation data in data buffer by using the cnc_svdtrddata()
function.

+---------+ +---------+ +---------+


| Appli- | cnc_svdtrddata()| I/F | cnc_svdtstartrd()|Learning |
| cation | <-------------- | Buffer | <--------------- | data |
+---------+ +---------+ +---------+

The procedure to read the data is shown as follows.

+-------------------+ * Start reading of the servo learning


| cnc_svdtstartrd() | data.(It takes about 2KB/sec to
+-------------------+ transfer the data.)
+-------------->|
| v
| +-------------------+ * The data is read from the I/F buffer
| | cnc_svdtrddata() | in CNC.
| +-------------------+
| v
| No +-------------------+ * It is checked whether to have read all
+-----| Was all read ? | the data transferred from the servo to
+-------------------+ the I/F buffer in CNC by status(stat).
| Yes
v
+-------------------+ * End reading of the servo learning
| cnc_svdtendrd() | data.
+-------------------+
v
+-------------------+
| END |
+-------------------+

* Please refer to "Self-learning control operation manual" for the


handling of the servo learning data.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

axis Specify axis number to read.


Range of the data are from 1 to n.

633
(n : number of controlled axis)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_ATTRIB data attribute error
The specification of axis number(axis)
is improper.

EW_NOOPT no option
The extended driver/library function is
necessary.

EW_REJECT The servo learning data during reading/writing.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

634
(2) Reading of the data from I/F buffer for the servo learning data

Function Name:
cnc_svdtrddata

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_svdtrddata(unsigned short FlibHndl,
short *stat,long *length,void *data);

Description:
The servo learning data is read from the buffer for reading/writing the
servo learning data.(buffer size = 65536 bytes)

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

stat Pointer to the variable for state of reading.


The state of reading the servo learning data is stored.
1 : During reading
3 : Reading end

length Pointer to the variable for data length.


Specify the data length (byte unit) in the variable.
After executing this function, the size to be read actually is
set.
The maximum data length which can be read at a time is 65535
bytes.

data Pointer to the variable for servo learning data.


The pointer of the variable to store the data read from the
I/F buffer is specified.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC 'cnc_svdtstartrd()' function has not been
executed.

EW_LENGTH data length error


Data length(length) is wrong.

EW_DATA The error occurred during reading the servo


learning data from the servo side.

EW_NOOPT no option
The extended driver/library function is
necessary.

EW_BUFFER The buffer is empty


Because the processing of the data transfer
on the CNC side is late, the data is not read.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

635
CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

636
(3) End of reading servo learning data

Function Name:
cnc_svdtendrd

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_svdtendrd(unsigned short FlibHndl);

Description:
Reading the servo learning data is ended.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC 'cnc_svdtstartrd()' function has not been
executed.

EW_DATA The error occurred during reading the servo


learning data from the servo side.

EW_NOOPT no option
The extended driver/library function is
necessary.

EW_REJECT The servo learning data during reading.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

637
(4) Start of writing servo learning data

Function Name:
cnc_svdtstartwr

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_svdtstartwr(unsigned short FlibHndl,
short axis);

Description:
Writing the servo learning data of the axis specified with "axis" is
begun.

After this function is executed, the written data is set in the I/F
buffer in CNC by using the cnc_svdtwrdata() function.

+---------+ +---------+ +---------+


| Appli- | cnc_svdtwrdata()| I/F | cnc_svdtstartwr()|Learning |
| cation | --------------> | Buffer | ---------------> | data |
+---------+ +---------+ +---------+

The procedure to write the data is shown as follows.

+-------------------+ * Start writing of the servo learning


| cnc_svdtstartwr() | data.
+-------------------+
+-------------->|
| v
| +-------------------+ * The data is written in the I/F buffer
| | cnc_svdtwrdata() | in CNC.
| +-------------------+
| v
| No +-------------------+ * Repeats until all the data is written
+-----| Was all written ? | in the I/F buffer in CNC.
+-------------------+
| Yes
+-------------->|
| v
| +-------------------+ * End writing of the servo learning
| | cnc_svdtendwr() | data.
| +-------------------+
| v
| Yes +-------------------+ * Repeats until the return code reaches
+-----| return = EW_BUSY ?| the values other then EW_BUSY.
+-------------------+ (It takes about 2KB/sec to transfer
v No the data.)
+-------------------+
| END |
+-------------------+

* Please refer to "Self-learning control operation manual" for the


handling of the servo learning data.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

axis Specify axis number to write.


Range of the data are from 1 to n.
(n : number of controlled axis)

638
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_ATTRIB data attribute error
The specification of axis number(axis)
is improper.

EW_NOOPT no option
The extended driver/library function is
necessary.

EW_REJECT The servo learning data during reading/writing.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

639
(5) Writing of the data to I/F buffer for the servo learning data

Function Name:
cnc_svdtwrdata

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_svdtwrdata(unsigned short FlibHndl,
short *stat,long *length,void *data);

Description:
The servo learning data is write to the buffer for reading/writing the
servo learning data.(buffer size = 65536 bytes)

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

stat Pointer to the variable for state of writing.


The state of writing the servo learning data is stored.
2 : During writing
4 : Writing end

length Pointer to the variable for data length.


Specify the data length (byte unit) in the variable.
After executing this function, the size to be write actually is
set.
The maximum data length which can be write at a time is 65535
bytes.

data Pointer to the variable for servo learning data.


The pointer of the variable where the data written in the
I/F buffer is stored is specified.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC 'cnc_svdtstartwr()' function has not been
executed.

EW_LENGTH data length error


Data length(length) is wrong.

EW_DATA The error occurred during writing the servo


learning data to the servo side.

EW_NOOPT no option
The extended driver/library function is
necessary.

EW_BUFFER The buffer is full


Because the processing of the data transfer
on the CNC side is late, the data is not write.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

640
CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

641
(6) End of writing servo learning data

Function Name:
cnc_svdtendwr

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_svdtendwr(unsigned short FlibHndl);

Description:
Writing the servo learning data is ended.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY The servo learning data during writing.

EW_FUNC 'cnc_svdtstartwr()' function has not been


executed.

EW_DATA The error occurred during writing the servo


learning data to the servo side.

EW_NOOPT no option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

642
(7) Stop of reading/writing of the servo learning data

Function Name:
cnc_svdtstopexec

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_svdtstopexec(unsigned short FlibHndl);

Description:
The processing of reading/writing of servo learning data is stopped.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC 'cnc_svdtstartrd()' or 'cnc_svdtstartwr()'
function has not been executed.

EW_NOOPT no option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

643
1.1.17 Function Reference of Others

(1) Read CNC System Information

Function Name:
cnc_sysinfo

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_sysinfo(unsigned short FlibHndl,
ODBSYS *sysinfo);
Description:
Reads system information such as kind of CNC system, Machining(M)
or Turning(T), series and version of CNC system software and controlled
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
Identify the process which uses the library.
See "Library handle" for details.

sysinfo Pointer to the ODBSYS structure including CNC system


information.
There is difference of structure between Series 150 and Series
160/180/210/160i/180i/210i,NC board.

The ODBSYS structure for Series 150 is as follows.


typedef struct odbsys {
short dummy ; /* dummy */
char max_axis[2] ;/* Max. controlled axes */
char cnc_type[2] ;/* Kind of CNC (ASCII) */
char mt_type[2] ; /* Kind of M/T/TT (ASCII) */
char series[4] ; /* Series number (ASCII) */
char version[4] ; /* Version number (ASCII) */
char axes[2] ; /* Current controlled axes(ASCII)*/
} ODBSYS ;
The ODBSYS structure for Series 160/180/210/160i/180i/210i,
NC board is as follows.
typedef struct odbsys {
short addinfo ; /* Additional information */
short max_axis ; /* Max. controlled axes */
char cnc_type[2] ;/* Kind of CNC (ASCII) */
char mt_type[2] ; /* Kind of M/T/TT (ASCII) */
char series[4] ; /* Series number (ASCII) */
char version[4] ; /* Version number (ASCII) */
char axes[2] ; /* Current controlled axes(ASCII)*/
} ODBSYS ;

644
dummy Not used

addinfo Additional information


This is available at Series 160/180/210/160i/
180i/210i,NC board.

7 6 5 4 3 2 1 0
+-+-+-+-+-+-+-+-+
+-+-+-+-+-+-+-+-+
| |
| +-> 0 : loader control exist
| 1 : loader control doesn't
| exist
+---> 0 : not i Series CNC
1 : i Series CNC
Bit2,..,Bit15 : reserved

max_axis Maximum controlled axes


This is the maximum controlled axes in CNC.

Series 150
both max_axis[0] and max_axis[1] are NULL('\0')
: 10 axes
in other case : value itself(ASCII: ex.'15')
Series 160/180/210,NC board
value itself(BINARY)

cnc_type Kind of CNC(ASCII)


'15' : Series 150
'16' : Series 160
'18' : Series 180
'21' : Series 210
'99' : NC board
'FD' : FD Mate mini

mt_type Kind of M/T/TT/MM(ASCII)


' M' : Machining center
' T' : Lathe
'MM' : M system 2 path control
'TT' : T system 2 path control
' P' : Punch press
' L' : Laser

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 Current controlled axes(ASCII)


The character string of 2 digits is stored.
In case of 4 axes, ' 4' is set.

645
Series 150 Series 160/180/210/
Series 160i/180i/210i
NC board

ODBSYS 0+---------+ ODBSYS 0+---------+


| dummy | | addinfo |
2+---------+ 2+---------+
| max_axis| | max_axis|
4+---------+ 4+---------+
| cnc_type| | cnc_type|
6+---------+ 6+---------+
| mt_type | | mt_type |
8+---------+-------+ 8+---------+-------+
| series | | series |
12+-----------------+ 12+-----------------+
| version | | version |
16+---------+-------+ 16+---------+-------+
| axes | | axes |
18+---------+ 18+---------+

For example, the following information are gotten by execution of this


function on Series 160i-M (B0F1-0001) system with 3 servo axes and
without loader control.

sysinfo.addinfo = 2
sysinfo.max_axis = 8
sysinfo.cnc_type = "16"
sysinfo.mt_type = " M"
sysinfo.series = "B0F1"
sysinfo.version = "0001"
sysinfo.axes = " 3"

Return: EW_OK is returned on successful completion, otherwise any value except


EW_OK is returned. (As for the details, see "Return status of CNC data
window" in "General Description".)

Others : EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

646
(2) Read CNC Configuration Information

Function Name:
cnc_sysconfig

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_sysconfig(unsigned short FlibHndl,
ODBSYSC *sysinfo);
Description:
Read the CNC system configuration information.
Various information is stored in each member of ODBSYSC.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

sysinfo Pointer to the ODBSYSC structure includingthe CNC configuration


information.
There is difference of structure between Series 150, Series 160
/180/210 and NC board.

- The ODBSYSC structure for Series 150 is as follows.

typedef struct odbsysc {


char slot_no_p[16]; /* Physical slot number */
char slot_no_l[16]; /* Logical slot number */
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 sys_id[16]; /* System ID of CNC(CNC series name)*/
char sys_ser[5]; /* System series of CNC */
char sys_ver[5]; /* System version of CNC */
char basic_ver[5];/* Version of CNC basic software */
char opta1_ver[5];/* Version of CNC option 1 software */
char opta2_ver[5];/* Version of CNC option 2 software */
char opta3_ver[5];/* Version of CNC option 3 software */
char opta4_ver[5];/* Version of CNC option 4 software */
char sub_ver[5]; /* Version of CNC sub software */
char opts1_ver[5];/* Version of CNC sub option 1 soft.*/
char tcopt_ver[5];/* Version of TC option software */
char axis_ser[5]; /* Series of axis software */
char axis_ver[5]; /* Version of axis software */
char help_ser[5]; /* Series of HELP ROM */
char help_ver[5]; /* Version of HELP ROM */
char boot_ser[5]; /* Series of BOOT ROM */
char boot_ver[5]; /* Version of BOOT ROM */
char servo_ser[5];/* Series of servo software */
char servo_ver[5];/* Version of servo software */
char cmpl_ser[5]; /* Series of macro compiler */
char cmpl_ver[5]; /* Version of macro compiler */
char sral1_ser[5];/* Series of 1st serial spindle */
char sral1_ver[5];/* Version of 1st serial spindle */
char sral2_ser[5];/* Series of 2nd serial spindle */
char sral2_ver[5];/* Version of 2nd serial spindle */
char sral3_ser[5];/* Series of 3rd serial spindle */
char sral3_ver[5];/* Version of 3rd serial spindle */

647
char sral4_ser[5];/* Series of 4th serial spindle */
char sral4_ver[5];/* Version of 4th serial spindle */
short pcb_info[20]; /* Information of each board */
short pcb_note[20][16];/* Modules built in each board */
} ODBSYSC ;

slot_no_p Physical slot number


The physical slot numbers 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.
00H to 0FH : Primary slot number
80H to 8FH : Secondary slot number
slot_no_l Logical slot number
The logical slot numbers 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.
00H to 0FH : logical slot number

mod_id Module ID
The module 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. 'XX' is internal
information.
XX3FH : Remote buffer
XX45H : Graphic
XX62H : CNC MAIN (High speed)
XX63H : Additional axis/CNC SUB
XX6BH : PMC-NB
XX6CH : FAPT/CAP
XX71H : CNC MAIN (Standard)
XX74H : ROM cassette adapter
XX77H : PMC-NA
XX94H : MMC-IV
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.
37H : CNC MAIN
39H : Additional axis
3AH : CNC SUB
3CH : Remote buffer/DNC1
3DH : PMC-NA
40H : Graphic
41H : ROM cassette adapter
42H : PMC-NB
44H : DNC1#2
45H : FAPT
4CH : TC
4DH : CAP
5EH : MMC-IV
s_series Software series
The software series of the modules which are built in
the slots are stored in ASCII code in order of their
position.
s_version Software version
The software version of the modules which are built in
the slots are stored in ASCII code in order of their
position.

648
sys_id System ID of CNC (CNC series name)
sys_ser System series of CNC
sys_ver System version of CNC
basic_ver Version of CNC basic software
opta1_ver Version of CNC option 1 software
opta2_ver Version of CNC option 2 software
opta3_ver Version of CNC option 3 software
opta4_ver Version of CNC option 4 software
sub_ver Version of CNC sub software
opts1_ver Version of CNC sub option 1 software
tcopt_ver Version of TC option software
axis_ser Series of axis software
axis_ver Version of axis software
help_ser Series of HELP ROM
help_ver Version of HELP ROM
boot_ser Series of BOOT ROM
boot_ver Version of BOOT ROM
servo_ser Series of servo software
servo_ver Version of servo software
cmpl_ser Series of macro compiler
cmpl_ver Version of macro compiler
sral1_ser Series of 1st serial spindle
sral1_ver Version of 1st serial spindle
sral2_ser Series of 2nd serial spindle
sral2_ver Version of 2nd serial spindle
sral3_ser Series of 3rd serial spindle
sral3_ver Version of 3rd serial spindle
sral4_ser Series of 4th serial spindle
sral4_ver Version of 4th serial spindle

The data from 's_series' to 'sral4_ver' are stored in ASCII


code, and the last data of each member is 'NULL' code.

pcb_info The information of each board

#15 #14 #0
+---+---+-----..----+---+
| | | | |
+---+---+-----..----+---+
| +--------+--------+
| +-> Information of each module
| 0 : Not existence 1 : Existence
| * Non-described bit is not used.
| (Refer to the following.)
+->Information of each board
0 : Not existence 1 : Existence

pcb_info[0] (MAIN) pcb_info[1] (SUB)


#0 : F-ROM #0 : D-RAM
#1 : D-RAM #1 : High Speed S-RAM
#2 : High Speed S-RAM #2 : File S-RAM
#3 : File S-RAM #3 : Spindle
#4 : Peripheral #4 : 5th,6th axis Servo
#5 : CRTC #5 : 7th,8th axis Servo
#6 : Spindle #6 : Analog I/O
#7 : 1st,2nd axis Servo
#8 : 3rd,4th axis Servo

649
pcb_info[2] (ADDITIONAL AXIS 1) pcb_info[3] (ADDITIONAL AXIS 2)
#0 : Spindle #0 : 9th,10th axis Servo
#1 : 5th,6th axis Servo
#2 : 7th,8th axis Servo
#3 : Analog I/O

pcb_info[4] (PMC-NA) pcb_info[5] (PMC-NB)


#0 : PMC CPU #0 : PMC CPU
#1 : PMC Engine #1 : PMC Engine
#2 : Option D-RAM #2 : Option D-RAM
#3 : F-ROM #3 : F-ROM
#4 : EPROM

pcb_info[6] (GRAPHIC) pcb_info[7]


(REMOTE BUFFER/DNC2)
#0 : Graphic CPU #0 : Communication
#1 : CRTC
#2 : Graphic Engine 1
#3 : Graphic Engine 2

pcb_info[8] (DNC1) pcb_info[9] (CAP/FAPT)


#0 : Communication #0 : CAP/FAPT CPU
#1 : EPROM
#2 : S-RAM
#3 : D-RAM

pcb_info[10] (RISC R4000) pcb_info[11] (reserve)


#0 : EPROM
#1 : S-RAM
#2 : D-RAM1
#3 : D-RAM2

pcb_info[12] (reserve) pcb_info[13] (reserve)

pcb_info[14] (AXIS CPU 1) pcb_info[15] (AXIS CPU 2)


#0 : D-RAM #0 : D-RAM
#1 : Spindle #1 : Spindle
#2 : 1st,2nd axis Servo #2 : 5th,6th axis Servo
#3 : 3rd,4th axis Servo #3 : 7th,8th axis Servo
#4 : DBL 1 #4 : DBL 1
#5 : DBL 2 #5 : DBL 2

pcb_info[16] (AXIS CPU 3) pcb_info[17] (AXIS CPU 4)


#0 : D-RAM #0 : D-RAM
#1 : Spindle #1 : Spindle
#2 : 9th,10th axis Servo #2 : 13th,14th axis Servo
#3 : 11th,12th axis Servo #3 : 15th,16th axis Servo
#4 : DBL 1 #4 : DBL 1
#5 : DBL 2 #5 : DBL 2

pcb_info[18] (reserve) pcb_info[19] (reserve)

pcb_note Modules built in each board

- CNC MAIN
pcb_note[0][0] --- Capacity of program memory module
(F-ROM)
-1 : Not existence 4 : 8MB
0 : Others 5 : 10MB
1 : 2MB 6 : 12MB
2 : 4MB 7 : 14MB
3 : 6MB

650
pcb_note[0][1] --- Capacity of main memory module
(D-RAM)
-1 : Not existence 2 : 4MB
0 : Others 3 : 6MB
1 : 2MB 4 : 8MB

pcb_note[0][2] --- Capacity of main memory module


(HS-RAM)
-1 : Not existence 4 : TYPE-D
0 : Others 5 : TYPE-E
1 : TYPE-A 6 : TYPE-F
2 : TYPE-B 7 : TYPE-G
3 : TYPE-C

pcb_note[0][3] --- Capacity of TAPE memory module


(S-RAM)
-1 : Not existence 4 : 320K
0 : Others 5 : 512K
1 : 64K 6 : 1M
2 : 128K 7 : 2M
3 : 256K

pcb_note[0][4] --- Existence of peripheral module


-1 : Not existence 1 : Existence
0 : (reserve)

pcb_note[0][5] --- Type of CRTC module


-1 : Not existence 2 : 9"
0 : Others 3 : 10"
1 : 14"

pcb_note[0][6] --- Type of spindle control module


-1 : Not existence 2 : Serial+High speed DI/DO
0 : Others 3 : Analog
1 : Serial 4 : Analog+High speed DI/DO

pcb_note[0][7] --- Type of axis control module


(1st, 2nd axis)
-1 : Not existence 2 : Analog servo
0 : Others 3 : Digital servo
1 : Piston lathe

pcb_note[0][8] --- Type of axis control module


(3rd, 4th axis)
-1 : Not existence 2 : Analog servo
0 : Others 3 : Digital servo
1 : Piston lathe

- CNC SUB
pcb_note[1][0] --- Capacity of SUB CPU memory module 1
(D-RAM)
-1 : Not existence 3 : 2MB
0 : Others 4 : 4MB
1 : 1MB 5 : 6MB
2 : 1.25MB 6 : 8MB

pcb_note[1][1] --- Capacity of SUB CPU memory module 1


(HS-RAM)
-1 : Not existence 4 : TYPE-D
0 : Others 5 : TYPE-E
1 : TYPE-A 6 : TYPE-F
2 : TYPE-B 7 : TYPE-G
3 : TYPE-C

651
pcb_note[1][2] --- Capacity of SUB CPU memory module 2
(S-RAM)
-1 : Not existence 4 : 320K
0 : Others 5 : 512K
1 : 64K 6 : 1M
2 : 128K 7 : 2M
3 : 256K

pcb_note[1][3] --- Type of spindle control module


-1 : Not existence 2 : Serial+High speed DI/DO
0 : Others 3 : Analog
1 : Serial 4 : Analog+High speed DI/DO

pcb_note[1][4] --- Type of axis control module


(5th, 6th axis)
-1 : Not existence 2 : Analog servo
0 : Others 3 : Digital servo
1 : Piston lathe

pcb_note[1][5] --- Type of axis control module


(7th, 8th axis)
-1 : Not existence 2 : Analog servo
0 : Others 3 : Digital servo
1 : Piston lathe

pcb_note[1][6] --- Type of analog I/O module


-1 : Not existence 4 : Out
0 : Others 5 : Port-B+In
1 : Port-B+I/O 6 : In
2 : I/O 7 : Port-B
3 : Port-B+Out

- Additional axis 1
pcb_note[2][0] --- Type of spindle control module
-1 : Not existence 2 : Serial+High speed DI/DO
0 : Others 3 : Analog
1 : Serial 4 : Analog+High speed DI/DO

pcb_note[2][1] --- Type of axis control module


(5th, 6th axis)
-1 : Not existence 2 : Analog servo
0 : Others 3 : Digital servo
1 : Piston lathe

pcb_note[2][2] --- Type of axis control module


(7th, 8th axis)
-1 : Not existence 2 : Analog servo
0 : Others 3 : Digital servo
1 : Piston lathe

pcb_note[2][3] --- Type of analog I/O module


-1 : Not existence 4 : Out
0 : Others 5 : Port-B+In
1 : Port-B+I/O 6 : In
2 : I/O 7 : Port-B
3 : Port-B+Out

652
- Additional axis 2
pcb_note[3][0] --- Type of axis control module
(9th, 10th)
-1 : Not existence 2 : Analog servo
0 : Others 3 : Digital servo
1 : Piston lathe

- PMC-NA
pcb_note[4][0] --- Existence of CPU module
-1 : Not existence 1 : Existence
0 : (reserve)

pcb_note[4][1] --- Type of PMC engine module


-1 : Not existence 1 : BOC2
0 : Others

pcb_note[4][2] --- Option D-RAM module


-1 : Not existence 2 : 1M
0 : Others 3 : 2M
1 : 512K

pcb_note[4][3] --- Capacity of program memory module


(F-ROM)
-1 : Not existence 2 : 1.5M
0 : Others 3 : 2M
1 : 1M

- PMC-NB
pcb_note[5][0] --- Existence of CPU module
-1 : Not existence 1 : Existence
0 : (reserve)

pcb_note[5][1] --- Type of PMC engine module


-1 : Not existence 1 : PMP
0 : Others

pcb_note[5][2] --- Option D-RAM module


-1 : Not existence 2 : 1M
0 : Others 3 : 2M
1 : 512K

pcb_note[5][3] --- Capacity of program memory module


(F-ROM)
-1 : Not existence 2 : 1.5M
0 : Others 3 : 2M
1 : 1M

pcb_note[5][4] --- Capacity of EPROM module


-1 : Not existence 2 : 768K
0 : Others 3 : 1M
1 : 512K

- GRAPHIC
pcb_note[6][0] --- Existence of CPU module
-1 : Not existence 1 : Existence
0 : (reserve)

653
pcb_note[6][1] --- Type of character control module
-1 : Not existence 2 : 9"
0 : (reserve) 3 : 10"
1 : 14"

pcb_note[6][2] --- Existence of graphic engine module 1


-1 : Not existence 1 : Existence
0 : (reserve)

pcb_note[6][3] --- Existence of graphic engine module 2


-1 : Not existence 1 : Existence
0 : (reserve)

- Remote buffer/DNC2
pcb_note[7][0] --- Existence of communication module
-1 : Not existence 1 : Existence
0 : (reserve)

- DNC1
pcb_note[8][0] --- Existence of communication module
-1 : Not existence 1 : Existence
0 : (reserve)

- CAP/FAPT
pcb_note[9][0] --- Existence of CPU module
-1 : Not existence 1 : Existence
0 : (reserve)

pcb_note[9][1] --- Capacity of EPROM module


-1 : Not existence 3 : 512K
0 : Others 4 : 576K
1 : 128K 5 : 1M
2 : 256K

pcb_note[9][2] --- Capacity of S-RAM module


-1 : Not existence 3 : 512K
0 : Others 4 : 576K
1 : 128K 5 : 1M
2 : 256K

pcb_note[9][3] --- Capacity of D-RAM module


-1 : Not existence 2 : 256K
0 : Others 3 : 512K
1 : 128K 4 : 1M

- RISC
pcb_note[10][0] -- Capacity of EPROM module
-1 : Not existence 1 : 512K
0 : Others 2 : 1M

pcb_note[10][1] -- Capacity of S-RAM module


-1 : Not existence 1 : 512K
0 : Others 2 : 1M

pcb_note[10][2] -- Capacity of D-RAM module 1


-1 : Not existence 1 : 1M
0 : Others 2 : 2M

654
pcb_note[10][3] -- Capacity of D-RAM module 2
-1 : Not existence 1 : 1M
0 : Others 2 : 2M

- AXIS CPU 1
pcb_note[14][0] -- Capacity of axis CPU memory module
(D-RAM)
-1 : Not existence 2 : 1.25M
0 : Others 3 : 2M
1 : 1M 4 : 4M

pcb_note[14][1] -- Type of spindle control module


-1 : Not existence 2 : Serial+NZ
0 : Others 3 : Analog
1 : Serial 4 : Analog+NZ

pcb_note[14][2] -- Type of axis control module


(1st, 2nd axis)
-1 : Not existence 2 : Analog servo
0 : Others 3 : Digital servo
1 : Piston lathe

pcb_note[14][3] -- Type of axis control module


(3rd, 4th axis)
-1 : Not existence 2 : Analog servo
0 : Others 3 : Digital servo
1 : Piston lathe

pcb_note[14][4] -- Type of error motion check module 1


-1 : Not existence 1 : 2 Pos
0 : Others 2 : 4 Pos

pcb_note[14][5] -- Type of error motion check module 2


-1 : Not existence 1 : 2 Pos
0 : Others 2 : 4 Pos

- AXIS CPU 2
pcb_note[15][0] -- Capacity of axis CPU memory module
(D-RAM)
-1 : Not existence 2 : 1.25M
0 : Others 3 : 2M
1 : 1M 4 : 4M

pcb_note[15][1] -- Type of spindle control module


-1 : Not existence 2 : Serial+NZ
0 : Others 3 : Analog
1 : Serial 4 : Analog+NZ

pcb_note[15][2] -- Type of axis control module


(1st, 2nd axis)
-1 : Not existence 2 : Analog servo
0 : Others 3 : Digital servo
1 : Piston lathe

655
pcb_note[15][3] -- Type of axis control module
(3rd, 4th axis)
-1 : Not existence 2 : Analog servo
0 : Others 3 : Digital servo
1 : Piston lathe

pcb_note[15][4] -- Type of error motion check module 1


-1 : Not existence 1 : 2 Pos
0 : Others 2 : 4 Pos

pcb_note[15][5] -- Type of error motion check module 2


-1 : Not existence 1 : 2 Pos
0 : Others 2 : 4 Pos

- AXIS CPU 3
pcb_note[16][0] -- Capacity of axis CPU memory module
(D-RAM)
-1 : Not existence 2 : 1.25M
0 : Others 3 : 2M
1 : 1M 4 : 4M

pcb_note[16][1] -- Type of spindle control module


-1 : Not existence 2 : Serial+NZ
0 : Others 3 : Analog
1 : Serial 4 : Analog+NZ

pcb_note[16][2] -- Type of axis control module


(1st, 2nd axis)
-1 : Not existence 2 : Analog servo
0 : Others 3 : Digital servo
1 : Piston lathe

pcb_note[16][3] -- Type of axis control module


(3rd, 4th axis)
-1 : Not existence 2 : Analog servo
0 : Others 3 : Digital servo
1 : Piston lathe

pcb_note[16][4] -- Type of error motion check module 1


-1 : Not existence 1 : 2 Pos
0 : Others 2 : 4 Pos

pcb_note[16][5] -- Type of error motion check module 2


-1 : Not existence 1 : 2 Pos
0 : Others 2 : 4 Pos

- AXIS CPU 4
pcb_note[17][0] -- Capacity of axis CPU memory module
(D-RAM)
-1 : Not existence 2 : 1.25M
0 : Others 3 : 2M
1 : 1M 4 : 4M

pcb_note[17][1] -- Type of spindle control module


-1 : Not existence 2 : Serial+NZ
0 : Others 3 : Analog
1 : Serial 4 : Analog+NZ

pcb_note[17][2] -- Type of axis control module


(1st, 2nd axis)
-1 : Not existence 2 : Analog servo
0 : Others 3 : Digital servo
1 : Piston lathe

656
pcb_note[17][3] -- Type of axis control module
(3rd, 4th axis)
-1 : Not existence 2 : Analog servo
0 : Others 3 : Digital servo
1 : Piston lathe

pcb_note[17][4] -- Type of error motion check module 1


-1 : Not existence 1 : 2 Pos
0 : Others 2 : 4 Pos

pcb_note[17][5] -- Type of error motion check module 2


-1 : Not existence 1 : 2 Pos
0 : Others 2 : 4 Pos

* 'pcb_note[11][0]' to 'pcb_note[11][15]',
'pcb_note[12][0]' to 'pcb_note[12][15]',
'pcb_note[13][0]' to 'pcb_note[13][15]',
'pcb_note[18][0]' to 'pcb_note[18][15]' and
'pcb_note[19][0]' to 'pcb_note[19][15]' are reserved.

- The ODBSYSC structure for Series 160/180/210, NC board is as


follows.

typedef struct odbsysc {


char slot_no_p[16]; /* Physical slot number */
char slot_no_l[16]; /* Logical slot number */
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 */

short m_rom; /* Main-CPU CNC software


installation status */
short s_rom; /* Sub-CPU CNC software
installation status */
char svo_soft[8]; /* Series and version of
servo software */
char pmc_soft[6]; /* Series and version of PMC
management software */
char lad_soft[6]; /* Series and version of
Ladder software */
char mcr_soft[8]; /* Series and version of
macro executor */
char spl1_soft[6]; /* Series and version of spindle
software(1st spindle)*/
char spl2_soft[6]; /* Series and version of spindle
software(2nd spindle)*/
short frmmin; /* Capacity of FROM module (MAIN) */
short drmmin; /* Capacity of DRAM module (MAIN) */
short srmmin; /* Capacity of additional SRAM module
(MAIN) */
short pmcmin; /* Type of PMC module (MAIN) */
short crtmin; /* Type of CRTC module (MAIN) */
short sv1min; /* Existence of servo module (axis 1,2)
(MAIN) */
short sv3min; /* Existence of servo module (axis 3,4)
(MAIN) */
short sicmin; /* Existence of SIC (MAIN) */
short posmin; /* Existence of position LSI (MAIN) */
short drmmrc; /* Extended DRAM for management software
(PMC-RC) */

657
short drmarc; /* Capacity of DRAM for applications
(PMC-RC) */
short pmcmrc; /* Type of PMC module (PMC-RC) */
short dmaarc; /* Existence of additional board for DMA
(PMC-RC) */
short iopt; /* Number of DI/DO points (I/O card) */
short hdiio; /* Existence of LSI for high-speed skip
(I/O card) */
short frmsub; /* Capacity of FROM module (SUB) */
short drmsub; /* Capacity of DRAM module (SUB) */
short srmsub; /* Capacity of added SRAM module (SUB) */
short sv5sub; /* Existence of servo module (axis 5,6)
(SUB) */
short sv7sub; /* Existence of servo module (axis 7,8)
(SUB) */
short sicsub; /* Existence of SIC (SUB) */

short possub; /* Existence of position LSI (SUB) */


short hamsub; /* Existence of high-speed skip and
analog I/O (SUB) */
short gm2gr1; /* Existence of graphic engine 2 */
short crtgr2; /* Existence of CRTC module type (OPT-1)*/
short gm1gr2; /* Existence of graphic module 1 (OPT-1)*/
short gm2gr2; /* Existence of graphic module 2 (OPT-1)*/
short cmmrb; /* Existence of communication module
(OPT-1)*/
short sv5axs; /* Existence of servo module (axis 5,6)
(Axis card) */
short sv7axs; /* Existence of servo module (axis 7,8)
(Axis card) */
short sicaxs; /* Existence of SIC (Axis card) */
short posaxs; /* Existence of position LSI (Axis card)*/
short hanaxs; /* Existence of high-speed skip and
analog I/O (Axis card)*/
short romr64; /* Capacity of the system EPROM
(64bitRISC)*/
short srmr64; /* Capacity of SRAM module (64bitRISC)*/
short dr1r64; /* Capacity of DRAM module 1 (64bitRISC)*/
short dr2r64; /* Capacity of DRAM module 2 (64bitRISC)*/
short iopio2; /* Number of DI/DO points (I/O card #2) */
short hdiio2; /* Existence of LSI for high-speed skip
(I/O card #2) */
short cmmrb2; /* Existence of communication module
(OPT-1 #2) */
short romfap; /* Capacity of EPROM module (CAP2) */
short srmfap; /* Capacity of SRAM module (CAP2) */
short drmfap; /* Capacity of DRAM module (CAP2) */
} ODBSYSC ;

slot_no_p Physical slot number


The physical slot numbers 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.
00H to 0FH : Primary slot number
80H to 8FH : Secondary slot number

slot_no_l Logical slot number


The logical slot numbers 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.
00H to 0FH : logical slot number

658
mod_id Module ID
The module 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. 'XX' is internal information.
The followings are main module IDs.
XX3FH:Remote buffer XXADH:FS18B/Main(4 axes)
XX45H:Graphic(CAP-II) XXAEH:FS18B/Main(6 axes)
XX46H:I/O card XXB0H:FS16B/SUB
XX6DH:CAP-II XXB2H:FS16B/Main(4 axes)
XX7FH:RISC(64bit) XXB4H:PMC-RB5/RB6
XX94H:MMC-IV XXB7H:FS18B/SUB
XX9AH:Graphic(standard) XXB9H:FS16C/Main(6 axes)
XX9DH:PMC-RC XXBAH:FS16C,18C/SUB
XXA7H:FS16B/Main(6 axes) XXBDH:FS18C/Main(6 axes)

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.
The followings are main software IDs.
40H : CNC 49H : CAP-II
41H : PMC-RC 4AH : Remote buffer
42H : Internal I/O card 4FH : PMC-RE
43H : CNC SUB 5EH : MMC-IV,HSSB I/F
45H : Graphic(standard) 67H : PMC-RB5/RB6
46H : Graphic(CAP-II)

s_series Software series


Software series information is stored in ASCII code
in order of slot numbers, first four bytes being used
for each slot number, and next one byte is NULL.

s_version Software version


Software version information is stored in ASCII code
in order of slot numbers, four bytes being used for
each slot number, and next one byte is NULL.

m_rom Main-CPU CNC software installation status


The relation between stored value and software
installation is as follows.
Series 160/180
bit0,..,3 : BASIC
bit4,..,7 : OPTION-A1
bit8,..,11 : OPTION-A2
Other bits : Not used
- 0000FH ---> BASIC
- 000FFH ---> BASIC + OPTION-A1
- 00F0FH ---> BASIC + OPTION-A2
- 00FFFH ---> BASIC + OPTION-A1 + OPTION-A2
Series 210
bit0 : BASIC
bit1 : OPTION-A1
bit2 : Macro library/application
bit3 : Servo software
Other bits : Not used
- 00009H ---> BASIC + Servo software
- 0000BH ---> BASIC + Servo software + OPTION-A1
- 0000DH ---> BASIC + Servo software
+ Macro library/application

659
- 0000FH ---> BASIC + Servo software + OPTION-A1
+ Macro library/application
NC board
bit0,..,3,5: BASIC
bit8 : Servo software
Other bits : Not used
- 0012FH ---> BASIC + Servo software

s_rom Sub-CPU CNC software installation status


For contents, see m_rom above.

svo_soft Series and version of servo software


This information item is stored in ASCII code.
The first four bytes indicate the series, and the
remaining four bytes indicate the version.
It is impossible that this software is absent.

pmc_soft Series and version of PMC management software


This information item is stored in ASCII code.
The first four bytes indicate the series, and the
remaining two bytes indicate the version.
It is impossible that this software is absent.

lad_soft Series and version of Ladder software


This information item is stored in ASCII code.
The first four bytes indicate the series, and the
remaining two bytes indicate the version.
If this software does not exist, all of the 6 bytes are
space(20H).

mcr_soft Series and version of macro executor


This information item is stored in ASCII. The four
bytes from second byte indicate the series, and the
subsequent two bytes indicate the version.
If this software exists, the first byte is 5AH.
The last byte is not used.

spl1_soft Series and version of spindle software


(1st spindle)
This information item is stored in ASCII code.
The first four bytes indicate the series, and the
remaining two bytes indicate the version.
If this software does not exist, all of the 6 bytes are
space(20H).

spl2_soft Series and version of spindle software(2nd sp.)


This information item is stored in ASCII code.
The first four bytes indicate the series, and the
remaining two bytes indicate the version.
If this software does not exist, all of the 6 bytes are
space(20H).

frmmin Capacity of FROM module (MAIN)


Series 160/180
-1 : Not existence 10 : 6 (MB)
0 : (reserve) 11 : 8 (MB)
1 : 2 (MB) 12 : 10 (MB)
2 : 4 (MB) 13 : 12 (MB)
3 : 6 (MB) 14 : 14 (MB)
4 : 8 (MB) 15 : 1 (MB)
5 : 10 (MB) 16 : 1 (MB)

660
6 : 12 (MB) 17 : (reserve)
7 : 4 (MB) 18 : 4 (MB)
8 : 3 (MB) 19 : 8 (MB)
9 : 2 (MB)
Series 210
0 : 128KB + 4MB 4 : 256KB + 4MB
1 : (reserve) 5 : (reserve)
2 : 128KB + 6MB 6 : 256KB + 6MB
3 : 128KB + 2MB 7 : 256KB + 2MB
NC board
Not used.

drmmin Series 160/180


Capacity of DRAM module (MAIN)
-1 : Not existence 4 : 16 (MB)
0 : 4 (MB) 5 : 8 (MB)
1 : 2 (MB) 6 : 4 (MB)
2 : 1 (MB) 7 : 24 (MB)
3 : 6 (MB)
Series 210
Capacity of SRAM module and SPINDLE TYPE(MAIN)
0 : SRAM 256KB + SIC
1 : SRAM 256KB + POSITION LSI
2 : SRAM 512KB + SIC
3 : SRAM 512KB + POSITION LSI
4 : SRAM 256KB + SIC + POSITION LSI
5 : (reserve)
6 : SRAM 512KB + SIC + POSITION LSI
7 : (reserve)
NC board
Capacity of DRAM module (MAIN)
-1 : Not existence 2 : (reserve)
0 : 4 (MB) 3 : 2 (MB)
1 : (reserve)

srmmin Series 160/180


Capacity of additional SRAM module (MAIN)
-1 : Not existence 5 : 768 (KB)
0 : 1 (MB) 6 : (reserve)
1 : 512 (KB) 7 : 2.25(MB)
2 : 2 (MB) 8 : (reserve)
3 : (reserve) 9 : 256 (KB)
4 : (reserve)
Series 210
Existence of MATRIX DI/DO (MAIN)
0 : Not existence 1 : Existence
NC board
Capacity of additional SRAM module (MAIN)
-1 : Not existence 0 : 256 (KB)

pmcmin Type of PMC module (MAIN)


Series 160/180
-1 : Not existence 2 : PMP2+SLC
0 : BOC2 3 : BSI
1 : BSI+SLC 4 : PMP2
Series 210
-1 : Not existence 2 : PMP+SLC
0 : BOC2 3 : BIT
1 : BIT+SLC 4 : PMP

661
NC board
-1 : Not existence 2 : PMP2+SLC
0 : RB4 3 : BSI
1 : BSI+SLC 4 : PMP2

crtmin Type of CRTC module (MAIN)


Series 160/180
-1 : Not existence 3 : HSSB-VGA
0 : 14"CRT 4 : (reserve)
1 : 9"CRT 5 : 9"VGA
2 : VGA
Series 210
0 : 14"VGA 2 : 7.2"VGA
1 : 14"CRT 3 : 9"CRT
NC board
Not used.

sv1min Existence of servo module (axis 1,2) (MAIN)


Series 160/180
-1 : Not existence 0 : Existence
Series 210
Not used.
NC board
-1 : Not existence 0 : Existence

sv3min Series 160/180


Existence of servo module (axis 3,4) (MAIN)
-1 : Not existence 0 : Existence
Series 210
Existence of servo module (axis 1+2,3+4) (MAIN)
0 : both axis 1+2 and 3+4
1 : only axis 1+2
NC board
Existence of servo module (axis 3,4) (MAIN)
-1 : Not existence 0 : Existence

sicmin Series 160/180


Existence of SIC (MAIN)
-1 : Not existence 0 : Existence
Series 210
Existence of high-speed skip & analog I/O(MAIN)
-1 : Not existence 0 : Existence
NC board
Existence of SIC (MAIN)
-1 : Not existence 0 : Existence

posmin Series 160/180


Existence of position LSI (MAIN)
-1 : Not existence 0 : Existence
Series 210
Existence of graphic module (MAIN)
-1 : Not existence 0 : Existence
NC board
Existence of position LSI (MAIN)
-1 : Not existence 0 : Existence

drmmrc Extended DRAM for management software (PMC-RC)


-1 : Not existence 0 : Existence

drmarc Capacity of DRAM for applications (PMC-RC)


-1 : Not existence 2 : 512(KB)
0 : 2(MB) 3 : 1(MB)
1 : (reserve)

662
pmcmrc Type of PMC module (PMC-RC)
-1 : Not existence 2 : PMP2+SLC
0 : BOC2 3 : BSI
1 : BSI+SLC 4 : PMP2

dmaarc Existence of additional board for DMA (PMC-RC)


-1 : Not existence 0 : Existence

iopt Number of DI/DO points (I/O card)


Series 160/180
-1 : Not existence 2 : 80/ 56
0 : 144/112 3 : 104/ 72
1 : 40/ 40 4 : 156/120
Series 210T
-1 : Not existence 1 : (reserve)
0 : 96/ 64 2 : 48/ 32
Series 210M/NC board
-1 : Not existence

hdiio Existence of LSI for high-speed skip (I/O card)


-1 : Not existence 0 : Existence

frmsub Capacity of FROM module (SUB)


-1 : Not existence 10 : 6 (MB)
0 : (reserve) 11 : 8 (MB)
1 : 2 (MB) 12 : 10 (MB)
2 : 4 (MB) 13 : 12 (MB)
3 : 6 (MB) 14 : 14 (MB)
4 : 8 (MB) 15 : 1 (MB)
5 : 10 (MB) 16 : 1 (MB)
6 : 12 (MB) 17 : (reserve)
7 : 4 (MB) 18 : 4 (MB)
8 : 3 (MB) 19 : 8 (MB)
9 : 2 (MB)

drmsub Capacity of DRAM module (SUB)


-1 : Not existence 4 : 16 (MB)
0 : 4 (MB) 5 : 8 (MB)
1 : 2 (MB) 6 : 4 (MB)
2 : 1 (MB) 7 : 24 (MB)
3 : 6 (MB)

srmsub Capacity of additional SRAM module (SUB)


-1 : Not existence 5 : 768 (KB)
0 : 1 (MB) 6 : (reserve)
1 : 512 (KB) 7 : 2.25(MB)
2 : 2 (MB) 8 : (reserve)
3 : (reserve) 9 : 256 (KB)
4 : (reserve)

sv5sub Existence of servo module (axis 5,6) (SUB)


-1 : Not existence 0 : Existence

sv7sub Existence of servo module (axis 7,8) (SUB)


-1 : Not existence 0 : Existence

sicsub Existence of SIC (SUB)


-1 : Not existence 0 : Existence

possub Existence of position LSI (SUB)


-1 : Not existence 0 : Existence

663
hamsub Existence of high-speed skip & analog I/O (SUB)
-1 : Not existence
0 : Existence either
1 : only high-speed skip
2 : only analog I/O

gm2gr1 Existence of graphic engine 2


-1 : Not existence 0 : Existence

crtgr2 Existence of CRTC module type (OPT-1)


-1 : Not existence 3 : (reserve)
0 : 14"CRT 4 : 14"CRT GRPH
1 : 9"CRT 5 : 9"CRT GRPH
2 : VGA MAIN 6 : VGA GRPH

gm1gr2 Existence of graphic module 1 (OPT-1)


-1 : Not existence 0 : Existence

gm2gr2 Existence of graphic module 2 (OPT-1)


-1 : Not existence 0 : Existence

cmmrb Existence of communication module (OPT-1)


-1 : Not existence 0 : Existence

sv5axs Existence of servo module (axis 5,6)(Axis card)


-1 : Not existence 0 : Existence

sv7axs Existence of servo module (axis 7,8)(Axis card)


-1 : Not existence 0 : Existence

sicaxs Existence of SIC (Axis card)


-1 : Not existence 0 : Existence

posaxs Existence of a position LSI (Axis card)


-1 : Not existence 0 : Existence

hanaxs Existence of high-speed skip & analog I/O


(Axis card)
-1 : Not existence
0 : Existence either
1 : only high-speed skip
2 : only analog I/O

romr64 Capacity of system EPROM (64bitRISC)


-1 : Not existence 3 : 512 (KB)
0 : 4 (MB) 4 : 256 (KB)
1 : 2 (MB) 5 : 128 (KB)
2 : 1 (MB) 6 : 768 (KB)

srmr64 Capacity of SRAM module (64bitRISC)


-1 : Not existence 3 : 512 (KB)
0 : 4 (MB) 4 : 256 (KB)
1 : 2 (MB) 5 : 128 (KB)
2 : 1 (MB) 6 : 768 (KB)

dr1r64 Capacity of DRAM module 1 (64bitRISC)


-1 : Not existence 2 : 2 (MB)
0 : (reserve) 3 : 4 (MB)
1 : (reserve)

664
dr2r64 Capacity of DRAM module 2 (64bitRISC)
-1 : Not existence 2 : 2 (MB)
0 : (reserve) 3 : 4 (MB)
1 : (reserve)

iopio2 Number of DI/DO points (I/O card #2)


-1 : Not existence 2 : 80/ 56
0 : 144/112 3 : 104/ 72
1 : 40/ 40 4 : 156/120

hdiio2 Existence of LSI for high-speed skip


(I/O card #2)
-1 : Not existence 0 : Existence

cmmrb2 Existence of communication module (OPT-1 #2)


-1 : Not existence 0 : Existence

romfap Capacity of EPROM module (CAP2)


-1 : Not existence 3 : 512 (KB)
0 : (reserve) 4 : 256 (KB)
1 : (reserve) 5 : 128 (KB)
2 : 1 (MB) 6 : 768 (KB)

srmfap Capacity of SRAM module (CAP2)


-1 : Not existence 3 : 512 (KB)
0 : (reserve) 4 : 256 (KB)
1 : (reserve) 5 : 128 (KB)
2 : 1 (MB) 6 : 768 (KB)

drmfap Capacity of DRAM module (CAP2)


-1 : Not existence 3 : 512 (KB)
0 : 2 (MB) 4 : 256 (KB)
1 : 1.5(MB) 5 : 128 (KB)
2 : 1 (MB) 6 : (reserve)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

665
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

666
(3) Read Series/Version of CNC System Software

Function Name:
cnc_rdsyssoft

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdsyssoft(unsigned short FlibHndl,
ODBSYSS *syssoft);
Description:
Reads the series/version of CNC system software.
These information are stored in each member of ODBSYSS.
Reading the data which depends on the path needs exchanging the path.

This function is available for Series 160/180 Model-C and Series 160i/
180i/210i.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

syssoft Pointer to the ODBSYSS structure for the data of the series/
version of CNC system software.
The ODBSYSS structure is as follows.

typedef struct odbsyss {


char slot_no_p[16]; /* Physical slot number */
char slot_no_l[16]; /* Logical slot number */
short module_id[16]; /* Module ID */
short soft_id[16]; /* Software ID */
char soft_series[16][5];/* Software series with CPU */
char soft_version[16][5];/* Software version with CPU*/

short soft_inst; /* soft. installation status */


char boot_ser[5]; /* Series of boot software */
char boot_ver[5]; /* Version of boot software */
char servo_ser[5]; /* Series of servo software */
char servo_ver[5]; /* Version of servo software */
char pmc_ser[5]; /* Series of PMC management soft. */
char pmc_ver[5]; /* Version of PMC management soft.*/
char ladder_ser[5];/* Series of ladder software */
char ladder_ver[5];/* Version of ladder software */
char mcrlib_ser[5];/* Series of macro library */
char mcrlib_ver[5];/* Version of macro library */
char mcrapl_ser[5];/* Series of macro application */
char mcrapl_ver[5];/* Version of macro application */
char spl1_ser[5]; /* Series of spindle soft.(1st) */
char spl1_ver[5]; /* Version of spindle soft.(1st) */
char spl2_ser[5]; /* Series of spindle soft.(2nd) */
char spl2_ver[5]; /* Version of spindle soft.(2nd) */
char spl3_ser[5]; /* Series of spindle soft.(3rd) */
char spl3_ver[5]; /* Version of spindle soft.(3rd) */
char c_exelib_ser[5];/* Series of C-executer library */
char c_exelib_ver[5];/* Version of C-executer library*/
char c_exeapl_ser[5];/* Series of C-exe. application */
char c_exeapl_ver[5];/* Version of C-exe. application*/
char int_vga_ser[5];/* Series of VGA soft.(internal) */
char int_vga_ver[5];/* Version of VGA soft.(internal)*/

667
char out_vga_ser[5];/* Series of VGA soft.(external) */
char out_vga_ver[5];/* Version of VGA soft.(external)*/
char pmm_ser[5]; /* Series of power motion */
/* manager software */
char pmm_ver[5]; /* Version of power motion */
/* manager software */
char pmc_mng_ser[5]; /* Series of PMC management */
/* software */
char pmc_mng_ver[5]; /* Version of PMC management */
/* software */
char pmc_shin_ser[5]; /* Series of PMC management */
/* software (internal SH) */
char pmc_shin_ver[5]; /* Version of PMC management */
/* software (internal SH) */
char pmc_shout_ser[5];/* Series of PMC management */
/* software (external SH) */
char pmc_shout_ver[5];/* Version of PMC management */
/* software (external SH) */
char pmc_c_ser[5]; /* Series of PMC management */
/* software (C language) */
char pmc_c_ver[5]; /* Version of PMC management */
/* software (C language) */
char pmc_edit_ser[5]; /* Series of PMC management */
/* software (edit card) */
char pmc_edit_ver[5]; /* Version of PMC management */
/* software (edit card) */
char lddr_mng_ser[5]; /* Series of ladder software */
char lddr_mng_ver[5]; /* Version of ladder software */
char lddr_apl_ser[5]; /* Series of ladder software */
/* (C application) */
char lddr_apl_ver[5]; /* Version of ladder software */
/* (C application) */
char reserve[16][5]; /* (reserve) */
} ODBSYSS ;

slot_no_p Physical slot number


The physical slot numbers 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.
00H to 0FH : Primary slot number
80H to 8FH : Secondary slot number

slot_no_l Logical slot number


The logical slot numbers 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.
00H to 0FH : logical slot number

module_id Module ID
The module ID 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. 'XX' is internal information.
The followings are main module ID.
XX3FH:Remote buffer XXADH:FS18B/Main(4 axes)
XX45H:Graphic(CAP-II) XXAEH:FS18B/Main(6 axes)
XX46H:I/O card XXB0H:FS16B/SUB
XX6DH:CAP-II XXB2H:FS16B/Main(4 axes)

668
XX7FH:RISC(64bit) XXB4H:PMC-RB5/RB6
XX94H:MMC-IV XXB7H:FS18B/SUB
XX9AH:Graphic(standard) XXB9H:FS16C/Main(6 axes)
XX9DH:PMC-RC XXBAH:FS16C,18C/SUB
XXA7H:FS16B/Main(6 axes) XXBDH:FS18C/Main(6 axes)

soft_id Software ID
The software ID 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. The followings are main software ID.
40H : CNC 49H : CAP-II
41H : PMC-RC 4AH : Remote buffer
42H : Internal I/O card 4FH : PMC-RE
43H : CNC SUB 5EH : MMC-IV,HSSB I/F
45H : Graphic(standard) 67H : PMC-RB5/RB6
46H : Graphic(CAP-II)

soft_series Software series


Software series information is stored in ASCII code in
order of its position (4 byte + 'NULL').

soft_version Software version


Software series information is stored in ASCII code in
order of its position (4 byte + 'NULL').

soft_inst Software installation status for CNC/CNC SUB


/LOADER(dependent on path)
bit1, bit0
0 0 --> BASIC
0 1 --> BASIC + OPTION-A1
1 0 --> BASIC + OPTION-A2
1 1 --> BASIC + OPTION-A1 + OPTION-A2

boot_ser Series of boot software


boot_ver Version of boot software
servo_ser Series of servo software(dependent on path)
servo_ver Version of servo software( " )
pmc_ser Series of PMC management soft.( " )
pmc_ver Version of PMC management soft.( " )
ladder_ser Series of ladder software( " )
ladder_ver Version of ladder software( " )
mcrlib_ser Series of macro library/order made macro
(dependent on path)
mcrlib_ver Version of macro library/order made macro
(dependent on path)
mcrapl_ser Series of macro application(dependent on path)
mcrapl_ver Version of macro application( " )

spl1_ser Series of spindle soft.(1st)(dependent on path)


spl1_ver Version of spindle soft.(1st)( " )
spl2_ser Series of spindle soft.(2nd)( " )
spl2_ver Version of spindle soft.(2nd)( " )
spl3_ser Series of spindle soft.(3rd)( " )
spl3_ver Version of spindle soft.(3rd)( " )
c_exelib_ser Series of C-executer library
c_exelib_ver Version of C-executer library
c_exeapl_ser Series of C-executer application
c_exeapl_ver Version of C-executer application
int_vga_ser Series of VGA software(internal)
int_vga_ver Version of VGA software(internal)

669
out_vga_ser Series of VGA software(external)
out_vga_ver Version of VGA software(external)

* Following items are only available for Series 160i/180i/210i.

pmm_ser Series of power motion manager soft


(dependent on path)
pmm_ver Version of power motion manager soft( " )
pmc_mng_ser Series of PMC management soft( " )
Please use this item instead of pmc_ser if CNC
is Series 160i/180i/210i.
pmc_mng_ver Version of PMC management soft(depend. on path)
Please use this item instead of pmc_ver if CNC
is Series 160i/180i/210i.
pmc_shin_ser Series of PMC management soft(internal SH)
(dependent on path)
pmc_shin_ver Version of PMC management soft(internal SH)
(dependent on path)
pmc_shout_ser Series of PMC management soft(external SH)
(dependent on path)
pmc_shout_ver Version of PMC management soft(external SH)
(dependent on path)
pmc_c_ser Series of PMC management soft(C language)
(dependent on path)
pmc_c_ver Version of PMC management soft(C language)
(dependent on path)
pmc_edit_ser Series of PMC management soft(edit card)
(dependent on path)
pmc_edit_ver Version of PMC management soft(edit card)
lddr_mng_ser Series of ladder software (dependent on path)
Please use this item instead of ladder_ser
if CNC is Series 160i/180i/210i.
lddr_mng_ver Version of ladder software (dependent on path)
Please use this item instead of ladder_ver
if CNC is Series 160i/180i/210i.
lddr_apl_ser Series of ladder software(C application)
(dependent on path)
lddr_apl_ver Version of ladder software(C application)
(dependent on path)
reserve (reserve)

* Above series/version are stored in ASCII code(4 byte +


'NULL'). In case of no software, first character is 'NULL'.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The extended driver/library option is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

670
CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

671
(4) Read Module Configuration of CNC System

Function Name:
cnc_rdmdlconfig

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdmdlconfig(unsigned short FlibHndl,
ODBMDLC *mdlconfig);
Description:
Reads the module configuration of CNC system.
These information are stored in each member of ODBMDLC.
Reading the data which depends on the path needs exchanging the path.

This function is only available for Series 160/180 Model-C.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

mdlconfig
Pointer to the ODBMDLC structure for the module configuration
of CNC system. The ODBMDLC structure is as follows.

- The ODBMDLC structure for Series 160/180 is as follows.

typedef struct odbmdlc {


short from; /* Capacity of FROM module */
short dram; /* Capacity of DRAM module */
short sram; /* Capacity of additional SRAM module*/
short pmc; /* Type of PMC module */
short crtc; /* Type of CRTC module */
short servo12; /* Existence of servo module(axis1,2)*/
short servo34; /* Existence of servo module(axis3,4)*/
short servo56; /* Existence of servo module(axis5,6)*/
short servo78; /* (reserve) */
short sic; /* Existence of SIC */
short pos_lsi; /* Existence of POSITION LSI */
short hi_aio; /* Existence of high-speed skip */
/* & analog I/O */
short reserve1[12];/* (reserve) */

/* Above items depend on each path. */


/* Following items are independent of each path. */

short drmmrc; /* Capacity of Extended DRAM */


/* for management software(PMC-RC) */
short drmarc; /* Capacity of DRAM for application */
/* (PMC-RC) */
short pmcmrc; /* Type of PMC module(PMC-RC) */
short dmaarc; /* Existence of additional board */
/* for DMA(PMC-RC) */

672
short iopt; /* Number of DI/DO points(I/O card) */
short hdiio; /* Existence of LSI for high-speed */
/* skip(I/O card) */

short gm2gr1; /* Existence of graphic engine 2 */

short crtgr2; /* Type of CRTC module(OPT-1) */


short gm1gr2; /* Existence of graphic module1(OPT-1*/
short gm2gr2; /* Existence of graphic module2(OPT-1*/
short cmmrb; /* Existence of communication module */
/* (OPT-1)*/

short sv5axs; /* Existence of servo module(axis5,6)*/


/* (axis card)*/
short sv7axs; /* Existence of servo module(axis7,8)*/
/* (axis card)*/
short sicaxs; /* Existence of SIC(axis card) */
short posaxs; /* Existence of POSITION LSI(axis crd*/
short hamaxs; /* Existence of high-speed skip */
/* & analog I/O(axis card) */

short romr64; /* Capacity of system EPROM module */


/* (64bitRISC)*/
short srmr64; /* Capacity of SRAM module(64bitRISC)*/
short dr1r64; /* Capacity of DRAM module1(64bitRISC*/
short dr2r64; /* Capacity of DRAM module2(64bitRISC*/

short iopio2; /* Number of DI/DO points(I/O card#2)*/


short hdiio2; /* Existence of LSI for high-speed */
/* skip(I/O card#2)*/

short cmmrb2; /* Existence of communication module */


/* (OPT-1#2) */
short romfap; /* Existence of system EPROM module */
(CAP2) */
short srmfap; /* Capacity of SRAM module(CAP2) */
short drmfap; /* Capacity of DRAM module(CAP2) */

short drmare; /* Capacity of DRAM for application */


/* (PMC-RE) */
short pmcmre; /* Type of PMC module(PMC-RE) */
short dmaare; /* Existence of additional board */
/* for DMA(PMC-RE) */

short frmbgg; /* Capacity of FROM module(BG-GRPH) */


short drmbgg; /* Capacity of DRAM module(BG-GRPH) */
short asrbgg; /* Capacity of additional SRAM module*/
/* (BG-GRPH)*/

short edtpsc; /* Version of module(PMC-RB5/RB6) */


short slcpsc; /* Existence of SLC(PMC-RB5/RB6) */

short reserve2[34];/* (reserve) */


} ODBMDLC ;

673
from Capacity of FROM module
-1 : Not existence 10 : 6 (MB)
0 : (reserve) 11 : 8 (MB)
1 : 2 (MB) 12 : 10 (MB)
2 : 4 (MB) 13 : 12 (MB)
3 : 6 (MB) 14 : 14 (MB)
4 : 8 (MB) 15 : 1 (MB)
5 : 10 (MB) 16 : 1 (MB)
6 : 12 (MB) 17 : (reserve)
7 : 4 (MB) 18 : 4 (MB)
8 : 3 (MB) 19 : 8 (MB)
9 : 2 (MB)

dram Capacity of DRAM module


-1 : Not existence 4 : 16 (MB)
0 : 4 (MB) 5 : 8 (MB)
1 : 2 (MB) 6 : 4 (MB)
2 : 1 (MB) 7 : 24 (MB)
3 : 6 (MB)

sram Capacity of additional SRAM module


-1 : Not existence 5 : 768 (KB)
0 : 1 (MB) 6 : (reserve)
1 : 512 (KB) 7 : 2.25(MB)
2 : 2 (MB) 8 : (reserve)
3 : (reserve) 9 : 256 (KB)
4 : (reserve)

pmc Type of PMC module


-1 : Not existence 2 : PMP2+SLC
0 : BOC2 3 : BSI
1 : BSI+SLC 4 : PMP2

crtc Type of CRTC module


-1 : Not existence 3 : HSSB-VGA
0 : 14"CRT 4 : (reserve)
1 : 9"CRT 5 : 9"VGA
2 : VGA

servo12 Existence of servo module(axis1,2)


-1 : Not existence 0 : Existence

servo34 Existence of servo module(axis3,4)


-1 : Not existence 0 : Existence

servo56 Existence of servo module(axis5,6)


-1 : Not existence 0 : Existence

sic Existence of SIC


-1 : Not existence 0 : Existence

pos_lsi Existence of POSITION LSI


-1 : Not existence 0 : Existence

hi_aio Existence of high-speed skip & analog I/O


-1 : Not existence 1 : only high-speed skip
0 : Existence both 2 : only analog I/O

674
drmmrc Capacity of additional DRAM for management
software(PMC-RC)
-1 : Not existence 0 : Existence

drmarc Capacity of DRAM for application(PMC-RC)


-1 : Not existence 2 : 512(KB)
0 : 2(MB) 3 : 1(MB)
1 : (reserve)

pmcmrc Type of PMC module(PMC-RC)


-1 : Not existence 2 : PMP2+SLC
0 : BOC2 3 : BSI
1 : BSI+SLC 4 : PMP2

dmaarc Existence of additional board for DMA(PMC-RC)


-1 : Not existence 0 : Existence

iopt Number of DI/DO points(I/O card)


-1 : Not existence 2 : 80/ 56
0 : 144/112 3 : 104/ 72
1 : 40/ 40 4 : 156/120

hdiio Existence of LSI for high-speed skip(I/O card)


-1 : Not existence 0 : Existence

gm2gr1 Existence of graphic engine 2


-1 : Not existence 0 : Existence

crtgr2 Type of CRTC module(OPT-1)


-1 : Not existence 3 : (reserve)
0 : 14"CRT 4 : 14"CRT GRPH
1 : 9"CRT 5 : 9"CRT GRPH
2 : VGA MAIN 6 : VGA GRPH

gm1gr2 Existence of graphic module 1(OPT-1)


-1 : Not existence 0 : Existence

gm2gr2 Existence of graphic module 2(OPT-1)


-1 : Not existence 0 : Existence

cmmrb Existence of communication module(OPT-1)


-1 : Not existence 0 : Existence

sv5axs Existence of servo module(axis5,6)(axis card)


-1 : Not existence 0 : Existence

sv7axs Existence of servo module(axis7,8)(axis card)


-1 : Not existence 0 : Existence

sicaxs Existence of SIC(axis card)


-1 : Not existence 0 : Existence

posaxs Existence of POSITION LSI(axis card)


-1 : Not existence 0 : Existence

hamaxs Existence of high-speed skip & analog I/O


(axis card)
-1 : Not existence 1 : only high-speed skip
0 : Existence both 2 : only analog I/O

675
romr64 Capacity of system EPROM module(64bitRISC)
-1 : Not existence 3 : 512 (KB)
0 : 4 (MB) 4 : 256 (KB)
1 : 2 (MB) 5 : 128 (KB)
2 : 1 (MB) 6 : 768 (KB)

srmr64 Capacity of SRAM module(64bitRISC)


-1 : Not existence 3 : 512 (KB)
0 : 4 (MB) 4 : 256 (KB)
1 : 2 (MB) 5 : 128 (KB)
2 : 1 (MB) 6 : 768 (KB)

dr1r64 Capacity of DRAM module 1(64bitRISC)


-1 : Not existence 2 : 2 (MB)
0 : (reserve) 3 : 4 (MB)
1 : (reserve)

dr2r64 Capacity of DRAM module 2(64bitRISC)


-1 : Not existence 2 : 2 (MB)
0 : (reserve) 3 : 4 (MB)
1 : (reserve)

iopio2 Number of DI/DO points(I/O card#2)


-1 : Not existence 2 : 80/ 56
0 : 144/112 3 : 104/ 72
1 : 40/ 40 4 : 156/120

hdiio2 Existence of LSI for high-speed skip(I/O card#2)


-1 : Not existence 0 : Existence

cmmrb2 Existence of communication module(OPT-1#2)


-1 : Not existence 0 : Existence

romfap Existence of system EPROM module(CAP2)


-1 : Not existence 3 : 512 (KB)
0 : (reserve) 4 : 256 (KB)
1 : (reserve) 5 : 128 (KB)
2 : 1 (MB) 6 : 768 (KB)

srmfap Capacity of SRAM module(CAP2)


-1 : Not existence 3 : 512 (KB)
0 : (reserve) 4 : 256 (KB)
1 : (reserve) 5 : 128 (KB)
2 : 1 (MB) 6 : 768 (KB)

drmfap Capacity of DRAM module(CAP2)


-1 : Not existence 3 : 512 (KB)
0 : 2 (MB) 4 : 256 (KB)
1 : 1.5(MB) 5 : 128 (KB)
2 : 1 (MB) 6 : (reserve)

drmare Capacity of DRAM for applications(PMC-RE)


-1 : Not existence 2 : 512 (KB)
0 : 2 (MB) 3 : 1 (MB)
1 : (reserve)

pmcmre Type of PMC module(PMC-RE)


-1 : Not existence 2 : PMP2+SLC
0 : BOC2 3 : BSI
1 : BSI+SLC 4 : PMP2

676
dmaare Existence of additional board for DMA(PMC-RE)
-1 : Not existence 0 : Existence

frmbgg Capacity of FROM module(BG-GRAPH)


-1 : Not existence 10 : 6 (MB)
0 : (reserve) 11 : 8 (MB)
1 : 2 (MB) 12 : 10 (MB)
2 : 4 (MB) 13 : 12 (MB)
3 : 6 (MB) 14 : 14 (MB)
4 : 8 (MB) 15 : 1 (MB)
5 : 10 (MB) 16 : 1 (MB)
6 : 12 (MB) 17 : (reserve)
7 : 4 (MB) 18 : 4 (MB)
8 : 3 (MB) 19 : 8 (MB)
9 : 2 (MB)

drmbgg Capacity of DRAM module(BG-GRAPH)


-1 : Not existence 4 : 16 (MB)
0 : 4 (MB) 5 : 8 (MB)
1 : 2 (MB) 6 : 4 (MB)
2 : 1 (MB) 7 : 24 (MB)
3 : 6 (MB)

asrbgg Capacity of additional SRAM module(BG-GRPH)


-1 : Not existence 5 : 768 (KB)
0 : 1 (MB) 6 : (reserve)
1 : 512 (KB) 7 : 2.25(MB)
2 : 2 (MB) 8 : (reserve)
3 : (reserve) 9 : 256 (KB)
4 : (reserve)

edtpsc Version of module(PMC-RB5/RB6)


-1 : Not existence 0 : Version

slcpsc Existence of SLC(PMC-RB5/RB6)


-1 : Not existence 0 : Existence

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The extended driver/library option is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

677
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

678
(5) Read Module Configuration of CNC System (2)

Function Name:
cnc_rdmdlconfig2

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdmdlconfig2(unsigned short FlibHndl,
char *data);
Description:
Reads the module configuration of CNC system.

This function is available for Series 160/180/210 and Series 160i/180i/


210i.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

data Pointer to the character array for the module configuration of


CNC system. The 128 bytes array is necessary to store them,
and if its size is less than 128 bytes, the behavior of this
function is not guaranteed. The details are as follows.

* Series 160-B/180-B
data[0] Capacity of FROM module (MAIN)
-1 : Not existence 9 : 2 MB
0 : reserve 10 : 6 MB
1 : 2 MB 11 : 8 MB
2 : 4 MB 12 : 10 MB
3 : 6 MB 13 : 12 MB
4 : 8 MB 14 : 14 MB
5 : 10 MB 15 : 1 MB
6 : 12 MB 16 : 1 MB
7 : 4 MB 17 : 4 MB
8 : 3 MB 18 : 8 MB
data[1] Capacity of DRAM module (MAIN)
-1 : Not existence 4 : 16 MB
0 : 4 MB 5 : 8 MB
1 : 2 MB 6 : 4 MB
2 : 1 MB 7 : 24 MB
3 : 6 MB
data[2] Capacity of additional SRAM module (MAIN)
-1 : Not existence 5 : 768 KB
0 : 1 MB 6 : reserve
1 : 512 KB 7 : 2.25 MB
2 : 2 MB 8 : reserve
3 : reserve 9 : 256 KB
4 : reserve
data[3] Type of PMC module (MAIN)
-1 : Not existence 2 : PMP2+SLC
0 : BOC2 3 : BSI
1 : BSI+SLC 4 : PMP2
data[4] Type of CRTC module (MAIN)
-1 : Not existence 3 : reserve
0 : 14"CRT 4 : reserve
1 : 9"CRT 5 : 9"VGA
2 : VGA

679
data[5] Existence of servo module(axis1,2) (MAIN)
0 : Existence -1 : Not existence
data[6] Existence of servo module(axis3,4) (MAIN)
0 : Existence -1 : Not existence
data[7] Existence of SIC (MAIN)
0 : Existence -1 : Not existence
data[8] Existence of POSITION LSI (MAIN)
0 : Existence -1 : Not existence
data[9] Existence of additional DRAM for
management software (PMC-RC)
0 : Existence -1 : Not existence
data[10] Existence of DRAM for application (PMC-RC)
-1 : Not existence 2 : 512 KB
0 : 2 MB 3 : 1 MB
1 : reserve
data[11] Type of PMC module (PMC-RC)
-1 : –¢À‘• 2 : PMP2+SLC
0 : BOC2 3 : BSI
1 : BSI+SLC 4 : PMP2
data[12] Existence of additional board for DMA (PMC-RC)
0 : Existence -1 : Not existence
data[13] Number of DI/DO points (I/O card)
-1 : reserve 2 : 80/56
0 : 144/112 3 : 104/72
1 : 40/40 4 : 156/120
data[14] Existence of LSI for high-speed skip (I/O card,M-NET)
0 : Existence -1 : Not existence
data[15] Capacity of FROM module (SUB)
-1 : Not existence 8 : 3 MB
0 : reserve 9 : 2 MB
1 : 2 MB 10 : 6 MB
2 : 4 MB 11 : 8 MB
3 : 6 MB 12 : 10 MB
4 : 8 MB 13 : 12 MB
5 : 10 MB 14 : 14 MB
6 : 12 MB 15 : 1 MB
7 : 4 MB 16 : 1 MB
data[16] Capacity of DRAM module (SUB)
-1 : Not existence 4 : 16 MB
0 : 4 MB 5 : 8 MB
1 : 2 MB 6 : 4 MB
2 : 1 MB 7 : 24 MB
3 : 6 MB
data[17] Capacity of additional SRAM module (SUB)
-1 : Not existence 5 : 768 KB
0 : 1 MB 6 : reserve
1 : 512 KB 7 : 2.25 MB
2 : 2 MB 8 : reserve
3 : reserve 9 : 256 KB
4 : reserve
data[18] Existence of servo module(axis1,2) (SUB)
0 : Existence -1 : Not existence
data[19] Existence of servo module(axis3,4) (SUB)
0 : Existence -1 : Not existence
data[20] Existence of SIC (SUB)
0 : Existence -1 : Not existence
data[21] Existence of POSITION LSI (SUB)
0 : Existence -1 : Not existence
data[22] Existence of high-speed skip & analog I/O (SUB)
-1 : Not existence 1 : only high-speed skip
0 : Existence both 2 : only analog I/O

680
data[23] Existence of graphic engine 2 (MAIN)
0 : Existence -1 : Not existence
data[24] Type of CRTC module (OPT-1)
-1 : Not existence 3 : reserve
0 : 14"CRT MAIN 4 : 14"CRT GRPH
1 : 9"CRT MAIN 5 : 9"CRT GRPH
2 : VGA MAIN 6 : VGA GRPH
data[25] Existence of graphic module 1 (OPT-1)
0 : Existence -1 : Not existence
data[26] Existence of graphic module 2 (OPT-1)
0 : Existence -1 : Not existence
data[27] Existence of communication module (OPT-1)
0 : Existence -1 : Not existence
data[28] Existence of servo module(axis1,2) (axis card)
0 : Existence -1 : Not existence
data[29] Existence of servo module(axis3,4) (axis card)
0 : Existence -1 : Not existence
data[30] Existence of SIC (axis card)
0 : Existence -1 : Not existence
data[31] Existence of POSITION LSI (axis card)
0 : Existence -1 : Not existence
data[32] Existence of high-speed skip & analog I/O (axis card)
-1 : Not existence 1 : only high-speed skip
0 : Existence both 2 : only analog I/O
From data[33] to data[38] are reserved.
data[39] Capacity of system EPROM module (64bitRISC)
-1 : Not existence 3 : 512 KB
0 : 4 MB 4 : 256 KB
1 : 2 MB 5 : 128 KB
2 : 1 MB 6 : 768 KB
data[40] Capacity of SRAM (64bitRISC)
-1 : Not existence 3 : 512 KB
0 : 4 MB 4 : 256 KB
1 : 2 MB 5 : 128 KB
2 : 1 MB 6 : 768 KB
data[41] Capacity of DRAM module 1 (64bitRISC)
-1 : Not existence 2 : 2 MB
0 : reserve 3 : 4 MB
1 : reserve
data[42] Capacity of DRAM module 2 (64bitRISC)
-1 : Not existence 2 : 2 MB
0 : reserve 3 : 4 MB
1 : reserve
data[43] Number of DI/DO points (I/O card#2)
-1 : Not existence 2 : 80/56
0 : 144/112 3 : 104/72
1 : 40/40 4 : 156/120
data[44] Existence of LSI for high-speed skip (I/O card#2)
0 : Existence -1 : Not existence
data[45] Existence of communication module (OPT-1#2)
0 : Existence -1 : Not existence
data[46] Capacity of system EPROM module (CAP2)
-1 : Not existence 3 : 512 KB
0 : reserve 4 : 256 KB
1 : reserve 5 : 128 KB
2 : 1 MB 6 : 768 KB
data[47] Capacity of SRAM module (CAP2)
-1 : Not existence 3 : 512 KB
0 : reserve 4 : 256 KB
1 : reserve 5 : 128 KB
2 : 1 MB 6 : 768 KB

data[48] Capacity of DRAM module (CAP2)

681
-1 : Not existence 3 : 512 KB
0 : 2 MB 4 : 256 KB
1 : 1.5 MB 5 : 128 KB
2 : 1 MB
data[49] Capacity of FROM module (LC)
-1 : Not existence 8 : 3 MB
0 : reserve 9 : 2 MB
1 : 2 MB 10 : 6 MB
2 : 4 MB 11 : 8 MB
3 : 6 MB 12 : 10 MB
4 : 8 MB 13 : 12 MB
5 : 10 MB 14 : 14 MB
6 : 12 MB 15 : 1 MB
7 : 4 MB 16 : 1 MB
data[50] Capacity of DRAM module (LC)
-1 : Not existence 4 : 16 MB
0 : 4 MB 5 : 8 MB
1 : 2 MB 6 : 4 MB
2 : 1 MB 7 : 24 MB
3 : 6 MB
data[51] Type of PMC module (LC)
-1 : Not existence 2 : PMP2+SLC
0 : BOC2 3 : BSI
1 : BSI+SLC 4 : PMP2
data[52] Existence of servo module(axis1,2) (LC)
0 : Existence -1 : Not existence
data[53] Existence of servo module(axis3,4) (LC)
0 : Existence -1 : Not existence
data[54] Capacity of DRAM for application (PMC-RE)
-1 : Not existence 2 : 512 KB
0 : 2 MB 3 : 1 MB
1 : reserve
data[55] TYPE of PMC module (PMC-RE)
-1 : Not existence 2 : PMP2+SLC
0 : BOC2 3 : BSI
1 : BSI+SLC 4 : PMP2
data[56] Existence of additional board for DMA (PMC-RE)
0 : Existence -1 : Not existence
data[57] Existence of servo module(axis5,6) (MAIN)
0 : Existence -1 : Not existence
data[58] Capacity of FROM module (BG-GRAPH)
-1 : Not existence 8 : 3 MB
0 : reserve 9 : 2 MB
1 : 2 MB 10 : 6 MB
2 : 4 MB 11 : 8 MB
3 : 6 MB 12 : 10 MB
4 : 8 MB 13 : 12 MB
5 : 10 MB 14 : 14 MB
6 : 12 MB 15 : 1 MB
7 : 4 MB 16 : 1 MB
data[59] Capacity of DRAM module (BG-GRAPH)
-1 : Not existence 4 : 16 MB
0 : 4 MB 5 : 8 MB
1 : 2 MB 6 : 4 MB
2 : 1 MB 7 : 24 MB
3 : 6 MB

682
data[60] Capacity of additional SRAM module (BG-GRPH)
-1 : Not existence 5 : 768 KB
0 : 1 MB 6 : reserve
1 : 512 KB 7 : 2.25 MB
2 : 2 MB 8 : reserve
3 : reserve 9 : 256 KB
4 : reserve
data[61] Existence of servo module(axis5,6) (SUB)
0 : Existence -1 : Not existence
data[62] to data[127] are reserved.

* Series 160-C/180-C
data[0] Capacity of FROM module (MAIN)
-1 : Not existence 10 : reserve
0 : reserve 11 : reserve
1 : 2 MB 12 : reserve
2 : 4 MB 13 : reserve
3 : 6 MB 14 : reserve
4 : 8 MB 15 : reserve
5 : reserve 16 : reserve
6 : reserve 17 : 12 MB
7 : reserve 18 : 4 MB
8 : reserve 19 : 8 MB
9 : reserve
data[1] Capacity of DRAM module (MAIN)
-1 : Not existence 4 : 16 MB
0 : 4 MB 5 : 8 MB
1 : 2 MB 6 : 4 MB
2 : 1 MB 7 : 24 MB
3 : 6 MB
data[2] Capacity of additional SRAM module (MAIN)
-1 : Not existence 5 : 768 KB
0 : reserve 6 : reserve
1 : reserve 7 : 2.25 MB
2 : reserve 8 : reserve
3 : reserve 9 : 256 KB
4 : reserve
data[3] reserved
data[4] Type of CRTC module (MAIN)
-1 : Not existence 3 : HSSB-VGA
0 : 14"CRT 4 : reserve
1 : 9"CRT 5 : 9"VGA
2 : VGA
data[5] Existence of servo module(axis1,2) (MAIN)
0 : Existence -1 : Not existence
data[6] Existence of servo module(axis3,4) (MAIN)
0 : Existence -1 : Not existence
data[7] Existence of SIC (MAIN)
0 : Existence -1 : Not existence
data[8] Existence of POSITION LSI (MAIN)
0 : Existence -1 : Not existence
data[9] Existence of additional DRAM for
management software (PMC-RC)
0 : Existence -1 : Not existence
data[10] Capacity of DRAM for application (PMC-RC)
-1 : Not existence 2 : 512 KB
0 : 2 MB 3 : 1 MB
1 : reserve

683
data[11] Type of PMC module (PMC-RC)
-1 : Not existence 2 : PMP2+SLC
0 : BOC2 3 : BSI
1 : BSI+SLC 4 : PMP2
data[12] Existence of additional board for DMA (PMC-RC)
0 : Existence -1 : Not existence
data[13] Existence of DI/DO points (I/O card)
-1 : Not existence 2 : 80/56
0 : 144/112 3 : 104/72
1 : 40/40 4 : 156/120
data[14] Existence of LSI for high-speed skip (I/O card)
0 : Existence -1 : Not existence
data[15] Capacity of FROM module (SUB)
-1 : Not existence 10 : reserve
0 : reserve 11 : reserve
1 : 2 MB 12 : reserve
2 : 4 MB 13 : reserve
3 : 6 MB 14 : reserve
4 : 8 MB 15 : reserve
5 : reserve 16 : reserve
6 : reserve 17 : 12 MB
7 : reserve 18 : 4 MB
8 : reserve 19 : 8 MB
9 : reserve
data[16] Capacity of DRAM module (SUB)
-1 : Not existence 4 : 16 MB
0 : 4 MB 5 : 8 MB
1 : 2 MB 6 : 4 MB
2 : 1 MB 7 : 24 MB
3 : 6 MB
data[17] Capacity of additional SRAM module (SUB)
-1 : Not existence 5 : 768KB
0 : reserve 6 : reserve
1 : reserve 7 : 2.25MB
2 : reserve 8 : reserve
3 : reserve 9 : 256KB
4 : reserve
data[18] Existence of servo module(axis1,2) (SUB)
0 : Existence -1 : Not existence
data[19] Existence of servo module(axis3,4) (SUB)
0 : Existence -1 : Not existence
data[20] Existence of SIC (SUB)
0 : Existence -1 : Not existence
data[21] Existence of POSITION LSI (SUB)
0 : Existence -1 : Not existence
data[22] Existence of high-speed skip & analog I/O (SUB)
-1 : Not existence 1 : only high-speed skip
0 : Existence both 2 : only analog I/O
data[23] reserve
data[24] Type of CRTC module (OPT-1)
-1 : Not existence 3 : reserve
0 : 14"CRT MAIN 4 : 14"CRT GRPH
1 : 9"CRT MAIN 5 : 9"CRT GRPH
2 : VGA MAIN 6 : VGA GRPH
data[25] Existence of graphic module 1 (OPT-1)
0 : Existence -1 : Not existence
data[26] Existence of graphic module 2 (OPT-1)
0 : Existence -1 : Not existence
data[27] Existence of communication module (OPT-1)
0 : Existence -1 : Not existence

684
data[28] Existence of servo module(axis1,2) (axis card)
0 : Existence -1 : Not existence
data[29] Existence of servo module(axis3,4) (axis card)
0 : Existence -1 : Not existence
data[30] Existence of SIC (axis card)
0 : Existence -1 : Not existence
data[31] Existence of POSITION LSI (axis card)
0 : Existence -1 : Not existence
data[32] Existence of high-speed skip & analog I/O (axis card)
-1 : Not existence 1 : only high-speed skip
0 : Existence both 2 : only analog I/O
From data[33] to data[38] reserved.
data[39] Capacity of system EPROM module (64bitRISC)
-1 : Not existence 3 : 512 KB
0 : 4 MB 4 : 256 KB
1 : 2 MB 5 : 128 KB
2 : 1 MB 6 : 768 KB
data[40] Capacity of SRAM module (64bitRISC)
-1 : Not existence 3 : 512 KB
0 : 4 MB 4 : 256 KB
1 : 2 MB 5 : 128 KB
2 : 1 MB 6 : 768 KB
data[41] Capacity of DRAM module 1 (64bitRISC)
-1 : Not existence 2 : 2 MB
0 : reserve 3 : 4 MB
1 : resreve
data[42] Capacity of DRAM module 2 (64bitRISC)
-1 : Not existence 2 : 2 MB
0 : reserve 3 : 4 MB
1 : reserve
data[43] Number of DI/DO points (I/O card#2)
-1 : Not existence 2 : 80/56
0 : 144/112 3 : 104/72
1 : 40/40 4 : 156/120
data[44] Existence of LSI for high-speed skip (I/O card#2)
0 : Existence -1 : Not existence
data[45] Existence of communication module (OPT-1#2)
0 : Existence -1 : Not existence
data[46] Capacity of system EPROM module (CAP2)
-1 : Not existence 3 : 512 KB
0 : reserve 4 : 256 KB
1 : reserve 5 : 128 KB
2 : 1 MB 6 : 768 KB
data[47] Capacity of SRAM module (CAP2)
-1 : Not existence 3 : 512 KB
0 : reserve 4 : 256 KB
1 : reserve 5 : 128 KB
2 : 1 MB 6 : 768 KB
data[48] Capacity of DRAM module (CAP2)
-1 : Not existence 3 : 512 KB
0 : 2 MB 4 : 256 KB
1 : 1.5 MB 5 : 128 KB
2 : 1 MB
data[49] Capacity of FROM module (LC)
-1 : Not existence 8 : 3 MB
0 : reserve 9 : 2 MB
1 : 2 MB 10 : 6 MB
2 : 4 MB 11 : 8 MB
3 : 6 MB 12 : 10 MB
4 : 8 MB 13 : 12 MB
5 : 10 MB 14 : 14 MB
6 : 12 MB 15 : 1 MB

685
7 : 4 MB 16 : 1 MB
data[50] Capacity of DRAM module (LC)
-1 : Not existence 4 : 16 MB
0 : 4 MB 5 : 8 MB
1 : 2 MB 6 : 4 MB
2 : 1 MB 7 : 24 MB
3 : 6 MB
data[51] Type of PMC module (LC)
-1 : Not existence 2 : PMP2+SLC
0 : BOC2 3 : BSI
1 : BSI+SLC 4 : PMP2
data[52] Existence of servo module(axis1,2) (LC)
0 : Existence -1 : Not existence
data[53] Existence of servo module(axis3,4) (LC)
0 : Existence -1 : Not existence
data[54] Capacity of DRAM for application (PMC-RE)
-1 : Not existence 2 : 512 KB
0 : 2 MB 3 : 1 MB
1 : reserve
data[55] TYPE of PMC module (PMC-RE)
-1 : Not existence 2 : PMP2+SLC
0 : BOC2 3 : BSI
1 : BSI+SLC 4 : PMP2
data[56] Existence of additional board for DMA (PMC-RE)
0 : Existence -1 : Not existence
data[57] Existence of servo module(axis5/6) (MAIN)
0 : Existence 1 : Not existence
data[58] Capacity of FROM module (BG-GRAPH)
-1 : Not existence 10 : reserve
0 : reserve 11 : reserve
1 : 2 MB 12 : reserve
2 : 4 MB 13 : reserve
3 : 6 MB 14 : reserve
4 : 8 MB 15 : reserve
5 : reserve 16 : reserve
6 : reserve 17 : 12 MB
7 : reserve 18 : 4 MB
8 : reserve 19 : 8 MB
9 : reserve
data[59] Capacity of DRAM module (BG-GRAPH)
-1 : Not existence 4 : 16 MB
0 : 4 MB 5 : 8 MB
1 : 2 MB 6 : 4 MB
2 : 1 MB 7 : 24 MB
3 : 6 MB
data[60] Capacity of additional SRAM module (BG-GRPH)
-1 : Not existence 5 : 768 KB
0 : reserve 6 : reserve
1 : reserve 7 : 2.25 MB
2 : reserve 8 : reserve
3 : reserve 9 : 256 KB
4 : reserve
data[61] Existence of servo module(axis5,6) (SUB)
0 : Existence -1 : Not existence
data[62] Version of module (PMC-RB5/RB6)
0,..,15 : Version -1 : Not existence
data[63] Existence of SLC (PMC-RB5/RB6)
0 : Existence -1 : Not existence
From data[64] to data[127] reserved.

686
* Series 160i/180i/210i

As for description of the ID, see "Maintenance Manual" of the


each CNC. If the value of ID is -1, it is not existence.

data[0] ID of FROM DIMM (MAIN)


data[1] ID of DRAM DIMM (MAIN)
data[2] ID of SRAM DIMM (MAIN)
data[3] ID of CPU card (MAIN)
data[4] ID of graphic card (MAIN)
data[5] ID of servo card (MAIN)
data[6] Existence of PMC CPU (MAIN)
0 : Existence -1 : Not existence
data[7] ID of DRAM DIMM (SUB)
data[8] ID of CPU card (SUB)
data[9] ID of servo card (SUB)
data[10] ID of DRAM DIMM (LC)
data[11] ID of SRAM DIMM (LC)
data[12] ID of CPU card (LC)
data[13] ID of servo card (LC)
data[14] ID of DRAM DIMM (PMC-RC)
data[15] ID of CPU card (PMC-RC)
data[16] ID of SRAM DIMM (PMC-RE)
data[17] ID of DRAM DIMM (PMC-RE)
data[18] ID of CPU card (PMC-RE)
data[19] ID of SRAM DIMM (CAP2)
data[20] ID of DRAM DIMM (CAP2)
data[21] ID of CPU card (CAP2)
data[22] ID of DRAM DIMM (RMT-BF,DNC1)
data[23] ID of CPU card (RMT-BF,DNC1)
data[24] ID of DRAM DIMM (RMT-BF,DNC1#2)
data[25] ID of CPU card (RMT-BF,DNC1#2)
From data[26] to data[127] reserved.

* Series 210-B
data[0] Capacity of FROM module (MAIN)
0 : 128 KB + 4 MB 4 : 256 KB + 4 MB
1 : reserve 5 : reserve
2 : 128 KB + 6 MB 6 : 256 KB + 6 MB
3 : 128 KB + 2 MB 7 : 256 KB + 2 MB
data[1] Capacity of SRAM module and type of spindle (MAIN)
0 : SRAM 256 KB + SIC existence
1 : SRAM 256 KB + POSITION LSI existence
2 : SRAM 512 KB + SIC existence
3 : SRAM 512 KB + POSITION LSI existence
4 : SRAM 256 KB + SIC & POSITION LSI
existence both
5 : reserve
6 : SRAM 512 KB + SIC & POSITION LSI
existence both
data[2] Existence of MATRIX DI/DO (MAIN)
0 : Not existence 1 : Existence
data[3] Type of PMC module (MAIN)
-1 : Not existence 2 : PMP+SLC
0 : BOC2 3 : BIT
1 : BIT+SLC 4 : PMP
data[4] Type of CRTC module (MAIN)
0 : 14"VGA 2 : 7.2"VGA
1 : 14"CRT 3 : 9"CRT
data[5] reserve

687
data[6] Existence of servo module(axis1+2,3+4) (MAIN)
0 : axis1+2, axis3+4 existence
1 : axis1+2 existence
data[7] Existence of high-speed skip & analog I/O (MAIN)
0 : Existence -1 : Not existence
data[8] Existence of graphic module (MAIN)
0 : Existence -1 : Not existence
From data[9] to data[12] reserved.
data[13] Number of DI/DO points (MAIN)
-1 : Not existence 1 : reserve
0 : 96/64 2 : 48/32
From data[14] to data[127] reserved.

* NC board
data[0] reserve
data[1] Capacity of DRAM module (MAIN)
-1 : Not existence 2 : reserve
0 : 4 MB 3 : 2 MB
1 : reserve
data[2] Capacity of additional SRAM module (MAIN)
0 : 256KB -1 : Not existence
data[3] Type of PMC module (MAIN)
0 : PMP2A+SLC -1 : Not existence
data[4] reserve
data[5] Existence of servo module(axis1,2) (MAIN)
0 : Existence -1 : Not existence
data[6] Existence of servo module(axis3,4)
(ADDITIONAL AXIS PCB)
0 : Existence -1 : Not existence
data[7] Existence of SIC (MAIN)
0 : Existence -1 : Not existence
data[8] Existence of POSITION LSI (MAIN)
0 : Existence -1 : Not existence
From data[9] to data[127] reserved.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The extended driver/library option is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

688
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

689
(6) Read CNC Status Information

Function Name:
cnc_statinfo

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_statinfo(unsigned short FlibHndl,
ODBST *statinfo);
Description:
Read the status information of CNC.
The various information is stored in each member of "ODBST".

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

statinfo
Pointer to the ODBST structure including the status
information of CNC.
There is difference of structure between Series 150, Series 160
/180/210 and NC board.

* The ODBST structure for Series 150 is as follows.


typedef struct odbst {
short dummy[2]; /* Not used */
short aut; /* AUTOMATIC mode selection */
short manual; /* MANUAL mode selection */
short run; /* Status of automatic operation */
short edit; /* Status of program editing */
short motion; /* Status of axis movement,dwell */
short mstb; /* Status of M,S,T,B function */
short emergency; /* Status of emergency */
short write; /* Status of writing backupped memory */
short labelskip; /* Status of label skip */
short alarm; /* Status of alarm */
short warning; /* Status of warning */
short battery; /* Status of battery */
} ODBST ;

* In case of multi-path, there are difference of path only with


"Status of axis movement,dwell","Status of M,S,T,B function".
As for other status, there is no difference.

aut AUTOMATIC mode selection


0 : ****(No selection) 1 : MDI
2 : TAPE 3 : MEMory
4 : EDIT 5 : THeach IN
manual MANUAL mode selection
0 : ***(No selection) 1 : REFerence
2 : INC - feed 3 : HaNDle
4 : JOG 5 : AnGular Jog
6 : Inc+Handl 7 : Jog+Handl

690
run Status of automatic operation
0 : STOP 1 : HOLD
2 : STaRT 3 : MSTR(jog mdi)
4 : ReSTaRt(not blinking) 5 : PRSR(program restart)
6 : NSRC(seq.no.srch) 7 : ReSTaRt(blinking)
8 : ReSET 9,..,12 : (not used)
13 : HPCC(during RISC operation)
* RSTR(during restart)
- blinking : Under manual mode or under cutter
radius compensation outside corner
- not blinking : Excluding the above-mentioned
edit Status of program editing
0 : ****(Not editing) 1 : EDIT
2 : SeaRCH 3 : VeRiFY
4 : CONDense 5 : READ
6 : PuNCH
motion Status of axis movement,dwell
0 : *** 1 : MoTioN
2 : DWeLl 3 : Wait(waiting:only TT)
mstb Status of M,S,T,B function
0 : *** 1 : FIN
emergency Status of emergency
0 : (Not emergency) 1 : EMerGency
write Status of writing backupped memory
0 : (Not writing) 1 : @(writing)
labelskip Status of label skip
0 : LabelSKip 1 : (Not label skip)
alarm Status of alarm
0 : (No alarm) 1 : ALarM
warning Status of warning
0 : (No warning) 1 : WaRNing
battery Status of battery
0 : (Normal) 1 : BATtery low
2 : BATtery low (backupped memory)
(absolute position detector)

* The ODBST structure for Series 160/180/210, NC board 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 ;
* In case of multi-path, all of status exist for each path.

aut AUTOMATIC/MANUAL mode selection


0 : MDI 1 : MEMory
2 : **** 3 : EDIT
4 : HaNDle 5 : JOG
6 : Theach in JOG 7 : Theach in HaNDle
8 : INC feed 9 : REFerence
10 : ReMoTe 11 : TEST(test operation
mode)

691
run Status of automatic operation
0 : ****(reset) 1 : STOP
2 : HOLD 3 : STaRT
4 : MSTR(during retraction and re-positioning of
tool retraction and recovery,
and operation of JOG MDI)
motion Status of axis movement, dwell
0 : *** 1 : MoTioN
2 : DWeLl
mstb Status of M,S,T,B function
0 : ***(Others) 1 : FIN
emergency
Status of emergency
0 : (Not emergency) 1 : EMerGency
2 : ReSET
alarm Status of alarm
0 : ***(Others) 1 : ALarM
2 : BATtery low
edit Status of program editing

- M series
0 : ****(Not editing)
1 : EDIT(during editing)
2 : SeaRCH(during serching)
3 : OUTPUT(during output)
4 : INPUT(during input)
5 : COMPARE(during comparing)
6 : Label SKip(label skip status)
7 : ReSTaRt(during program restart)
8 : HPCC(during RISC operation)
9 : PTRR(during tool retraction and recovery mode)
10 : RVRS(during retracing)
11 : RTRY(during reprogressing)
12 : RVED(end of retracing)
13 : HANDLE(during handle overlapping)
14 : OFfSeT(during tool length measurement mode)
15 : Work OFfSet(during work zero point measurement
mode)
16 : SHPCC(during simple high precision contour
control operation)

- T series
0 : ****(Not editing)
1 : EDIT(during editing)
2 : SeaRCH(during serching)
3 : OUTPUT(during output)
4 : INPUT(during input)
5 : COMPARE(during comparing)
6 : Label SKip(label skip status)
7 : OFfSeT(during writing mode of tool length
compensation amount)
8 : Work ShiFT(during writing mode of work shift
amount)
9 : ReSTaRt(during program restart)
10,..,13 : (Not used)
14 : PTRR(during tool retraction and recovery mode)

692
Return: EW_OK is returned on successful completion, otherwise any value except
EW_OK is returned.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

(As for the details, see "Return status of CNC data window" in "General
Description".)

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

693
(7) Read Alarm Status

Function Name:
cnc_alarm

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_alarm(unsigned short FlibHndl,ODBALM *alarm);

Description:
Reads the alarm status of CNC.
Various information is stored in "data" of ODBALM.

This function is used for watching CNC's alarm status, displaying


the maintenance information or guidance of how to reset the alarm, etc.

When CNC becomes system alarm, it is completely impossible to


communicate data between MMC and CNC, and the alarm status cannot be
acquired.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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.
Series 150
#00 : Background P/S (BG)
#01 : Foreground P/S (PS)
#02 : Overheat alarm (OH)
#03 : Sub-CPU error (SB)
#04 : Syncronized error (SN)
#05 : Parameter switch on (SW)
#06 : Overtravel,External data (OT)
#07 : PMC error (PC)
#08 : External alarm message (EX)
#09 : (Not used)
#10 : Serious P/S (SR)
#11 : (Not used)
#12 : Servo alarm (SV)
#13 : I/O error (IO)
#14 : Power off parameter set (PW)
#15 : (Not used)

694
Series 160/180/210,NC board
#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 : Spindle alarm
#10 : P/S alarm(No.5000,..), Punchpress alarm
#11 : Laser alarm
#12 : (Not used)
#13 : Rigid tap alarm
#14 : (Not used)
#15 : External alarm message

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_PARAM CNC parameter error
(Only Series150)The CNC parameter 7613#0 has been 0 since
CNC was turned on.
Set 7613#0=1.

Note)If 7613#0 has modified 0 from 1,


no error occurs, but the data is invalid.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.
Series 150 7613#0=1 --- must be set
Series 160/180/210,NC board none

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

695
(8) Read Alarm Information

Function Name:
cnc_rdalminfo

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdalminfo(unsigned short FlibHndl,short type,
short alm_type,short length,ALMINFO *alarminfo);
Description:
Reads the detail information of currently arising CNC alarms.
Various information is stored in "data" of ALMINFO.

This function is used for displaying the alarm numbers or messages of


the currently arising alarms by the application program, etc.

When CNC becomes system alarm, it is completely impossible to


communicate data between MMC and CNC, and the alarm information cannot
be acquired.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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.
Series 150
0 : Background P/S (BG)
1 : Foreground P/S (PS)
2 : Overheat alarm (OH)
3 : Sub-CPU error (SB)
4 : Syncronized error (SN)
5 : Parameter switch on (SW)
6 : Overtravel,External data (OT)
7 : PMC error (PC)
8 : External alarm message (EX)
9 : (Not used)
10 : Serious P/S (SR)
11 : (Not used)
12 : Servo alarm (SV)
13 : I/O error (IO)
14 : power off parameter set (PW)
15 : (Not used)

696
Series 160/180/210,NC board
0 : P/S alarm 100
1 : P/S alarm 000
2 : P/S alarm 101
3 : P/S alarm except above
4 : Overtravel alarm
5 : Overheat alarm
6 : Servo alarm
7 : (Not used)
8 : APC alarm
9 : Spindle alarm
10 : P/S alarm(No.5000,...), Punch press alarm
11 : Laser alarm
12 : (Not used)
13 : Rigid tap alarm
14 : (Not used)
15 : External alarm message

length Specify the length of the data block(size of ALMINFO structure)

- Series 150:maximum axis<=15 or Series 160/180/210,NC board


u.alm1 0+-----------------------+ ---
| alm[0] | ^
4+-----------------------+ |
== == |
4*(N-1)+-----------------------+length
| alm[N-1] | |
4*N+-----------------------+ |
| data_end | v
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 | v
38*N+2+-----------------------+ ---
u.alm2.alm 0+-----------------------+
| axis |
2+-----------------------+
| alm_no |
4+-----------------------+
| msg_len |
6+-----------+-----------+
| alm_msg[0]|
7+-----------+
== ==
37+-----------+
| alm_msg[31]
38+-----------+
N is number of messages to be read.

697
- Series 150:maximum axis=24
u.alm1 0+-----------------------+ ---
| alm[0] | ^
8+-----------------------+ |
== == |
8*(N-1)+-----------------------+length
| alm[N-1] | |
8*N+-----------------------+ |
| data_end | v
8*N+2+-----------------------+ ---
u.alm1.alm 0+-----------------------+
| |
2+ axis +
| |
4+-----------------------+
| alm_no |
6+-----------------------+
| dummy |
8+-----------------------+
u.alm2 0+-----------------------+ ---
| alm[0] | ^
40+-----------------------+ |
== == |
40*(N-1)+-----------------------+length
| alm[N-1] | |
40*N+-----------------------+ |
| data_end | v
40*N+2+-----------------------+ ---
u.alm2.alm 0+-----------------------+
| |
2+ axis +
| |
4+-----------------------+
| alm_no |
6+-----------------------+
| msg_len |
8+-----------+-----------+
| alm_msg[0]|
9+-----------+
== ==
39+-----------+
| alm_msg[31]
40+-----------+

N is number of messages to be read.

698
alarminfo
Pointer to the ALMINFO structure including the alarm
information. The ALMINFO structure is as follows.

typedef struct alminfo {


#ifdef M_AXIS2 /* Series 150 : maximum axis=24 */
union {
struct {
struct {
long axis ; /* Axis information */
short alm_no ; /* Alarm number */
} alm[N] ;
long data_end ; /* data end */
} alm1 ;
struct {
struct {
long axis ; /* Axis information */
short alm_no ; /* Alarm number */
short msg_len ; /* Message length */
char alm_msg[32] ; /* Alarm message */
} alm[N] ;
long data_end ; /* data end */
}alm2 ;
} u ;
#else
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 */
short alm_no ; /* Alarm number */
short msg_len ; /* Message length */
char alm_msg[32] ; /* Alarm message */
} alm[N] ;
short data_end ; /* data end */
}alm2 ;
} u ;
#endif
} ALMINFO ; /* N : number of messages to be read. */

axis Axis information is stored.


The generation of the alarm of each axis is
shown with ON/OFF of bit.
As for the not axis-type alarm, all bits are
set 0.

- Series 150:maximum axis<=15


or Series 160/180/210,NC board
#15:0 always
#14:The 15th axis alarm
#13:The 14th axis alarm
:
#01:The 2nd axis alarm
#00:The 1st axis alarm

699
- Series 150:maximum axis=24
#24<->31:0 always
#23:The 24th axis alarm
#22:The 23th axis alarm
:
#01:The 2nd axis alarm
#00:The 1st axis alarm
alarm_no Alarm number(binary) is stored.
For Series 150, The first 2 bits(#15,#14) is
as follows.
#15:macro alarm
#14:alarm for path 2 of TT system
(Alarm number can be acquired by masking these
bits.)
msg_len Message length(binary) is stored.
( 1 to 32 )
alm_msg Alarm message character string(ASCII) is
stored.
data_end Data end is stored.
Always '-1' is set.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH data block length error
Size of ALMINFO structure(length) is wrong.
EW_NUMBER data number error
The type of output format(type) is wrong.
EW_ATTRIB data attribute error
The specification of alarm type(alm_type) is
wrong.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

700
(9) Read Modal Data

Function Name:
cnc_modal

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_modal(unsigned short FlibHndl,short type,
short block,ODBMDL *modal);
Description:
Reads the modal information of CNC.
Various information is stored in each member of ODBMDL.

The readable modal data are modal G code or commanded data such as
M,S,T,F.

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.
See "Library handle" for details.

type Type of data is stored.(refer to below)


Series 150
-4 : Read the all data of 1 shot G code at a time.
-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 17 : Read the data of G code one by one.
100 to 126 : Read the data other than G code
one by one.
200 to 223 : Read the data concerning axis other than
G code one by one.
300 to 303 : Read the data of 1 shot G code one by one.
Series 160/180/210,NC board
-4 : Read the all data of 1 shot G code at a time.
-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, 31 to 34(only Series 160L)
: Read the data of G code one by one.
100 to 126 : Read the data other than G code
one by one.
200 to 207 : Read the data concerning axis other than
G code one by one.
300 : Read the data of 1 shot G code one by one.

701
block Assigned block in stored.
Series 150
0 : previous block
1 : active block
2 : next block
Series 160/180/210,NC board
0 : active block
1 : next block
2 : block after next block

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 */
/* char g_rdata[35]; /* " (160L) */
char g_1shot[4]; /* Modal data of 1 shot 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(and 1 shot


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.

g_1shot Use for reading 1 shot G code at a time.


(In case of individual reading, use "g_data".)

aux Use for an individual reading other than


G code(include axis data).

702
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.

(1) Reading modal G code.

- Series 150
Specify G code group number in following table for "type".

M Series T Series
-------+-------+---------------+-----------------------
G code
type g_data G code SystemA SystemB SystemC
-------+-------+---------------+-------+-------+-------
0 0 G00 G00 G00 G00
1 G01 G01 G01 G01
2 G02 G02 G02 G02
3 G03 G03 G03 G03
4 G33 G32 G33 G33
5 G34 G34 G34
6 G35 G35 G35
7 G36 G36 G36
8 G90 G77 G20
9 G92 G78 G21
10 G94 G79 G24
12 G02.3
13 G03.3
14 G02.1
15 G03.1
17 G02.2 G02.2 G02.2 G02.2
18 G03.2 G03.2 G03.2 G03.2
19 G06.1 G06.1 G06.1 G06.1
20 G02.4
21 G03.4
-------+-------+---------------+-------+-------+-------
1 0 G17 G97 G97 G97
1 G18 G96 G96 G96
2 G19
-------+-------+---------------+-------+-------+-------
2 0 G91 G91 G91
1 G90 G90 G90
-------+-------+---------------+-------+-------+-------
3 0 G22 G22 G22 G22
1 G23 G23 G23 G23
-------+-------+---------------+-------+-------+-------
4 0 G94 G98 G94 G94
1 G95 G99 G95 G95
2 G93
-------+-------+---------------+-------+-------+-------
(to be continued)

703
M Series T Series
-------+-------+-------+-------+-------+-------+------
G code
type g_data G code SystemA SystemB SystemC
-------+-------+---------------+-----------------------
5 0 G21 G21 G21 G71
1 G20 G20 G20 G70
-------+-------+---------------+-------+-------+-------
6 0 G40 G40 G40 G40
1 G41 G41 G41 G41
2 G42 G42 G42 G42
-------+-------+-------+-------+-------+-------+------
7 0 G49
1 G43
2 G44
3 G43.1
-------+-------+---------------+-------+-------+-------
8 0 G80 G80 G80 G80
1 G81 G81 G81 G81
2 G82 G82 G82 G82
3 G83 G83 G83 G83
4 G84 G84 G84 G84
5 G85 G85 G85 G85
6 G86 G86 G86 G86
7 G87 G87 G87 G87
8 G88 G88 G88 G88
9 G89 G89 G89 G89
10 G73 G83.1 G83.1 G83.1
11 G74 G84.1 G84.1 G84.1
12 G76 G86.1 G86.1 G86.1
14 G84.2 G84.2 G84.2 G84.2
15 G84.3 G84.3 G84.3 G84.3
-------+-------+---------------+-------+-------+------
9 0 G98 G98 G98
1 G99 G99 G99
-------+-------+---------------+-------+-------+------
10 0 G50
1 G51
-------+-------+---------------+-------+-------+------
11 0 G67 G67 G67 G67
1 G66 G66 G66 G66
2 G66.1 G66.1 G66.1 G66.1
-------+-------+---------------+-------+-------+------
12 0 G97 G69 G69 G69
1 G96 G68 G68 G68
-------+-------+---------------+-------+-------+------
13 0 G54 G54 G54 G54
1 G55 G55 G55 G55
2 G56 G56 G56 G56
3 G57 G57 G57 G57
4 G58 G58 G58 G58
5 G59 G59 G59 G59
6<->53 G54.1
-------+-------+---------------+-------+-------+-------
(to be continued)

704
M Series T Series
-------+-------+-------+-------+-------+-------+------
G code
type g_data G code SystemA SystemB SystemC
-------+-------+---------------+-------+-------+------
14 0 G64 G64 G64 G64
1 G61 G61 G61 G61
2 G62 G62 G62 G62
3 G63
-------+-------+---------------+-------+-------+------
15 0 G69 G17 G17 G17
1 G68 G18 G18 G18
2 G19 G19 G19
-------+-------+---------------+-------+-------+------
16 0 G15
1 G16
-------+-------+---------------+-------+-------+------
17 0 G50.1 G50.1 G50.1 G50.1
1 G51.1 G51.1 G51.1 G51.1
-------+-------+---------------+-------+-------+------

- Series 160/180/210,NC board


Specify G code group number in following table for "type".
(M Series includes Punch press, and T Series includes Grinder.)

M Series T Series Laser


-------+-------+---------------+-----------------------+--------
G code
type g_data G code SystemA SystemB SystemC G code
-------+-------+---------------+-------+-------+-------+--------
0 0 G00 G00 G00 G00 G00
1 G01 G01 G01 G01 G01
2 G02 G02 G02 G02 G02
3 G03 G03 G03 G03 G03
4 G33 G32 G33 G33
5 G90 G77 G20
6 G92 G78 G21
7 G94 G79 G24
8 G33
9 G34 G34 G34
10 [G] G71 G71 G72
11 [G] G72 G72 G73
12 [G] G73 G73 G74
13 [G] G74 G74 G75
20 G12
-------+-------+---------------+---------------+-------+--------
1 0 G17 G97 G97 G97 G17
1 G96 G96 G96
4 G19 G19
8 G18 G18
-------+-------+---------------+---------------+-------+--------
2 0 G90 G90 G90 G90
1 G91 G91 G91 G91
-------+-------+---------------+---------------+-------+--------
3 0 G23 G69 G69 G69 G23
1 G22 G68 G68 G68 G22
-------+-------+---------------+---------------+-------+--------
4 0 G94 G98 G94 G94
1 G95 G99 G95 G95
-------+-------+---------------+---------------+-------+--------
[G] is an available G code only on Grinder Series.
(to be continued)

705
M Series T Series Laser
-------+-------+---------------+-----------------------+--------
G code
type g_data G code SystemA SystemB SystemC G code
-------+-------+---------------+-------+-------+-------+--------
5 0 G20 G20 G20 G70 G20
1 G21 G21 G21 G71 G21
-------+-------+---------------+---------------+-------+--------
6 0 G40 G40 G40 G40 G40
1 G41 G41 G41 G41 G41
2 G42 G42 G42 G42 G42
-------+-------+---------------+---------------+-------+--------
7 0 G49 G25 G25 G25 G49
1 G43 G26 G26 G26 G43
2 G44 G44
-------+-------+---------------+---------------+-------+--------
8 0 G80 G23 G23 G23
1 G81 G22 G22 G22
2 G82
3 G83
4 G84
5 G85
6 G86
7 G87
8 G88
9 G89
10 G73
11 G74
12 G76
-------+-------+---------------+---------------+-------+--------
9 0 G98 G80 G80 G80
1 G99 G83 G83 G83
2 G84 G84 G84
3 G85 G85 G85
5 G87 G87 G87
6 G88 G88 G88
7 G89 G89 G89
-------+-------+---------------+---------------+-------+--------
10 0 G50 G98 G98 G50
1 G51 G99 G99 G51
-------+-------+---------------+---------------+-------+--------
11 0 G67 G67 G67 G67 G67
1 G66 G66 G66 G66 G66
-------+-------+---------------+---------------+-------+--------
12 0 G97
1 G96
-------+-------+---------------+---------------+-------+--------
13 0 G54 G54 G54 G54 G54
0 G54.1
1 G55 G55 G55 G55 G55
2 G56 G56 G56 G56 G56
3 G57 G57 G57 G57 G57
4 G58 G58 G58 G58 G58
5 G59 G59 G59 G59 G59
-------+-------+---------------+---------------+-------+--------
14 0 G64 G64
1 G61 G61
2 G62 G62
3 G63
-------+-------+---------------+---------------+-------+--------
(to be continued)

706
M Series T Series Laser
-------+-------+---------------+-----------------------+--------
G code
type g_data G code SystemA SystemB SystemC G code
-------+-------+---------------+-------+-------+-------+--------
15 0 G69 G17 G17 G17 G85
1 G68 G84
4 G18 G18 G18
8 G19 G19 G19
-------+-------+---------------+-------+-------+-------+--------
16 0 G15 G15
1 G16 G16
-------+-------+---------------+---------------+-------+--------
17 0 G42.1 G40.1
1 G40.1 G41.1
2 G41.1 G42.1
-------+-------+---------------+---------------+-------+--------
18 0 G25
1 G26
-------+-------+---------------+---------------+-------+--------
19 0 G160 G50.2 G50.2 G50.2
1 G161 G51.2 G51.2 G51.2
-------+-------+---------------+---------------+-------+--------
20 0 G13.1 G13.1 G13.1 G13.1 G13.1
1 G12.1 G12.1 G12.1 G12.1 G12.1
-------+-------+---------------+---------------+-------+--------
31 0 G14
1 G13
-------+-------+---------------+---------------+-------+--------
32 0 G69
1 G68
-------+-------+---------------+---------------+-------+--------
33 0 G99
1 G98
-------+-------+---------------+---------------+-------+--------
34 0 G34
1 G33
-------+-------+---------------+---------------+-------+--------

The numerical value of "g_data" mentioned in the above table is stored


in the bit 0,..,bit 6 of "g_data" with binary format.
Whether this G code is commanded in the objective block specified by
"block" or not is stored in the bit 7 of "g_data".

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

For example, the following result is gotten by calling this function


during executing N100's block of the next machining program.
(for M of Series 160/180/210,NC board)

N090 G18 ;
N100 G1 Z100. ;
N110 G17 G2 X10. Y-20. R12. ;

707
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.

To read all "type" concerning G code at a time, -1 is specified.


The array of g_data is stored in g_rdata.
In case of Series 160L, the data of type=0,..,20 is stored in
g_rdata[0],..,g_rdata[20], and the data of type=31,..,34 is stored in
g_rdata[31],..,g_rdata[34].

(2) Reading modal data other than G code.

- Series 150

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 M (2nd M code)
126 M (3rd M code)
-------+------------------------

708
type Address
-------+------------------------
200 1st axis
201 2nd axis
. .
. .
209 10th axis
210 11th axis
. .
. .
214 15th axis
215 16th axis
. .
. .
222 23th axis
223 24th axis
-------+------------------------
* When MAX_AXIS=15, type=215,..,223 are not used.
* When MAX_AXIS=10, type=210,..,223 are not used.

To read "type" concerning 100's at a time, -2 is specified.


The data is stored in the array of raux1.
To read "type" concerning 200's at a time, -3 is specified.
The data is stored in the array of raux2.

+-------------------------------+
| Data | : 4 byte
+-------------------------------+
+---| FLAG1 | : 1 byte
| +-------------------------------+
+-+---| FLAG2 | : 1 byte
| | +-------------------------------+
| | 7 6 5 4 3 2 1 0
| | +---+---+---+---+---+---+---+---+
| +-->|---| | | |Number of places of decimals
| +---+---+---+---+---+---+---+---+
| | | +----> 0 : There is no command of a decimal point.
| | | +----> 1 : There is a command of a decimal point.
| | +--------> 0 : Positive
| | +--------> 1 : Negative
| +------------> 0 : Not 1 digit
| +------------> 1 : 1 digit
| +---+---+---+---+---+---+---+---+
+---->| |---|---|---| |---|---|---|
+---+---+---+---+---+---+---+---+
| +----> 0 : There is no command after RESET.
| +----> 1 : There is a command after RESET.
+-------------> 0 : There is no command in the present block.
+-------------> 1 : There is a command in the present block.

709
- Series 160/180/210,NC board

type Address
-------+------------------------
100 B (2nd auxiliary function)
101 D
102 - (reserved)
103 F
104 H [M]
105 L
106 M
107 S
108 T
109 R [M]
110 P [M]
111 Q [M]
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 M (2nd M code)
126 M (3rd M code)
-------+------------------------
200 1st axis
201 2nd axis
202 3rd axis
203 4th axis
204 5th axis
205 6th axis
206 7th axis
207 8th axis
-------+------------------------
[M] is read as a modal data on M Series and a commanded data
on T Series.

710
To read "type" concerning 100's at a time, -2 is specified.
The data is stored in the array of raux1.
To read "type" concerning 200's at a time, -3 is specified.
The data is stored in the array of raux2.

+-------------------------------+-
| 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
+---+---+---+---+---+---+---+---+
* The command of a decimal point in 'FLAG1' and the number of places
of decimals in 'FLAG2' are valid in the case of 'F code'.
Sometimes the number of places of decimals is 'not zero' without the
command of a decimal point.
* The number of input place of M,S,T,B is digits granted by NC parameter.
M code : parameter No.3030
S code : parameter No.3031
T code : parameter No.3032
B code : parameter No.3033

711
(3) Read modal data of one shot G code

- Series 150

M Series T Series
-------+-------+---------------+-----------------------
G code
type g_1shot G code SystemA SystemB SystemC
-------+-------+---------------+-------+-------+-------
300 0 G04 G04 G04 G04
1 G10 G10 G10 G10
2 G10.1 G10.1 G10.1 G10.1
3 G27 G27 G27 G27
4 G28 G28 G28 G28
5 G29 G29 G29 G29
6 G30 G30 G30 G30
7 G30.1 G30.1 G30.1 G30.1
8 G31 G31 G31 G31(*)
(G31.1) (G31.1) (G31.1) (G31.1)
9 G31.2 G31.2 G31.2 G31.2
10 G31.3 G31.3 G31.3 G31.3
11
12 G37 G37 G37 G37(*)
(G37.1) (G37.1) (G37.1)
13 G37.2 G37.2 G37.2
14 G37.3 G37.3 G37.3
15 G39 G39 G39 G39
16 G52 G52 G52 G52
17 G60 G60 G60 G60
18 G65 G65 G65 G65
19 G92 G92 G92 G92
20 G70 G70 G70
21 G71 G71 G71
22 G72 G72 G72
23 G73 G73 G73
24 G74 G74 G74
25 G75 G75 G75
26 G76 G76 G76
27
28
29
30
31
32
33
34
35 G11 G11 G11 G11
36 G07 G07 G07 G07
37 G10.2 G10.2 G10.2
38
39
-------+-------+---------------+-------+-------+------
(to be continued)

712
M Series T Series
-------+-------+---------------+-----------------------
G code
type g_1shot G code SystemA SystemB SystemC
-------+-------+---------------+-------+-------+-------
40 G10.3 G10.3 G10.3 G10.3
41 G11.3 G11.3 G11.3 G11.3
42 G65.3 G65.3 G65.3 G65.3
43
44 G05.1 G05.1 G05.1 G05.1
45
46
47 G07.1 G07.1 G07.1 G07.1
48
49
50 G81.1
51 G72.2
52 G10.6
53 G92.1 G50.3 G92.1 G92.1
54 G72.1
55 G05.2
56 G12.2
57 G13.2
58 G10.7 G10.7 G10.7
59
60
61
62
63
64
65
66
67 G31.9
68 G10.9
69
70
71
72

(*) G31 and G31.1 are the same function.


G37 and G37.1 are the same function.

M Series T Series
-------+-------+---------------+-----------------------
G code
type g_1shot G code SystemA SystemB SystemC
-------+-------+---------------+-------+-------+-------
301 0 G09 G09 G09 G09
1
2
302 0
1
2 G53 G53 G53 G53
303 0 G38
1 G45
2 G46
3 G47
4 G48

713
- Series 160/180/210,NC board

M Series T Series Laser


-------+-------+---------------+-----------------------+--------
G code
type g_1shot G code SystemA SystemB SystemC G
code
-------+-------+---------------+---------------+-------+--------
300 0 G04 G04 G04 G04 G04
1 G10 G27 G27 G27 G10
2 G28 G28 G28
3
4 G27 G30 G30 G30 G27
5 G28 G50 G92 G92 G28
6 G29 G70 G70 G72 G29
7 G30 G71 G71 G73 G30
8 G38 G72 G72 G74
9 G39 G73 G73 G75
10 G45 G74 G74 G76 G45
11 G46 G75 G75 G77 G46
12 G47 G76 G76 G78 G47
13 G48 G10 G10 G10 G48
14 G92 G36 G36 G36 G92
15 G09 G37 G37 G37 G09
16 G31 G31 G31 G31 G31
17 G60 G65 G65 G65 G60
18 G65 G65
19 G05 G05 G05
20 G05 G05
21 G11 G07.1 G07.1 G07.1 G11
22 G52 G52 G52 G52 G52
23 G53 G53 G53 G53 G53
24 G37 G30.1 G30.1 G30.1
25 G07.1 G07.1
26 G30.1 G50.3 G92.1 G92.1 G30.1
27 G10.6
28 G72.1 G72.1
29 G72.2 G39 G39 G39 G72.2
30 G92.1 G92.1
31 G08
32 G71
80 G24
81 G32

The numerical value of "g_1shot" mentioned in the above table is stored


in the bit 0,..,bit 6 of each array in "g_1shot" with binary format.
Whether this G code is commanded in the objective block specified by
"block" or not is stored in the bit 7 of "g_1shot".
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
To read "type" concerning 1 shot G code at a time, -4 is specified.
In case of Series 150, the data of type=300,..,303 is stored in
g_1shot[0],..,g_1shot[3].
In case of Series 160/180/210 and NC board, the data of type=300 is
stored in g_1shot[0].

714
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The specification of modal data(type) is wrong.
EW_ATTRIB data attribute error
The specification of block(block)is wrong.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

715
(10) Read Diagnosis Data

Function Name:
cnc_diagnoss

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_diagnoss(unsigned short FlibHndl,
short number,short axis,short length,ODBDGN *diag);
Description:
Reads the diagnosis specified by "number","axis"(only for the diagnosis
with axis). The data format depends on each diagnosis. The format of
Byte/Word/2-Word diagnosis is generally signed binary.
Reads the diagnosis for all axes once by specifying 'ALL_AXES' in
'axis'. The diagnosis for each axis is stored in each array of
"ODBDGN".

The attribute of diagnosis depends on the type and axis, and it is


different for each diagnosis. It is as follows, and can be got by
cnc_rddiaginfo() function.

Diagnosis type Use Byte size


--------------------------+---------------------------------+---------
Bit diagnosis Every bits have each definition. 1
Bit diagnosis with axis Every bits have each definition. 1
(each axis)
Byte diagnosis 1-byte data is stored. 1
Byte diagnosis with axis 1-byte data is stored.(each axis) 1
Word diagnosis 2-byte data is stored. 2
Word diagnosis with axis 2-byte data is stored.(each axis) 2
2-Word diagnosis 4-byte data is stored. 4
2-Word diagnosis with axis 4-byte data is stored.(each axis) 4

It is impossible to read any bit diagnosis bit by bit.


8 bits(i.e. 1 byte) which belong to the same diagnosis number are read
at the same time.

See the "MAINTENANCE MANUAL" of CNC for details of each diagnosis.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

number Specify the diagnosis number.


See the "MAINTENANCE MANUAL" of CNC about available diagnosis
number. It can be got by cnc_rddiagnum() function and
cnc_rddiaginfo() function.

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)

716
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.

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 +---------------+ ---

Series 150 : n = Maximum controlled axes


Series 160/180/210,NC board : n = Current controlled axes

diag Pointer to the ODBDGN structure including the diagnosis.


The ODBDGN structure is as follows.

typedef struct odbdgn {


short datano; /* diagnosis number */
short type; /* upper byte:type */
/* lower byte:axis */
union {
char cdata; /* bit/byte diagnosis */
short idata; /* word diagnosis */
long ldata; /* 2-word diagnosis */
char cdatas[MAX_AXIS]; /* bit/byte diagnosis with axis*/
short idatas[MAX_AXIS];/* word diagnosis with axis */
long ldatas[MAX_AXIS]; /* 2-word diagnosis with axis */
} u ;
} ODBDGN ; /* MAX_AXIS : max. controlled axes */

datano Diagnosis number which was read is stored.

type Attribute of diagnosis which was read is stored.


Upper byte:type(only Series 150)
0 : byte type
1 : word type
2 : 2-word type
3 : bit type(8 bit)

Lower byte:axis
0 : no axis
1,..,m : 1 axis(m=max. controlled axes)
ALL_AXES : all axes(ALL_AXES=-1)

717
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Size of ODBDGN structure(length) is wrong.
EW_NUMBER Data number error
Diagnosis number(number) is wrong.
EW_ATTRIB Data attribute error
Axis number(axis) is wrong.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

718
(11) Read Diagnosis Data (Area Specified)

Function Name:
cnc_diagnosr

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_diagnosr(unsigned short FlibHndl,
(short *)&s_number,short axis,(short *)&e_number,
(short *)&length,(void *)diag);
Description:
Reads the diagnosis specified by "s_number","e_number","axis"(only for
the diagnosis with axis). The data format depends on each diagnosis.
The format of Byte/Word/2-Word diagnosis is generally signed binary.

Reads the diagnosis for all axes specified range by specifying


'ALL_AXES' in 'axis'.

The attribute of CNC diagnosis depends on the type and axis, and it is
different for each diagnosis. It is as follows, and can be got by
cnc_rddiaginfo() function.

Diagnosis type Use Byte size


--------------------------+---------------------------------+---------
Bit diagnosis Every bits have each definition. 1
Bit diagnosis with axis Every bits have each definition. 1
(each axis)
Byte diagnosis 1-byte data is stored. 1
Byte diagnosis with axis 1-byte data is stored.(each axis) 1
Word diagnosis 2-byte data is stored. 2
Word diagnosis with axis 2-byte data is stored.(each axis) 2
2-Word diagnosis 4-byte data is stored. 4
2-Word diagnosis with axis 4-byte data is stored.(each axis) 4

It is impossible to read any bit diagnosis bit by bit.


8 bits(i.e. 1 byte) which belong to the same diagnosis number are read
at the same time.

See the "MAINTENANCE MANUAL" of CNC for details of each parameter.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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. It can be got by cnc_rddiagnum() function and
cnc_rddiaginfo() function.

719
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.

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)

None axis type diagnosis can be read even if any value is


specified in "axis". In case that an axis type diagnosis
exists in the specified range, the error(Retuen:EW_ATTRIB) is
returned by specifying "axis=0".

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))]

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 diagnosis is 1 byte, the ODBDGN


structure is as follows.
In case that the size of diagnosis is 1 byte and the length per
1 diagnosis 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 diagnosis or 1 axis is 2 or 4 byte, and so
'dummy' is not necessary.

no axis/1 axis all axes


ODBDGN 0 +-------+ --- 0 +-------+ ---
|datano | ^ |datano | ^
2 +-------+ | 2 +-------+ |
|type | length/diagnosis |type | length
4 +---+---+ | 4 +---+---+ /diag.
|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

720
diag Pointer to the area to store the diagnoses.
Each diagnosis can be referred by using the ODBDGN structure.

typedef struct odbdgn {


short datano; /* diagnosis number */
short type; /* upper byte:type */
/* lower byte:axis */
union {
char cdata; /* bit/byte diagnosis */
short idata; /* word diagnosis */
long ldata; /* 2-word diagnosis */
char cdatas[MAX_AXIS]; /* bit/byte diagnosis with axis*/
short idatas[MAX_AXIS];/* word diagnosis with axis */
long ldatas[MAX_AXIS]; /* 2-word diagnosis with axis */
} u ;
} ODBDGN ; /* MAX_AXIS : max. controlled axes */

datano Diagnosis number which was read is stored.

type Attribute of diagnosis which was read is stored.


Upper byte:type(only Series 150)
0 : byte type
1 : word type
2 : 2-word type
3 : bit type(8 bit)
4 : bit type(1 bit : except Series 150)

Lower byte:axis
0 : no axis
1,..,m : 1 axis(m=max. controlled axes)
ALL_AXES : all axes(ALL_AXES=-1)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH Data block length error
Size of area to store diagnosis(length) is
wrong.
EW_NUMBER Data number error
Diagnosis number(s_number,e_number) is wrong.
EW_ATTRIB Data attribute error
Axis number(axis) is wrong.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

721
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

722
(12) Read Diagnosis Information

Function Name:
cnc_rddiaginfo

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rddiaginfo(unsigned short FlibHndl,
short s_number, unsigned short read_no, ODBDIAGIF *diagif);
Description:
Reads the CNC diagnosis data information specified by "s_number" and
"read_no".

The CNC diagnosis data is basically non-continuous, and the attribute


like the type and the size, etc. is different in each number.
Use this function for such as displaying the diagnosis data.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_number
Specify the start diagnosis data number.

read_no Specify the number of the diagnosis data information to read.

diagif Pointer to the ODBDIAGIF structure including the diagnosis data


information. The ODBDIAGIF structure is as follows.
typedef struct odbdiagif {
unsigned short info_no ;
/* number of diagnosis data information */
short prev_no ; /* previous diagnosis data number */
short next_no ; /* next diagnosis data number */
struct {
short diag_no ; /* diagnosis data number */
short diag_type ; /* attribute of diagnosis data */
} info[N] ; /* N is amount of diagnosis data information */
} ODBDIAGIF ;

info_no Number of diagnosis data information


Number of the diagnosis data information which
has been read actually

prev_no Previous diagnosis data number


Previous effective number of the diagnosis data
information which has been read first

next_no Next diagnosis data number


Next effective number of the diagnosis data
information which has been read lastly

723
info[N].diag_no Setting data number
The setting data number which exists actually.

info[N].diag_type Attribute of diagnosis data


The following attributes are set.
bit 0,1 : type attribute
(It is effective when bit 3 = 0)
0 : bit type (8 bit)
1 : byte type
2 : word type
3 : 2-word type
bit 2 : axis attribute
0 : without axis
1 : with axis
bit 3 : type attribute
1 : bit type (1 bit)
bit 4 - 15:(reserve)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
Start diagnosis data number(s_number) is
wrong.
EW_NOOPT no option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

724
(13) Read Minimum, Maximum, Total Number of Diagnosis

Function Name:
cnc_rddiagnum

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rddiagnum(unsigned short FlibHndl,
ODBDIAGNUM *diagnum);
Description:
Reads minimum, maximum, total number of the CNC diagnosis data.

The distribution of the diagnosis data is different in each CNC model,


and the new diagnosis data may be added because of the expansion of CNC
function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

diagnum Pointer to the ODBDIAGNUM structure including the minimum,


maximum, total number of the diagnosis data.
The ODBDIAGNUM structure is as follows.
typedef struct odbdiagnum {
unsigned short diag_min ;
/* mininum number of diagnosis data */
unsigned short diag_max ;
/* maximum number of diagnosis data */
unsigned short total_no ;
/* total number of diagnosis data */
} ODBDIAGNUM ;

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

725
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

726
(14) Read A/D Conversion Data

Function Name:
cnc_adcnv

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_adcnv(unsigned short FlibHndl,short inp_type,
short av_type,ODBAD *adcnv);
Description:
Read the A/D conversion data.
The A/D conversion data is stored in "data" of "ODBAD".

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

inp_type
Specify the type of analog voltage input.
Series 150
0, 1 : Analog for general purpose
100, 101 : Load current of analog spindle
200 : Load current of CNC controlled axis
Series 160/180
0 : Analog for general purpose(4 channel)
2 : CNC controlled axis' load current

av_type Specify the kind of analog voltage(specification of connector).


The specified content is different because of setting inp_type.

Series 150
1) Specification of analog for general purpose
inp_type av_type Input channel Signal Connector
--------+-------+-------------+------+---------
0 0 Channel1 AIN2 JA6
1 0 Channel2 AIN3 JA6

2) Specification of load current of analog spindle.


inp_type av_type Analog spindle Signal Connector
--------+-------+------------------+------+---------
100 0 1st spindle AIN0 JA6
101 0 2nd spindle AIN1 JA6

3) Specification of Load current of CNC controlled axis.


inp_type av_type Servo axis Signal Connector
--------+-------+------------+------+---------
200 1 1st axis AMP1 JV1
200 2 2nd axis AMP2 JV2
.
.
200 10 10th axis AMP10 JV10
200 11 11th axis AMP11 JV11
.
.
200 15 15th axis AMP15 JV15
200 16 16th axis AMP16 JV16
.
.

727
200 23 23th axis AMP23 JV23
200 24 24th axis AMP24 JV24
* When MAX_AXIS=15, av_type=16,..,24 are not used.
* When MAX_AXIS=10, av_type=11,..,24 are not used.

Series 160/180
1) Specification of analog for general purpose
inp_type av_type Input channel Signal Connector
--------+-------+-------------+------+---------
0 0 Channel1 AIN0 JA6
0 1 Channel2 AIN1 JA6
0 2 Channel3 AIN2 JA6
0 3 Channel4 AIN3 JA6

2) Specification of Load current of CNC controlled axis.


inp_type av_type Servo axis Signal Connector
--------+-------+------------+------+---------
2 1 1st axis AMP1 JV1
2 2 2nd axis AMP2 JV2
2 3 3rd axis AMP3 JV3
2 4 4th axis AMP4 JV4
2 5 5th axis AMP5 JV5
2 6 6th axis AMP6 JV6
2 7 7th axis AMP7 JV7
2 8 8th axis AMP8 JV8

adcnv Pointer to the ODBAD structure including A/D conversion data.


The ODBAD structure is as follows.
Series 150
typedef struct odbad {
short datano ; /* type of analog voltage input */
short type ; /* kind of analog voltage
(specification of connector) */
char data ; /* digital voltage */
} ODBAD ;

Series 160/180
typedef struct odbad {
short datano ; /* type of analog voltage input */
short type ; /* kind of analog voltage
(specification of connector) */
short data ; /* digital voltage */
} ODBAD ;

datano The type of analog voltage input is stored.

type The kind of analog voltage(specification of connector)


is stored.

data The analog voltage data is set, which is input in A/D


converter of the CNC, with conversion into digital
value.

Series 150
The A/D conversion data (0,..,255) which is converted
from input voltage data is stored with binary format.
The digital data is linearly proportional to the input
voltage as follows.

728
Input voltage data
---------------+-----------
-10V 0
0V 128 (half - adjust value)
+10V 255

Series 160/180
- Specification of analog for general purpose
The A/D conversion data (0,..,255) which is converted
from input voltage data is stored with binary format.
The digital data is linearly proportional to the input
voltage as follows.

Input voltage data


---------------+-----------
-10V 0
0V 128 (half - adjust value)
+10V 255

- Specification of Load current of CNC controlled axis.


The digital value (0,..,+/-7282) which is converted
from the load current is stored with binary format.
It is possible to get the load current using this value
as following formula.

The load current = adcnv.data * N / 7282 [Apeak]

N = 40 [Apeak] (for motor type 0S,5S,10S,20S/1500)


80 [Apeak] (for motor type 20S,30S)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The type of analog voltage input (inp_type) is
wrong.
EW_ATTRIB data attribute error
The kind of analog voltage (av_type) is wrong.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

729
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

730
(15) Read Operator's Message

Function Name:
cnc_rdopmsg

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdopmsg(unsigned short FlibHndl,short type,
short length,OPMSG *opmsg);
Description:
Reads the contents of the operator's message in CNC.
The operator's message is stored in "data" of "OPMSG".

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

type Specify the kind of operator's message.

Series 150
0 : 1st message
1 : 2nd message
2 : 3rd message
3 : 4th message
4 : macro message
-1 : all messages

Series 160/180/210,NC board


0 : 1st message

length Specify the length of the data block(size of OPMSG structure)

Series 150

single message(1st - 4th message)


0+-----------------------+ ---
| datano | ^
2+-----------------------+ |
| type | |
4+-----------------------+ |
| char_num | |
6+-----------+-----------+ length
| data[0] | |
7+-----------+ |
== == |
6+128+-----------+ |
| data[128]| |
6+129+-----------+ |
| dummy | v
6+130+-----------+ ---

731
macro message
0+-----------------------+ ---
| datano | ^
2+-----------------------+ |
| type | |
4+-----------------------+ |
| char_num | |
6+-----------+-----------+ length
| data[0] | |
7+-----------+ |
== == |
6+26+-----------+ |
| data[26] | |
6+27+-----------+ |
| dummy | v
6+28+-----------+ ---

all messages
0+-----------------------+ ----
| 1st message | ^
136+-----------------------+ |
| 2nd message | |
272+-----------------------+ |
| 3rd message | length
408+-----------------------+ |
| 4th message | |
544+-----------------------+ |
| macro message | v
578+-----------------------+ ---

Series 160/180/210,NC board

0+-----------------------+ ---
| datano | ^
2+-----------------------+ |
| type | |
4+-----------------------+ |
| char_num | |
6+-----------+-----------+ length
| data[0] | |
7+-----------+ |
== == |
6+255+-----------+ |
| data[255]| v
6+256+-----------+ ---

732
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
Series 150
0 to 999
Series 160/180/210,NC board
100 to 999
2000 to 2099
message does not exist
-1

type Kind of operator's message is stored.


Series 150
0 to 3 : 1st to 4th message
4 : macro message
Series 160/180/210,NC board
0 : 1st message

char_num The operator's message length is stored.


Series 150
1 to 129 : 1st to 4th message
1 to 27 : macro message
Series 160/180/210,NC board
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.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH data block length error
Size of OPMSG structure(length) is wrong.
EW_ATTRIB data attribute error
The specification of the kind of operator's
message(type) is wrong.
EW_NOOPT no option
Set necessary CNC option.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

733
CNC option: This function need the following CNC option.
Series 150 The external data I/O function
Series 160/180/210,NC board
external message
external data input

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

734
(16) Read Program Restart Information

Function Name:
cnc_rdprstrinfo

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdprstrinfo(unsigned short FlibHndl,
ODBPRS *prstr);
Description:
Read the program restart information.
The program restart information is stored in each member of "ODBPRS".

In case of Series 160/180, B code read count and value are not used
except M system.

In case of Series 150, the program restart position and remaining


travel distance are valid when both NC parameter 2204#1 and 7613#0 are
on(=1).

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

prstr Pointer to the ODBPRS structure including the program restart


information. The ODBPRS structure is as follows.

typedef struct odbprs {


short datano; /*
Not used */
short type; /*
Not used */
short data_info[5]; /*
Data setting information */
long rstr_bc; /*
Block number */
long rstr_m[35]; /*
M code value */
long rstr_t[2]; /*
T code value */
long rstr_s; /*
S code value */
long rstr_b; /*
B code value */
long dest[MAX_AXIS]; /* Program restart position */
long dist[MAX_AXIS]; /* Program restart remaining
travel distance */
} ODBPRS ; /* MAX_AXIS : max. controlled axes. */

datano Not used

type Not used

data_info Data setting information


The read count for rstr_m, rstr_t, rstr_s,
rstr_b is set respectively.
data_info[0] Always 1
data_info[1] M code read count (0 to 35)
data_info[2] T code read count (0 to 2)
data_info[3] S code read count (0 to 1)
data_info[4] B code read count (0 to 1)

735
rstr_bc Block number is stored.

rstr_m M code value is stored in the array.


rstr_t T code value is stored in the array.
rstr_s S code value is stored.
rstr_b B code value is stored.

dest Program restart position is stored.


The limit within the number of controlled axes
is effective.

dist Program restart remaining travel distance is


stored.
The limit within the number of controlled axes
is effective.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The program restart function and the extended
driver/library function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The program restart function and the extended driver/library
function is necessary.

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 2204#1=1, 7613#0=1 --- must be set


Series 160/180 none

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

736
(17) Search Sequence Number for Program Restart

Function Name:
cnc_rstrseqsrch

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rstrseqsrch(unsigned short FlibHndl,long no,
long rep,short no_type,short pq_type);
Description:
Search the sequence number for program restart.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

no Specify the Sequence / Block number.

rep Specify the count

no_type Specify the number type.


0 : Sequence number
1 : Block number

pq_type Specify the search type.


0 : P type
1 : Q type

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
The specification of number type (no_type) is
wrong.
EW_ATTRIB data attribute error
The specification of search type (pq_type) is
wrong.
EW_DATA data error
Detail status is set in global variable
cnc_errno (short).
0 : Completion status other than EW_DATA
1 : Sequence / Block number(no) error
2 : Count(rep) error
EW_NOOPT no option
The program restart function and the extended
driver/library function is necessary.
EW_MODE CNC mode error
Set CNC mode to MEM.
EW_REJECT CNC execution denied

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

737
CNC option: The program restart function and the extended driver/library
function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function must be used in MEM mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

738
(18) Search Sequence Number for Program Restart (2)

Function Name:
cnc_rstrseqsrch2

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rstrseqsrch2(unsigned short FlibHndl,long no,
long rep,short no_type,short pq_type,long prg_no);
Description:
Search the sequence number for program restart.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

no Specify the Sequence / Block number.

rep Specify the count.

no_type Specify the number type.


0 : Sequence number
1 : Block number

pq_type Specify the search type.


0 : P type
1 : Q type

prg_no Specify the search program number.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER data number error
Number type (no_type) is wrong.
EW_ATTRIB data attribute error
Search type (pq_type) is wrong.
EW_DATA data error
Detail status is set in global variable
cnc_errno (short).
0 : Completion status other than EW_DATA
1 : Sequence / Block number(no) error
2 : Count(rep) error
3 : Program number(prg_no) error
EW_NOOPT no option
The program restart function and the extended
driver/library function is necessary.
EW_MODE CNC mode error
Set CNC mode to MEM.
EW_REJECT CNC execution denied

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

739
CNC option: The program restart function and the extended driver/library
function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function must be used in MEM mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

740
(19) Read Block Restart Information

Function Name:
cnc_rdbrstrinfo

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdbrstrinfo(unsigned short FlibHndl,
ODBBRS *brstr);
Description:
Reads the data of block restart.
These are stored in each member of ODBBRS structure.

The destination and the distance to go of block restart are valid in


case of CNC parameter 2204#1=1, 7613#0=1.

The places of decimal points can be got by cnc_getfigure() function.

The relation to these data, amounts of Tool Length Compensation/Cutter


Compensation, and amounts of servo delay and acceleration/deceleration
delay follows setting of CNC parameter of the following description.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

brstr Pointer to the ODBBRS structure for the data of block restart.
The ODBBRS structure is as follows.

typedef struct odbbrs {


long dest[MAX_AXIS]; /* destination */
long dist[MAX_AXIS]; /* distance to go */
} ODBBRS ; /* MAX_AXIS : max. controlled axes */

dest The destination of block restart is set.


The data of current controlled axis is valid.

dist The distance to go of block restart is set.


The data of current controlled axis is valid.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The block restart option and the extended
driver/library option.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the block restart option and the extended
driver/library option.

741
CNC parameter: This function relates to the following CNC parameter.
See the manual of CNC parameter for details.

Series 150 2204#1=1, 7613#0=1 --- must be set


M 2202#2,#3,#4,#5 --- influenced by setting
T 2202#4,#5, 2203#3 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

742
(20) 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);
Description:
Read the output signal image of software operator's panel.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

slct_data
Specify the data select flag.
bit 0 : Mode signal
bit 1 : Manual handle feed axis selection signal
bit 2 : Manual handle feed travel distance selection signal
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.

Series 150
typedef struct iodbsgnl {
short datano; /*(Not used) */
short type; /*Data select flag */
short mode; /*Mode signal */
short hndl_ax; /*Manual handle feed axis
selection signal */
short hndl_mv; /* Manual handle feed travel
distance selection signal */
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) */

743
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) */
short manual_rpd; /* (Not used) */
short dummy[2]; /* (Not used) */
} IODBSGNL ;

Series 160/180/210,NC board


typedef struct iodbsgnl {
short datano; /* (Not used) */
short type; /* Data select flag */
short mode; /* Mode signal */
short hndl_ax; /* Manual handle feed axis
selection signal */
short hndl_mv; /* Manual handle feed travel
distance selection signal */
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

type Data select flag is stored.

mode Mode signal is stored.


Series 150
0 : MDI
1 : MEM
2 : EDIT
3 : HND
4 : JOG
5 : REF
6 : TAP
7 : INC
Series 160/180/210,NC board
0 : MDI
1 : MEM
2 : EDIT
3 : HNDL or INC
4 : JOG
5 : REF

hndl_ax Manual handle feed axis selection signal is


stored.
0 : HX
1 : HY
2 : HZ
3 : H4

744
hndl_mv Manual handle feed travel distance selection
signal is stored.
0 : *1
1 : *10
2 : *100

rpd_ovrd Rapid traverse override signal is stored.


0 : 100%
1 : 50%
2 : 25%
3 : F0

jog_ovrd Manual feedrate override signal is stored.


0 : 0 % 10 : 2.0% 20 : 52.0%
1 : 0.1 % 11 : 2.7% 21 : 72.0%
2 : 0.14% 12 : 3.7% 22 : 100 %
3 : 0.2 % 13 : 5.2% 23 : 140 %
4 : 0.27% 14 : 7.2% 24 : 200 %
5 : 0.37% 15 : 10.0%
6 : 0.52% 16 : 14.0%
7 : 0.72% 17 : 20.0%
8 : 1.0 % 18 : 27.0%
9 : 1.4 % 19 : 37.0%

feed_ovrd Feedrate override signal is stored.


0 : 0% 10 : 100% 20 : 200%
1 : 10% 11 : 110%
2 : 20% 12 : 120%
3 : 30% 13 : 130%
4 : 40% 14 : 140%
5 : 50% 15 : 150%
6 : 60% 16 : 160%
7 : 70% 17 : 170%
8 : 80% 18 : 180%
9 : 90% 19 : 190%

spdl_ovrd Not used.

blck_del Optional block skip signal(0/1) is stored.

sngl_blck Single block signal(0/1) is stored.

machn_lock Machine lock signal(0/1) is stored.

dry_run Dry run signal(0/1) is stored.

mem_prtct Memory protection signal(0/1) is stored.

feed_hold Automatic operation halt signal(0/1) is stored.

manual_rpd Not used.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The extended driver/library function is
necessary.

745
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

746
(21) Write Output Signal of Software Operator's Panel

Function Name:
cnc_wropnlsgnl

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wropnlsgnl(unsigned short FlibHndl,
IODBSGNL *sgnl);
Description:
Write the output signal of software operator's panel.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

sgnl Pointer to the IODBSGNL structure to be set the output signal


of software operator's panel.
The IODBSGNL structure is as follows.

Series 150

typedef struct iodbsgnl {


short datano; /*(Not used) */
short type; /*Data select flag */
short mode; /*Mode signal */
short hndl_ax; /*Manual handle feed axis
selection signal */
short hndl_mv; /* Manual handle feed travel
distance selection signal */
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) */
short manual_rpd; /* (Not used) */
short dummy[2]; /* (Not used) */
} IODBSGNL ;

Series 160/180/210,NC board

typedef struct iodbsgnl {


short datano; /*(Not used) */
short type; /*Data select flag */
short mode; /*Mode signal */
short hndl_ax; /*Manual handle feed axis
selection signal */
short hndl_mv; /* Manual handle feed travel
distance selection signal */
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) */

747
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

type Specify the data select flag.


bit 0 : Mode signal
bit 1 : Manual handle feed axis selection signal
bit 2 : Manual handle feed travel distance selection
signal
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 written.
To write a signal, set the corresponding bit to 1.

mode Specify the mode signal.


Series 150
0 : MDI
1 : MEM
2 : EDIT
3 : HND
4 : JOG
5 : REF
6 : TAP
7 : INC
Series 160/180/210,NC board
0 : MDI
1 : MEM
2 : EDIT
3 : HNDL or INC
4 : JOG
5 : REF

hndl_ax Specify the manual handle feed axis selection


signal.
0 : HX
1 : HY
2 : HZ
3 : H4

hndl_mv Specify the manual handle feed travel distance


selection signal.
0 : *1
1 : *10
2 : *100

748
rpd_ovrd Specify the rapid traverse override signal.
0 : 100%
1 : 50%
2 : 25%
3 : F0

jog_ovrd Specify the manual feedrate override signal.


0 : 0 % 10 : 2.0% 20 : 52.0%
1 : 0.1 % 11 : 2.7% 21 : 72.0%
2 : 0.14% 12 : 3.7% 22 : 100 %
3 : 0.2 % 13 : 5.2% 23 : 140 %
4 : 0.27% 14 : 7.2% 24 : 200 %
5 : 0.37% 15 : 10.0%
6 : 0.52% 16 : 14.0%
7 : 0.72% 17 : 20.0%
8 : 1.0 % 18 : 27.0%
9 : 1.4 % 19 : 37.0%

feed_ovrd Specify the feedrate override signal.


0 : 0% 10 : 100% 20 : 200%
1 : 10% 11 : 110%
2 : 20% 12 : 120%
3 : 30% 13 : 130%
4 : 40% 14 : 140%
5 : 50% 15 : 150%
6 : 60% 16 : 160%
7 : 70% 17 : 170%
8 : 80% 18 : 180%
9 : 90% 19 : 190%

spdl_ovrd Not used.

blck_del Specify the optional block skip signal(0/1).

sngl_blck Specify the single block signal(0/1).

machn_lock Specify the machine lock signal(0/1).

dry_run Specify the dry run signal(0/1).

mem_prtct Specify the memory protection signal(0/1).

feed_hold Specify the automatic operation halt


signal(0/1).

manual_rpd Not used.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_DATA data error
Some value of member in IODBSGNL is wrong.
EW_NOOPT no option
The software operator's panel function and the
extended driver/library function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

749
CNC option: The software operator's panel function and the extended
driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

750
(22) Read General Signal Image of Software Operator's Panel

Function Name:
cnc_rdopnlgnrl

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdopnlgnrl(unsigned short FlibHndl,
short slct_data,IODBGNRL *opnlgnrl);
Description:
Read the general output signal image of software operator's panel.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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

751
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

752
(23) 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);
Description:
Write the general output signal of software operator's panel.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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

753
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The software operator's panel general SW
function and the extended driver/library
function is necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The software operator's panel general SW function and the
extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

754
(24) Read General Signal Name of Software Operator's Panel

Function Name:
cnc_rdopnlgsname

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdopnlgsname(unsigned short FlibHndl,
short slct_data,IODBRDNA *brdna);
Description:
Read the general signal name of software operator's panel.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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.

sgnl1_name General signal name 1 (ASCII)


sgnl2_name General signal name 2 (ASCII)
sgnl3_name General signal name 3 (ASCII)
sgnl4_name General signal name 4 (ASCII)
sgnl5_name General signal name 5 (ASCII)
sgnl6_name General signal name 6 (ASCII)
sgnl7_name General signal name 7 (ASCII)
sgnl8_name General signal name 8 (ASCII)

755
The specified name is set.
For the end of name(sgnl?_name[8]),
NULL character('\0') is set.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

756
(25) Write General Signal Name of Software Operator's Panel

Function Name:
cnc_wropnlgsname

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wropnlgsname(unsigned short FlibHndl,
IODBRDNA *brdna);
Description:
Write the general signal name of software operator's panel.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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.

sgnl1_name General signal name 1 (ASCII)


sgnl2_name General signal name 2 (ASCII)
sgnl3_name General signal name 3 (ASCII)
sgnl4_name General signal name 4 (ASCII)
sgnl5_name General signal name 5 (ASCII)
sgnl6_name General signal name 6 (ASCII)
sgnl7_name General signal name 7 (ASCII)
sgnl8_name General signal name 8 (ASCII)

757
Specify the general signal name.
Eight characters from the top of each name
(sgnl?_name[0] - sgnl?_name[7])
is set in CNC.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

758
(26) Read Menu Switch Signal

Function Name:
cnc_rdmenuswitch

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdmenuswitch(unsigned short FlibHndl,
short *menu);
Description:
Reads the menu switch signals.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

menu The menu switch signals are set.


The following bit for each signal is set to 0 or 1.
The details are as follows.
bit 0 : machine lock signal
bit 1 : display lock signal
bit 2 : single block signal
bit 3 : dry run signal
bit 4 : auxiliary function lock signal
bit 5 : manual absolute signal
bit 6 : Z axis neglect signal
bit 7 : block delete signal 1
bit 8 : block delete signal 2
bit 9 : block delete signal 3
bit10 : block delete signal 4
bit11 : block delete signal 5
bit12 : block delete signal 6
bit13 : block delete signal 7
bit14 : block delete signal 8
bit15 : block delete signal 9

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at 150TT.
EW_NOOPT No option
The menu switch option and the extended
driver/library option are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

759
CNC option: This function needs the menu switch option and the extended
driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

760
(27) Write Menu Switch Signal

Function Name:
cnc_wrmenuswitch

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrmenuswitch(unsigned short FlibHndl,
short slct_data,short menu);
Description:
Writes the menu switch signals.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

slct_data
Specify the signal selection flag.
bit 0 : machine lock signal
bit 1 : display lock signal
bit 2 : single block signal
bit 3 : dry run signal
bit 4 : auxiliary function lock signal
bit 5 : manual absolute signal
bit 6 : Z axis neglect signal
bit 7 : block delete signal 1
bit 8 : block delete signal 2
bit 9 : block delete signal 3
bit10 : block delete signal 4
bit11 : block delete signal 5
bit12 : block delete signal 6
bit13 : block delete signal 7
bit14 : block delete signal 8
bit15 : block delete signal 9

* If the bit for each signal is 0, its signal does not


be written. If some bit is 1, its signal should be
written.

menu The menu switch signals must be set.


The following bit for each signal must be set to 0 or 1.
The details are as follows.
bit 0 : machine lock signal
bit 1 : display lock signal
bit 2 : single block signal
bit 3 : dry run signal
bit 4 : auxiliary function lock signal
bit 5 : manual absolute signal
bit 6 : Z axis neglect signal
bit 7 : block delete signal 1

761
bit 8 : block delete signal 2
bit 9 : block delete signal 3
bit10 : block delete signal 4
bit11 : block delete signal 5
bit12 : block delete signal 6
bit13 : block delete signal 7
bit14 : block delete signal 8
bit15 : block delete signal 9

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at 150TT.
EW_NOOPT No option
The menu switch option and the extended
driver/library option are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the menu switch option and the extended
driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

762
(28) Read Internal Position Compensation Data (Cutter Compensation / Tool Nose
Radius Compensation)

Function Name:
cnc_rdradofs

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdradofs(unsigned short FlibHndl,
ODBROFS *radofs);
Description:
Reads the mode and vector of the cutter compensation(tool nose radius
compensation).
These are stored in each member of ODBROFS structure.

The places of decimal points can be got by cnc_getfigure() function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

radofs Pointer to the ODBROFS structure for the data of the cutter
compensation(tool nose radius compensation).
The ODBROFS structure is as follows.

typedef struct odbrofs {


short mode; /* offset mode */
short pln_axes[2]; /* axis of plane selection */
long ofsvct[2]; /* offset vector */
} ODBROFS ;

mode Mode of the cutter compensation(tool nose


radius compensation) is set.
0 : cancel mode
1 : offset mode

* In case of '0', the data except 'mode' is invalid.

pln_axes Axis number of plane selection is set.


(0,..,MAX_AXIS-1) MAX_AXIS:max.controlled axes
pln_axes[0] : 1st axis number
pln_axes[1] : 2nd axis number

ofsvct Vector of the cutter compensation(tool nose


radius compensation) is set.

'ofsvct' according to the G code of plane


selection is as follows.

763
+-----+-------------+-------------+
| | ofsvct[0] | ofsvct[1] |
+-----+-------------+-------------+
| G17 |X axis or |Y axis or |
| |parallel axis|parallel axis|
+-----+-------------+-------------+
| G18 |Z axis or |X axis or |
| |parallel axis|parallel axis|
+-----+-------------+-------------+
| G19 |Y axis or |Z axis or |
| |parallel axis|parallel axis|
+-----+-------------+-------------+

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The cutter compensation(tool nose radius
compensation) option and the extended driver/
library option are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the cutter compensation(tool nose radius
compensation) option and the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

764
(29) Read Internal Position Compensation Data (Tool Length Compensation)

Function Name:
cnc_rdlenofs

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdlenofs(unsigned short FlibHndl,
ODBLOFS *lenofs);
Description:
Reads the mode and vector of the tool length compensation.
These are stored in each member of ODBLOFS structure.

The places of decimal points can be got by cnc_getfigure() function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

lenofs Pointer to the ODBLOFS structure for the data of the tool
length compensation. The ODBLOFS structure is as follows.

typedef struct odblofs {


short mode; /* offset mode */
long ofsvct[MAX_AXIS]; /* offset vector */
} ODBLOFS ; /* MAX_AXIS : max. controlled axes */

mode Mode of the tool length compensation is set.


0 : cancel mode
1 : offset mode

* In case of '0', 'ofsvct' is invalid.

ofsvct The vector of the tool length compensation is


set. The data for current controlled axes are
valid.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at 150T/150TT.
EW_NOOPT No option
The extended driver/library option is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

765
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

766
(30) Read Internal Position Compensation Data (Canned Cycle)

Function Name:
cnc_rdfixcycle

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdfixcycle(unsigned short FlibHndl,
ODBFIX *fixcyc);
Description:
Reads the mode and data of the canned cycle.
These are stored in each member of ODBFIX structure.
The places of decimal points can be got by cnc_getfigure() function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

fixcyc Pointer to the ODBFIX structure for the data of the canned
cycle. The ODBFIX structure is as follows.
typedef struct odbfix {
short mode; /* canned cycle mode */
short pln_axes[2];/* axis of plane selection */
short drl_axes; /* axis of drilling */
long i_pos; /* absolute position of Initial point */
long r_pos; /* absolute position of R point */
long z_pos; /* absolute position of Z point */
long cmd_cnt; /* command of number of repeats */
long act_cnt; /* current number of repeats */
long cut; /* cut-in value */
long shift[2]; /* shift value */
} ODBFIX ;

mode Mode of the canned cycle is set.


0 : cancel mode
1 : canned cycle mode
* In case of '0', the data except 'mode' is invalid.

pln_axes Axis number of plane selection is set.


(0,..,MAX_AXIS-1) MAX_AXIS:max.controlled axes
pln_axes[0] : 1st axis number
pln_axes[1] : 2nd axis number

drl_axes Axis number of drilling axis is set.


(0,..,MAX_AXIS-1) MAX_AXIS:max.controlled axes

i_pos Absolute position of Initial point is set.

r_pos Absolute position of R point is set.

z_pos Absolute position of Z point is set.

cmd_cnt Command of number of repeats is set.

767
act_cnt Current number of repeats is set.

cut Cut-in value of G73(High-speed peck drilling


cycle), G83(Peck drilling cycle) is set.

shift Shift value of G76(Fine boring cycle),


G87(Boring cycle) is set.
shift[0] : 1st axis
shift[1] : 2nd axis
In case of CNC parameter 6200#2=0, shift[1] is
not used.

Each member of 'ODBFIX' according to CNC parameter and the G


code of plane selection is as follows.

* The basic axis of following table includes its parallel axis.

CNC parameter 6200#2=1, 6200#0=1


+-------+-------+-------+-------+-----+---------+---------+
| | i_pos | r_pos | z_pos | cut | shift[0]| shift[1]|
+-------+-------+-------+-------+-----+---------+---------+
| G17 | Z axis | X axis | Y axis |
+-------+-----------------------------+---------+---------+
| G18 | Y axis | Z axis | X axis |
+-------+-----------------------------+---------+---------+
| G19 | X axis | Y axis | Z axis |
+-------+-----------------------------+---------+---------+
CNC parameter 6200#2=1, 6200#0=0
+-------+-------+-------+-------+-----+---------+---------+
| | i_pos | r_pos | z_pos | cut | shift[0]| shift[1]|
+-------+-------+-------+-------+-----+---------+---------+
| G17 | | X axis | Y axis |
+-------+ +---------+---------+
| G18 | Z axis | Z axis | X axis |
+-------+ +---------+---------+
| G19 | | Y axis | Z axis |
+-------+-----------------------------+---------+---------+
CNC parameter 6200#2=0, 6200#0=1
+-------+-------+-------+-------+-----+---------+---------+
| | i_pos | r_pos | z_pos | cut | shift[0]| shift[1]|
+-------+-------+-------+-------+-----+---------+---------+
| G17 | Z axis | | |
+-------+-----------------------------+ | |
| G18 | Y axis | Note) |not used |
+-------+-----------------------------+ | |
| G19 | X axis | | |
+-------+-----------------------------+---------+---------+
CNC parameter 6200#2=0, 6200#0=0
+-------+-------+-------+-------+-----+---------+---------+
| | i_pos | r_pos | z_pos | cut | shift[0]| shift[1]|
+-------+-------+-------+-------+-----+---------+---------+
| G17 | | | |
+-------+ | | |
| G18 | Z axis | Note) |not used |
+-------+ | | |
| G19 | | | |
+-------+-----------------------------+---------+---------+
Note) Axis indicated by CNC parameter 6240

768
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT No option
The canned cycle option and the extended
driver/library option are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the canned cycle option and the extended
driver/library option.

CNC parameter: This function relates to the following CNC parameters.

Series 150 6200#0,#2, 6240 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

769
(31) Read Internal Position Compensation Data (Coordinate Rotation)

Function Name:
cnc_rdcdrotate

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdcdrotate(unsigned short FlibHndl,
ODBROT *cdrot);
Description:
Reads the mode and data of the coordinate rotation.
These are stored in each member of ODBROT structure.

The places of decimal points can be got by cnc_getfigure() function.

The unit of angle follows CNC parameter 6400#2.

6400#2=0 : 0.00001 deg (1/100,000)


6400#2=1 : 0.001 deg

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

cdrot Pointer to the ODBROT structure for the data of the coordinate
rotation. The ODBROT structure is as follows.

typedef struct odbrot {


short mode; /* coordinate rotation mode */
short pln_axes[2]; /* axis of plane selection */
long center[2]; /* rotation center */
long angle; /* rotation angle */
} ODBROT ;

mode Mode of the coordinate rotation is set.


0 : cancel mode
1 : coordinate rotation mode

* In case of '0', the data except 'mode' is invalid.

pln_axes Axis number of plane selection is set.


(0,..,MAX_AXIS-1) MAX_AXIS:max.controlled axes
pln_axes[0] : 1st axis number
pln_axes[1] : 2nd axis number

center Absolute position of rotation center is set.

angle Coordinate rotation angle is set.

'center' according to the G code of plane


selection is as follows.

770
+-----+-------------+-------------+
| | center[0] | center[1] |
+-----+-------------+-------------+
| G17 |X axis or |Y axis or |
| |parallel axis|parallel axis|
+-----+-------------+-------------+
| G18 |Z axis or |X axis or |
| |parallel axis|parallel axis|
+-----+-------------+-------------+
| G19 |Y axis or |Z axis or |
| |parallel axis|parallel axis|
+-----+-------------+-------------+

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at 150T/150TT.
EW_NOOPT No option
The coordinate rotation option and the
extended driver/library option are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the coordinate rotation option and the
extended driver/library option.

CNC parameter: This function relates to the following CNC parameters.

Series 150 6400#2 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

771
(32) Read Internal Position Compensation Data (3-D Coordinate Conversion)

Function Name:
cnc_rd3dcdcnv

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rd3dcdcnv(unsigned short FlibHndl,
ODB3DCD *cdcnv);
Description:
Reads the mode and data of the 3-dimensional coordinate conversion.
These are stored in each member of ODB3DCD structure.

The places of decimal points can be got by cnc_getfigure() function.

The unit of angle follows CNC parameter 6400#2.

6400#2=0 : 0.00001 deg (1/100,000)


6400#2=1 : 0.001 deg

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

cdcnv Pointer to the ODB3DCD structure for the data of the


3-dimensional coordinate conversion.
The ODB3DCD structure is as follows.

typedef struct odb3dcd {


short mode; /* 3-D coordinate conversion mode */
short dno; /* number of 3-D coordinate conv. */
short cd_axes[3]; /* axis of 3-D coordinate conv. */
long center[2][3]; /* center of rotation */
long direct[2][3]; /* direction of center */
long angle[2]; /* rotation angle */
} ODB3DCD ;

mode Mode of the 3-dimensional coordinate


conversion is set.
0 : cancel mode
1 : conversion mode

* In case of '0', the data except 'mode' is invalid.

dno Number of 3-D coordinate conversion is set.


Valid number is 1 or 2.

cd_axes Axis number of 3-D coordinate conversion is set.


(0,..,MAX_AXIS-1) MAX_AXIS:max.controlled axes
cd_axes[0] : 1st axis number
cd_axes[1] : 2nd axis number
cd_axes[2] : 3rd axis number

772
center Absolute position of center of rotation is set.
center[0][0],...,center[0][2] : 1st time
center[1][0],...,center[1][2] : 2nd time
In case of dno=1, center[1][0],..,center[1][2]
are not used.

direct Direction of center is set.


direct[0][0],...,direct[0][2] : 1st time
direct[1][0],...,direct[1][2] : 2nd time
In case of dno=1, direct[1][0],..,direct[1][2]
are not used.

angle Rotation angle of coordinate rotation is set.


angle[0] : 1st time
angle[1] : 2nd time
In case of dno=1, angle[1] is not used.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at 150T/150TT.
EW_NOOPT No option
The 3-dimensional coordinate system conversion
option and the extended driver/library option
are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the 3-dimensional coordinate system


conversion option and the extended driver/library option.

CNC parameter: This function relates to the following CNC parameters.

Series 150 6400#2 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

773
(33) Read Internal Position Compensation Data (Programmable Mirror Image)

Function Name:
cnc_rdmirimage

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdmirimage(unsigned short FlibHndl,
ODBMIR *mirimg);
Description:
Reads the mode of the programmable mirror image and the absolute
position of center of mirror image.
These are stored in each member of ODBMIR structure.

The places of decimal points can be got by cnc_getfigure() function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

mirimg Pointer to the ODBMIR structure for the data of the


programmable mirror image. The ODBMIR structure is as follows.

typedef struct odbmir {


short mode; /* mirror image mode */
long mir_flag; /* flag of mirror axis */
long mir_pos[MAX_AXIS]; /* absolute pos. of center */
} ODBMIR ; /* MAX_AXIS : max.controlled axes */

mode Mode of the programmable mirror image is set.


0 : cancel mode
1 : mirror image mode

* In case of '0', the data except 'mode' is invalid.

mir_flag Flag of mirror axis is set.


The details are as follows.

bit 0(1st axis) =0 : not mirror axis


=1 : mirror axis
bit 1(2nd axis) =0 : not mirror axis
=1 : mirror axis
bit 2(3rd axis) =0 : not mirror axis
=1 : mirror axis
.
.
* In case that some bit of 'mir_flag' is '0', 'mir_pos'
of its axis is valid.

mir_pos Absolute position of center of mirror is set.


The data for current controlled axes are valid.

774
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at 150TT.
EW_NOOPT No option
The programmable mirror image option and the
extended driver/library option are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the programmable mirror image option and
the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

775
(34) Read Internal Position Compensation Data (Scaling)

Function Name:
cnc_rdscaling

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdscaling(unsigned short FlibHndl,
ODBSCL *scale);
Description:
Reads the mode and data of the scaling.
These are stored in each member of ODBSCL structure.

The places of decimal points can be got by cnc_getfigure() function.

The unit of magnification follows CNC parameter 6400#1.

6400#1=0 : 0.00001 times (1/100,000)


6400#1=1 : 0.001 times

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

scale Pointer to the ODBSCL structure for the data of the scaling.
The ODBSCL structure is as follows.

typedef struct odbscl {


short mode; /* scaling mode */
long center[MAX_AXIS]; /* center of scaling */
long magnif[MAX_AXIS]; /* magnification of scaling */
} ODBSCL ; /* MAX_AXIS : max.controlled axes */

mode Mode of the scaling is set.


0 : cancel mode
1 : scaling mode

* In case of '0', the data except 'mode' is invalid.

center Center of scaling is set.


The data for current controlled axes are valid.

magnif Magnification of scaling is set.


The data for current controlled axes are valid.

776
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at 150T/150TT.
EW_NOOPT No option
The scaling option and the extended driver/
library option are necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the scaling option and the extended
driver/library option.

CNC parameter: This function relates to the following CNC parameters.

Series 150 6400#1 --- influenced by setting

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

777
(35) Read Internal Position Compensation Data (3-D Tool Compensation)

Function Name:
cnc_rd3dtofs

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rd3dtofs(unsigned short FlibHndl,
ODB3DTO *tofs3d);
Description:
Reads the mode and vector of the 3-dimensional tool compensation.
These are stored in each member of ODB3DTO structure.

The places of decimal points can be got by cnc_getfigure() function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

tofs3d Pointer to the ODB3DTO structure for the data of the


3-dimensional tool compensation.
The ODB3DTO structure is as follows.

typedef struct odb3dto {


short mode; /* offset mode */
short ofs_axes[3]; /* axis of 3-D tool compensation */
long ofsvct[3]; /* offset vector */
} ODB3DTO ;

mode Mode of the 3-dimensional tool compensation is


set.
0 : cancel mode
1 : offset mode
* In case of '0', the data except 'mode' is invalid.

ofs_axes Axis number of 3-D tool compensation is set.


(0,..,MAX_AXIS-1) MAX_AXIS:max.controlled axes
ofs_axes[0] : 1st axis number
ofs_axes[1] : 2nd axis number
ofs_axes[2] : 3rd axis number

ofsvct Vector of the 3-dimensional tool compensation


is set.
ofsvct[0] : 1st axis number
ofsvct[1] : 2nd axis number
ofsvct[2] : 3rd axis number

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at 150T/150TT.
EW_NOOPT No option
The 3-dimensional cutter compensation option
and the extended driver/library option are
necessary.

778
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function needs the 3-dimensional cutter compensation


option and the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

779
(36) Read Internal Position Compensation Data (Tool Position Compensation)

Function Name:
cnc_rdposofs

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_rdposofs(unsigned short FlibHndl,
ODBPOFS *posofs);
Description:
Reads the mode and vector of the tool position compensation.
These are stored in each member of ODBPOFS structure.

The places of decimal points can be got by cnc_getfigure() function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

posofs Pointer to the ODBPOFS structure for the data of the tool
position compensation. The ODBPOFS structure is as follows.

typedef struct odbpofs {


short mode; /* mode */
long ofsvct[MAX_AXIS]; /* offset vector */
} ODBPOFS ; /* MAX_AXIS : max. controlled axes */

mode Mode of the tool position compensation is set.


0 : cancel mode
1 : offset mode
* In case of '0', 'ofsvct' is invalid.

ofsvct Vector of the tool position compensation is set.


The data for current controlled axes are valid.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC Unavailable
This function cannot be used at 150M/150T.
EW_NOOPT No option
The extended driver/library option is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

780
CNC option: This function needs the extended driver/library option.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

781
(37) Read Maximum Valid Figures, Number of Decimal Places

Function Name:
cnc_getfigure

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 and the number of decimal places under
the input/output unit, which is related to various data of CNC.

The value which is read by the window library is binary data under the
unit of the CNC side. Therefore, it is nesessary to display a decimal
point, etc. in consideration of the unit.

It is valid when the following functions are used.

- axis type data - tool offset - 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
cnc_rdmovrlap
cnc_rdzofs
cnc_rdzofsr

The value which returns from the function is as follows.

- maximum valid figures


Series 150 Series 160/180/210,NC board
---------------+---------------+---------------------------
axis type data 9 8
tool offset 9 7
custum macro 8 8
(unit[digit])

- number of decimal places under the input/outpu unit

1) axis type data


The data within the controlled axes are valid at the both of
the number of decimal places under the input/outpu unit.

Series 150
Linear axis Rotary axis
---------------+---------------+------------------------
[mm] [inch] [deg]
---------------+-------+-------+------------------------
IS-A 2 3 2
IS-B 3 4 3
IS-C 4 5 4
IS-D 5 6 5
IS-E 6 7 6

* Refer to the CNC parameter concerning "IS-A","IS-B","IS-C",

782
"IS-D","IS-E".
* "Metric/Inch" of linear axis depends on the following CNC
parameter.
In case of the input unit ---- Input unit(0010#0)
In case of the output unit --- Machine linear axis
detection unit (1002#1)
* In case of the special jig grinder function of milling
system, the number of decimal palces is as follows.

1004#4 1004#3
-------+-------+---------------------------
0 0 accordance with above table
- 1 6
1 0 5
* "-" indicates that there is no relation to the decimal
places.

Series 160/180/210,NC board


Linear axis Rotary axis
---------------+---------------+------------------------
[mm] [inch] [deg]
---------------+-------+-------+------------------------
IS-A 2 3 2
IS-B 3 4 3
IS-C 4 5 4

* Refer to the CNC parameter concerning "IS-A","IS-B","IS-C".


* "Metric/Inch" of linear axis depends on the following CNC
parameter.
In case of the input unit ---- Input unit(0000#2)
In case of the output unit --- Machine linear axis
detection unit (1001#0)

2) tool offset
Only the number of decimal places of the first axis under the
input unit is valid, and others including it under the output
unit is invalid.

Series 150
[mm] [inch]
---------------+-------+--------
Unit A 2 3
Unit B 3 4
Unit C 4 5
Unit D 5 6
Unit E 6 7

* "Unit-A,B,C,D,E" depends on the following CNC parameters.

6007#0 6004#0 6002#1 6002#0


-------+-------+-------+-------+--------
- - - 1 Unit A
0 0 0 0 Unit B
- - 1 0 Unit C
- 1 0 0 Unit D
1 0 0 0 Unit E
* "-" indicates that there is no relation to the
decimal places.

783
Series 160/180/210,NC board
[mm] [inch]
---------------+-------+--------
IS-A 2 3
IS-B 3 4
IS-C 4 5

* Refer to the CNC parameter concerning "IS-A","IS-B","IS-C".

3) custom macro
Only the number of decimal places of the first axis under the
input unit is valid, and others including it under the output
unit is invalid.

Series 150
[mm] [inch]
-------+--------
3 4

Series 160/180/210,NC board


[mm] [inch]
---------------+-------+--------
IS-A 3 4
IS-B 3 4
IS-C 4 5

* Refer to the CNC parameter concerning "IS-A","IS-B","IS-C".

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

data_type
Specify the kind of the data.
0 : axis type data
1 : tool offset
2 : custom macro

valid_fig
Specify the address of the variable to store the maximum valid
figures.

dec_fig_in
Specify the address of the array to store the number of decimal
places under the input unit.
The number of array must be equal to the number of maximum
controlled axis.
(Except axis type data, only the top of array is valid.)

dec_fig_out
Specify the address of the array to store the number of decimal
places under the output unit.
The number of array must be equal to the number of maximum
controlled axis.
(Except axis type data, only the top of array is valid.)

784
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_ATTRIB data attribute error
Kind of data(data_type) is wrong.
EW_NOOPT no option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function relates to the following CNC option.


Series 150 inch/mm conversion function -+- influenced by setting
increment system D function -+
increment system E function -+
special jig grinder function -+
Series 160/180/210,NC board
inch/mm conversion function -+- influenced by setting
increment system 1/10 function-+

CNC parameter: This function relates to the following CNC parameter.


See the manual of CNC parameter for details.

Series 150 0010#0, 1002#1 -+- influenced by setting


1004#0,#1,#3,#4,#5, 1009#1 -+
6002#0,#1, 6004#0, 6007#0 -+

Series 160/180/210,NC board


0000#2, 1001#0 -+- influenced by setting
1004#0,#1, 1006#0 -+

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

785
(38) Get Current Screen

Function Name:
cnc_getcrntscrn

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_getcrntscrn(unsigned short FlibHndl,
short *scrn_no);
Description:
Gets the current selected screen(CNC/MMC). This function is not
available on the HSSB system and the Intelligent Terminal.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

scrn_no Specify the address of variable in which the current screen


number is stored.
The screen number is as follows.
0 (MMC_SCRN) : MMC screen(default)
1 (CNC_SCRN) : CNC screen

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC This function is not available.
This is available only on MMC-IV.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

786
(39) Select Screen

Function Name:
cnc_slctscrn

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_slctscrn(unsigned short FlibHndl,
short scrn_no);
Description:
Selects between the MMC screen and the CNC screen. This function is
not available on the HSSB system and the Intelligent Terminal.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

scrn_no Specify the screen number.


0 (MMC_SCRN) : MMC screen
1 (CNC_SCRN) : CNC screen

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_FUNC This function is not available.
This is available only on MMC-IV.
EW_NUMBER screen number error
Specified screen number(scrn_no) is wrong.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

787
(40) Get Path Number (for 4 Axes Lathes, Multi-Path and Loader Control)

Function Name:
cnc_getpath

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_getpath(unsigned short FlibHndl,
short *path_no,short *maxpath_no);
Description:
Reads the current selected path number which is objective path of
the data window functions.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

path_no Specify the address of the variable which is set the path number.
1 : The 1st path
2 : The 2nd path
3 : (not used)
4 : (not used)
5 : The 5th path/for loader --- valid only for 160/180
with loader control
maxpath_no
Specify the address of the variable which is set the maximum
path number.

Return: EW_OK is returned on successful completion, otherwise any value except


EW_OK is returned.

Return :EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS
(For details, see "Return status of CNC data window" in "General Description".)

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

788
(41) Set Path Number (for 4 Axes Lathes, Multi-Path and Loader Control)

Function Name:
cnc_setpath

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_setpath(unsigned short FlibHndl,
short path_no);
Description:
Selects the path number which is objective path in the multi-path
system or system with loader control.

All window library functions input from/output to the CNC's path


selected by this function.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

path_no Specify the path number.


(0 : The 1st path)
1 : The 1st path
2 : The 2nd path
3 : (not used)
4 : (not used)
5 : The 5th path/for loader --- valid only for 160/180 with
loader control

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_PATH path number error
The path number(path_no) is wrong.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

789
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|T | X | X | X | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | X | X | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | X | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

790
(42) Allocate Library Handle

Function Name:
cnc_allclibhndl

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_allclibhndl(&FlibHndl);

Description:
Allocates the library handle which is used by the Windows version
library.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

Return: EW_OK is returned on successful completion, otherwise any value except


EW_OK is returned.

Others : EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

(As for the details, see "Return status of CNC data window" in "General
Description".)

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

791
(43) Free Library Handle

Function Name:
cnc_freelibhndl

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.
See "Library handle" for details.

Return: EW_OK is returned on successful completion, otherwise any value except


EW_OK is returned.

Others : EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

(As for the details, see "Return status of CNC data window" in "General
Description".)

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

792
(44) Get Detail Error For CNC

Function Name:
cnc_getdtailerr

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_getdtailerr(unsigned short FlibHndl,DTLERR *err);

Description:
Gets the detail error information after the function has been executed.
The detail error information is stored in "err_no", "err_dtno" of DTLERR".

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

err Pointer to the DTLERR structure to be set the detail error


information. The DTLERR structure is as follows.
typedef struct dtlerr{
short err_no; /* Detail error */
short err_dtno; /* Data number on error */
} DTLERR ;

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 CNC data window" in "General Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The extended driver/library function is
necessary.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

793
(45) Get calendar timer of CNC (Version 1.4 and newer)

Function Name:
cnc_gettimer

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_gettimer(unsigned short FlibHndl,
IODBTIMER *buf);

Description:
Gets the date or time data from the calendar timer device of the CNC
unit.

Specify one of following values in "buf.type". (It is impossible to


get both date and time simultaneously.)

buf.type Data to be acquired


---------------+-------------------
0 Gets date
1 Gets time

The date value or time value in each member of "buf.data.date"


or "buf.data.time" with binary format is stored as follows.

Member Setting data Range of value


-----------------------+---------------+---------------
buf.data.date.year Year 1987 - 2037
buf.data.date.month Month 1 - 12
buf.data.date.date Date 1 - 31
buf.data.time.hour Hour 0 - 23
buf.data.time.minute Minute 0 - 59
buf.data.time.second Second 0 - 59

That is, the time "00:00:00, Jan. 1, 1987" through


"23:59:59, Dec. 31, 2037" can be set.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

buf Pointer to the IODBTIMER structure including the date or time


of CNC. The IODBTIMER structure is as follows.

typedef struct iodbtimer {


short type ; /* Spec. of date or time. */
short dummy ; /* Not used. */
union {
struct {
short year ; /* Year. */
short month ; /* Month. */
short date ; /* Date. */
} date ;
struct {
short hour ; /* Hour. */
short minute ;/* Minute. */
short second ;/* Second. */
} time ;
} data ;
} IODBTIMER ;

794
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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER Incorrect spec. of date or time "buf.type".

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

795
(46) Set calendar timer of CNC (Version 1.4 and newer)

Function Name:
cnc_settimer

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_settimer(unsigned short FlibHndl,
IODBTIMER *buf);
Description:
Sets the date or time to the calendar timer device of the CNC unit.

Specify one of following values in "buf.type". (It is impossible to


set both date and time simultaneously.)

buf.type Data to be set


---------------+-----------------
0 Sets date
1 Sets time

Store the date value or time value in each member of "buf.data.date"


or "buf.data.time" with binary format as follows.

Member Setting data Range of value


-----------------------+---------------+---------------
buf.data.date.year Year 1987 - 2037
buf.data.date.month Month 1 - 12
buf.data.date.date Date 1 - 31
buf.data.time.hour Hour 0 - 23
buf.data.time.minute Minute 0 - 59
buf.data.time.second Second 0 - 59

That is, the time "00:00:00, Jan. 1, 1987" through


"23:59:59, Dec. 31, 2037" can be set.

This function doesn't check strictly validity of date format


(buf.data.date.*). For example, "Feb. 31" can be set. In this case,
"Mar. 3" is read by "time()" function (not a leap year), "Feb. 31"
is displayed in the setting screen of CNC.

Arguments:
FlibHndl Identify the process which uses the library.
See "Library handle" for details.

buf Pointer to the IODBTIMER structure including the date or time


of CNC. The IODBTIMER structure is as follows.

typedef struct iodbtimer {


short type ; /* Spec. of date or time. */
short dummy ; /* Not used. */
union {
struct {
short year ; /* Year. */
short month ; /* Month. */
short date ; /* Date. */
} date ;
struct {
short hour ; /* Hour. */
short minute ;/* Minute. */
short second ;/* Second. */
} time ;
} data ;

796
} IODBTIMER ;

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NUMBER Incorrect spec. of date or time "buf.type".

EW_DATA Incorrect date or time data.

EW_REJECT Failed to set the data to the calendar timer


device. Any hardware may be out of order.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | X | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|T | X | O | O | O | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | X | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

797
1.1.18 Function Reference Related to PMC

(1) Read Message from PMC to MMC

Function Name:
pmc_rdmsg

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI pmc_rdmsg(unsigned short FlibHndl,short *length,
short *data);
Description:
Reads the data of 32 bytes transmitted from the PMC.
It is necessary to transmit the data on the PMC side to read the data.
If the data is not transmitted from the PMC, it waits in the library.
The data is stored in the data array.
The meaning of the data can be decided by the each application of the
PMC and the MMC.

The outline of each processing is as follows.

MMC side PMC side


+-----------+ +-----------+
| start | | start |
+-----+-----+ +-----+-----+
+---------->| +---------->|
| +-----+-----+ | +---------+---------+
| | pmc_rdmsg | | | MMCWW or pl_mmcww | Note)
| +-----+-----+ | +---------+---------+
| | | |
| +-------+-------+ Yes |Yes+-------+-------+
| | Completion +---+ |<--+ Completion | Note)
| | status <0>?| | | | status <-10>?|
| +-------+-------+ | | +-------+-------+
| | No | | | No
| +---------+---------+ | | +-------+-------+ Yes
| | Error handling | | | | Completion +---+
| +---------+---------+ | | | status <0>?| |
| | <---------+ | +-------+-------+ |
|Yes+-------+-------+ | | No |
+---+ repeat? | | +---------+---------+ |
+-------+-------+ | | Error handling | |
| No | +---------+---------+ |
+-----+-----+ | | <---------+
| end | |Yes+-------+-------+
+-----------+ +---+ repeat? |
+-------+-------+
| No
+-----+-----+
| end |
+-----------+
Note) When the MMC side processing is late, the completion status on
the PMC side is <-10>.
See the "PROGRAMMING MANUAL" of PMC for details of the PMC side
processing.

798
Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

length Specify the pointer to the reception data length.


The data length actually received is returned.

data Specify the pointer to the reception data storage area.


The array is as follows.
short data[16] ;

Note) The order of the data changes places on the MMC side and
the PMC side as the following figure in case of PMC-NA.

PMC side MMC side


+---------+ +---------+
| 1 | ----+ +-->| 2 | low-ranking byte
+---------+ +-+-+ +---------+
| 2 | --+ +---->| 1 | High-ranking byte
+---------+ +---------+
| 3 | ----+ +-->| 4 | low-ranking byte
+---------+ +-+-+ +---------+
| 4 | --+ +---->| 3 | High-ranking byte
+---------+ +---------+

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 PMC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOPMC There is no PMC.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

799
(2) Write Message from MMC to PMC

Function Name:
pmc_wrmsg

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI pmc_wrmsg(unsigned short FlibHndl,short length,
short *data);
Description:
Writes the data of 32 bytes transmitted to the PMC.
It is necessary to receive the data on the PMC side to write the data.
If the PMC side does not receive the data, it waits in the library.
The data must be stored in the data array.
The meaning of the data can be decided by the each application of the
PMC and the MMC.

The outline of each processing is as follows.

MMC side PMC side


+-----------+ +-----------+
| start | | start |
+-----+-----+ +-----+-----+
+---------->| +---------->|
| +-----+-----+ | +---------+---------+
| | pmc_wrmsg | | | MMCWR or pl_mmcwr | Note)
| +-----+-----+ | +---------+---------+
| | | |
| +-------+-------+ Yes |Yes+-------+-------+
| | Completion +---+ |<--+ Completion | Note)
| | status <0>?| | | | status <-10>?|
| +-------+-------+ | | +-------+-------+
| | No | | | No
| +---------+---------+ | | +-------+-------+ Yes
| | Error handling | | | | Completion +---+
| +---------+---------+ | | | status <0>?| |
| | <---------+ | +-------+-------+ |
|Yes+-------+-------+ | | No |
+---+ repeat? | | +---------+---------+ |
+-------+-------+ | | Error handling | |
| No | +---------+---------+ |
+-----+-----+ | | <---------+
| end | |Yes+-------+-------+
+-----------+ +---+ repeat? |
+-------+-------+
| No
+-----+-----+
| end |
+-----------+
Note) When the MMC side processing is late, the completion status on
the PMC side is <-10>.
See the "PROGRAMMING MANUAL" of PMC for details of the PMC side
processing.

800
Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

length Specify the data block length of the transmission data.

data Specify the pointer to the transmission data storage area.


The array is as follows.
short data[16] ;

Note) The order of the data changes places on the MMC side and
the PMC side as the following figure in case of PMC-NA.

MMC side PMC side


+---------+ +---------+
| 1 | ----+ +-->| 2 | low-ranking byte
+---------+ +-+-+ +---------+
| 2 | --+ +---->| 1 | High-ranking byte
+---------+ +---------+
| 3 | ----+ +-->| 4 | low-ranking byte
+---------+ +-+-+ +---------+
| 4 | --+ +---->| 3 | High-ranking byte
+---------+ +---------+

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 PMC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOPMC There is no PMC.
EW_LENGTH Data block length error
Data length(length) is wrong.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

801
(3) Read Message from PMC to MMC (Conditional)

Function Name:
pmc_crdmsg

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI pmc_crdmsg(unsigned short FlibHndl,short *length,
short *data);
Description:
Reads the data of 32 bytes transmitted from the PMC.
It is necessary to transmit the data on the PMC side to read the data.
If the data is not transmitted from the PMC, the error(Return:
EW_BUFFER) is returned.
The data is stored in the data array.
The meaning of the data can be decided by the each application of the
PMC and the MMC.

The outline of each processing is as follows.

MMC side PMC side


+-----------+ +-----------+
| start | | start |
+-----+-----+ +-----+-----+
+---------->| +---------->|
| +-----+-----+ | +---------+---------+
| | pmc_crdmsg| | | MMCWW or pl_mmcww | Note)
| +-----+-----+ | +---------+---------+
| | | |
| +---------+---------+ Yes |Yes+-------+-------+
| | Completion status +---+ |<--| Completion | Note)
| | <EW_BUFFER>? | | | | status <-10>?|
| +---------+---------+ | | +-------+-------+
| | No | | | No
| +-------+-------+ Yes | | +-------+-------+ Yes
| | Completion +---->| | | Completion +-----+
| | status <0>?| | | | status <0>?| |
| +-------+-------+ | | +-------+-------+ |
| | No | | | No |
| +---------+---------+ | | +---------+---------+ |
| | Error handling | | | | Error handling | |
| +---------+---------+ | | +---------+---------+ |
| | <-----------+ | | <-----------+
|Yes+-------+-------+ |Yes+-------+-------+
+---+ repeat? | +---+ repeat? |
+-------+-------+ +-------+-------+
| No | No
+-----+-----+ +-----+-----+
| end | | end |
+-----------+ +-----------+
Note) When the MMC side processing is late, the completion status on
the PMC side is <-10>.
See the "PROGRAMMING MANUAL" of PMC for details of the PMC side
processing.

802
Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

length Specify the pointer to the reception data length.


The data length actually received is returned.

data Specify the pointer to the reception data storage area.


The array is as follows.
short data[16] ;
Note) The order of the data changes places on the MMC side and
the PMC side as the following figure in case of PMC-NA.
PMC side MMC side
+---------+ +---------+
| 1 | ----+ +-->| 2 | low-ranking byte
+---------+ +-+-+ +---------+
| 2 | --+ +---->| 1 | High-ranking byte
+---------+ +---------+
| 3 | ----+ +-->| 4 | low-ranking byte
+---------+ +-+-+ +---------+
| 4 | --+ +---->| 3 | High-ranking byte
+---------+ +---------+

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 PMC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOPMC There is no PMC.
EW_BUFFER The buffer is empty.
The PMC side does not transmit the data or the
transmission processing is late, therefore the
data cannot be received.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

803
(4) Write Message from MMC to PMC (Conditional)

Function Name:
pmc_cwrmsg

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI pmc_cwrmsg(unsigned short FlibHndl,short length,
short *data);
Description:
Writes the data of 32 bytes transmitted to the PMC.
It is necessary to receive the data on the PMC side to write the data.
If the PMC side does not receive the data, the error(Return:EW_BUFFER)
is returned.
The data must be stored in the data array.
The meaning of the data can be decided by the each application of the
PMC and the MMC.

The outline of each processing is as follows.

MMC side PMC side


+-----------+ +-----------+
| start | | start |
+-----+-----+ +-----+-----+
+---------->| +---------->|
| +-----+-----+ | +---------+---------+
| | pmc_cwrmsg| | | MMCWR or pl_mmcwr | Note)
| +-----+-----+ | +---------+---------+
| | | |
| +---------+---------+ Yes |Yes+-------+-------+
| | Completion status +---+ |<--+ Completion | Note)
| | <EW_BUFFER>? | | | | status <-10>?|
| +---------+---------+ | | +-------+-------+
| |No | | | No
| +-------+-------+ Yes | | +-------+-------+ Yes
| | Completion +---->| | | Completion +-----+
| | status <0>?| | | | status <0>?| |
| +-------+-------+ | | +-------+-------+ |
| | No | | | No |
| +---------+---------+ | | +---------+---------+ |
| | Error handking | | | | Error handling | |
| +---------+---------+ | | +---------+---------+ |
| | <-----------+ | | <-----------+
|Yes+-------+-------+ |Yes+-------+-------+
+---+ repeat? | +---+ repeat? |
+-------+-------+ +-------+-------+
| No | No
+-----+-----+ +-----+-----+
| end | | end |
+-----------+ +-----------+
Note) When the MMC side processing is late, the completion status on
the PMC side is <-10>.
See the "PROGRAMMING MANUAL" of PMC for details of the PMC side
processing.

804
Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

length Specify the data block length of the transmission data.

data Specify the pointer to the transmission data storage area.


The array is as follows.
short data[16] ;
Note) The order of the data changes places on the MMC side and
the PMC side as the following figure in case of PMC-NA.
MMC side PMC side
+---------+ +---------+
| 1 | ----+ +-->| 2 | low-ranking byte
+---------+ +-+-+ +---------+
| 2 | --+ +---->| 1 | High-ranking byte
+---------+ +---------+
| 3 | ----+ +-->| 4 | low-ranking byte
+---------+ +-+-+ +---------+
| 4 | --+ +---->| 3 | High-ranking byte
+---------+ +---------+

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 PMC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOPMC There is no PMC.
EW_LENGTH Data block length error
Data length(length) is wrong.
EW_BUFFER The buffer is full.
The PMC side does not receive the data or the
reception processing is late, therefore the
data cannot be transmitted.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.


Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

805
(5) Read PMC Data (Area Specified)

Function Name:
pmc_rdpmcrng

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);
Description:
Reads the PMC data of the specified PMC address/range.

This function is used to exchange the data between the application of


MMC and LADDER soft of PMC.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

adr_type
Specify the identification code corresponding to the kind of
the PMC address.

<The referenceable range of PMC data of Series 150>

ID code Kind of PMC address Referenceable range (Kind of PMC)


-----------+--------------------------+---------------------+-------------------
0 G (Signal to PMC->CNC) 0000-0511 (NA/NB)
1 F (Signal to CNC->PMC) 0000-0319 (NA/NB)
2 Y (Signal to PMC->machine) 0000-0127 (NA/NB)
3 X (Signal to machine->PMC) 0000-0127 (NA/NB)
4 A (Message demand) 0000-0024 (NA/NB)
5 R (Internal relay) 0000-0999, 2000-2999 (NA)
0000-1499, 9000-9015,
9016-9099, 9100-9117 (NB)
6 T (Changeable timer) 0000-0079 (NA/NB)
7 K (Keep relay) 0000-0018 (NA)
0000-0019 (NB)
8 C (Counter) 0000-0079 (NA/NB)
9 D (Data table) 0000-2999 (NA/NB)

(*) It is not possible to write to all areas of address 'F' and 'X', and
"R9000",... Moreover, "K0017",.."K0019" must not be written.

806
<The referenceable range of PMC data of Series 160/180/210,NC board>

ID code Kind of PMC address Referenceable range (Kind of PMC)


-----------+--------------------------+---------------------+-------------------
0 G (Signal to PMC->CNC) 0000-0255, 1000-1255 (RA1/RA3/RB3/RC3)
0000-0511, 1000-1511 (RB4/RC4)
1 F (Signal to CNC->PMC) 0000-0255, 1000-1255 (RA1/RA3/RB3/RC3)
0000-0511, 1000-1511 (RB4/RC4)
2 Y (Signal to PMC->machine) 0000-0127, 1000-1063 (RA1/RA3/RB3
/RC3/RB4/RC4)
3 X (Signal to machine->PMC) 0000-0127, 1000-1063 (RA1/RA3/RB3
/RC3/RB4/RC4)
4 A (Message demand) 0000-0024 (RA1/RA3/RB3/RC3)
0000-0124 (RB4/RC4)
5 R (Internal relay) 0000-0999, 9000-9099 (RA1)
0000-0999, 9000-9015,
9016-9099, 9100-9117 (RA3)
0000-1499, 9000-9015,
9016-9099, 9100-9117 (RB3/RC3)
0000-2999, 9000-9015,
9016-9199 (RB4/RC4)
6 T (Changeable timer) 0000-0079 (RA1/RA3/RB3/RC3)
0000-0299 (RB4/RC4)
7 K (Keep relay) 0000-0019 (RA1/RA3/RB3/RC3)
0000-0039, 0900-0909 (RB4/RC4)
8 C (Counter) 0000-0079 (RA1/RA3/RB3/RC3)
0000-0199 (RB4/RC4)
9 D (Data table) 0000-1859 (RA1/RA3)
0000-2999 (RB3/RC3)
0000-7999 (RB4/RC4)

(*) It is not possible to write to all areas of address 'F' and 'X', and
"R9000",... Moreover, "K0017",..,"K0019"(RA1/RA3/RB3/RC3) and "K0900",..,
"k0909"(RB4/RC4) must not be written.
(*) See the "PROGRAMMING MANUAL" of PMC about CNC which each PMC can correspond.

<The referenceable range of PMC data of FD mate mini>

ID code Kind of PMC address Referenceable range (Kind of PMC)


-----------+--------------------------+---------------------+-------------------
2 Y (Signal to PMC->machine) 0000-0127, 0200-0327 (QC)
3 X (Signal to machine->PMC) 0000-0127, 0200-0327 (QC)
5 R (Internal relay) 0000-3999, 9000-9015,
9016-9099, 9100-9117 (QC)
6 T (Changeable timer) 0000-0199 (QC)
7 K (Keep relay) 0000-0031 (QC)
8 C (Counter) 0000-0799 (QC)
9 D (Data table) 0000-39999 (QC)
10 M (Signal to MMC->PMC) 0000-0255 (QC)
11 N (Signal to PMC->MMC) 0000-0255 (QC)

(*) It is not possible to write to all areas of address 'F' and 'X', and
"R9000",... Moreover, "K0017",.."K0019" must not be written.

807
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.

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 ;

Example of specifying argument


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(1) D0100(It is assumed the word type) is read.
adr_type 9
data_type 1
s_number 100
e_number 101
length 8+2*1 (=10)
buf.u.idata[0] The content of D0100 is stored.

(2) R0200,..,R0209(It is assumed the byte type) is read.


adr_type 5
data_type 0
s_number 200
e_number 209
length 8+1*10 (=18)
buf.u.cdata[0] The contents of R0200,..,R0209 are
,..,buf.u.cdata[9] stored.

808
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 PMC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOPMC There is no PMC.
EW_LENGTH Data block length error
Size of IODBPMC structure(length) is wrong.
EW_RANGE Address range error
PMC address number(s_number,e_number) is wrong.
EW_ATTRIB Data attribute error
Kind of PMC address(adr_type) or type of PMC
data (data_type) is wrong.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

809
(6) Write PMC Data (Area Specified)

Function Name:
pmc_wrpmcrng

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI pmc_wrpmcrng(unsigned short FlibHndl,
short length,IODBPMC *buf);
Description:
Writes the PMC data of the specified PMC address/range.

This function is used to exchange the data between the application of


MMC and LADDER soft of PMC.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

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.

810
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

(2) 0 is written all of R0200,..,R0209(It is assumed byte type)


buf.type_a 5
buf.type_d 0
buf.datano_s 200
buf.datano_e 209
length 8+1*10 (=18)
buf.u.cdata[0] 0 all
,..,buf.u.cdata[9]

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 PMC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOPMC There is no PMC.
EW_LENGTH Data block length error
Size of IODBPMC structure(length) is wrong.
EW_RANGE Address range error
PMC address number(datano_s,datano_e) is wrong.
EW_ATTRIB Data attribute error
Kind of PMC address(type_a) or type of PMC
data (type_d) is wrong.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: There is no need of CNC option for this function.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

811
(7) Read PMC Data Information

Function Name:
pmc_rdpmcinfo

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 PMC address, etc.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

adr_type
Specify the kind of PMC address.
0,... : refer to the table of 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 ; /* last number of PMC address */
} info[64] ;
} ODBPMCINF ;

datano Number of PMC data information (1 - 64)


* Some PMC address may be separated 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.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_ATTRIB data attribute error
Kind of data(adr_type) is wrong.
EW_NOOPT no option
The extended driver/library function is
necessary.

812
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

813
(8) Read Control Data of PMC Data Table

Function Name:
pmc_rdcntldata

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI pmc_rdcntldata(unsigned short FlibHndl,
short s_number,short e_number,short length,
IODBPMCCNTL *pmccntl);
Description:
Reads the control data to manage PMC data table (address D).

This function is not available for PMC-NA.

Refer to the programming manual of PMC-RC/NB(ladder language)


concerning the details of output arguments.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

s_number
Specify the start group number.

e_number
Specify the end group number.

length Specify the length of data block.(size of IODBPMCCNTL structure)


IODBPMCCNTL 0+---------+ ---
| datano_s| ^
2+---------+ |
| dummy | |
4+---------+ |
| datano_e| length
6+---------+---------+ |
| info[0] | |
6+8+-------------------+ |
= = |
6+8*(N-1)+-------------------+ |
| info[N-1] | v
6+8*N+-------------------+ ---

info 0+-----------+
| tbl_prm |
1+-----------+
| data_type |
2+-----------+-----------+
| data_size |
4+-----------------------+
| data_dsp |
6+-----------------------+
| dummy |
8+-----------------------+

N is number of group to be read.

814
pmccntl Pointer to the IODBPMCCNTL structure including the control data
of PMC data table. The IODBPMCCNTL structure is as follows.

typedef struct iodbpmccntl {


short datano_s ; /* start group number */
short dummy ; /* (not used) */
short datano_e ; /* end group number */
struct {
char tbl_prm ; /* table parameter */
char data_type ; /* data type */
unsigned short data_size ;
/* size of data in group */
unsigned short data_dsp ;
/* address of data in group */
short dummy ; /* (not used) */
} info[N] ; /* N : number of messages to be read */
} IODBPMCCNTL ;

datano_s Start group number

datano_e End group number

tbl_prm Table parameter


bit 0 : Format of data table
0 : binary 1 : BCD
bit 1 : Protection of data table
0 : not protected
1 : protected
bit 2 : Format of data table
0 : binary or BCD
1 : hexadecimal
bit 3<-->7 : (not used)

data_type Data type(0:BYTE,1:WORD,2:LONG)

data_size Size of data in group(number of byte)

data_dsp Address of data in group(address D inside)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH data block length error
Size of IODBPMCCNTL structure(length) is wrong.
EW_NUMBER data number error
Group number(s_number,e_number) is wrong.
EW_NOOPT no option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

815
CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

816
(9) Write Control Data of PMC Data Table

Function Name:
pmc_wrcntldata

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI pmc_wrcntldata(unsigned short FlibHndl,
short length, IODBPMCCNTL *pmccntl);
Description:
Writes the control data to manage PMC data table (address D).

This function is not available for PMC-NA.

Refer to the programming manual of PMC-RC/NB(ladder language)


concerning the details of input arguments.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

length Specify the length of data block.(size of IODBPMCCNTL structure)

IODBPMCCNTL 0+---------+ ---


| datano_s| ^
2+---------+ |
| dummy | |
4+---------+ |
| datano_e| length
6+---------+---------+ |
| info[0] | |
6+8+-------------------+ |
= = |
6+8*(N-1)+-------------------+ |
| info[N-1] | v
6+8*N+-------------------+ ---

info 0+-----------+
| tbl_prm |
1+-----------+
| data_type |
2+-----------+-----------+
| data_size |
4+-----------------------+
| data_adr |
6+-----------------------+
| dummy |
8+-----------------------+

N is number of group to be written.

817
pmccntl Pointer to the IODBPMCCNTL structure to be set the control data
of PMC data table. The IODBPMCCNTL structure is as follows.

typedef struct iodbpmccntl {


short datano_s ; /* start group number */
short dummy ; /* (not used) */
short datano_e ; /* end group number */
struct {
char tbl_prm ; /* table parameter */
char data_type ; /* data type */
unsigned short data_size ;
/* size of data in group */
unsigned short data_dsp ;
/* address of data in group */
short dummy ; /* (not used) */
} info[N] ; /* N : number of group to be written */
} IODBPMCCNTL ;

datano_s Specify the start group number.

datano_e Specify the end group number.

tbl_prm Specify the table parameter.


bit 0 : Format of data table
0 : binary 1 : BCD
bit 1 : Protection of data table
0 : no protection
1 : protection
bit 2 : Format of data table
0 : binary or BCD
1 : hexadecimal
bit 3<-->7 : (not used)

data_type Specify the data type.


(0:BYTE,1:WORD,2:LONG)

data_size Specify the size of data in group


(number of byte)

data_dsp Specify the address of data in group


(address D inside)

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_LENGTH data block length error
Size of IODBPMCCNTL structure(length) is wrong.
EW_NUMBER data number error
Group number(datano_s,datano_e) is wrong.
EW_DATA data error
Detailed status is set in global variable
pmc_errno (short).
0 : Error except EW_DATA
1 : Table parameter(tbl_prm) error
2 : Data type(data_type) error
3 : Size of data in group(data_size) error
4 : Address of data in group(data_dsp) error
Group number in which includ an incorrect data
is set in global variable pmc_errdtno (short).

818
EW_NOOPT no option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

819
(10) Read the Sum Total Group of Control Data of PMC Data Table

Function Name:
pmc_rdcntlgrp

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI pmc_rdcntlgrp(unsigned short FlibHndl,
short *grp_no);
Description:
Reads the sum total group of control data to manage PMC data table
(address D).
This function is not available for PMC-NA.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

grp_no Specify the address of the variable to store the sum total
group. After executing this function, the number of group
which has been read actually is set.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

820
(11) Write the Sum Total Group of Control Data of PMC Data Table

Function Name:
pmc_wrcntlgrp

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI pmc_wrcntlgrp(unsigned short FlibHndl,
short grp_no);
Description:
Writes the sum total group of control data to manage PMC data table
(address D).
This function is not available for PMC-NA.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

grp_no Specify the sum total group.

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 CNC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_DATA data error
Group number(grp_no) is wrong.
EW_NOOPT no option
The extended driver/library function is
necessary.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

821
(12) Read Data from Extended Backup Memory

Function Name:
pmc_rdkpm

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI pmc_rdkpm(unsigned short FlibHndl,
unsigned long offset,char *data,unsigned short length);
Description:
Reads the contents of the extended backup memory of PMC specified by
"offset", "length".
The data are stored in "data" with the same format as PMC.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

offset Specify the start address.


The top of the extended backup memory is indicated by '0'.

data Pointer to the data storage area.


The array is as follows.
char data[65535] ;

length Specify the size of data to be read.

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 PMC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOPMC There is no PMC.
EW_LENGTH Data block length error
Size of data(length) is wrong.
EW_RANGE Address range error
Start address(offset) is wrong.
EW_NOOPT No option
This function needs the extended backup memory
option.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function relates to the following CNC option.

Series 150 PMC backup memory 14K addition


PMC backup memory 64K addition

Series 160/180 PMC backup memory addition

Series 210,NC board


There is no extended backup memory option.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

822
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

823
(13) Write Data to Extended Backup Memory

Function Name:
pmc_wrkpm

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI pmc_wrkpm(unsigned short FlibHndl,
unsigned long offset,char *data,unsigned short length);
Description:
Writes the data to the extended backup memory of PMC specified by
"offset", "length".
The data must be stored in "data" with the same format as PMC.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

offset Specify the start address.


The top of the extended backup memory is indicated by '0'.

data Pointer to the data storage area.


The array is as follows.
char data[65535] ;

length Specify the size of data to be written.

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 PMC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOPMC There is no PMC.
EW_LENGTH Data block length error
Size of data(length) is wrong.
EW_RANGE Address range error
Start address(offset) is wrong.
EW_NOOPT No option
This function needs the extended backup memory
option.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

824
CNC option: This function relates to the following CNC option.

Series 150 PMC backup memory 14K addition


PMC backup memory 64K addition

Series 160/180 PMC backup memory addition

Series 210,NC board


There is no extended backup memory option.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

825
(14) Read Maximum Size of Extended Backup Memory

Function Name:
pmc_kpmsiz

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI pmc_kpmsiz(unsigned short FlibHndl,
unsigned long *size);
Description:
Reads the maximum size of the extended backup memory.

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

size Pointer to the maximum size storage area.

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 PMC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOPMC There is no PMC.

EW_NOOPT No option
This function needs the extended backup memory
option.

Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,


EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: This function relates to the following CNC option.

Series 150 PMC backup memory 14K addition


PMC backup memory 64K addition

Series 160/180 PMC backup memory addition

Series 210,NC board


There is no extended backup memory option.

CNC parameter: This function doesn't relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

826
Available CNC: +---+-----+-----+-----+-----+---------+
| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | X | X | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

827
(15) Get Detail Error for PMC

Function Name:
pmc_getdtailerr

Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI pmc_getdtailerr(unsigned short FlibHndl, DTLERR *err);

Description:
Gets the detail error information after the function has been executed.
The detail error information is stored in "err_no", "err_dtno" of "DTLERR".

Arguments:
FlibHndl
Identify the process which uses the library.
See "Library handle" for details.

err Pointer to the DTLERR structure to be set the detail error


information. The DTLERR structure is as follows.
typedef struct dtlerr{
short err_no; /* Detail error */
short err_dtno; /* Data number on error */
} DTLERR ;

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 PMC data window" in "General
Description".)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_NOOPT no option
The extended driver/library function is
necessary.
Others: EW_BUS, EW_SYSTEM2, EW_HSSB, EW_HANDLE, EW_VERSION,
EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS

CNC option: The extended driver/library function is necessary.

CNC parameter: This function does not relate to CNC parameter.

CNC mode: This function can be used in any CNC mode.

Available CNC: +---+-----+-----+-----+-----+---------+


| | 150 | 160 | 180 | 210 |NC board |
+---+-----+-----+-----+-----+---------+
|M | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|T | O | O | O | O | O |
+---+-----+-----+-----+-----+---------+
|MM | X | O | X | X | X |
+---+-----+-----+-----+-----+---------+
|TT | O | O | O | X | X |
+---+-----+-----+-----+-----+---------+
|P | X | O | O | X | X | : Punch press
+---+-----+-----+-----+-----+---------+
|L | X | O | X | X | X | : Laser
+---+-----+-----+-----+-----+---------+
|LC | X | O | O | X | X | : Loader Control
+---+-----+-----+-----+-----+---------+

828
GE Fanuc Automation North America, Inc., Charlottesville Virginia

Vous aimerez peut-être aussi