News CNCnetPDM About us Support  
       
  

CNC_RDWAVEDATA | WAVE

TOP

Description

Reads waveform diagnosis data.

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

In case that the waveform diagnosis parameter is changed, the correct data cannot be read if cnc_wavestart function is not executed.
MTConnect Fanuc Adapter

Universal Fanuc Driver

Fanuc Focas Library CD

Declaration

#include "fwlib32.h"

FWLIBAPI short WINAPI cnc_rdwavedata(unsigned short FlibHndl, short channel, short axis, long rd_pntr, long *number, ODBWVDT *wvdt);

Arguments

FlibHndl   [ in ]

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

channel   [ in ]

Specify the channel number to be read.

Series 15 : 0,..,3, 6,..,11
Series 15i : 0,..,3, 8,..,11
Series 16/18, 16i/18i/21i, 0i : 0,..,7
Series 16i/18i-W : 6, 7
axis   [ in ]

Specify axis number of data to be read.(1 to number of controlled axis)
This is invalid except channel number 0 to 5.
In case of Series 16/18, 16i/18i/21i, 0i, and Series 15/15i, 16i/18i-W, this is not used.

rd_pntr   [ in ]

Specify the start pointer to read.

example)
In case of the top, '0' should be specified.
In case of the 10th from the top, '9' should be specified.
number   [ in/out ]

Specify the address of the variable which shows the number of data of the waveform diagnosis data.
Set the read number of data to this variable(*number).
After executing this function, the number of data which has been read actually is set.

The maximum data number which can be sampled is shown in the following table according to the condition and the CNC MODEL.

MODEL Series 16/18, 16i/18i/21i, 0i Series 15 Series 15i
condition 0/1/2 100/101/102 0/1/2 100/101/102
maximum number(n) 4096 8192 prm.15#6=
0:1000
1:5000
2000 5001
wvdt   [ out ]

Pointer to the ODBWVDT structure including the waveform diagnosis data.
The ODBWVDT structure is as follows.


typedef struct odbwvdt {
    short   channel ;   /* channel number */
    short   kind ;      /* kind of waveform data */
    union {
        short   axis ;  /* axis number of waveform data */
        struct {        /* machine signal */
            char    adr ; /* kind of PMC address */
            char    bit ; /* bit number */
            short   no ;  /* PMC address number */
        } io ;
    } u ;
    char    year ;              /* year (0<->99) */
    char    month ;             /* month (1<->12) */
    char    day ;               /* day (1<->31) */
    char    hour ;              /* hour (0<->23) */
    char    minute ;            /* minute (0<->59) */
    char    second ;            /* second (0<->59) */
    short   t_cycle ;           /* sampling cycle (msec) */
    short   data[8192] ;        /* waveform diagnosis data */
} ODBWVDT ;
channel
channel number
The channel number which has been read actually is set.

kind
kind of waveform data
Refer to the kind of waveform data in cnc_rdwaveprm function.
  • In case that "kind" is except 13(machine signal)
  • axis
    axis number of waveform data( Series 15/15i )
    axis number of waveform data
    0,..,7 1 to number of controlled axis : axis number
    9 1 to number of path : path number
    10,..,11 1 to number of spindle : spindle number
    axis number of waveform data( Series 16/18, 16i/18i/21i, 0i )
    channel numberkind of waveform data
    0,..,51,..,number of controlled axis : axis number
    6, 70,..,3, 5,..,71,..number of controlled axis : axis number
    6, 710, 111,..number of spindle : spindle number

  • In case that "kind" is 13(machine signal)
  • adr
    kind of PMC address of machine signal
    The kind of the PMC address which is traced is stored with ASCII code.
    kind of PMC address to be set : G, F, Y, X
    bit
    bit number of machine signal
    The bit number of PMC address which is traced is stored.
    range of bit number which is stored : 0,..,7
    no
    number of PMC address of machine signal
    The PMC address number which is traced is stored.
    The range of stored number is shown in pmc_rdpmcrng

year, month, day, hour, minute, second
If condition is 0,..,20, these are the date when sampling is started.
If condition is 100,..,120, these are the date when sampling is stopped.
year Year (0,..,99)
month Month (1,..,12)
day Day (1,..,31)
hour Hour (0,..,23)
minute Minute (0,..,59)
second Second (0,..,59)

t_cycle
sampling cycle (msec)
MODE Series 16/18, 16i/18i/21i, 0i Series 15 Series 15i
condition 0/1/2 100/101/102 0/1/2 100/101/102 kind is except 13 kind is 13
cycle 2 8 2/4/8/16 8 2/4/8/16 8/16

data
waveform diagnosis data
The data which is specified by "kind" is stored.(In case of kind=13, this is 0/1. Othewise, this is binary data)
Concerning the unit, etc., refer to the kind of the waveform data in cnc_rdwaveprm function.

Summary of the reading data

  • In case that "kind" is except 13(machine signal)
  • structure membarsizekindeffecitve range(binary)
    channel 2 channel number0,..,
    kind 2 kind of waveform data0,..,12
    axis 2 axis number of waveform data1,..,number of controlled axis
    (dummy) 2
    year 1 year 0,..,99
    month 1 manth 1,..,12
    day 1 day 1,..,31
    hour 1 hour 0,..,23
    minute 1 minute 0,..,59
    second 1 second 0,..,59
    t_cycle 2 sampling cycle 2/4/8/16(ms)
    data[0] 2 waveform diagnosis data
    data[1] 2 waveform diagnosis data
      :  :  :
    data[n-1]2 waveform diagnosis data
  • In case that "kind" is 13(machine signal)
  • structure membersizekindeffecitve range(binary)
    channel 2 channel number 6,..,
    kind 2 kind of waveform data 13
    adr 1 kind of PMC address of machine signalASCII code(G,F,Y,X)
    bit 1 bit number of machine signal0,..,7
    no 2 PMC address number0,..,
    year 1 year 0,..,99
    month 1 manth 1,..,12
    day 1 day 1,..,31
    hour 1 hour 0,..,23
    minute 1 minute 0,..,59
    second 1 second 0,..,59
    t_cycle 2 sampling cycle 2/4/8/16(ms)
    data[0] 2 waveform diagnosis data0 or 1
    data[1] 2 waveform diagnosis data0 or 1
      :  :  :  :
    data[n-1]2 waveform diagnosis data0 or 1

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_FUNC
(1)
function is not executed
cnc_wavestop function has not been executed.
EW_LENGTH
(2)
data block length error
The number of data(*number) is less than 1.
EW_NUMBER
(3)
data number error
Channel number(channel) is out of range.
EW_ATTRIB
(4)
data attribute error
Axis number(axis) is out of range.
EW_DATA
(5)
data error
Start pointer to read(rd_pntr) is out of range.
EW_NOOPT
(6)
no option
The extended driver/library function is necessary.
EW_PARAM
(9)
CNC parameter error( Series 16/18, 16i/18i/21i, 0i )
3112#0=0 when CNC is turned on.
set 3112#0=1 and reboot.
EW_BUFFER
(10)
buffer empty
There is no specified waveform diagnosis data.
(The case that the condition of a waveform diagnosis does not correspond to the specified channel number is included.)

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) - - O O 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_wrwaveprm2   cnc_wavestart   cnc_wavestop   cnc_wavestat  

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_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 | cnc_wrwaveprm2

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

Fanuc Focas Library | Wave | flist_Wave

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