![Advantech PCL-841 Series Скачать руководство пользователя страница 21](http://html.mh-extra.com/html/advantech/pcl-841-series/pcl-841-series_user-manual_2856744021.webp)
2 0
PCL-841 Series User's Manual
memcpy(&can2, &canl, sizeof(CAN_STRUCT));
if(canConfig(PORT2,can2)==FAIL)
{
clrscr();
cprintf("\n\n CAN Port %d Configuration Error", 2);
return;
}
canNormalRun(PORTl); /* Put CAN1 into normal mode. */
canNormalRun(PORT2); /* Put CAN2 into normal mode. */
clrscr();
smsgl.id = 0x015; /* Set ID =8 */
smsql.rtr=l; /* Data lengths =8*/
smsgl.dlen=8;
for(i=0; i<smsql.dlen; i++)
smsgl.data[i] =i;
while(l)
{
canSendMsg(PORTl, smsgl); /* Send to CAN1 */
if(canReceiveMsg(PORT2, &rmsg2)==1)
{
cprintf("PORT2 receive:ID=%3X RTR=%ld Length=%ld",
rmsg2.id,rmsg2.rtr, rmsg2.dlen);
for(i=0; i< rmsg2.dlen; i++)
cprintf(" %2X",rmsg2.data[il);
printf("\n");
}
if (kbLit())
{
getch();
break;
}
}
/* Reset CAN controller. */
canReset(PORTl);
canReset(PORT2);
canExitHW();
clrscr();
}
Содержание PCL-841 Series
Страница 2: ...1 Introduction C H A P T E R ...
Страница 5: ...4 PCL 841 Series User s Manual ...
Страница 6: ...2 Hardware Installation C H A P T E R ...
Страница 8: ...Chapter 2 Hardware Installation 7 Jumper and switch locations ...
Страница 13: ...12 PCL 841 Series User s Manual ...
Страница 14: ...3 Software Programming C H A P T E R ...
Страница 22: ...4 DataMonitor Utility C H A P T E R ...
Страница 28: ...5 Wiring C H A P T E R ...
Страница 31: ...30 PCL 841 Series User s Manual ...
Страница 32: ...A Register structure A P P E N D I X ...
Страница 37: ...36 PCL 841 Series User s Manual ...