Fanuc C-Executer Operating Manual
B-62443EN-3/03E
- 500 -
The A/D conversion data (0,..,255) which is converted from input
voltage data is stored in "buf.data" with binary format.
The digital data is linearly proportional to the input voltage as
follows.
Input voltage buf.data
---------------+-----------
-10V 0
0V 128
+10V 255
(2) Reading the load information of the controlled axis of the CNC.
Reads the load current data of the controlled axis of the CNC which is
converted into analog voltage via A/D converter.
Specify "2" in "inp_type".
Specify the controlled axis number of the CNC whose load information
is read in "av_type".
av_type Objective axis
-------+---------------------------------
1 Axis connected to connector "JV1"
2 Axis connected to connector "JV2"
3 Axis connected to connector "JV3"
4 Axis connected to connector "JV4"
5 Axis connected to connector "JV5"
6 Axis connected to connector "JV6"
7 Axis connected to connector "JV7"
8 Axis connected to connector "JV8"
This axis number is the servo axis number, and may be different from
the controlled axis number of the CNC.
The digital value (0,..,+/-7282) which is converted from the load
current is stored in "buf.data" with binary format.
It is possible to get the load current using this value as following
formula.
The load current = buf.data * N / 7282 [Apeak]
N = 40 [Apeak] (for motor type 0S,5S,10S,20S/1500)
80 [Apeak] (for motor type 20S,30S)
[Example]
The following program reads the analog voltage data and displays it.
#include <data.h>
#include <fwindow.h>
#include <stdio.h>
void example( void )
{
struct odbad buf ;
int idx ;
char strbuf[6] ;
for ( idx = 0 ; idx < 4 ; idx++ ) {
cnc_adcnv( 0, idx, &buf ) ;
sprintf( strbuf, "%+04d", ( buf.data - 128 ) * 100 / 127 ) ;
strbuf[5] = '\000' ;
strbuf[4] = strbuf[3] ;
strbuf[3] = '.' ;