industrialNETworXnetx

Rainer Versteeg

Rainer Versteeg

| 16.02.2009 | 09:52 | 1 reply

DNS_FAL_CMD_GET_STATUS

Hi,

I want to get the DNS_FAL_GEN_STATUS_T data.
What is to do to get the data ?

Here is my REQ and CNF.

void DnsApp_GetStatus_Cnf(DEVICENET_DEMO_RSC_T FAR* ptRsc, DNS_FAL_PACKET_GET_STATUS_CNF_T* ptPck)
{
TLR_UINT32 ulStatus;
DNS_FAL_GEN_STATUS_T* ptPck1; // Status Data

ulStatus = ptPck->tHead.ulSta;
TLR_POOL_PACKET_RELEASE(ptRsc->tLoc.hPool, ptPck);

/* This code below handles the information between Master and Slave
After checking the information, then set the state of LEDS */
if(ulStatus == TLR_S_OK)
{

DnsApp_GetStatus_Req(ptRsc); /* update the request */
}
else
{
/* ToDo */
}

}

void DnsApp_GetStatus_Req(DEVICENET_DEMO_RSC_T FAR* ptRsc)
{
TLR_UINT32 eRslt;
DNS_FAL_PACKET_GET_STATUS_REQ_T* ptPck;
eRslt = TLR_POOL_PACKET_GET(ptRsc->tLoc.hPool, (TLR_VOID*)&ptPck);

if( eRslt == TLR_S_OK )
{
TLR_QUE_LINK_SET_PACKET_SRC(ptPck,ptRsc->tLoc.tQueSrcDnsApp);
ptPck->tHead.ulCmd = DNS_FAL_CMD_GET_STATUS_REQ;
ptPck->tHead.ulLen = 4;//sizeof(DNS_FAL_PACKET_GET_STATUS_REQ_T);
eRslt = TLR_QUE_SENDPACKET_FIFO(ptRsc->tLoc.tDnsFalQue,ptPck,TLR_FINITE);
if(eRslt == TLR_S_OK)
{
/* ToDo*/
}
else
{
TLR_POOL_PACKET_RELEASE(ptRsc->tLoc.hPool, ptPck);
}
}

}

Br,
Rainer

Andreas Jacob

Andreas Jacob

Hilscher Gesellschaft fuer Systemautomation mbH

| 16.02.2009 | 14:41

Hi Rainer,

please try the following code:

void DnsApp_GetStatus_Cnf(DEVICENET_DEMO_RSC_T FAR* ptRsc, DNS_FAL_PACKET_GET_STATUS_CNF_T* ptPck)
{
  TLR_UINT32 ulStatus;
  DNS_FAL_GEN_STATUS_T* ptPck1;  // Status Data
  
  ulStatus = ptPck->tHead.ulSta;
  TLR_POOL_PACKET_RELEASE(ptRsc->tLoc.hPool, ptPck);

/* This code below handles the information between Master and Slave
After checking the information, then set the state of LEDS */
if(ulStatus == TLR_S_OK)
{

DnsApp_GetStatus_Req(ptRsc); /* update the request */
}
else
{
/* ToDo */
}

}

void DnsApp_GetStatus_Req(DEVICENET_DEMO_RSC_T FAR* ptRsc)
{
TLR_UINT32 eRslt;
DNS_FAL_PACKET_GET_STATUS_REQ_T* ptPck;
eRslt = TLR_POOL_PACKET_GET(ptRsc->tLoc.hPool, (TLR_VOID*)&ptPck);

if( eRslt == TLR_S_OK )
{
TLR_QUE_LINK_SET_PACKET_SRC(ptPck,ptRsc->tLoc.tQueSrcDnsApp);
ptPck->tHead.ulCmd = DNS_FAL_CMD_GET_STATUS_REQ;
ptPck->tHead.ulLen = 4; //sizeof(DNS_FAL_PACKET_GET_STATUS_REQ_T);

/* Changes */
ptPckt->tData.usArea = 0; // 0 -> Get diag struct DNS_FAL_GEN_STATUS_T
ptPckt->tData.usSubArea = 0; // 0 -> Get the entire diag struct DNS_FAL_GEN_STATUS_T

eRslt = TLR_QUE_SENDPACKET_FIFO(ptRsc->tLoc.tDnsFalQue,ptPck,TLR_FINITE);
if(eRslt == TLR_S_OK)
{
/* ToDo*/
}
else
{
TLR_POOL_PACKET_RELEASE(ptRsc->tLoc.hPool, ptPck);
}
}

}

Login