
[Example]
The following program reads the dynamic data of all axes (amount of
axes = MAX) and displays them on the screen.
#include <data.h>
#include <fwindow.h>
#include <stdio.h>
void example( void )
{
struct odbdy buf ;
unsigned int idx ;
cnc_rddynamic( -1, sizeof(buf), &buf ) ;
printf( "Current program = %d Main program = %d¥n",
buf.prgnum, buf.prgmnum ) ;
printf( "Sequence number = %ld¥n", buf.seqnum ) ;
printf( "actf = %ld acts = %ld¥n", buf.actf, buf.acts ) ;
printf( "Alarm status = %d¥n", buf.alarm ) ;
printf( "AXIS Absolute Relative Machine Distance¥n" ) ;
printf( "----+---------+---------+---------+--------¥n" ) ;
for ( idx = 0 ; idx < MAX ; idx++ )
printf( " %u %8ld %8ld %8ld %8ld¥n", idx,
buf.pos.faxis.absolute[idx],
buf.pos.faxis.relative[idx],
buf.pos.faxis.machine[idx],
buf.pos.faxis.distance[idx] ) ;
}