4 F 912 A 737563 F
4 F 912 A 737563 F
Reference Manual
                                                    Warning
          Warning notices are used in this publication to emphasize that hazardous voltages, currents,
          temperatures, or other conditions that could cause personal injury exist in this equipment or
          may be associated with its use.
          In situations where inattention could cause either personal injury or damage to equipment, a
          Warning notice is used.
                                                     Caution
          Caution notices are used where equipment might be damaged if care is not taken.
                                                      Note
          Notes merely call attention to information that is especially significant to understanding and
          operating the equipment.
          This document is based on information available at the time of its publication. While efforts
          have been made to be accurate, the information contained herein does not purport to cover all
          details or variations in hardware or software, nor to provide for every possible contingency in
          connection with installation, operation, or maintenance. Features may be described herein
          which are not present in all hardware and software systems. GE Fanuc Automation assumes
          no obligation of notice to holders of this document with respect to changes subsequently made.
                                                       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.
   * 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.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.
       This data includes tool offset data, workpiece reference point offset
       data, parameters, settings, custom macro variables, P-code macro
       variables, and pitch error compensation data.
This data includes operation history data and alarm history data.
                                            9
1.1.2 General Description
(1) Library files
     * The files for Series 150 and Series 160/180/210,NC board are different
       each other.
   Maximum controlled axes : maximum number of axes for data window interface
   Current controlled axes : number of axes controlled by CNC system currently
           #if defined(M_AXIS2)
           #define     MAX_AXIS     24
           #elif defined(M_AXIS1)
           #define     MAX_AXIS     15
           #else
           #define     MAX_AXIS     10
           #endif
At FD Mate mini system, data window function only for PMC is available.
                                         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
            +------------------------------+
            | 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 |
            +------------------------------------+
                                        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.
(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
                                        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
--------------------------------------------------------------------------------
                                          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.
--------------------------------------------------------------------------------
                                        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
--------------------------------------------------------------------------------
                                        28
1.1.6 Multi-Connection of HSSB
                      +---------------------------+
                      |        Application        |
                      +-------------+-------------+
                                    |
                      +-------------+-------------+
                      | FWLIB32.DLL: Control DLL |
                      +-----------+---+---+-------+
                                  |   |   |
                   +--------------+   |   +--------------+
                   |                  |                  |
           +-------+-------+ +-------+-------+ +-------+-------+
           | FWLIB150.DLL: | | FWLIB160.DLL: | | FWLIBPM.DLL: |
           | DLL for 150 | | DLL for          | | DLL for      |
           |               | | 160/180/210 | | Power Mate      |
           +---------------+ +---------------+ +---------------+
   - All function must be called through the control DLL after the handle
     number of specified node has been got by using the cnc_allclibhndl2()
     function.
                                            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 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.
                                           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 code       Meaning/Error handling
              --------------------------------------------------------------
              EW_MMCSYS         Access failure to the device driver
                                The device driver for HSSB multi-connection is
                                not installed.
                                          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.)
             --------------------------------------------------------------
             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.
                                       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 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.
                                          34
1.1.7 Function Reference Related to Controlled Axes/Spindle
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 ;
                                            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".
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                         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. */
                                          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".
     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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                          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. */
                                          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".
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                         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. */
                                          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".
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        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. */
                                          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".
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                         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. */
                                        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".
     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.
                                        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. */
                                        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".
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                         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. */
                                        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
     The formats of each data are same as "Function used for reading
     individually".
     Refer each functions for details.
     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.
                                        51
length       Specify the length of the data block(size of ODBDY structure)
                                   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. */
                 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
                                        54
CNC option: There is no need of CNC option for this function.
                                          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".
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
      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. */
                                            56
            data   Specify value to make preset.
                         data[0],..,data[m-1] : for all axes
                         data[0]              : for each axis
                                         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".
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
     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. */
                                        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.
CNC option: The work coordinate system preset function and the extended
            driver/library function is necessary.
                                        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.
     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.
                                        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. */
CNC option: The handle interrupt function and the extended driver/library
            function is necessary.
                                         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".
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
CNC option: The handle interrupt function and the extended driver/library
            function is necessary.
                                        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 ;
                                             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".
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
      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. */
                                          67
CNC option: The extended driver/library function is necessary.
                                        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".
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
     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. */
                                        69
CNC option: The extended driver/library function is necessary.
                                        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".
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
      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. */
            EW_NOOPT     no option
                         The extended driver/library function is
                         necessary.
                                            71
CNC option: The extended driver/library function is necessary.
                                        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".
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
              ODB3DHDL tooltip[2] ;
                        tooltip[0] : for general and first parallel axis
                        tooltip[1] : for second parallel axis
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.
                                        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.
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
                                         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.
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.
                                          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".
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
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.
                                       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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
              long   ofschg[2] ;
                           ofschg[0] : for general and parallel axes
                           ofschg[1] : (not used)
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.
                                           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.
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
             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.
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.
                                        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.
      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.
                                          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.
      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.
                                           84
1.1.8 Function Reference Related to 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.
                                        85
CNC option: There is no need of CNC option for this function.
                                             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.
             +-------------------+
             | 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)
                                        87
     NC program format
     ~~~~~~~~~~~~~~~~~
     NC program to be registered to CNC is a string composed of
     ASCII characters as following format.
                 LF    0x0A('\n')
                 Oxxxx Program number
                 Mxx   M code at the end of the program(M02,M30,etc.)
     'LF' must be placed at the top of the whole program, and '%' at the end
     Data before 'LF' at the top are ignored. Address 'O' and program number
     must be placed in the program to be registered.
     For example, to register a program such as
            O1234 ;
            G1 F0.3 W10. ;
            M30 ;
            %
"\nO1234\nG1F0.3W10.\nM30\n%"
            "\n"
            "O1234\n"
            "G1F0.3W10.\n"
            "M30\n"
            "%"
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        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
                                            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.
                                         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.
                                             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.
                                        92
CNC parameter:    This function relates to the following CNC parameter.
            See the manual of CNC parameter for details.
                                             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.)
      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.
                                        94
CNC parameter:    This function relates to the following CNC parameter.
            See the manual of CNC parameter for details.
                                             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.
             +-------------------+
             | 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)
                                        96
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                             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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                          99
CNC parameter:    This function relates to the following CNC parameter.
            See the manual of CNC parameter for details.
                                             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.)
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        101
CNC mode:   This function relates to the following mode.
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                         103
CNC mode:   This function relates to the following mode.
                                        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.
             +-------------------+
             | 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)
     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.
           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 ;
cnc_dnc( "\nM3S2000\nT14\nG0X10.\nG0Z-5.\nM30\n%", 32 ) ;
     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.
                                        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.
                                        109
CNC option: There is no need of CNC option for this function.
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        111
CNC mode:   This function relates to the following mode.
                                        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.
      +-----------------------+
      |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,
           EW_NOOPT          No option
                             The extended driver/library function is
                             necessary.
                                        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 150
           It is necessary to set TAPE mode.
                                        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.
     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.
EOB CMD1 EOB CMD2 EOB ..... CMDn EOB Mxx EOB
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.
                                        116
            --------------------------------------------------------------
            Return code       Meaning/Error handling
            --------------------------------------------------------------
            EW_RESET          Reset or stop request
                              'RESET or STOP' was pushed.
                              Call the cnc_dncend function.
            EW_NOOPT         No option
                             The extended driver/library function is
                             necessary.
     Series 150
           0000#0                  --- influenced by setting
           7713#0 = 1              -+- must be set
           0020   = 15             -+
     Series 150
           It is necessary to set TAPE mode.
                                        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.
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.
            EW_NOOPT              No option
                                  The extended driver/library function is
                                  necessary.
                                              119
              EW_UNEXP, EW_SYSTEM,   EW_PARITY, EW_MMCSYS
     Series 150
           0000#0                     --- influenced by setting
           7713#0 = 1                 -+- must be set
           0020   = 15                -+
     Series 150
           It is necessary to set TAPE mode.
                                           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;
                                          121
              --------------------------------------------------------------
              Return code       Meaning/Error handling
              --------------------------------------------------------------
              EW_NOOPT          No option
                                The extended driver/library function is
                                necessary.
     Series 150
           0000#0                    --- influenced by setting
           7713#0 = 1                -+- must be set
           0020   = 15               -+
                                          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.
                                             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).
             +-------------------+
             |   cnc_upstart()   |   beginning of upload
             +---------+---------+   (must be done)
       +-------------->|
       |     +---------+---------+
       |     |   cnc_upload()    |   read NC program
       |     +---------+---------+
       |               |
       | No +---------+---------+
       +-----+ the last data='%'?|
             +---------+---------+
                       | Yes
             +---------+---------+
             |    cnc_upend()    |   End of upload
             +-------------------+   (must be done)
                   LF    0x0A('\n')
                   Oxxxx Program number
                   Mxx   M code at the end of the program(M02,M30,etc.)
           O1234 ;
           G1 F0.3 W10. ;
           M30 ;
           %
                                         125
     And in case that the buffer size is less than 24 bytes, you will get
     the following strings.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
            ODBUP      0+-----------------------------------+
                        |              dummy[0]             |
                       2+-----------------------------------+
                        |              dummy[1]             |
                       4+-----------------+-----------------+
                        | data[0]         |
                       5+-----------------+
                        =                 =
            4+MAX_RBUF-1+-----------------+
                        | data[MAX_RBUF-1]|
            4+MAX_RBUF +-----------------+
                                        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.
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
            ODBUP      0+-----------------------------------+
                        |              dummy[0]             |
                       2+-----------------------------------+
                        |              dummy[1]             |
                       4+-----------------+-----------------+
                        | data[0]         |
                       5+-----------------+
                        =                 =
            4+MAX_RBUF-1+-----------------+
                        | data[MAX_RBUF-1]|
            4+MAX_RBUF +-----------------+
                                        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.
                                        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.
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
            ODBBUF   0+---------+
                      | dummy[0]|
                     2+---------+
                      | dummy[1]|
                     4+---------+
                      |   data |
                     6+---------+
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                         133
CNC option: There is no need of CNC option for this function.
CNC mode: The behavior of this function depends on the CNC mode.
                                          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.
                                         135
CNC option: There is no need of CNC option for this function.
                                        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.
                                         137
     Others: EW_BUS,   EW_SYSTEM2, EW_HSSB,  EW_HANDLE,    EW_VERSION,
           EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
     datano_e
           Specify the end program number.
                                          139
Format of input data
~~~~~~~~~~~~~~~~~~~~
The program directory list which is read from CNC is a string composed
of ASCII characters as following format.
           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 example, when the next programs are registered in CNC, the result
of this function, in case that datano_s=1 and datano_e=9999,
is as follows.
      Program number (COMMENT)      Character number
      -------------------------------+----------------
      O0012 (TEST) ;                420
      O0200 (WORK1) ;               352
      O0201 ;                       537
      O9001 (SUB-PRO1) ;            781
If the buffer size is not enough for the specified program, the
specified size is read. In case of 15 bytes, the result is as follows.
type Contents to be read
-------+-----------------------------------------------------------
0     "O12O200O201O900"
1     "%\nO12(TEST)\nO20"
2     "O12(TEST)420O20"
                                  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.
                                        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.
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 func-
            tion call.
      buf
             Pointer to the PRGDIR 2 structure where program directory data
             are returned to. The PRGDIR 2 structure is as follows.
                                         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".
                                        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.
     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.
                                         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'.
                                           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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        146
CNC parameter:    This function relates to the following CNC parameter.
            See the manual of CNC parameter for details.
                                           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.
     This function is used for watch the block being executed or the current
     process by the application program, or only displaying the current
     sequence number.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                           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.
                                          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.
                                         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.
CNC option: The program restarting function and the extended driver/library
            function is necessary.
                                        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.
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        157
CNC option: The extended driver/library function is necessary.
                                        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)
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
      crntpntr
            Specify the block pointer to execute first.
                                         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.
                                          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.
                                        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.
           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.
CNC option: This function needs the machining time stamp option and the
            extended driver/library option.
                                        164
1.1.9 Function Reference Related to NC File Data
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.
      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
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        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.
                                         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
* ( ) : Basic
                                            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.
      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 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)
                                        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.
                                         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.
     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
* ( ) : Basic
                                            170
CNC mode:   This function can be used in any CNC mode.
                                        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.
                                          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.
                                  173
     - Lathe Series/Tool offset Memory B
                                        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
* ( ) : Basic
                                            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.
            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.
                                          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.
     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
                                        177
CNC parameter:     This function relates to the following CNC parameters.
                 See the manual of CNC parameter for details.
                                         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.
            ofs_type
                  Memory type of    tool   offset
                        0:memory    type   A
                        1:memory    type   B
                        2:memory    type   C(except T series)
            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
                                             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
                                        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".
     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
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
         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
                                          182
     Others: EW_BUS,   EW_SYSTEM2, EW_HSSB,  EW_HANDLE,    EW_VERSION,
           EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS
                                         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.
             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 160/180
              M series
                  Work   zero offset
                  Work   zero offset 48 sets
                  Work   zero offset 300 sets
              T series
                  Work   zero offset
                                          185
CNC parameter:     This function relates to the following CNC parameters.
                 See the manual of CNC parameter for details.
                                         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 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
      e_number
            Specify the end work zero offset number.
                                           187
     length        Specify the data block length(size of IODBZOR structure).
              (6+4*(number of axes)*(number of offset))
     zofsr Pointer to the IODBZOR structure including the work zero offset
           value. The IODBZOR structure is as follows.
                                         188
CNC option: This function relates to the following CNC option.
                                         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.
                                          190
     zofsr Pointer to the IODBZOR structure including the work zero offset
           value. The IODBZOR structure is as follows.
           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
           datano_e
                 Specify the end work zero offset number.
                                          191
     Others: EW_BUS,   EW_SYSTEM2, EW_HSSB,  EW_HANDLE,    EW_VERSION,
           EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS
                                         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.
            Series 160/180
                M series       7/55/307 sets
                T series       7 sets
CNC option: This function needs the extended driver/library option, and
            relates to the following CNC option.
      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
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        195
length        Specify the data block length(size of IODBPSD structure).
         (4+(byte size of parameter)*(number of axis))
             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.
                                        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.
      The attribute of CNC parameter depends on the type and axis, and it is
      different for each parameter. It is as follows, and can be got by
      cnc_rdparainfo() function.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                          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.
               } u ;
           } IODBPSD ;       /* MAX_AXIS : max. controlled axes */
                                        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.
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.
                                        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.
     The attribute of CNC parameter depends on the type and axis, and it is
     different for each parameter. It is as follows, and can be got by
     cnc_rdparainfo() function.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
     s_number
           Specify the start parameter number.
           The first parameter number to be read is returned.
                                        201
e_number
      Specify the end parameter number.
      The last parameter number to be read is returned.
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))]
                                     202
     param Pointer to the area to store the parameters.
           Each parameter can be referred by using the IODBPSD structure.
                   Lower byte:axis
                       ALL_AXES : all axes(ALL_AXES=-1)
                       0        : no axis
                       1,..,m   : 1 axis(m=max. controlled axes)
                                         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.
      The attribute of CNC parameter depends on the type and axis, and it is
      different for each parameter. It is as follows, and can be got by
      cnc_rdparainfo() function.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            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.
            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.
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.
                                        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".
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
     s_number
           Specify the start parameter number.
                                        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)
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        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.
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.
                                         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
                                   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.
                                        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.
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.
                                          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 +---------------+---
                                   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.
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.
                                        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.
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.
                                           218
e_number
      Specify the end setting data number.
      The last setting data number to be read is returned.
       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))]
                                     219
     set    Pointer to the area to store the setting data.
            Each setting data can be referred by using the IODBPSD
            structure.
                   Lower byte:axis
                       ALL_AXES : all axes(ALL_AXES=-1)
                       0        : no axis
                       1,..,m   : 1 axis(m=max. controlled axes)
                                         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.
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.
             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.
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.
                                        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".
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
      s_number
            Specify the start setting data number.
                                        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)
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        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.
                                          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.
CNC option: This function needs the pitch error compensation option.
                                        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.
            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.
CNC option: This function needs the pitch error compensation option.
                                        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.
CNC option: This function needs the pitch error compensation option and
            the extended driver/library option.
                                          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)
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.
                                          236
CNC parameter:   This function doesn't relate to CNC parameter.
                                        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)
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.
                                          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.
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.
           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.
                                          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.
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.
           datano_s
                 Specify the start custom macro variable number.
           datano_e
                 Specify the end custom macro variable number.
                                         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.
                                          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.
                 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
                                            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.
                                          248
 (31) Get Type of Custom Macro Variable
Function Name:
      cnc_getmactype
Declaration:
      #include    "fwlib32.h"
      FWLIBAPI short WINAPI cnc_getmactype(unsigned short FlibHndl,
                                                ¯o_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
     (As for the details, see "Return status of CNC data window" in "General
     Description".)
                                          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
     (As for the details, see "Return status of CNC data window" in "General
     Description".)
                                          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.
                                          251
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
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.
                                        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.
                                          253
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
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.
                                        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.
                                        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.
           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.
                                        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.
                                         258
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
           datano_s
                 Specify the start P code macro variable number.
           datano_e
                 Specify the end P code macro variable number.
                                         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.
                                        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.
           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;
                                        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;
                    * 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)
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.
                                          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
     (As for the details, see "Return status of CNC data window" in "General
     Description".)
                                          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
     (As for the details, see "Return status of CNC data window" in "General
     Description".)
                                          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.
     buf    Pointer to the ODBMGRP structure where returned data are stored.
            The ODBMGRP structure is as follows.
            m_code      M code
                  M code is returned.
                                          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.
CNC option: This function needs the M code group option and the extended
            driver/library option.
                                        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.
                                        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.
CNC option: This function needs the M code group option and the extended
            driver/library option.
                                         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.
     buf    Pointer to the ODBEXEM structure where returned data are stored.
            The ODBEXEM structure is as follows.
                                           270
            m_code[N].no      ‚l code
                  The latest five M codes in the group are returned.
                   (N: 0,..,4)
CNC option: This function needs the M code group option and the extended
            driver/library option.
                                        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.
            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)
CNC option: This function needs the M code group option, the program
            restart option and the extended driver/library option.
                                        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 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.
                                         274
length       Specify the data block length(size of IODBINT structure).
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 +---------------+ ---
                                    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.
                                         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.
                                          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 +---------------+ ---
     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.
                                   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.
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.
                                          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.
            Series 150
                  TT 16/32/80 sets(each path)
            Series 160/180
                  MM 1 set(each path)
                  TT 16/32/64 sets(each path)
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.
                                         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.
                                           283
            hpcc         Valid/invalid of high precision contour
                         control is set.
                           0 : invalid
                           1 : valid
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.
                                          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.
                                           286
           hpcc         Specify valid/invalid of high precision contour
                        control.
                          0 : invalid
                          1 : valid
                                        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.
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.
                                        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.
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.
                                        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.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.
                                292
            max_cf             Maximum feed of feed clamp by radius of cercle
                         is set.
                                         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.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.
                                              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.
                                        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.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
                                              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.
                                               298
CNC option: This function needs the extended driver/library option.
                                        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.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
                                                300
                   bit10   :   (not   used)
                   bit11   :   (not   used)
                   bit12   :   (not   used)
                   bit13   :   (not   used)
                   bit14   :   (not   used)
                   bit15   :   (not   used)
                                              301
     Others: EW_BUS,   EW_SYSTEM2, EW_HSSB,  EW_HANDLE,   EW_VERSION,
           EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS
                                        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.
                                          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.
                                        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.
                                           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.
                                        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 unit of active fixture offset value is the same as "Read work zero
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                         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.
CNC option: This function needs the rotary table dynamic fixture offset
            option and the extended driver/library option.
                                         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 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.
                                          310
     length        Specify the data block length(size of IODBZOR structure).
              (6+4*(number of axes)*(number of offset))
     fixofsr     Pointer to the IODBZOR structure for the fixture offset value.
           The IODBZOR structure is as follows.
                                         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.
                                         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.
                                           313
     fixofsr     Pointer to the IODBZOR structure for the fixture offset value.
           The IODBZOR structure is as follows.
            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.
CNC option: This function needs the rotary table dynamic fixture offset
            option and the extended driver/library option.
                                         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".
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                         316
     wkcdshft
           Pointer to the IODBWCSF structure for the work coordinate shift
           value. The IODBWCSF structure is as follows.
                                         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.
      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   */
                                          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.
                                         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 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.
     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.
                                         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.
     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.
                                         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.
                                           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.
CNC option: This function needs the B axis option and the extended driver/
            library option.
            And, this function relates to the following CNC option.
                                         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.
            datano_e
                  Specify the end tool offset number.
                      The available number is 1,...,9.
      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.
CNC option: This function needs the B axis option and the extended driver/
            library option.
            And, this function relates to the following CNC option.
                                         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.
            ofs_type
                  Memory type of tool offset for B axis
                        0:memory type A
                        1:memory type B
                                          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.
                                           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).
     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
     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.
           ODBBAXIS    baxis[2] ;
                             baxis[0] : current command data
                             baxis[1] : next command data
                                        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
CNC option: This function needs the B axis option and the extended driver/
            library option.
                                          332
1.1.10 Function Reference Related to Tool Life Management Data
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.
     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.
                                          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.
                                        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.
                                        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.
     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.
                                          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.
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                         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.
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                          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.
                                        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.
     tool_num
           Specify the tool number with binary format.
                                        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.
                                        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.
     tuse_num
           Specify the tool use-order number with binary format.
                                        345
            EW_NOOPT   no option
                       The tool life management function is necessary.
                                        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.
     tool_num
           Specify the tool number with binary format.
                                        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.
                                        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.
     tuse_num
           Specify the tool use-order number with binary format.
                                        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.
                                        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.
     tool_num
           Specify the tool number 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.
                                         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.
                                        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.
     tuse_num
           Specify the tool use-order number 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.
                                         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.
                                        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.
     tuse_num
           Specify the tool use-order number with binary format.
                                          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.
                                        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.
            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.
                                        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. */
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
            data      0+-----------+
                       | dummy[0] |
                      4+-----------+
                       | dummy[1] |
                      8+-----------+
                       |   count   |
                     12+-----------+
                                         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.
                                        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 ;
                                        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.
                                        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.
                                          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.
                                        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.
                                        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.
                                        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.
                                        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.
                                        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.
                                        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.
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                           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
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                           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
                                        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.
                                        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. */
                                          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
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
            data       0+-------------+
                        |    n_tool   |
                       4+-------------+
                        | count_value |
                       8+-------------+
                        |   counter   |
                      12+-------------+
                        | count_type |
                      16+-------------+
                                          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. */
                                        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.
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                          388
            EW_OVRFLOW   memory overflow
                         The number of the maximum tool which was able
                         to be registered was exceeded.
            EW_REJECT    CNC execution denied
                                         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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        390
     Others: EW_BUS,   EW_SYSTEM2, EW_HSSB,  EW_HANDLE,   EW_VERSION,
           EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS
                                        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.
                                         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
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.
                                           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.
                                         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.
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        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 +-----------+
                                  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)
                                        401
     Others: EW_BUS,   EW_SYSTEM2, EW_HSSB,  EW_HANDLE,   EW_VERSION,
           EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS
                                        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.
                                         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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        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 +-------------+
                                    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
                                        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.
                                          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.
                                          410
CNC option: This function needs the extended driver/library option.
                                        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.
                                          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
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
CNC option: This function needs the external message option or the external
            data input option, and the extended driver/library option.
                                         414
CNC mode:   This function can be used in any CNC mode.
                                        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.
CNC option: This function needs the external message option or the external
            data input option, and the extended driver/library option.
                                        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.
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.
                                        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.
     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.
                                        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.
CNC option: This function needs the external message option or the external
            data input option, and the extended driver/library option.
                                        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.
CNC option: This function needs the external message option or the external
            data input option, and the extended driver/library option.
                                         421
1.1.12 Function Reference Related to Servo/Spindle
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 */
                                        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".
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 */
                                         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 */
                                        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.
CNC option: The serial spindle function(only Series 150) and the extended
            driver/library function is necessary.
                                          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 */
                                        428
CNC option: The following functions are necessary for this function.
                  The serial spindle function
                  The extended driver/library function
                                         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".
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
CNC option: The following functions are necessary for this function.
                  The serial spindle function
                  The extended driver/library function
                                         430
CNC parameter:     This function relates to the following CNC parameters.
                 See the manual of CNC parameter for details.
                                         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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
CNC option: The following functions are necessary for this function.
                  The serial spindle function
                  The extended driver/library function
                                         432
CNC parameter:     This function relates to the following CNC parameters.
                 See the manual of CNC parameter for details.
                                         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.
CNC option: The following functions are necessary for this function.
                  The serial spindle function
                  The extended driver/library function
                                         434
CNC mode:   This function can be used in any CNC mode.
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
CNC option: The following functions are necessary for this function.
                  The serial spindle function
                  The extended driver/library function
                                        436
CNC parameter:     This function relates to the following CNC parameters.
                 See the manual of CNC parameter for details.
                                         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.
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.
CNC option: The following functions are necessary for this function.
                  The serial spindle function
                  The extended driver/library function
                                        438
CNC parameter:     This function relates to the following CNC parameters.
                 See the manual of CNC parameter for details.
                                         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
                                            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.
CNC option: The following functions are necessary for this function.
                  The serial spindle function
                  The extended driver/library function
                                         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.
                                          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
CNC option: The following functions are necessary for this function.
                  The serial spindle function(only Series 150)
                  The extended driver/library function
                                         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.
                                         445
            sgnl4 control output signal 4
                     #7    #6    #5    #4    #3    #2    #1    #0
                  +-----+-----+-----+-----+-----+-----+-----+-----+
                  |     |     |     |     |     |     |     |     |
                  +-----+-----+-----+-----+-----+-----+-----+-----+
CNC option: The following functions are necessary for this function.
                  The serial spindle function(only Series 150)
                  The extended driver/library function
                                         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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        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.
                            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.
condition : 100/101/102
condition : 0/1/2
                             449
- Kind of waveform data
-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'.
Series 150
     - Maximum axis = 24
           31 <----------.....----------> 0 bit
           +-+-+-+-+-+-+-.....-+-+-+-+-+-+-+
           +-+-+-+-+-+-+-     -+-+-+-+-+-+-+
                            451
     Series 160/180
channel 0 <--> 5
channel 6, 7
                            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.
                                          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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        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.
                            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.
condition : 100/101/102
condition : 0/1/2
                             456
- Kind of waveform data
                                  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.
Series 150
     - Maximum axis = 24
           31 <----------.....----------> 0 bit
           +-+-+-+-+-+-+-.....-+-+-+-+-+-+-+
           +-+-+-+-+-+-+-     -+-+-+-+-+-+-+
                            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
         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.
                            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.
                                          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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                          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.
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                          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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
            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.
                                        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 ;
Series 150
Series 160/180
                                     468
     - In case that "kind" is 13(machine signal)
                                   469
           data[0]           2    waveform diagnosis data
           data[1]           2    waveform diagnosis data
              :        :        :
           data[n-1]   2    waveform diagnosis data
                                        470
     Others: EW_BUS,   EW_SYSTEM2, EW_HSSB,  EW_HANDLE, EW_VERSION,
           EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS
                                        471
1.1.13 Function Reference Related to Data Server, DNC1, DNC2,
OSI-Ethernet
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            ----------+               +-----------------
                   cnc_dtsvftpget()
                   cnc_dtsvftpput()
                   cnc_dtsvdelete()
                   cnc_dtsvrdpgdir()
                   cnc_dtsvrdset()
                   cnc_dtsvwrset()
                   cnc_dtsvchkdsk()
                   cnc_dtsvhdformat()
                                           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.
nc_file Specify the pointer to the file name in the data server.
                                        473
CNC option: This function needs the extended driver/library option.
                                        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.
                   cnc_dtsvftpget()
                   cnc_dtsvftpput()
                   cnc_dtsvdelete()
                   cnc_dtsvrdpgdir()
                   cnc_dtsvrdset()
                   cnc_dtsvwrset()
                   cnc_dtsvchkdsk()
                   cnc_dtsvhdformat()
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.
nc_file Specify the pointer to the file name in the data server.
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                         478
CNC mode:   This function can be used in any CNC mode.
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        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 ;
           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.
                                         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
                                        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.
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.
                                         483
     Others: EW_BUS,   EW_SYSTEM2, EW_HSSB,  EW_HANDLE,   EW_VERSION,
           EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS
                                        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.
                 cnc_dwnstart()
                 cnc_vrfstart()
                 cnc_dncstart()
                 cnc_delete()
                 cnc_delall()
                 cnc_search()
                 cnc_dtsvdownload()
                 cnc_dtsvupload()
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
                                           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.
                 cnc_dwnstart()
                 cnc_vrfstart()
                 cnc_dncstart()
                 cnc_delete()
                 cnc_delall()
                 cnc_search()
                 cnc_dtsvdownload()
                 cnc_dtsvupload()
                                        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"
                                        489
CNC parameter:    This function relates to the following CNC parameter.
            See the manual of DATA SERVER parameter for details.
                                           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.
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        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
                                         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"
                                        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.
                                         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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                            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
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                           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.
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        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.
                                        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.
      cram   Pointer to the content of the interface buffer for the data
             server.
             The area more than above size is necessary.
                                         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.
                                         508
     Others: EW_BUS,   EW_SYSTEM2, EW_HSSB,  EW_HANDLE,   EW_VERSION,
           EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS
                                        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.
                                        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.
                                           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.
                                           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.
CNC option: This function needs the DNC1, DNC2, OSI-Ethernet option and the
            extended driver/library option.
                                        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.
CNC option: This function needs the DNC1, DNC2, OSI-Ethernet option and the
            extended driver/library option.
                                        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 ;
                                        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
     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.
                                        522
CNC option: This function needs the DNC1, DNC2, OSI-Ethernet option and the
            extended driver/library option.
                                        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 ;
                                        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
                               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.
                             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.
                                        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 ":".
CNC option: This function needs the DNC2 option and the extended driver/
            library option.
                                        529
CNC mode:   This function can be used in any CNC mode.
                                        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.
CNC option: This function needs the DNC1, DNC2 option and the extended
            driver/library option.
                                        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.
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.
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.
                                        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.
CNC option: This function needs the OSI-Ethernet option and the extended
            driver/library option.
                                        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.
CNC option: This function needs the OSI-Ethernet option and the extended
            driver/library option.
                                         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
CNC option: This function needs the OSI-Ethernet option and the extended
            driver/library option.
                                         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.
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
CNC option: This function needs the OSI-Ethernet option and the extended
            driver/library option.
                                        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
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.
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.
CNC option: This function needs the extended driver/library function, and
            relates to the following function.
                                        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.
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.
CNC option: This function needs the extended driver/library function, and
            relates to the following function.
                                        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.
                                        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.
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.
CNC option: This function needs the extended driver/library function, and
            relates to the following functions.
                                        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.
                                         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.
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.
CNC option: This function needs the extended driver/library function, and
            relates to the following functions.
                                        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.
                                            553
            m_tl_no           Sub-tool number of multiple tool is set. (0,..)
reserve (reserve)
CNC option: This function needs the multiple tool function and the extended
            driver/library function, and relates to the following functions.
                                          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.
                                            556
           m_tl_no           Specify Sub-tool number of multiple tool.(0,..)
reserve (reserve)
                                         557
CNC option: This function needs the multiple tool function and the extended
            driver/library function, and relates to the following functions.
                                        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.
                                           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.
CNC option: This function needs the safety zone check function and the
            extended driver/library function.
                                        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.
                                            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.
CNC option: This function needs the safety zone check function and the
            extended driver/library function.
                                        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.
     tlzone      Pointer to the IODBTLZN structure including the tool zone data.
           The IODBTLZN structure is as follows.
                                         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.
CNC option: This function needs the safety zone check function and the
            extended driver/library function.
                                        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.
      tlzone      Pointer to the IODBTLZN structure including the tool zone data.
            The IODBTLZN structure is as follows.
                                          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.
CNC option: This function needs the safety zone check function and the
            extended driver/library function.
                                        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.
                                          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.
CNC option: This function needs the safety zone check function and the
            extended driver/library function.
                                        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.
CNC option: This function needs the safety zone check function and the
            extended driver/library function.
                                        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)
CNC option: This function needs the safety zone check function and the
            extended driver/library function.
                                        570
1.1.15 Function Reference Related to LASER
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.
                                              571
                   bit 9 : Edge cutting select
                   bit10 : Start-up select
                   bit11,..,15 : (reserve)
                         * When some bit is 0, its data is invalid.
reserve (reserve)
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.
                                        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.
                                           574
           feed        Specify feedrate.
                        (Setting range: 0 to 99999, Unit: mm/min)
reserve (reserve)
                                         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.
CNC option: This function needs the cutting condition setting function
            and the extended driver/library function are necessary.
                                        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.
                                              577
                   bit10 : Assist gas setting time
                   bit11 : Reference displace
                   bit12,..,15 : (reserve)
                         * When some bit is 0, its data is invalid.
reserve (reserve)
                                          578
CNC option: This function needs the cutting condition setting function
            and the extended driver/library function are necessary.
                                        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.
                                            580
                   bit11 : Reference displace
                   bit12,..,15 : (reserve)
                         * When some bit is 1, its data is written.
reserve (reserve)
CNC option: This function needs the cutting condition setting function
            and the extended driver/library function are necessary.
                                        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.
                                          583
           angle        Judge angle for edge is set.
                         (Setting range: 0 to 180, Unit: degree)
reserve (reserve)
CNC option: This function needs the cutting condition setting function,
            the edge cutting function and the extended driver/library
            function are necessary.
                                          584
CNC mode:   This function can be used in any CNC mode.
                                        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.
                                          586
           angle       Specify judge angle for edge.
                        (Setting range: 0 to 180, Unit: degree)
reserve (reserve)
                                         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.
CNC option: This function needs the cutting condition setting function,
            the edge cutting function and the extended driver/library
            function are necessary.
                                        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.
                                            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.
reserve (reserve)
CNC option: This function needs the cutting condition setting function,
            the slope control function and the extended driver/library
            function are necessary.
                                          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.
                                            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.
reserve (reserve)
                                         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.
CNC option: This function needs the cutting condition setting function,
            the slope control function and the extended driver/library
            function are necessary.
                                        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.
reserve (reserve)
                                            595
CNC mode:   This function can be used in any CNC mode.
                                        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.
reserve (reserve)
                                            597
     Others: EW_BUS,   EW_SYSTEM2, EW_HSSB,  EW_HANDLE,   EW_VERSION,
           EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS
                                        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.
reserve (rerserve)
                                            599
     Others: EW_BUS,   EW_SYSTEM2, EW_HSSB,  EW_HANDLE,   EW_VERSION,
           EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS
                                        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.
                                        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.
                                        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.
reserve (reserve)
                                            603
CNC parameter:   This function doesn't relate to CNC parameter.
                                        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.
reserve (reserve)
                                            605
     Others: EW_BUS,   EW_SYSTEM2, EW_HSSB,  EW_HANDLE,   EW_VERSION,
           EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS
                                        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.
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.
                                        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.
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.
                                        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.
reserve (reserve)
                                            611
     Others: EW_BUS,   EW_SYSTEM2, EW_HSSB,  EW_HANDLE,   EW_VERSION,
           EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS
                                        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.
reserve (reserve)
                                             613
            EW_NOOPT   No option
                       The extended driver/library function is
                       necessary.
                                        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.
reserve (reserve)
                                             615
     Others: EW_BUS,   EW_SYSTEM2, EW_HSSB,  EW_HANDLE,   EW_VERSION,
           EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS
                                        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.
reserve (reserve)
                                             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.
                                        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.
                                           619
            duty         Actual pulse duty is set.
reserve (reserve)
                                           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.
                                        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.
                                        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.
                                           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.
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.
CNC option: This function needs the cutting condition setting function
            and the extended driver/library function are necessary.
                                        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.
                                          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.
                                        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.
                                        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)
                                        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.
                                        632
1.1.16 Function Reference of 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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                            633
              (n : number of controlled axis)
              EW_NOOPT    no option
                          The extended driver/library function is
                          necessary.
                                          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.
              EW_NOOPT    no option
                          The extended driver/library function is
                          necessary.
                                           635
CNC parameter:   This function does not relate to CNC parameter.
                                       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.
              EW_NOOPT    no option
                          The extended driver/library function is
                          necessary.
                                          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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                              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.
                                          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.
              EW_NOOPT    no option
                          The extended driver/library function is
                          necessary.
                                            640
CNC parameter:   This function does not relate to CNC parameter.
                                       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.
              EW_NOOPT   no option
                         The extended driver/library function is
                         necessary.
                                          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.
              EW_NOOPT   no option
                         The extended driver/library function is
                         necessary.
                                          643
1.1.17 Function Reference of Others
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.
     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.
                                        644
dummy        Not used
              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
        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)
                               645
            Series 150                 Series 160/180/210/
                                       Series 160i/180i/210i
                                       NC board
            sysinfo.addinfo    =   2
            sysinfo.max_axis   =   8
            sysinfo.cnc_type   =   "16"
            sysinfo.mt_type    =   " M"
            sysinfo.series     =   "B0F1"
            sysinfo.version    =   "0001"
            sysinfo.axes       =   " 3"
                                            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.
                                          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 ;
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
  #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
                            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
- 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
- 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
                            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
- 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
                            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)
- PMC-NB
      pcb_note[5][0] --- Existence of CPU module
          -1 : Not existence       1 : Existence
           0 : (reserve)
- 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"
- 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)
- RISC
      pcb_note[10][0] -- Capacity of EPROM module
          -1 : Not existence       1 : 512K
           0 : Others              2 : 1M
                            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
- 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
                            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
- 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
- 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
                            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[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.
                               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) */
                             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)
                              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
                              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.
                               661
     NC board
                 -1 : Not existence       2 : PMP2+SLC
                  0 : RB4           3 : BSI
                  1 : BSI+SLC             4 : PMP2
                            662
pmcmrc             Type   of PMC module (PMC-RC)
                   -1 :   Not existence       2 : PMP2+SLC
                    0 :   BOC2          3 : BSI
                    1 :   BSI+SLC             4 : PMP2
                               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
                         664
            dr2r64           Capacity of DRAM module 2 (64bitRISC)
                             -1 : Not existence       2 :   2 (MB)
                              0 : (reserve)           3 :   4 (MB)
                              1 : (reserve)
                                        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.
                                        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 ;
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)
                              669
           out_vga_ser Series of VGA software(external)
           out_vga_ver Version of VGA software(external)
                                        670
CNC mode:   This function can be used in any CNC mode.
                                        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.
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.
                                        672
    short     iopt;     /* Number of DI/DO points(I/O card)     */
    short     hdiio;    /* Existence of LSI for high-speed      */
                   /*               skip(I/O card) */
                              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)
                            674
drmmrc            Capacity of additional DRAM for management
                                    software(PMC-RC)
                  -1 : Not existence       0 : Existence
                              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)
                     676
            dmaare           Existence of additional board for DMA(PMC-RE)
                             -1 : Not existence       0 : Existence
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
      * 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
                             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
* 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.
                                        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.
                                         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)
                            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.
     (As for the details, see "Return status of CNC data window" in "General
     Description".)
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                         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
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
     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
                                  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+-----------+
                                  698
alarminfo
      Pointer to the ALMINFO structure including the alarm
      information. The ALMINFO structure is as follows.
                                  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.
                                        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.
                                        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
                                  702
     raux1       Use for reading other than G code at a time.
- 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
     -------+-------+---------------+-------+-------+------
                                  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
     -------+-------+---------------+---------------+-------+--------
          7   6   5   4   3   2   1   0
       +---+---+---+---+---+---+---+---+
     +-- * |    Code in each group     | : 1 byte
     | +---+---+---+---+---+---+---+---+
     +----+-----> 0 : Not under command in the present block
          +-----> 1 : Under command in the present block
     N090 G18 ;
     N100 G1 Z100. ;
     N110 G17 G2 X10. Y-20. R12. ;
                                  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.
- 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.
        +-------------------------------+
        |            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
            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
                                         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.
                                        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".
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        716
length        Specify the data block length(size of ODBDGN structure).
         (4+(byte size of diagnosis)*(number of axis))
              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.
                                        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.
      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.
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.
                                         719
e_number
      Specify the end diagnosis number.
      The last diagnosis number to be read is returned.
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))]
                                     720
     diag   Pointer to the area to store the diagnoses.
            Each diagnosis can be referred by using the ODBDGN structure.
                   Lower byte:axis
                       0        : no axis
                       1,..,m   : 1 axis(m=max. controlled axes)
                       ALL_AXES : all axes(ALL_AXES=-1)
                                         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".
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
     s_number
           Specify the start diagnosis data number.
                                        723
            info[N].diag_no   Setting data number
                        The setting data number which exists actually.
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        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
           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
                                        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
     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 ;
         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.
                                         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.
            Series 150
                     0   :   1st message
                     1   :   2nd message
                     2   :   3rd message
                     3   :   4th message
                     4   :   macro message
                    -1   :   all messages
Series 150
                                             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+-----------------------+ ---
            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 */
                                        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
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                          735
            rstr_bc           Block number is stored.
CNC option: The program restart function and the extended driver/library
            function is necessary.
                                            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.
                                        737
CNC option: The program restart function and the extended driver/library
            function is necessary.
                                        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.
                                        739
CNC option: The program restart function and the extended driver/library
            function is necessary.
                                        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.
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.
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.
                                         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)
            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 ;
                                744
           hndl_mv            Manual handle feed travel distance selection
                        signal is stored.
                        0 : *1
                        1 : *10
                        2 : *100
                                        745
     Others: EW_BUS,   EW_SYSTEM2, EW_HSSB,  EW_HANDLE,   EW_VERSION,
           EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS
                                        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.
Series 150
                                            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 ;
                                748
           rpd_ovrd     Specify the rapid traverse override signal.
                        0 : 100%
                        1 : 50%
                        2 : 25%
                        3 : F0
                                          749
CNC option: The software operator's panel function and the extended
            driver/library function is necessary.
                                        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 ;
                                          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.
                                        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 ;
                                          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.
CNC option: The software operator's panel general SW function and the
            extended driver/library function is necessary.
                                        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.
                                             755
                       The specified name is set.
                       For the end of name(sgnl?_name[8]),
                       NULL character('\0') is set.
                                        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.
                                             757
                       Specify the general signal name.
                       Eight characters from the top of each name
                             (sgnl?_name[0] - sgnl?_name[7])
                       is set in CNC.
                                        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.
                                        759
CNC option: This function needs the menu switch option and the extended
            driver/library option.
                                        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
                                         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
CNC option: This function needs the menu switch option and the extended
            driver/library option.
                                               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.
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.
                                         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|
                       +-----+-------------+-------------+
CNC option: This function needs the cutter compensation(tool nose radius
            compensation) option and the extended driver/library option.
                                        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.
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.
                                         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 ;
                                         767
act_cnt          Current number of repeats is set.
                            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.
CNC option: This function needs the canned cycle option and the extended
            driver/library option.
                                         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.
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.
                                          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|
                         +-----+-------------+-------------+
CNC option: This function needs the coordinate rotation option and the
            extended driver/library option.
                                         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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        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.
                                          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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        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.
CNC option: This function needs the programmable mirror image option and
            the extended driver/library option.
                                        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.
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.
                                         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.
CNC option: This function needs the scaling option and the extended
            driver/library option.
                                         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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        778
     Others: EW_BUS,   EW_SYSTEM2, EW_HSSB,  EW_HANDLE,   EW_VERSION,
           EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS
                                        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.
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.
                                        780
CNC option: This function needs the extended driver/library option.
                                        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.
     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
                                        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.
 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
                                  783
     Series 160/180/210,NC board
                       [mm] [inch]
           ---------------+-------+--------
           IS-A        2     3
           IS-B        3     4
           IS-C        4     5
       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
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.
                                        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.
                                        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.
                                        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.
                                          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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                            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.
      (As for the details, see "Return status of CNC data window" in "General
      Description".)
                                        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.
      (As for the details, see "Return status of CNC data window" in "General
      Description".)
                                        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.
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                         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".
                                          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.
Arguments:
      FlibHndl    Identify the process which uses the library.
                  See "Library handle" for details.
                                         796
                          } IODBTIMER ;
                                          797
1.1.18 Function Reference Related to PMC
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.
                                        798
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
            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.
                                          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.
                                        800
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
            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.
                                          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.
                                        802
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        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.
                                        804
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
                                        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.
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.
(*) 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>
(*) 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.
(*) 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.
                                   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.
                                        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.
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
            datano_s
                  Specify the start PMC address number.
            datano_e
                  Specify the end PMC address number.
                                         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
                                        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
                                        812
     Others: EW_BUS,   EW_SYSTEM2, EW_HSSB,  EW_HANDLE, EW_VERSION,
           EW_UNEXP, EW_SYSTEM, EW_PARITY, EW_MMCSYS
                                        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).
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.
           info         0+-----------+
                         | tbl_prm |
                        1+-----------+
                         | data_type |
                        2+-----------+-----------+
                         |       data_size       |
                        4+-----------------------+
                         |       data_dsp        |
                        6+-----------------------+
                         |         dummy         |
                         8+-----------------------+
                                           814
     pmccntl     Pointer to the IODBPMCCNTL structure including the control data
           of PMC data table. The IODBPMCCNTL structure is as follows.
                                          815
CNC option: The extended driver/library function is necessary.
                                        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).
Arguments:
      FlibHndl
            Identify the process which uses the library.
            See "Library handle" for details.
            info        0+-----------+
                         | tbl_prm |
                        1+-----------+
                         | data_type |
                        2+-----------+-----------+
                         |       data_size       |
                        4+-----------------------+
                         |       data_adr        |
                        6+-----------------------+
                         |         dummy         |
                        8+-----------------------+
                                            817
     pmccntl     Pointer to the IODBPMCCNTL structure to be set the control data
           of PMC data table. The IODBPMCCNTL structure is as follows.
                                        818
            EW_NOOPT   no option
                       The extended driver/library function is
                       necessary.
                                        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.
                                        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.
                                        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.
                                        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.
                                        824
CNC option: This function relates to the following CNC option.
                                        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.
            EW_NOOPT    No option
                            This function needs the extended backup memory
                        option.
                                         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.
                                         828
GE Fanuc Automation North America, Inc., Charlottesville Virginia