Hello,
I have started the demo project Profibus_Slave_netX50.htp wich comes with NXLOM RCX-DPS 07'2009 V2.2
PROFIBUS Slave stack.
There is no Master available, but cyclically appears PROFIBUS_DEMO_CMD_CYCLIC_EVENT_IND.
/* wait for packet */
eRslt = TLR_QUE_WAITFORPACKET(hQue, &ptPck, TLR_INFINITE);
if (TLR_S_OK != eRslt)
{
continue;
}
switch (ptPck->tHead.ulCmd)
{
case PROFIBUS_DEMO_CMD_CYCLIC_EVENT_IND:
PbDemo_DataExchange(ptRsc);
break;
I have expected that this event will come only if the Slave is connected to the Master and its state is DATA_EXCH.
Could someone explain this behaviour?
Is there a possibility to prevent this event in states different from DATA_EXCH?
Best regards
Rumen
Ralf Hornung
Hilscher
Hi,
the PROFIBUS_DEMO_CMD_CYCLIC_EVENT_IND is a cyclic timer packet that is configured at the TaskResource_ProfibusDemo_InitLocal function.
/* Timer intitialisation */
ptRsc->tLoc.tCyclicTimerPckt.ulSrc = (UINT32)ptRsc->tLoc.hQue;
ptRsc->tLoc.tCyclicTimerPckt.ulRout = 0;
ptRsc->tLoc.tCyclicTimerPckt.ulCmd = PROFIBUS_DEMO_CMD_CYCLIC_EVENT_IND;
ptRsc->tLoc.tCyclicTimerPckt.ulSta = 0;
ptRsc->tLoc.tCyclicTimerPckt.ulExt = TLR_PACKET_NOT_DELETE;
eRslt = TlrTimerApplicationCreate( ptRsc->tLoc.hQue,
TLR_TIMER_APPL_RELOAD,
3,
&ptRsc->tLoc.hCyclicTimer);
At the example it is used to get the I/O data with a host application cycle.
There is a way to get the data at every DATA_EXCH. Therfore you have to register a callback function at the TriBuffer. (TLR_ENABLE_TRIBUFF_CALLBACK(hTrp, pfnCallback, pvPrm) .
Best regards