industrialNETworXnetx

| 04.09.2008 | 16:29 | 7 replies

Problems with Ethernet/IP Example on netX 100 Network Evalua

Hello,

I tried to get the ExampleCode for the Ethernet/IP-Stack V2.0.10 running on the netX 100 Network Evaluation Board.

ShmDemo_Process.c Lines 141-149:

    lTemp = xChannelGetPacket(hChannel, sizeof(tRecvPkt), &tRecvPkt, 3000);
}

/* Waiting for netX warmstarting */
do
{
lTemp = xChannelHostState(hChannel, CIFX_HOST_STATE_READY, &ulState, 10);
}
while (CIFX_DEV_NOT_RUNNING == lTemp);

After execution of the first snipped line the Value of tRecvPkt.tHeader.ulState changes from 0x0 to 0xC0000125 - the Error Code for an invalid Network Adress. This happens if i use the original IP values - and if i change those values.

The xChannelHostState-function returns the Errorcode "0x800C0012" which means "Device not running" - and so the example loops in the while-loop.

Has anybody an idea where i can search for the problem?

Thanks you for response!

Jonathan Schneider

Andreas Jacob

Andreas Jacob

Hilscher Gesellschaft fuer Systemautomation mbH

| 04.09.2008 | 16:37

Hello Jonathan,

which board are you using? An NXSB100?

If the answer is yes, the stack will not start, because the MAC address is missing. (The NXSB is not equipped with a Sec.Mem, which includes the MAC-Address.)
In this case you must add into the config.c file in front of the entry ""CONST FAR RX_EDD_PARAMETERS_T atrXEdd0Param[]=" " the following line "STATIC CONST FAR RX_EDD_MAC_ADDR_T tMyMac0={0x00,0x6e,0x65,0x74,0x78,0xCE};".

If the answer is no, you should check the warmstart parameters.

| 04.09.2008 | 17:22

Hello AJ,

thanks for the answer. I'm using an NXSB100 board.

I added the line like you told it:
Protocol/Sources/next100/Config.c lines 252-268

/************************************************************
*   Definition of the EDD Instances
************************************************************
*/

//Following Line Added by Jonathan - look at http://board.hilscher.com/viewtopic.php?f=34&t=419
STATIC CONST FAR RX_EDD_MAC_ADDR_T tMyMac0={0x00,0x6e,0x65,0x74,0x78,0xCE};

CONST FAR RX_EDD_PARAMETERS_T atrXEdd0Param[]=
{
{RX_EDD_PARAM_XPEC_NAME, "XPEC", 0},
{RX_EDD_PARAM_XMAC_RPU_NAME, "XMACRPU", 0},
{RX_EDD_PARAM_XMAC_TPU_NAME, "XMACTPU", 0},
{RX_EDD_PARAM_INTERRUPT_NAME, "COM0", 0},
{RX_EDD_PARAM_END_OF_LIST}
};

- but the problems are the same. Also i couldn't find any place in the sourcecode where the programm tried to get the new variable. Is it right where i have added the line or should it be in any structure?

Rainer Versteeg

Rainer Versteeg

| 04.09.2008 | 17:35

Hello Jonathan

CONST FAR RX_EDD_PARAMETERS_T atrXEdd0Param[]=
{
    {RX_EDD_PARAM_MAC_ADDR, &tMyMac0, 0},
    {RX_EDD_PARAM_XPEC_NAME, "XPEC", 0},
    {RX_EDD_PARAM_XMAC_RPU_NAME, "XMACRPU", 0},
    {RX_EDD_PARAM_XMAC_TPU_NAME, "XMACTPU", 0},
    {RX_EDD_PARAM_INTERRUPT_NAME, "COM0", 0},
    {RX_EDD_PARAM_END_OF_LIST}

Try to insert the MyMac0 in atrxEdd0Param[].

Br,
Rainer

| 05.09.2008 | 08:53

Hello Rainer,
thanks for your help. Now the example is running and i can try to connect the card via ethernet ;-)

| 08.09.2008 | 16:23

Hi,

is it normal, that "lTemp = xChannelIORead(hChannel, 0, 0, sizeof(abData), abData, 10);" in the while-loop always returns "0x800C0021" which means "CIFX_DEV_NO_COM_FLAG"?

| 09.09.2008 | 14:54

Hi,

does anybody know what the CIFX_DEV_NO_COM_FLAG means, and how i can fix the Problem?

Quote:
/* Waiting for netX warmstarting */
do
{
lTemp = xChannelHostState(hChannel, CIFX_HOST_STATE_READY, &ulState, 10);
}
while (CIFX_DEV_NOT_RUNNING == lTemp);

In that loop lTemp changes from CIFX_DEV_NOT_RUNNING to CIFX_DEV_NO_COM_FLAG (and leaves the loop) - but everytime when the function xChannelIORead gets called in the next loop it also returns CIFX_DEV_NO_COM_FLAG.

I thought that the Ethernet/IP example would include the Hilscher TCP/IP-Stack which includes ARP and ICMP and i wanted to watch the traffic betreen a Networkinterface and the NSBX 100 board via wireshark. But it seems that the board answers to no ARP or ICMP-requests, it doesn't seem to send any Ethernetframe to the pc...

simon

simon

| 09.09.2008 | 14:59

Well, I don't know about Ethernet/IP, but I know that in order to get fieldbus communication running, you have to initialize the appropriate stack with connection parameters, delivered in a warmstart packet. For fieldbuses a CIFX_DEV_NO_COM_FLAG error signifies that the device itself is running but gets no communication with the fieldbus network.

Login