Delta ASD-B2-0121-B User Manual page 264

Asda-b2 series standard type ac servo drive for network communication application
Hide thumbs Also See for ASD-B2-0121-B:
Table of Contents

Advertisement

unsigned char rdat[60];
/* read 2 data from address 0200H of ASD with address 1 */
unsigned char tdat[60]={':','0','1','0','3','0','2','0','0','0','0','0','2','F','8','\r','\n'};
void main() {
int I;
outportb(PORT+MCR,0x08);
outportb(PORT+IER,0x01);
outportb(PORT+LCR,( inportb(PORT+LCR) | 0x80 ) );
/* the BRDL/BRDH can be access as LCR.b7 == 1 */
outportb(PORT+BRDL,12);
outportb(PORT+BRDH,0x00);
outportb(PORT+LCR,0x06);
*/
for( I = 0; I<=16; I++ ) {
while( !(inportb(PORT+LSR) & 0x20) );
outportb(PORT+THR,tdat[I]);
}
I = 0;
while( !kbhit() ) {
if( inportb(PORT+LSR)&0x01 ) { /* b0==1, read data ready */
rdat[I++] = inportb(PORT+RDR); /* read data from RDR */
}
}
}
Revision June 2010
Chapter 8 MODBUS Communications
/* interrupt enable */
/* interrupt as data in */
/* set prorocol
<7,E,1> = 1AH,
<8,N,2> = 07H
<8,O,1> = 0BH
/* wait until THR empty */
/* send data to THR */
<7,O,1> = 0AH
<8,E,1> = 1BH
8-15

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents