industrialNETworXnetx

Rainer Versteeg

Rainer Versteeg

| 13.02.2009 | 15:31 | 2 replies

Manage State and Error LED

Hi,

Can I manage the state and error LED from the DeviceNet Stack ?

In the Profibus Stack I can do this:

/* =============================================================================

Function: APS_StateChanged_ind

- Indicate that the internal stack state has changed

------------------------------------------------------------------------------

Input : (PROFIBUS_AP_RSC_T FAR* ptRsc) - Pointer to APS Resources

Output : -

Return : -

============================================================================= */
void FAR APS_StateChanged_ind(PROFIBUS_APS_RSC_T FAR* ptRsc, PROFIBUS_APS_PACKET_T FAR* ptPck)
{
if (ptPck->tStateChangedInd.tData.ulState != (-1))
{
/* Handle the new State */
switch (ptPck->tStateChangedInd.tData.ulState)
{
case RCX_COMM_STATE_STOP:
myDpMemory->PROFIBUS_STATE=0x00;
Mid_LedSetState(ptRsc->tRem.hMNSRedLed, LED_MODE_OFF, 500, 50);
Mid_LedSetState(ptRsc->tRem.hMNSGreenLed, LED_MODE_ON, 0, 0);
break;

case RCX_COMM_STATE_IDLE:
myDpMemory->PROFIBUS_STATE=0x01;
Mid_LedSetState(ptRsc->tRem.hMNSRedLed, LED_MODE_OFF, 0, 0);
Mid_LedSetState(ptRsc->tRem.hMNSGreenLed, LED_MODE_ON, 0, 0);
break;

case RCX_COMM_STATE_OPERATE:
myDpMemory->PROFIBUS_STATE=0x02;
Mid_LedSetState(ptRsc->tRem.hMNSRedLed, LED_MODE_ON, 0, 0);
Mid_LedSetState(ptRsc->tRem.hMNSGreenLed, LED_MODE_OFF, 0, 0);
break;

default:
break;

}
}
} /* APS_StateChanged_ind */

Br,
Rainer

Andreas Jacob

Andreas Jacob

Hilscher Gesellschaft fuer Systemautomation mbH

| 16.02.2009 | 08:57

Hi Rainer,

the DN-Stack does not support this possibility.
The stack have the complete control for the LEDs. There is no chance for the user to manage this.

Rainer Versteeg

Rainer Versteeg

| 16.02.2009 | 09:43

Thank you AJ.

Br,
Rainer

Login