Jump to content

Recommended Posts

Hi,

For a test setup between my Laptop en a PLC i'm trying to configure an Ethernet connection. Easy peasy you would say. Well, apparently not.

Init of the TCP/IP card and the socket (socket 1 in this case) is all successful. 

I made the following settings on de PLC:
TCP/IP card init: IP address -> 192.168.0.1, subnetmask -> 255.255.255.0, Default gateway -> 192.168.0.254
Socket init: Socket 1, Protocol -> TCP, Port -> 20256, client/server -> client (master).

My laptop's IP address is set to 192.168.0.10

When I ping the PLC from my laptop is this successful.

The PLC is set als Master (intentionally). For testing I've also tried set the PLC to Slave. This had no positive result.

I can't find the reason why the socket status will not switch to connected. 

 

Explanation for the attached picture. please read MB0 as SB2. MB0 is set on start up by SB2. When all initialization is done, MB0 will be reset.

 

In advance, thanks for any help.

 

Leyke

TCPIP set up.jpg

Link to comment
Share on other sites

Hi;

  I see the note about   MB 0 being set by  SB2, 

   Are these nets in a subroute?  Is the subroutine being called?

   If not sure -  put a Incremental counter ( XI whatever)    at the top of the subroutine- attached to the rail.

        If it counts, the routine is /was  active.  If not counting, subroutine ius not currently being called.

DanT

Link to comment
Share on other sites

2 hours ago, DanT said:

Hi;

  I see the note about   MB 0 being set by  SB2, 

   Are these nets in a subroute?  Is the subroutine being called?

   If not sure -  put a Incremental counter ( XI whatever)    at the top of the subroutine- attached to the rail.

        If it counts, the routine is /was  active.  If not counting, subroutine ius not currently being called.

DanT

Yess, it's called. As long as MB0 is high, the "start-up" subroutine is called (see attached picture).

For testing I've put the status of SB 142, (Ethernetcard Initialized), SB144 (Ehternet Socket 1 Initialized), SB151 (Ethernet status: Link) and SB148 (Ethernet socket 1: Connected) on the HMI.
Only SB148 stays 0 in my case. 

Schermafbeelding_20221108_201112.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.