Unitronics v570 ethernet and modbus

dahnuguy

Member
Join Date
Mar 2007
Location
SC
Posts
720
I need to connect a V570 to several V350s and my PC.

I have a hub to connect them all with ethernet.

I have read the vague help files and even read the Unitronics forum and tried to parse the incomplete answers there.

I have named the PLC. Initialized the ethernet card. Initialized the socket.
Set the modbus parameters. And connected the socket.

This was working earlier today, but during testing, I closed the socket, now nothing I do will open it.

I can't find a good explaination of how the sockets work or a good explaination of how to use the port numbers.

Each of the 4 sockets has a default port number for different types of communication. Can the port numbers be changed? Must they be a certain number ? If so what where how.

I can't even use the PC to connect to the V570 through ethernet now.

I suspect a hardware failure, but I am not familiar enough with the 2000 variables to be sure.

Why does communication have to be so difficult?

I am using the example code, I did have it working PLC to PLC and online with PC with no issues. Then after closing the socket to see if it could be recovered, NADA.
 
I need to connect a V570 to several V350s and my PC.

I have named the PLC. Initialized the ethernet card. Initialized the socket.
Set the modbus parameters. And connected the socket.

This was working earlier today, but during testing, I closed the socket, now nothing I do will open it.

I can't find a good explaination of how the sockets work or a good explaination of how to use the port numbers.
I am in the middle of this my self. The modbus master example wouldn't work for me, and the code in the help file for modbus master is incomplete. But all is not lost - it really will work!

Each of the 4 sockets has a default port number for different types of communication. Can the port numbers be changed? Must they be a certain number ? If so what where how.
Yes, all four are adjustable. I set them explicitly in ladder as I have found that no two Unitronics PLCs come with the same default set, no matter what the documentation claims. I pulled a new one out of the box this morning and not one of the sockets was as described as default. In fact, they were weird ports I have never seen used. But set them in ladder, and it doesn't really matter. Under COM->TCP/IP there is a Socket INIT FB to set the local sockets. I usually do the following, but this is specific to my setup and how I design things - yours will likely be different:

Socket 0 : Protocol HTTP : Port 80 : Slave (for web access)
Socket 1 : Protocol PCOM : Port 20256 : Slave (for programming access)
Socket 2 : Protocol TCP : Port 502 : Slave (Modbus slave)
Socket 3 : Protocol TCP : Port 20257 : Master (Modbus Master)

My first code line is:

Power Up Bit (SB2) -> Eth Card Exists(SB141) -> Card Init FB -> PLC Name FB -> then the socket parameter FBs I need (usually all 4)

I can't even use the PC to connect to the V570 through ethernet now.

The PCOM protocol socket at that port is required. The port is adjustable in visilogic.

I have working code that allows me to close a socket with a button then re-open with another button on the screen. PM me if you want a copy ([email protected]). It wasn't easy to figure out how to do it, but there was an obscure post on the forum that hinted at it and it works now. The key is once the socket is closed I had to do a Sock Init FB again, then, and only then, would the TCP Connect FB work again. I also found a managed switch with port mirroring and wireshark to be indispensible for this sort of thing - to see the TCP handshake in progress, and who breaks the connection, etc. My Modbus test slave (Redlion G3) closes the connection after a couple of seconds of inactivity.
 

Similar Topics

Can someone explain to me how I can load an existing program from a V570 unit onto an SD card and transfer that program to a new unit? I...
Replies
4
Views
4,184
I am trying to down load a program direct from a laptop to the above PLC and I keep getting the error 210 which pertains to TCP connection, not a...
Replies
10
Views
5,080
If anyone is using the Unitronics V570 I would appreciate some help if you have time. A V570 with expansion I/O modules was delivered into my...
Replies
9
Views
6,687
Greetings all! Disclaimer - I don't work for Unitronics, I'm just a fan of their products :) For those who don't know, Unitronics makes low-cost...
Replies
4
Views
7,367
I have a nice project in Visilogic that I have been asked to re-create in Tiaportal/Siemens. (Bosses / maintenance want to standardise on one...
Replies
2
Views
1,307
Back
Top Bottom