/*-------------------------------------------------------------------*/
/* fwlib32.h */
/* */
/* CNC/PMC Data Window Library for FOCAS1 and FOCAS2 */
/* */
/* Copyright (C) 2003-2012 by FANUC CORPORATION All rights reserved. */
/* */
/*-------------------------------------------------------------------*/
#ifndef _INC_FWLIB
#define _INC_FWLIB
#if defined (_WIN32) || defined (_WIN32_WCE)
#include <windows.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
#if defined (_WIN32) || defined (_WIN32_WCE)
#if !defined(_FWLIBDLL_)
#define FWLIBAPI __declspec(dllimport)
#else
#define FWLIBAPI __declspec(dllexport)
#endif
#else
#define FWLIBAPI
#define WINAPI
#define HWND int
#endif
/*
Axis define
*/
/* machine information for FS300i/310i/320i */
#define HSSB_LIB
#define FS30D
#if defined (F22_TYPE5)
#define MAX_AXIS 48
#define MAX_SPINDLE 16
#else
#define MAX_AXIS 32
#define MAX_SPINDLE 8
#endif
#if !defined (MAX_AXIS)
#if defined (F22_TYPE5) || !defined(CNC_PPC)
#define MAX_AXIS 48
#else
#define MAX_AXIS 32
#endif
#endif
#if !defined (MAX_SPINDLE)
#if defined (F22_TYPE5) || !defined(CNC_PPC)
#define MAX_SPINDLE 16
#else
#define MAX_SPINDLE 8
#endif
#endif
#define MAX_AXISNAME 4
#define ALL_AXES (-1)
#define ALL_SPINDLES (-1)
/*
Program lock define
*/
#define MAX_LOCK_PROG 12 /* Program lock max num */
/*
Error Codes
*/
#define EW_PROTOCOL (-17) /* protocol error */
#define EW_SOCKET (-16) /* Windows socket error */
#define EW_NODLL (-15) /* DLL not exist error */
#define EW_INIERR (-14) /* error in APi library inital valiefile */
#define EW_ITLOW (-13) /* low temperature alarm of intelligent terminal */
#define EW_ITHIGHT (-12) /* hight temperature alarm of intelligent terminal */
#define EW_BUS (-11) /* bus error */
#define EW_SYSTEM2 (-10) /* system error */
#define EW_HSSB (-9) /* hssb communication error */
#define EW_HANDLE (-8) /* Windows library handle error */
#define EW_VERSION (-7) /* CNC/PMC version missmatch */
#define EW_UNEXP (-6) /* abnormal error */
#define EW_SYSTEM (-5) /* system error */
#define EW_PARITY (-4) /* shared RAM parity error */
#define EW_MMCSYS (-3) /* emm386 or mmcsys install error */
#define EW_RESET (-2) /* reset or stop occured error */
#define EW_BUSY (-1) /* busy error */
#define EW_OK 0 /* no problem */
#define EW_FUNC 1 /* command prepare error */
#define EW_NOPMC 1 /* pmc not exist */
#define EW_LENGTH 2 /* data block length error */
#define EW_NUMBER 3 /* data number error */
#define EW_RANGE 3 /* address range error */
#define EW_ATTRIB 4 /* data attribute error */
#define EW_TYPE 4 /* data type error */
#define EW_DATA 5 /* data error */
#define EW_NOOPT 6 /* no option error */
#define EW_PROT 7 /* write protect error */
#define EW_OVRFLOW 8 /* memory overflow error */
#define EW_PARAM 9 /* cnc parameter not correct error */
#define EW_BUFFER 10 /* buffer error */
#define EW_PATH 11 /* path error */
#define EW_MODE 12 /* cnc mode error */
#define EW_REJECT 13 /* execution rejected error */
#define EW_DTSRVR 14 /* data server error */
#define EW_ALARM 15 /* alarm has been occurred */
#define EW_STOP 16 /* CNC is not running */
#define EW_PASSWD 17 /* protection data error */
#define EW_PMC 18 /* error generated by PMC */
#define EW_PMCHANDLE 19 /* PMC handle error */
#define EW_RD_OVWSTP 20 /* overwrite stop in program read */
#define EW_RD_RSTFIN 21 /* reset interrupt in program read */
/*
Result codes of DNC operation
*/
#define DNC_NORMAL (-1) /* normal completed */
#define DNC_CANCEL (-32768) /* DNC operation was canceled by CNC */
#define DNC_OPENERR (-514) /* file open error */
#define DNC_NOFILE (-516) /* file not found */
#define DNC_READERR (-517) /* read error */
/*
Option name for cnc_getlibopt / cnc_setlibopt
*/
#define LIB_MODE 0
#define MOVE_RDPRGPTR 1
#define PRM_ALLPATH 2
#define UPLOAD_M02M99 3
#define MSG_NOCTRL 4
#define DIAM_RAD_SWITCH 5
#define MSG_CONV 6
#define ASYNC_READ_PROG3 7
#define UP_DNLOAD_EDT 8
#define PROG_WORD_SRCH 9
#define ONUM_ZERO_SUP 10
#define LONG_ISE_FIG 11
#define INT_CHK_UNIT 12
#define HZR_PRM_WR_SKIP 13
#define SLVSRAM_ACCESS 14
#define GET_SMTCP_STAT 15
#define TLIFE_OPTION 16
#define SVGD_MATE_PUNCH 17
#define READ_FLD_ON 18
#define DELETE_RECURSIVE 19
#define READ_ORIG_OPT 20
#define SVGD_MATE_ORIGIN 21
#define PUN_SFZN_MDP 22
#define PAXIS_PATH 23
#define AXDATA_G198 24
#define BG_EDIT_SIGNAL 25
#define UPLOAD_BG 26
#define TDATA_EXTRACT 27
#define PROG_CHECK_CMNT 28
#define LEVEL8_PROTECT 32
#define PGLOCK_TYPE 64
#define TLIFE_TOOL0 128
#define OPPROG_DSP 256
#define OPPROG_MODE 512
#define PROGRAM_CHECK 1024
#define CZPP_NEDPP 2048
#define MULTI_PATH_MIX_AXIS_NAME 4096
/*
Work-piece setting
*/
#define WSETER_GRP 8
#define WSETER_DATA 8
/*
3D interference check
*/
#define MAX_POS_BUF 2
/* cnc_rdtlgeomsize:read tool geom size data */
#define TLGS_EMP 0x7FFFFFFF
/*
cnc_data_copy
*/
#define DC_PRM 1 /* parameter */
#define DC_OFS 2 /* offset */
#define DC_WKZ 3 /* work zero offset */
#define DC_MAC 4 /* macro value */
#define DC_PCD 5 /* P-CODE macro value */
#define DC_RTM 6 /* RTM value */
/*--------------------*/
/* */
/* Structure Template */
/* */
/*--------------------*/
/*-------------------------------------*/
/* CNC: Control axis / spindle related */
/*-------------------------------------*/
#ifdef _MSC_VER
#pragma pack(push, 4)
#endif
/* cnc_actf:read actual axis feedrate(F) */
/* cnc_acts:read actual spindle speed(S) */
typedef struct odbact {
short dummy[2] ; /* dummy */
long data ; /* actual feed / actual spindle */
} ODBACT ;
/* cnc_acts2:read actual spindle speed(S) */
/* (All or specified ) */
typedef struct odbact2 {
short datano; /* spindle number */
short type; /* dummy */
long data[MAX_SPINDLE]; /* spindle data */
} ODBACT2 ;
/* cnc_absolute:read absolute axis position */
/* cnc_machine:read machine axis position */
/* cnc_machine2:read machine axis position(2) */
/* cnc_relative:read relative axis position */
/* cnc_distance:read distance to go */
/* cnc_skip:read skip position */
/* cnc_srvdelay:read servo delay value */
/* cnc_accdecdly:read acceleration/deceleration delay value */
/* cnc_absolute2:read absolute axis position 2 */
/* cnc_relative2:read relative axis position 2 */
/* cnc_absolute_bg:read absolute axis position (BG) */
/* cnc_relative_b
评论1
最新资源