- 92 -
16-5.Example of INDEX DRIVE Program Specified in Absolute Value
The INDEX DRIVE specified in absolute value requires URATE, DRATE, LSPD and HSPD data.
You must set these
data prior to the drive. Once set, these rate and speed data remain valid until a change is needed of them.
And, the target address of the drive must be set before turning on the INDEX DRIVE.
Whenever starting the drive, the address data must be specified.
/*-----------------------------------*/
/*
X-AXIS ABSOLUTE INDEX DRIVE */
/*-----------------------------------*/
void
xabsindex( void )
{
/** RATE SET COMMAND **/
xmccrdy();
/* X-AXIS MCC05 RDY WAIT */
outp(XMCCDT2 ,urate);
/* UP RATE No. OUT */
outp(XMCCDT3 ,drate);
/* DOWN RATE No. OUT */
outp(XMCCCOM ,0x06);
/* RATE SET COMMAND OUT */
/** LSPD SET COMMAND **/
xmccrdy();
/* X-AXIS MCC05 RDY WAIT */
outp(XMCCDT1 ,*((UC *)&lspd + 2));
/* LOW SPEED DATA MSB SET */
outp(XMCCDT2 ,*((UC *)&lspd + 1));
outp(XMCCDT3 ,*((UC *)&lspd ));
/* LOW SPEED DATA LSB SET */
outp(XMCCCOM ,0x07);
/* LSPD SET COMMAND OUT */
/** HSPD SET COMMAND **/
xmccrdy();
/* X-AXIS MCC05 RDY WAIT */
outp(XMCCDT1 ,*((UC *)&hspd + 2));
/* HIGH SPEED DATA MSB SET */
outp(XMCCDT2 ,*((UC *)&hspd + 1));
outp(XMCCDT3 ,*((UC *)&hspd ));
/* HIGH SPEED DATA LSB SET */
outp(XMCCCOM ,0x08);
/* HSPD SET COMMAND OUT */
/** ABSOLUTE INDEX DRIVE COMMAND **/
xmccrdy();
/* X-AXIS MCC05 RDY WAIT */
outp(XMCCDT1 ,*((UC *)&absdt + 2));
/* ABS INDEX DATA MSB SET */
outp(XMCCDT2 ,*((UC *)&absdt + 1));
outp(XMCCDT3 ,*((UC *)&absdt ));
/* ABS INDEX DATA LSB SET */
outp(XMCCCOM ,0x15);
/* ABS INDEX DRIVE COMMAND OUT */
}
Note: The above program is developed on the assumption that the RAM AREA URATE and DRATE contain the
RATE DATA TABLE No., and the LSPD and HSPD contain the speed data set in Hz.
And, the absdt is supposed to contain the target address.
Summary of Contents for C-875
Page 98: ... 98 2 M TYPE 3 H TYPE ...