NewsCNCnetPDMAbout usSupport
  

CNC_WRWAVEPRM2 | WAVE

Description

Writes the waveform diagnosis parameter.

In case of using this function, the waveform diagnosis screen of CNC must not be used.
If used, the behavior of this function is not guaranteed.
MTConnect Fanuc Adapter

Universal Fanuc Driver

Fanuc Focas Library CD

Declaration

#include "fwlib32.h"

FWLIBAPI short WINAPI cnc_wrwaveprm2(unsigned short FlibHndl, IODBWVPRM *wave );

Arguments

FlibHndl   [ in ]

Specify the library handle.
See "Library handle" for details.

wave   [ in ]

Pointer to the IODBWVPRM structure including the waveform diagnosis parameter.
The IODBWVPRM structure is as follows.


typedef struct iodbwvprm {
    short   condition ; /* condition */
    char    trg_adr ;   /* trigger address */
    char    trg_bit ;   /* trigger bit */
    short   trg_no ;    /* trigger number */
    short   reserve1 ;
    long    delay ;     /* delay time */
    long    t_range ;   /* sampling time */
    struct {
        short   kind ;  /* kind of waveform data */
        union {
            long        axis ;  /* axis information */
            struct {            /* machine signal */
                char    adr ;   /* kind of PMC address */
                char    bit ;   /* bit number */
                short   no ;    /* number of PMC address */
            } io ;
        } u ;
        long    reserve2 ;
    } ch[12] ;
} IODBWVPRM ;
condition
data sampling condition
One of the following condition is stored.
0 : The sampling of the data is started by cnc_wavestart function, and stopped after the specified sampling time.
1 to 20 : The sampling of the data is started when the trigger event occurs after calling cnc_wavestart function, and stopped after the specified sampling time.
The trigger events are the followings.
1:Machine signal on
2:Machine signal off
3:Change of the machine signal state(only Series 15i)
10 :Servo alarm (only Series 15i)
11 :Servo alarm or machine signal on (only Series 15i)
12 :Servo alarm or machine signal off(only Series 15i)
13 :Servo alarm or change of the machine signal state(only Series 15i)
20 :The trigger event is not specified.(only Series 15i)
100 to 120:The sampling of the data is started by cnc_wavestart function, and stopped when the trigger event occurs.
The trigger events are the followings.
100:Servo alarm
101:Servo alarm or machine signal on
102:Servo alarm or machine signal off
103:Servo alarm or change of the machine signal state(only Series 15i)
111:Machine signal on(only Series 15i)
112:Machine signal off(only Series 15i)
113:Change of the machine signal state(only Series 15i)
120:The trigger event is not specified.(only Series 15i)
* In case of Series 16/18, 0i, the waveform data under the condition 100,101,102 is backupped even if the power is off.

trg_adr
kind of PMC address of trigger machine signal
The kind of PMC address which corresponds to machine signal for a trigger event is stored with ASCII code.
It is valid when condition is 1/2/3/11/12/13/101/102/103/111/112/113.
Kind of stored PMC address : "G","F","Y","X"
When the machine signal for a trigger event is not be specified, NULL(0x00) is stored.

trg_bit
bit number of trigger machine signal
The bit number of PMC address which corresponds to machine signal for a trigger event is stored.
It is valid when condition is 1/2/3/11/12/13/101/102/103/111/112/113.
Range of stored bit number : 0,..,7

trg_no
number of PMC address of trigger machine signal
The PMC address number which corresponds to machine signal for a trigger event is stored.
It is valid when condition is 1/2/3/11/12/13/101/102/103/111/112/113.
Range of stored number is shown in pmc_rdpmcrng function reference.

delay
delay time
After the stop condition is satisfied and this delay time has passed, the sampling is stopped.
range
Series 15 0,..,32000
Series 15i 0,..,160000
Series 16/18, 16i/18i/21i, 0i0,..,32760
unit 1 msec
It is valid when the condition is 100/101/102/103/111/112/113.

t_range
sampling time
Sampling time is stored.
range
Series 1525/50/100/200/400/800 show the following time respectively.
500/1000/2000/4000/8000/16000
Series 15i10,..,80000
Series 16/18, 16i/18i/21i, 0i10,..,8192
unit 1 msec
It is valid on all conditions.

ch[n].kind
kind of waveform data (n is channel number 0,..,11)
An available channel and the kind of the waveform data are as follows according to the CNC MODEL and the condition.
channel No (n) ch[n].kind
(kind of waveform data)
Series 16/18, 16i/18i/21i, 0i Series 15 Series 15i
0 0 (condition is 100/101/102) 0,..,2, 4,..,7 (condition is 100/101/102) 0,..,2, 4,..,7, 9,..,11 (wave 1)
1 1 (condition is 100/101/102) 0,..,2, 4,..,7 (condition is 100/101/102) 0,..,2, 4,..,7, 9,..,11 (wave 2)
2 2 (condition is 100/101/102) 0,..,2, 4,..,7 (condition is 100/101/102) 0,..,2, 4,..,7, 9,..,11 (wave 3)
3 5 (condition is 100/101/102) 0,..,2, 4,..,7 (condition is 100/101/102) 0,..,2, 4,..,7, 9,..,11 (wave 4)
4 6 (condition is 100/101/102) not used not used
5 7 (condition is 100/101/102) not used not used
6 0,..,3, 5,..,7, 9,..,13 (condition is 0/1/2) 0,..,2, 4,..,7, 9,..,11 (condition is 0/1/2) not used
7 0,..,3, 5,..,7, 9,..,13 (condition is 0/1/2) 0,..,2, 4,..,7, 9,..,11 (condition is 0/1/2) not used
8 not used 13 (condition is 0/1/2) 13 (signel 1)
9 not used 13 (condition is 0/1/2) 13 (signel 2)
10 not used 13 (condition is 0/1/2) 13 (signel 3)
11 not used 13 (condition is 0/1/2) 13 (signel 4)
    * If "-1" is stored in ch[n].kind, the data of its channel is invalid.
    (The value of "kind" concerning an unused channel is indefinite.)
    * Select a following member of union properly according to the value of ch[n].kind.
    ch[n].u.axis kind : except '13'
    ch[n].u.io kind : '13'

Kind of waveform data (O:available,X:not available)
number meaning unit Series 16/18, 16i/18i/21i, 0i Series 15 Series 15i
0/1/2 100/101/102 0/1/2 100/101/102
-1No data- OOOOO
0Servo error(8msec)Pulse(detection unit) OOOOO
1Number of servo pulses to be generatedPulse(detection unit) OOOOO
2Servo torque%(max. current ratio) OOOOO
3Servo error(2msec)Pulse(detection unit) OXXXX
4Number of servo pulses after acceleration,decelerationPulse(detection unit) XXOOO
5Actual speed RPM OOXXX
Pulse(detection unit) XXOOO
6Value of the electric current command for servo%(max. current ratio) OOOOO
7Data during heat simulation%(OVC alarm ratio) OOOOO
9Composite speed for 1st,2nd,3rd axisPulse(detection unit) OXXXX
Composite speed for all axesMM/MIN,INCH/MIN or RPM XXOXO
10Spindle speed%(max. spin ratio) OXXXX
RPM XXOXO
11Load meter for spindle%(max. output ratio) OXOXO
12Difference of spindle conversion errorPulse(detection unit) OXXXX
13on/off state of specified machine signal- OXOXO

ch[n].u.axis
axis information of waveform data
Axis information of waveform data is stored.
It is valid when the kind of waveform data is expect '13'.
Axis information of Series 15/16/18, Series 15i/16i/18i/21i, 0i, are as follows.
  • Series 15
  • kind of waveform data value of ch[n].axis
    (axis information of waveform data)
    0,..,2
    4,..,7
    bit 0 ON:first axis designation
    bit 1 ON:second axis designation
       :
    bit 22 ON:23rd axis designation
    bit 23 ON:24th axis designation
    bit 24,..,31:not used
    9
    bit 0 ON:first path designation
    bit 1 ON:second path designation(only 15TT)
    bit 2,..,31:not used
    10,..,11
    bit 0 ON:first spindle designation
    bit 1 ON:second spindle designation
    bit 2,..,31:not used

  • Series 15i
  • kind of waveform data value of ch[n].axis
    (axis information of waveform data)
    0,..,2
    4,..,7
    bit 0 ON:first axis designation
    bit 1 ON:second axis designation
       :
    bit 22 ON:23rd axis designation
    bit 23 ON:24th axis designation
    bit 24,..,31:not used
    9
    bit 0 ON:first path designation
    bit 1 ON:second path designation
    (only existing second path)
    bit 2,..,31:not used
    10,..,11
    bit 0 ON:first spindle designation
    bit 1 ON:second spindle designation
    bit 2 ON:third spindle designation
    bit 3 ON:fourth spindle designation
    bit 4,..,31:not used

  • Series 16/18, 16i/18i/21i, 0i
  • channel The kind of waveform data value of ch[n].axis
    (axis information of waveform data)
    0,..,5 -
    bit 0 ON:first axis designation
    bit 1 ON:second axis designation
       :
    bit 7 ON:eighth axis designation
    bit 8,..,31:not used
    6, 7 0,..,3
    5,..,7
    bit 0 ON:first axis designation
    bit 1 ON:second axis designation
       :
    bit 7 ON:eighth axis designation
    bit 8,..,31:not used
    10,..,11
    bit 0 ON:first spindle designation
    bit 1 ON:second spindle designation
    bit 2 ON:third spindle designation
    bit 3,..,31:not used

    * n = maximum controlled axes

    ch[n].u.io.adr
    Kind of PMC address of machine signal
    The kind of PMC address which corresponds to machine signal to trace is stored with ASCII code.
    It is valid when the kind of waveform data is 13.
    Kind of stored PMC address : "G","F","Y","X"

    ch[n].u.io.bit
    bit number of machine signal
    The bit number of PMC address which corresponds to machine signal to trace is stored.
    It is valid when the kind of waveform data is 13.
    Range of stored bit number : 0,..,7

    ch[n].u.io.no
    number of PMC address of machine signal
    The PMC address number which corresponds to machine signal to trace is stored.
    It is valid when the kind of waveform data is 13.
    Range of stored number is shown in pmc_rdpmcrng function reference.

    Return

    EW_OK is returned on successful completion, otherwise any value except EW_OK is returned.

    The major error codes are as follows.

    Return code Meaning/Error handling
    EW_DATA
    (5)
    data error In order to get more information for this err_no(nErr_no) return value, execute cnc_getdtailerrfunction.
    The following detail status will be set onto the member, err_no of ODBERR structure (nErr_no of ODBERR user define type.).
    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
    And the channel number (0 to 11) including incorrect data will be set onto the member, err_dtno of ODBERR.
    (In case that a date is not related to channel, -1 is set)
    EW_NOOPT
    (6)
    No option
    The extended driver/library function is necessary.
    EW_PARAM
    (9)
    CNC parameter error (only Series 16/18, 16i/18i/21i, 0i )
    3112#0=0 when CNC is turned on. Set 3112#0=1 and reboot.
    EW_REJECT
    (13)
    CNC execution rejected (only Series 16/18, 16i/18i/21i, 0i )
    The waveform diagnosis data is being sampled.

    As for the other return codes or the details, see "Return status of Data window function"

    CNC option

    For HSSB connection,

      The extended driver/library function is necessary.

    For Ethernet connection,

      The Ethernet function and the extended driver/library function are necessary.

      However, in case of Series 16i/18i/21i-B, 0i-B/C, the required CNC option is as follows.

      When Embedded Ethernet is used,

        above two optional functions are not required.

      When Ethernet board is used,

        only Ethernet function is required.

    CNC parameter

    This function is related to the following CNC parameter.
    See the manual of CNC parameter for details.

    • Series 16/18, 16i/18i/21i, 0i
    • 3112#0=1 (must be set)

    CNC mode

    This function can be used in any CNC mode.

    Available CNC

    0i-A 0i-B/C(Note) 0i-D 0i-F 15 15i 16 18 21 16i-A 18i-A 21i-A 16i-B 18i-B 21i-B 30i-A 30i-B
    M (Machining)H O X X H O H H X O O O O O O X X
    T (Turning) H O X X H - H H X O O O O O O X X
    LC (Loader) - - - - - - X X X X X X X X X - -

    0i-D0i-F16i18i30i-A30i-B
    P (Punch press)X X O O - X
    L (Laser) - - O - - X
    W (Wire) - - X X X X


    Power Mate i-DX
    Power Mate i-HX
    Power Motion i-AX

    "O" : Both Ethernet and HSSB
    "E" : Ethernet
    "H" : HSSB
    "X" : Cannot be used
    "-" : None

    Note) 0i-C does not support the HSSB function.

    See Also

    cnc_rdwaveprm   cnc_rdwaveprm2   cnc_wrwaveprm   cnc_wavestart   cnc_wavestop   cnc_wavestat   cnc_rdwavedata  

    Privacy notice

    This website uses cookies. By continuing to use it you agree to our privacy policy. 

    https://www.inventcom.net/fanuc-focas-library/wave/cnc_wrwaveprm2

    Fanuc Focas Library | Wave | cnc_rdwavedata

    Reads waveform diagnosis data. In case of using this function, the waveform diagnosis screen of CNC must not be used.... [read more]
    Fanuc Focas Library | Wave | cnc_rdwavedata

    Fanuc Focas Library | Wave | cnc_rdwaveprm

    Reads the waveform diagnosis parameter setting.... [read more]
    Fanuc Focas Library | Wave | cnc_rdwaveprm

    Fanuc Focas Library | Wave | cnc_rdwaveprm2

    Reads the waveform diagnosis parameter setting. In case of using this function, the waveform diagnosis screen of CNC must not be used.... [read more]
    Fanuc Focas Library | Wave | cnc_rdwaveprm2

    Fanuc Focas Library | Wave | cnc_wavestart

    Starts a sampling of the waveform diagnosis data. In case of using this function, the waveform diagnosis screen of CNC must not be used.... [read more]
    Fanuc Focas Library | Wave | cnc_wavestart

    Fanuc Focas Library | Wave | cnc_wavestat

    Reads the sampling status of the waveform diagnosis data. In case of using this function, the waveform diagnosis screen of CNC must not be... [read more]
    Fanuc Focas Library | Wave | cnc_wavestat

    Fanuc Focas Library | Wave | cnc_wavestop

    Stops a sampling of the waveform diagnosis data. In case of using this function, the waveform diagnosis screen of CNC must not be used.... [read more]
    Fanuc Focas Library | Wave | cnc_wavestop

    Fanuc Focas Library | Wave | cnc_wrwaveprm

    Writes the waveform diagnosis parameter. cnc_wrwaveprm2... [read more]
    Fanuc Focas Library | Wave | cnc_wrwaveprm

    Fanuc Focas Library | Wave | flist_Wave

    CNC: Function related to waveform diagnosis... [read more]
    Fanuc Focas Library | Wave | flist_Wave
    Modified: 2023-12-05