EmbeddedRelated.com
Forums

TCP connection via Ethernet Switch

Started by Phahee March 30, 2010
Hello Friends,

I have been using BL2600 for my projects to communicate with Touch Screen
Panels via Modbus TCP. I used a cross over Ethernet cable so far because I
used one to one connection.

Now I tried to connect two BL2600s to one single Touch Screen via an
Ethernet switch using straight through cable. This works fine, but when any
of the BL2600 looses physical connection it cannot pick up when the cable is
plugged in again (yellow LEDs are off). I need to restart the system to get
the physical connection again.

BL2600s are programmed as Modbus Slave devices as the touch screen I am
using is a Modbus master device. I am doing the following settings

#define INACTIVE_PERIOD 5

#define KEEPALIVE_WAITTIME 3

#define KEEPALIVE_NUMRETRYS 3

#define MB_MAX_SKT 1

#define TCPCONFIG 0

#define USE_ETHERNET 1

// set up my IP addresses

#define IFCONFIG_ETH0 \

IFS_IPADDR,aton("192.168.1.200"),
\

IFS_ROUTER_SET, aton("192.168.1.1"), \

IFS_NETMASK,aton("255.255.255.0"), \

IFS_UP

#define PORT 502

#define MY_MODBUS_ADDRESS 1

#use "dcrtcp.lib"

#use "MODBUS_SLAVE.lib"

#use "MODBUS_SLAVE_TCP.lib"

#use "MODBUS_SLAVE_BL26xx.lib"

void main(void)

{

brdInit();

sock_init();

while (ifpending(IF_DEFAULT) == IF_COMING_UP) {

tcp_tick(NULL); }

MODBUS_TCP_Init (MY_MODBUS_ADDRESS, PORT );

While (1)

{

MODBUS_TCP_tick();

}

}

Both BL2600s have the above code. I did the necessary settings on Touch
screen. Both are communicating to the touch screen. When I plug out the
Ethernet cable from any of the BL2600s, it looses the connection. When I
plugged in back there is still no physical connection (yellow LEDs are still
off).

Does anyone have any idea to solve this problem?

Thank You

Phahee
Hello Friends,

I have sorted out this problem by using

If (pd_havelink(IF_ETH0) )

{

MODBUS_TCP_tick();

}

Phahee

_____

From: r... [mailto:r...] On
Behalf Of Phahee
Sent: Tuesday, March 30, 2010 6:05 PM
To: r...
Subject: [rabbit-semi] TCP connection via Ethernet Switch

Hello Friends,

I have been using BL2600 for my projects to communicate with Touch Screen
Panels via Modbus TCP. I used a cross over Ethernet cable so far because I
used one to one connection.

Now I tried to connect two BL2600s to one single Touch Screen via an
Ethernet switch using straight through cable. This works fine, but when any
of the BL2600 looses physical connection it cannot pick up when the cable is
plugged in again (yellow LEDs are off). I need to restart the system to get
the physical connection again.

BL2600s are programmed as Modbus Slave devices as the touch screen I am
using is a Modbus master device. I am doing the following settings

#define INACTIVE_PERIOD 5

#define KEEPALIVE_WAITTIME 3

#define KEEPALIVE_NUMRETRYS 3

#define MB_MAX_SKT 1

#define TCPCONFIG 0

#define USE_ETHERNET 1

// set up my IP addresses

#define IFCONFIG_ETH0 \

IFS_IPADDR,aton("192.168.1.200"),
\

IFS_ROUTER_SET, aton("192.168.1.1"), \

IFS_NETMASK,aton("255.255.255.0"), \

IFS_UP

#define PORT 502

#define MY_MODBUS_ADDRESS 1

#use "dcrtcp.lib"

#use "MODBUS_SLAVE.lib"

#use "MODBUS_SLAVE_TCP.lib"

#use "MODBUS_SLAVE_BL26xx.lib"

void main(void)

{

brdInit();

sock_init();

while (ifpending(IF_DEFAULT) == IF_COMING_UP) {

tcp_tick(NULL); }

MODBUS_TCP_Init (MY_MODBUS_ADDRESS, PORT );

While (1)

{

MODBUS_TCP_tick();

}

}

Both BL2600s have the above code. I did the necessary settings on Touch
screen. Both are communicating to the touch screen. When I plug out the
Ethernet cable from any of the BL2600s, it looses the connection. When I
plugged in back there is still no physical connection (yellow LEDs are still
off).

Does anyone have any idea to solve this problem?

Thank You

Phahee
Prahee,

If the BL2600 uses a core module with an ASIX Ethernet controller on it, you should contact Rabbit's Tech Support group (s...@rabbit.com) for an updated ASIX.LIB they have for Dynamic C 9.62. I think the new driver takes care of the link check at a lower level so you don't have to do it in your code.

-Tom
On Apr 5, 2010, at 10:03 PM, Phahee wrote:
>
> Hello Friends,
>
>
>
> I have sorted out this problem by using
>
>
>
> If (pd_havelink(IF_ETH0) )
>
> {
>
> MODBUS_TCP_tick();
>
> }
>
>
>
>
>
> Phahee
>
> _,_._,___
Tom,

Thank you for the reply. The BL2600 uses RCM3200 that uses ASIX Ethernet
controller. I contacted rabbit technical support and they sent me a patch
update to DC9.62 that includes updates to ASIX.LIB plus a number of other
library updates.

I updated the patch to DC 9.62 and tried the codes again. They are working
fine. I do not need to check the physical link in my code any more. The new
updated driver takes care of this.

Phahee

_____

From: r... [mailto:r...] On
Behalf Of Tom Collins
Sent: Wednesday, April 07, 2010 9:23 PM
To: r...
Subject: Re: [rabbit-semi] TCP connection via Ethernet Switch

Prahee,

If the BL2600 uses a core module with an ASIX Ethernet controller on it, you
should contact Rabbit's Tech Support group (support@rabbit.
com) for an updated ASIX.LIB they have for
Dynamic C 9.62. I think the new driver takes care of the link check at a
lower level so you don't have to do it in your code.

-Tom

On Apr 5, 2010, at 10:03 PM, Phahee wrote:

Hello Friends,

I have sorted out this problem by using

If (pd_havelink(IF_ETH0) )

{

MODBUS_TCP_tick();

}

Phahee

_,_._,___
On 4/9/2010 1:15 AM, Phahee wrote:
> Tom,
>
>
>
> Thank you for the reply. The BL2600 uses RCM3200 that uses ASIX
> Ethernet controller. I contacted rabbit technical support and they
> sent me a patch update to DC9.62 that includes updates to ASIX.LIB
> plus a number of other library updates.
>
> I updated the patch to DC 9.62 and tried the codes again. They are
> working fine. I do not need to check the physical link in my code any
> more. The new updated driver takes care of this.
>

And yet they were notified about the bug years ago and even included the
errata sheet ASIX had on the data sheet ZW included in their docs.

I seem to recall fixing this for Softools about the time 7.25 came out ;)

--
------
Scott G. Henion, Consultant
Web site: http://SHDesigns.org
Rabbit libs: http://shdesigns.org/rabbit/
------
On Apr 8, 2010, at 11:12 PM, Scott Henion wrote:
> And yet they were notified about the bug years ago and even included the errata sheet ASIX had on the data sheet ZW included in their docs.
>
> I seem to recall fixing this for Softools about the time 7.25 came out ;)

Scott,

I think you'll find that it's a different company now. A lot of bad things went away along with the Z-World name.

The recent Dynamic C 10 releases are worlds apart from the old days of Dynamic C 7, 8 and 9. If you browse through the Release Notes, you'll see that there's a lot happening with each release.

-Tom
On 4/10/2010 11:11 AM, Tom Collins wrote:
> On Apr 8, 2010, at 11:12 PM, Scott Henion wrote:
>> And yet they were notified about the bug years ago and even included
>> the errata sheet ASIX had on the data sheet ZW included in their docs.
>>
>> I seem to recall fixing this for Softools about the time 7.25 came out ;)
>
> Scott,
>
> I think you'll find that it's a different company now. A lot of bad
> things went away along with the Z-World name.
>
> The recent Dynamic C 10 releases are worlds apart from the old days of
> Dynamic C 7, 8 and 9. If you browse through the Release Notes, you'll
> see that there's a lot happening with each release.
>

Yes, they are rewriting near everything. I've given up trying to follow
it. I spent a day trying to find how to write to flash. The functions
have changed, there are numerous levels of code and _none_ of it is
documented properly. And still bugs are not tracked publicly.

I gave up as I could never write anything that would work from one
version to the next. Nowhere do they explain what they are doing, _why_
and what they plan on changing. Just a big list or release notes of
changes. For my DLM's and any chance of Softools support we needed this
info along with chip errata and things that still are not documented.
They say "we'll get right on it" then later act as If they have never
spoken with us.

The code looks like they have been writing for a PC with gigs of RAM.
Seems no wonder so many complain about running out of code space.

No they are not the same, from my point even worse. They are far less
responsive for my needs.



--
------
Scott G. Henion, Consultant
Web site: http://SHDesigns.org
Rabbit libs: http://shdesigns.org/rabbit/
------