src/pdo.c
changeset 252 b0dd37421d28
parent 236 905677ed00f3
child 285 dbf7695290ae
equal deleted inserted replaced
251:cab66ef3e68e 252:b0dd37421d28
   118     if (offset <= lastIndex) {
   118     if (offset <= lastIndex) {
   119       /* get the CobId*/
   119       /* get the CobId*/
   120       pwCobId = (UNS32*) d->objdict[offset].pSubindex[1].pObject;
   120       pwCobId = (UNS32*) d->objdict[offset].pSubindex[1].pObject;
   121 
   121 
   122       MSG_WAR(0x3930, "sendPDOrequest cobId is : ",*pwCobId);
   122       MSG_WAR(0x3930, "sendPDOrequest cobId is : ",*pwCobId);
   123 
   123       {
   124       Message pdo = {*pwCobId, REQUEST, 0};
   124       Message pdo = {*pwCobId, REQUEST, 0};
   125       return canSend(d->canHandle,&pdo);
   125       return canSend(d->canHandle,&pdo);
       
   126       }
   126     }
   127     }
   127   }
   128   }
   128   MSG_ERR(0x1931, "sendPDOrequest : RPDO Index not found : ", RPDOIndex);
   129   MSG_ERR(0x1931, "sendPDOrequest : RPDO Index not found : ", RPDOIndex);
   129   return 0xFF;
   130   return 0xFF;
   130 }
   131 }
   473       	  (*pTransmissionType <= TRANS_SYNC_MAX) &&
   474       	  (*pTransmissionType <= TRANS_SYNC_MAX) &&
   474           (++d->PDO_status[pdoNum].transmit_type_parameter == *pTransmissionType) ) {
   475           (++d->PDO_status[pdoNum].transmit_type_parameter == *pTransmissionType) ) {
   475         /*Reset count of SYNC*/	
   476         /*Reset count of SYNC*/	
   476 	d->PDO_status[pdoNum].transmit_type_parameter = 0;
   477 	d->PDO_status[pdoNum].transmit_type_parameter = 0;
   477 	MSG_WAR(0x3964, "  PDO is on SYNCHRO. Trans type : ", *pTransmissionType);
   478 	MSG_WAR(0x3964, "  PDO is on SYNCHRO. Trans type : ", *pTransmissionType);
   478 	pdo = (Message)Message_Initializer;
   479  {
       
   480  Message msg_init = Message_Initializer;
       
   481  pdo = msg_init;
       
   482  }	
   479         if(buildPDO(d, pdoNum, &pdo))
   483         if(buildPDO(d, pdoNum, &pdo))
   480         {
   484         {
   481             MSG_ERR(0x1906, " Couldn't build TPDO number : ", pdoNum);
   485             MSG_ERR(0x1906, " Couldn't build TPDO number : ", pdoNum);
   482 	    status = state11;
   486 	    status = state11;
   483 	    break;
   487 	    break;
   498       /* If transmission on Event and not inhibited, check for changes */
   502       /* If transmission on Event and not inhibited, check for changes */
   499       }else if((*pTransmissionType == TRANS_EVENT_PROFILE ||
   503       }else if((*pTransmissionType == TRANS_EVENT_PROFILE ||
   500                *pTransmissionType == TRANS_EVENT_SPECIFIC )&&
   504                *pTransmissionType == TRANS_EVENT_SPECIFIC )&&
   501               !(d->PDO_status[pdoNum].transmit_type_parameter & PDO_INHIBITED)) {
   505               !(d->PDO_status[pdoNum].transmit_type_parameter & PDO_INHIBITED)) {
   502 	MSG_WAR(0x3968, "  PDO is on EVENT. Trans type : ", *pTransmissionType);
   506 	MSG_WAR(0x3968, "  PDO is on EVENT. Trans type : ", *pTransmissionType);
   503 	pdo = (Message)Message_Initializer;
   507  {
       
   508  Message msg_init = Message_Initializer;
       
   509  pdo = msg_init;
       
   510  }	
   504         if(buildPDO(d, pdoNum, &pdo))
   511         if(buildPDO(d, pdoNum, &pdo))
   505         {
   512         {
   506             MSG_ERR(0x3907, " Couldn't build TPDO number : ", pdoNum);
   513             MSG_ERR(0x3907, " Couldn't build TPDO number : ", pdoNum);
   507 	    status = state11;
   514 	    status = state11;
   508 	    break;
   515 	    break;