Hi,
We now have a netStick and want to test the "EIP_OBJECT_MR_REGISTER_REQ" command with a pursose of adding a new object into EIP_OBJECT process and test the UCMM message.
To achieve this, we created a queue, named "OBJECT_QUE" in one task and assignm a handle named "hObjectQue", as:
eRslt = TLR_QUE_CREATE("OBJECT_QUE", 32, &ptRsc->tLoc.hObjectQue)At the same time, we identify this queue in "EIPDemo" task of the demo, using codes as:
TLR_QUE_IDENTIFY_INTERN("OBJECT_QUE", ptRsc->tLoc.uTskInst, &ptRsc->tRem.hObjectQue)and then cosntruct a MR_REGISTER_REQ packet and sent it out as:
ptPck->tMrRegisterReq.tHead.ulCmd = EIP_OBJECT_MR_REGISTER_REQ;
ptPck->tMrRegisterReq.tHead.ulSrc = (UINT32)ptRsc->tLoc.hQue;
ptPck->tMrRegisterReq.tHead.ulSrcId = 0;
ptPck->tMrRegisterReq.tHead.ulSta = 0;
ptPck->tMrRegisterReq.tHead.ulLen = EIP_OBJECT_MR_REGISTER_REQ_SIZE;
ptPck->tMrRegisterReq.tData.hObjectQue = ptRsc->tRem. hObjectQue;ptPck->tMrRegisterReq.tData.ulClass = 0xC9;
TLR_QUE_SENDPACKET_FIFO_INTERN(ptRsc->tRem.hEipObjectQue, &ptPck->tMrRegisterReq, 0);
After these coding, we run the program and want to send a UCMM to this new object (class 0xC9). We once thought the message would be sent to "ptRsc->tRem. hObjectQue" and trigger the remote task to run. So we added the codes in this task's "TaskProcess",as:
TLR_HANDLE hQue = ptRsc->tLoc.hObjectQue;
....
do {
eRslt = TLR_QUE_WAITFORPACKET(hQue, &pvPck, TLR_INFINITE);
if(TLR_S_OK != eRslt)
{ continue; }
.......
}while(1);
laurence_yu
Wow, I suddenly notice a statement in the Ethernet/IP Adapter protocol for netx, that says:
"The source queue is directly bound the new object. All indication for the new object are send to the
ulSrc and ulSrcId of the request packet"
So I change the ulSrc to point to the task queue which is regarded as the new object. Then the UCMM sent to the new object is routed to this queue!
This problem is solved!