Send Quote Requests to info@automatedpt.com
Call +1(800)985-6929 To Order or Order Online At Deltaacdrives.com
Modbus Communication
ASDA-A3
9
outportb(PORT+BRDH,0x00);
outportb(PORT+LCR,0x06);
/* set protocol
<7,E,1> = 1AH,
<8,N,2> = 07H
<8,O,1> = 0BH
<7,O,1> = 0AH
<8,E,1> = 1BH
*/
for( I = 0; I<=16; I++ ) {
while( !(inportb(PORT+LSR) & 0x20) ); /* wait until THR empty */
outportb(PORT+THR,tdat[I]);
/* send data to THR */
}
I = 0;
while( !kbhit() ) {
if( inportb(PORT+LSR)&0x01 ) { /* b0==1, read data ready */
rdat[I++] = inportb(PORT+RDR); /* read data from RDR */
}
}
}
9-14
Send Quote Requests to info@automatedpt.com
Call +1(800)985-6929 To Order or Order Online At Deltaacdrives.com