NewsCNCnetPDMAbout usSupport
  

CNC_SDTSETCHNL | MOTOR

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 channel.type in the arguments.


The position feedback pulse data of the Servo and the Spindle shows the summation value.(When the CNC was powered on, these value are "0".)

Sampling cycle of servo data is 0.25msec or 1msec. The one of spindle data is 1msec.

These functions cannot be simultaneously used with the Servo Guide or the Servo Guide Mate. In this case, these functions return EW_REJECT.

The processing flow is as follows.

MTConnect Fanuc Adapter

Universal Fanuc Driver

Fanuc Focas Library CD

Declaration

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

FWLIBAPI short WINAPI cnc_sdtsetchnl(unsigned short FlibHndl, short num, long datanum, IDBSDTCHAN *channel);

Arguments

FlibHndl   [ in ]

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

num   [ in ]

Specify the number of channels which wants to be sampled. Maximum channel numbers are "8".
However, the following limitations are in the data which can be acquired at the same time.

Servo axes : 4ch can be set to 1DSP(2 axes)
Spindle axis : 2ch can be set to 1DSP(=1 spindle amplifier)
datanum   [ in ]

Specify the number of total points of the data which wants to be sampled. (Specify the value of eight or more.)
If you wants to read data after all sampling ends, the maximum number which can be set is as follows.

setting channel numbers max. points
1ch 262144
2ch 131072
3ch 87376
4ch 65536
5ch 52424
6ch 43688
7ch 37448
8ch 32768

So, when the sampling data of each 10msec is necessary, the following numbers can be sampled.

setting channel numbers sampling points
1ch 23300
2ch 12335
3ch 8387
4ch 6353
5ch 5242
6ch 4368
7ch 3744
8ch 3276

In case that data is serially read during the sampling execution, this limitation does not exist.
When -1 is specified, the limitation of a total number is lost.
Please serially read the data by the sampling data reading function(cnc_sdtreadsmpl).
When the reading buffer is filled, the sampling data reading function returns EW_BUFFER.

channel   [ in ]

Pointer to the IDBSFBCHAN 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 IDBSFBCHAN is as follows.


                typedef struct idbsdtchan {
                short           type;       /* data type */
                char            chno;       /* channel number */
                char            axis;       /* axis number */
                unsigned short  shift;      /* upper byte : sampling cycle,
                lower byte : right shift amount */
                } IDBSDTCHAN;
              
type
Specify the sampling data type.
In case of positive value(sampling axis is servo):
Value The sampling data type The unit of the sampling data
(In case of shift's lower byte=0)
note
0 Summation of position feedback pulse data (POSF) 1 = Detection unit(1 pulse)
1 Position error (ERR) 1 = Detection unit(1 pulse)
2 Velocity command (VCMD) 16,777,216 = 3750min-1
(In case of shift = 9 : 32768=3750min-1)

3 Torque command (TCMD) 7,282 = The maximum current value of amplifier (A)
4 Speed feedback signal (SPEED) 262,144 = 3750min-1
(In case of shift=3 : 32768=3750min-1)

5 Estimated disturbance torque (DTRQ) 7,282 The maximum current value of amplifier (A)
6 Synchronous error on rigid tapping (SYNC) 1 = 1/4096 rotation of spindle
7 OVC simulation data (OVCLV) 1 = 1%
8 Effective current (IEFF) 6,554 = The maximum current value of amplifier (A)
9 DC link voltage(VDC) 8,192 = 640V (200V) or 1280V (400V)
10 Semi-Full error(SFERR) 1 = Detection unit(1 pulse)
11 Analog signal command(ALGCMD) 32,767 = 100% (Maximum analog signal command)
(In case of pressure and position control : Maximum pressure command value)
Pressure command in case of pressure and position control (90BP only)
12 Analog signal feedback(ALGFB) 32,767 = 100% (Maximum analog signal feedback)
(In case of pressure and position control : Maximum pressure detecting value)
Pressure feedback in case of pressure and position control (90BP only)
13 R-phase current(IR) 6,554 = The maximum current value of amplifier (A)
14 R-phase current(PDM slave1)(IR1) 6,554 = The maximum current value of amplifier (A)
15 R-phase current(PDM slave2)(IR2) 6,554 = The maximum current value of amplifier (A)
16 R-phase current(PDM slave3)(IR3) 6,554 = The maximum current value of amplifier (A)
17 R-phase current(PDM slave4)(IR4) 6,554 = The maximum current value of amplifier (A)
18 S-phase current(IS) 6,554 = The maximum current value of amplifier (A)
19 S-phase current(PDM slave1)(IS1) 6,554 = The maximum current value of amplifier (A)
20 S-phase current(PDM slave2)(IS2) 6,554 = The maximum current value of amplifier (A)
21 S-phase current(PDM slave3)(IS3) 6,554 = The maximum current value of amplifier (A)
22 S-phase current(PDM slave4)(IS4) 6,554 = The maximum current value of amplifier (A)
23 Reactive current(ID) 8,027 = The maximum current value of amplifier (A)
24 Active current(IQ) 8,027 = The maximum current value of amplifier (A)
25 Motor winding temperature(MTTMP) 1 1 degrees centigrade
26 Pulsecoder temperature(PCTMP) 1 1 degrees centigrade
27 Velocity command without FF(VCOUT) Same as VCMD
28 Advanced velocity command(VCC0) Internal unit(not open)
29 Backlash acceleration amount(BLACL) Internal unit(not open)
30 Absolute position detected internal pulse coder(ABS) 1 = 1/2^21 rotation
31 Vibration frequency(FREQ) 1 = 1Hz
32 Vibration torque command(FRTCM) 7,282 = The maximum current value of amplifier (A)
33 DC link voltage(VDC)

Same as type=9
34 Acceleration feedback in direction specified by No.2277#7,6,5(ACC) 512 = 0.1G = 0.98m/s^2 In case of aiGS0.1-3D (0.1G)
4096 = 1G = 9.8m/s^2 In case of aiGS1-3D (1G)
35 1st direction acceleration feedback(ACC1) 512 = 0.1G = 0.98m/s^2 In case of aiGS0.1-3D (0.1G)
4096 = 1G = 9.8m/s^2 In case of aiGS1-3D (1G)
36 2nd direction acceleration feedback(ACC2) 512 = 0.1G = 0.98m/s^2 In case of aiGS0.1-3D (0.1G)
4096 = 1G = 9.8m/s^2 In case of aiGS1-3D (1G)
37 3rd direction acceleration feedback(ACC3) 512 = 0.1G = 0.98m/s^2 In case of aiGS0.1-3D (0.1G)
4096 = 1G = 9.8m/s^2 In case of aiGS1-3D (1G)
38 Vibration velocity command(FRVCM) Same as VCMD
39 Backlash compensation(BLCMP) 1 = Detection unit(1 pulse)
40 Backlash acceleration amount 1(BLAC1) Internal unit(not open)
41 Backlash acceleration amount 2(BLAC2) Internal unit(not open)
42 Smart backlash compensation (position compensation amount)(SMTBKL) 1 = Detection unit(1 pulse)
43 Estimated load torque for Smart backlash compensation(SMTTRQ) 7282 = The maximum current value of amplifier (A)
44 Compensation amount of smart backlash (for full-closed)(SMTBAC) 1 = Detection unit(1 pulse)
45 Analog signal offset(ALGOFS) -32000 - 0 - 32000 = -10V - 0V - +10V In case of Voltage input(AIM)
-32768 - 0 - 32767 = 0mA - 12.5mA - 25mA In case of current input(AMU)
46 Analog signal offset 2(ALGOF2) Same as ALGOFS
type=14-17, 19-22 are avilable on 90B1/06 or later and 90BP/01 or later.

In case of negative value(sampling axis is spindle):
Value The sampling data type The unit of the sampling data
(In case of shift's lower byte=0)
note
0 Summation of position feedback pulse data (CSPOS) 360,000 pulses = 1 rotation(In case of No.4005#0=0)
3,600,000 pulses = 1 rotation(In case of No.4005#0=1)
1 Moter speed (SPEED) 4,096 = 1min-1
2 Torque command (TCMD) 16,384 = Maximun moter torque
3 Moter speed command (VCMD) 4,096 = 1min-1
4 Position error (ERR) At Cs:
360,000 pulses = 1 rotation(In case of No.4005#0=0)
3,600,000 pulses = 1 rotation(In case of No.4005#0=1)
Others:
4,096 pulses = 1 rotation
5 Load meter data (LMDAT) 32,768 = 10 Volts
6 Spindle load torque (DTRQ) 16,384 = Maximun moter torque
7 Amplitude of moter current (INORM) Changed with the kind of the motor and the amplifier.
8 Moter winding temperature (MTTMP) 1 = 1 degree
9 Spindle axis power consumption(EPMTR) 1 = 10kW (In case of No.4541#2,#1=0,0) When you get this data, the setting of the power consumption monitor function is necessary.(No.4541#0=1 etc.)
Refer to the "Power consumption monitor Specifications(A-92737E etc.)" for detail. (Series 9D80 or later)
Note) type=9 will become valid at 9D80/T(20) or later(plan).
1 = 1kW (In case of No.4541#2,#1=0,1)
1 = 0.1kW (In case of No.4541#2,#1=1,0)
1 = 0.01kW (In case of No.4541#2,#1=1,1)
10 Frequency of disturbance torque(FREQ) 1 = 1Hz
11 Gain data(GAIN) 4096 = 100%
12 Torque command 2(TCMD2) 16,384 = Maximun moter torque
13 A/D data of motor sensor (A phase)(PA1) 65536 = 1.48V
14 A/D data of motor sensor (B phase)(PB1) 65536 = 1.48V
15 A/D data of spindle sensor (A phase)(PA2) 65536 = 1.48V
16 A/D data of spindle sensor (B phase)(PB2) 65536 = 1.48V
17 Velocity error(VERR) 4096 = 1min-1
18 Spindle speed(SPSPD) 4096 = 1min-1
19 Present value of loadmeter (Normalized by cont. rated output(LMDTC) 1 = 1%
100% is equivalent to continuous rated output.

20 Maximum value of loadmeter at the present speed (Normalized by cont. rated output)(LMMAX) 1 = 1%
100% is equivalent to continuous rated output.

21 Duration time for cutting(DURTM) 1 = 1sec
chno
Specify the channel number(1-8).
axis
Specify the sampling axis number.
Servo axis number : 1 to 32
Spindle axis number -1 to -8

Specify the logical axis number which is allocated to the entire paths of CNC system.
The axis number is not the relative axis number of each path.
(It is the same as the order of CNC parameter No.981(Spindle axis is No.982).)
shift
Specify sampling period at upper byte and right shift value at lower byte.

Specify sampling period at upper byte as follows.
0 : 1msec
2 : 0.25msec

* 0.25msec can be set in case of servo data. In case of setting any value except 0 to shift's upper byte, EW_DATA(5)(No.24 for detail) is returned.
* In case of difference of sampling period of servo between channels, EW_DATA(5)(No.24 for detail) is returned. Make the same sampling period of servo between channels.
* In case of setting under the following conditions simultaneously, EW_DATA(5)(No.3 for detail) is returned.
  • 0.25msec(Sampling period of servo)
  • 1msec (Sampling period of spindle)
  • any normal value except -1(The number of total points of sampling data to read(per one channel), datanum)

In case of setting channel of servo(Sampling period : 0.25msec) and spindle(Sampling period : 1ms) at the same time, set the number of total points which wants to be sampled(per one channel), datanum to -1 and execute process of count the number of reading data and of end of sampling in program.

Specify the right shift amount(0-15) for the sampling data at lower byte.
The sampling data acquired by specifying this data is as follows.

In case of shift = 0 : 1 detection unit(or 1 rotation)
In case of shift = 1 : 2 detection units
In case of shift = 2 : 4 detection unit
:
In case of shift = 7 : 128 detection units
:
In case of shift = 15 : 32,768 detection units

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. The following detail status will be set onto the member, err_no of ODBERR structure.
3 : Total point number(datanum) is not 8 or more.
4 : The motor 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.
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.

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

"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_sdtstartsmpl   cnc_sdtcancelsmpl   cnc_sdtreadsmpl   cnc_sdtendsmpl   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_sdtsetchnl

Fanuc Focas Library | Motor | cnc_loadtorq

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]
Fanuc Focas Library | Motor | cnc_loadtorq

Fanuc Focas Library | Motor | cnc_rdctrldi

Reads control input signal for spindle monitor.... [read more]
Fanuc Focas Library | Motor | cnc_rdctrldi

Fanuc Focas Library | Motor | cnc_rdctrldo

Reads control output signal for spindle monitor.... [read more]
Fanuc Focas Library | Motor | cnc_rdctrldo

Fanuc Focas Library | Motor | cnc_rdcurrent

Reads The servo adjustment real current. When the following parameter is '0', '0' is... [read more]
Fanuc Focas Library | Motor | cnc_rdcurrent

Fanuc Focas Library | Motor | cnc_rdfromservoid2

Read specified servo id information from FROM. Each information is stored in member of the ODBCSVID2 structure.... [read more]
Fanuc Focas Library | Motor | cnc_rdfromservoid2

Fanuc Focas Library | Motor | cnc_rdfromspindleid2

Read specified spindle id information from FROM. Each information is stored in member of the ODBCSPID2 structure.... [read more]
Fanuc Focas Library | Motor | cnc_rdfromspindleid2

Fanuc Focas Library | Motor | cnc_rdloopgain

Reads The servo adjustment loop gain.... [read more]
Fanuc Focas Library | Motor | cnc_rdloopgain

Fanuc Focas Library | Motor | cnc_rdnspdl

Reads the number of spindles which CNC can control. It is not the number of mounted spindles.... [read more]
Fanuc Focas Library | Motor | cnc_rdnspdl

Fanuc Focas Library | Motor | cnc_rdopmode

Reads The operation mode for spindle adjustment.... [read more]
Fanuc Focas Library | Motor | cnc_rdopmode

Fanuc Focas Library | Motor | cnc_rdposerrs

Reads The position deflection S for spindle adjustment. The position deflection S is valid only when... [read more]
Fanuc Focas Library | Motor | cnc_rdposerrs

Fanuc Focas Library | Motor | cnc_rdposerrs2

Reads The position deflection S1, S2 for spindle adjustment in the synchronous control mode. The... [read more]
Fanuc Focas Library | Motor | cnc_rdposerrs2

Fanuc Focas Library | Motor | cnc_rdposerrz

Reads The position deflection Z for spindle adjustment in the rigid tapping mode. The position... [read more]
Fanuc Focas Library | Motor | cnc_rdposerrz

Fanuc Focas Library | Motor | cnc_rdservoid2

Read specified servo id information from adaptation device. Each information is stored in member of the ODBCSVID2 structure.... [read more]
Fanuc Focas Library | Motor | cnc_rdservoid2

Fanuc Focas Library | Motor | cnc_rdspdlalm

Reads the alarm number corresponding to the message of spindle alarm for spindle monitor.... [read more]
Fanuc Focas Library | Motor | cnc_rdspdlalm

Fanuc Focas Library | Motor | cnc_rdspindleid2

Read specified spindle id information from adaptation device. Each information is stored in member of the ODBCSPID2 structure.... [read more]
Fanuc Focas Library | Motor | cnc_rdspindleid2

Fanuc Focas Library | Motor | cnc_rdsrvspeed

Reads The servo adjustment real speed.... [read more]
Fanuc Focas Library | Motor | cnc_rdsrvspeed

Fanuc Focas Library | Motor | cnc_rdsynerrrg

Reads The synchronous error for spindle adjustment in the rigid tapping mode. The synchronous error... [read more]
Fanuc Focas Library | Motor | cnc_rdsynerrrg

Fanuc Focas Library | Motor | cnc_rdsynerrsy

Reads The synchronous error for spindle adjustment in the synchronous control mode. The synchronous... [read more]
Fanuc Focas Library | Motor | cnc_rdsynerrsy

Fanuc Focas Library | Motor | cnc_sdtcancelsmpl

Cancel of sampling is notified. If you want to cancel the sampling after sampling starts, execute this function. This function can be... [read more]
Fanuc Focas Library | Motor | cnc_sdtcancelsmpl

Fanuc Focas Library | Motor | cnc_sdtclrchnl

The channel data setting for sampling is cleared. When you change the channel data number for sampling, beforehand execute this... [read more]
Fanuc Focas Library | Motor | cnc_sdtclrchnl

Fanuc Focas Library | Motor | cnc_sdtendsmpl

The end of sampling is notified. In case that the error occurred by cnc_sdtreadsmpl, execute this function.... [read more]
Fanuc Focas Library | Motor | cnc_sdtendsmpl

Fanuc Focas Library | Motor | cnc_sdtendsmpl2

The end of sampling is notified. In case that the error occurred by cnc_sdtreadsmpl2, execute this function.... [read more]
Fanuc Focas Library | Motor | cnc_sdtendsmpl2

Fanuc Focas Library | Motor | cnc_sdtread1shot

Read the data for 8 channels that are set by cnc_sdtsetchnl function.... [read more]
Fanuc Focas Library | Motor | cnc_sdtread1shot

Fanuc Focas Library | Motor | cnc_sdtreadsmpl

Reads the sampling data. (The cycle of sampling is 1msec.)... [read more]
Fanuc Focas Library | Motor | cnc_sdtreadsmpl

Fanuc Focas Library | Motor | cnc_sdtreadsmpl2

Reads the sampling data. In case of using cnc_sdtstartsmpl2, acquire data immediately after the function call by this function. Trigger... [read more]
Fanuc Focas Library | Motor | cnc_sdtreadsmpl2

Fanuc Focas Library | Motor | cnc_sdtsetchnl2

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... [read more]
Fanuc Focas Library | Motor | cnc_sdtsetchnl2

Fanuc Focas Library | Motor | cnc_sdtstartsmpl

The start of sampling is notified. When the block of the specified sequence number is executed, sampling is... [read more]
Fanuc Focas Library | Motor | cnc_sdtstartsmpl

Fanuc Focas Library | Motor | cnc_sdtstartsmpl2

The start of sampling is notified. In case of cnc_sdtstartsmpl, start sampling after... [read more]
Fanuc Focas Library | Motor | cnc_sdtstartsmpl2

Fanuc Focas Library | Motor | cnc_wrfromservoid2

Write specified servo id information to FROM.... [read more]
Fanuc Focas Library | Motor | cnc_wrfromservoid2

Fanuc Focas Library | Motor | cnc_wrfromspindleid2

Write specified spindle id information to FROM.... [read more]
Fanuc Focas Library | Motor | cnc_wrfromspindleid2

Fanuc Focas Library | Motor | flist_Motor

CNC: Function related to servo/spindle... [read more]
Fanuc Focas Library | Motor | flist_Motor
Modified: 2023-12-05