News CNCnetPDM About us Support  
         
  

CNC_SDTSETCHNL2 | MOTOR

Description

The channel data for the sampling of various data are set.

The setting to acquire servo, spindle information and ,in addition, PMC signal and CNC information can be set by this function.

The condition to acquire servo, spindle information is same the one of "cnc_sdtsetchnl()".


The data which can be acquired is as follows.

  • Servo data
  • Spindle data
  • PMC data(word type, byte type, bit type)
  • CNC information

?1 PMC signal(bit type) in the channel data for the sampling can be set to only one channel. 16 signals data at most can be set to one channel.However, when PMC signal(byte type, word type) is set to other channel, the number of PMC signal(bit type) can be set is 8 signals at most.

?2 One signal of byte type and word type can be set per one channel.

MTConnect Fanuc Adapter

Universal Fanuc Driver

Fanuc Focas Library CD

Declaration

#include "fwlib32.h" or "fwlib64.h"

FWLIBAPI short WINAPI cnc_sdtsetchnl2(unsigned short FlibHndl, short num, long datanum, IDBSDTCHAN2 *channel);

Arguments

FlibHndl   [ in ]

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

num   [ in ]

Specify the number of channels.

datanum   [ in ]

Specify the number of total points of the data which wants to be sampled. (Specify the value of eight or more.)
Acquire data sequentially from the function which read sampling data(cnc_sdtreadsmpl2).
When -1 is specified, the limitation of a total number is lost.

channel   [ in ]

Pointer to the IDBSFBCHAN2 structure including the channel data.

Prepare the number of the channel data which you want to set as an array, and specify the top pointer of the array for this argument(channel).

The structure of IDBSFBCHAN2 is as follows.

typedef struct idbsdtchan {
    short           type;       /* data type */
    char            chno;       /* channel number */
    char            axis;       /* axis number */
    unsigned short  shift;      /* upper byte :sampling period, 
                                                 lower byte :right shift value */
    typedef struct pmc_data{    /* PMC signal */
        short unittype;         /* PMC path (unit type)  */
        char adr;               /* kind of PMC address */
        unsigned char bit;      /* bit number */
        unsigned short no;      /* PMC address number */
    } io[16]; 
} IDBSDTCHAN2;
type
Specify the sampling data type.
? When the sampling axis number is PMC signal(-125,-126,-127), type is invalid.

In case of CNC information, specify as follows.
1: Program number(O number)
2: Sequence number(N number)
chno
Specify the channel number(1-8).
axis
Specify the sampling axis number.
In case of PMC signal, specify as follows.
-125: PMC signal(word type) (enable in 30i-B or later)
-126: PMC signal(byte type) (enable in 30i-B or later)
-127: PMC signal(bit type)

In case of CNC information, specify as follows.
101-115: CNC information(PATH1~PATH15)
shift
Specify sampling period at upper byte and right shift value at lower byte.
? When the sampling axis number is PMC signal(-125,-126,-127) and CNC information, right shift value is invalid.

The member of the io structure is as follows.

unittype
PMC path (unit type)
0:not sampled (at this bit position)
1:1st PMC(include PMC-L)
2:2nd PMC(optional)
3:3rd PMC(optional)
4:4th PMC(optional)
5:5th PMC(optional)
9:Dual-check safety PMC(optional)
adr
kind of PMC address
0:G(Signal to PMC->CNC)
1:F(Signal to CNC->PMC)
2:Y(Signal to PMC->machine)
3:X(Signal to machine->PMC)
4:A(Message display)
5:R(Internal relay)
6:T(Timer)
7:K(Keep relay)
8:C(Counter)
9:D(Data table)
10:M(Input signal from other PMC path)
11:N(Output signal to other PMC path)
12:E(Extra relay)
13:Z(Internal relay)
? Z address can be used when PMC mamory type is C or D.
bit
bit number of PMC address
no
PMC address number

? Input PMC signal data in turn to an array of the io structure of PMC signal. When unittype is set to 0, subsequently PMC signal is invalid.

? When PMC signal is word type or byte type, set bit to 0.

? When PMC signal is word type or byte type, set each member of the io[1]~io[15] structure to 0.

? When the sampling axis number is NOT PMC signal(-125,-126,-127), the io structure of PMC signal is invalid.

? Sampling interval of CNC information is 4msec. So, the same values (4 datas: 1masec, 16 datas: 0.25msec) are output according to the sampling interval.

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_NUMBER
(3)
Data number error
Channel number(num) data is wrong.
EW_DATA
(5)
Data error
In order to get more information for this err_no return value, execute cnc_getdtailerr function.
3:Total point number(datanum) is not 8 or more.
4:The servo motor, spindle or PMC signal of the specified channel cannot be used.
20:Sampling data type(channel.type) is wrong.
21:Channel number(channel.chno) is wrong.
22:Axis number(channel.axis) is wrong.
23:Right shift amount(channel.shift) is wrong.
24:Sampling period(channel.shift) is wrong, or inconsistent between channels.
30:CNC information setting is wrong.
50:PMC signal setting(unit type) is wrong.
51:PMC signal setting(kind of PMC address) is wrong.
52:PMC signal setting(PMC address number) is wrong.
53:PMC signal setting(bit number) is wrong.
54:The number of PMC signal(bit type) is over the limit.
56:PMC signal(bit type) is specified more one channel.
EW_PATH
(11)
Path number error
Path which is corresponding to specified sampling axis number (axis) does not exist.
EW_REJECT
(13)
CNC execution denied
Sampling is already starting.
Execute this function again after executing of cnc_sdtcancelsmpl or cnc_sdtendsmpl.
EW_VERSION
(-7)
Specified data type(axis) is not supported.

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 0i-D/F, Series 30i and PMi-A, 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 not related to CNC parameter.

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)X X X O X X X X X X X X X X X X O
T (Turning) X X X O X - X X X X X X X X X X O
LC (Loader) - - - - - - X X X X X X X X X - -

0i-D0i-F16i18i30i-A30i-B
P (Punch press)X X X X - X
L (Laser) - - X - - 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_sdtclrchnl   cnc_sdtstartsmpl2   cnc_sdtcancelsmpl   cnc_sdtreadsmpl2   cnc_sdtendsmpl2   cnc_sdtread1shot  

Privacy notice

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

https://www.inventcom.net/fanuc-focas-library/motor/cnc_sdtsetchnl2
Fanuc Focas Library | Motor | cnc_loadtorq
Description Reads abnormal load torque data (estimated load torque) of servo motors or spindle motors. Data is stored in ODBLOAD structure in signed binary form. motor... [read more]
cnc_loadtorq
Fanuc Focas Library | Motor | cnc_rdctrldi
Description Reads "control input signal for spindle monitor".... [read more]
cnc_rdctrldi
Fanuc Focas Library | Motor | cnc_rdctrldo
Description Reads "control output signal for spindle monitor".... [read more]
cnc_rdctrldo
Fanuc Focas Library | Motor | cnc_rdcurrent
Description Reads "The servo adjustment real current". When the following parameter is '0', '0' is... [read more]
cnc_rdcurrent
Fanuc Focas Library | Motor | cnc_rdfromservoid2
Description Read specified servo id information from FROM. Each information is stored in member of the ODBCSVID2 structure.... [read more]
cnc_rdfromservoid2
Fanuc Focas Library | Motor | cnc_rdfromspindleid2
Description Read specified spindle id information from FROM. Each information is stored in member of the ODBCSPID2 structure.... [read more]
cnc_rdfromspindleid2
Fanuc Focas Library | Motor | cnc_rdloopgain
Description Reads "The servo adjustment loop gain".... [read more]
cnc_rdloopgain
Fanuc Focas Library | Motor | cnc_rdnspdl
Description Reads the number of spindles which CNC can control. It is not the number of mounted spindles.... [read more]
cnc_rdnspdl
Fanuc Focas Library | Motor | cnc_rdopmode
Description Reads "The operation mode for spindle adjustment".... [read more]
cnc_rdopmode
Fanuc Focas Library | Motor | cnc_rdposerrs
Description Reads "The position deflection S for spindle adjustment". The position deflection S is valid only when... [read more]
cnc_rdposerrs
Fanuc Focas Library | Motor | cnc_rdposerrs2
Description Reads "The position deflection S1, S2 for spindle adjustment" in the synchronous control mode. The... [read more]
cnc_rdposerrs2
Fanuc Focas Library | Motor | cnc_rdposerrz
Description Reads "The position deflection Z for spindle adjustment" in the rigid tapping mode. The position... [read more]
cnc_rdposerrz
Fanuc Focas Library | Motor | cnc_rdservoid2
Description Read specified servo id information from adaptation device. Each information is stored in member of the ODBCSVID2 structure.... [read more]
cnc_rdservoid2
Fanuc Focas Library | Motor | cnc_rdspdlalm
Description Reads the alarm number corresponding to the message of "spindle alarm for spindle monitor".... [read more]
cnc_rdspdlalm
Fanuc Focas Library | Motor | cnc_rdspindleid2
Description Read specified spindle id information from adaptation device. Each information is stored in member of the ODBCSPID2 structure.... [read more]
cnc_rdspindleid2
Fanuc Focas Library | Motor | cnc_rdsrvspeed
Description Reads "The servo adjustment real speed".... [read more]
cnc_rdsrvspeed
Fanuc Focas Library | Motor | cnc_rdsynerrrg
Description Reads "The synchronous error for spindle adjustment" in the rigid tapping mode. The synchronous error... [read more]
cnc_rdsynerrrg
Fanuc Focas Library | Motor | cnc_rdsynerrsy
Description Reads "The synchronous error for spindle adjustment" in the synchronous control mode. The synchronous... [read more]
cnc_rdsynerrsy
Fanuc Focas Library | Motor | cnc_sdtcancelsmpl
Description Cancel of sampling is notified. If you want to cancel the sampling after sampling starts, execute this function. This function can be... [read more]
cnc_sdtcancelsmpl
Fanuc Focas Library | Motor | cnc_sdtclrchnl
Description The channel data setting for sampling is cleared. When you change the channel data number for sampling, beforehand execute this... [read more]
cnc_sdtclrchnl
Fanuc Focas Library | Motor | cnc_sdtendsmpl
Description The end of sampling is notified. In case that the error occurred by cnc_sdtreadsmpl, execute this function.... [read more]
cnc_sdtendsmpl
Fanuc Focas Library | Motor | cnc_sdtendsmpl2
Description The end of sampling is notified. In case that the error occurred by cnc_sdtreadsmpl2, execute this function.... [read more]
cnc_sdtendsmpl2
Fanuc Focas Library | Motor | cnc_sdtread1shot
Description Read the data for 8 channels that are set by cnc_sdtsetchnl function.... [read more]
cnc_sdtread1shot
Fanuc Focas Library | Motor | cnc_sdtreadsmpl
Description Reads the sampling data. (The cycle of sampling is 1msec.)... [read more]
cnc_sdtreadsmpl
Fanuc Focas Library | Motor | cnc_sdtreadsmpl2
Description Reads the sampling data. In case of using cnc_sdtstartsmpl2, acquire data immediately after the function call by this function. Trigger... [read more]
cnc_sdtreadsmpl2
Fanuc Focas Library | Motor | cnc_sdtsetchnl
Description The channel data for the sampling of various data of Servo and Spindle are set. As for the data which can be acquired, refer to... [read more]
cnc_sdtsetchnl
Fanuc Focas Library | Motor | cnc_sdtstartsmpl
Description The start of sampling is notified. When the block of the specified sequence number is executed, sampling is... [read more]
cnc_sdtstartsmpl
Fanuc Focas Library | Motor | cnc_sdtstartsmpl2
Description The start of sampling is notified. In case of cnc_sdtstartsmpl, start sampling after... [read more]
cnc_sdtstartsmpl2
Fanuc Focas Library | Motor | cnc_wrfromservoid2
Description Write specified servo id information to FROM.... [read more]
cnc_wrfromservoid2
Fanuc Focas Library | Motor | cnc_wrfromspindleid2
Description Write specified spindle id information to FROM.... [read more]
cnc_wrfromspindleid2
Fanuc Focas Library | Motor | flist_Motor
CNC: Function related to servo/spindle... [read more]
flist_Motor
Modified: 2018-06-11