Jump to content

Recommended Posts

Hi All

 

Im working on a project that requires a v570 to communicate with kepserver using modbus ip has anybody achieved this and if so what settings were used for both the v570 and kepserver

 

Thanks

Hello Active

 

Just did a simple test with Kepserver and selected the ”Modbus tcp/ip driver”

Channel properties=>Ethernet settings selected port 502  and ip protocol tcp/ip.

Added a device and named it device1 and for the model selected “modbus”.

ID <135.0.2.78>20    The V570 has this ip address and 20 is the slave number in my test situation.

 

In the V570 socket init in my case socket 3 port number 502 and server(slave) followed by

A Modbus ipconfig,selected in this function block socket 3 and gave it network id 20,time out 100 and retries 3 and assigned a function in progress mb.

The indexes with slaves can be deleted using the clear link button.

 

The next network has to have a “Modbus ip scanex” block  and for the name in this block select the name of the Modbus ip config block.

TCP card init was already done somewhere else in the program but you could follow the example explained in the visilogic helpfile and it’s called “configuring a modbus slave device”.

In this example for the gateway you have to choose the ip address of the master unitronics plc but this is only needed I think if communication is between Unitronics plcs so leave the TCP settings in this block as they should be four your local network.

For addresses see the example in the visilogic helpfile called “slave addressing” under Modbus ip.

 

To test this  all I started kepware opc quick client and added here an item “channel1.device1.40032” and here I can see the actual value from MI31

So kepware acts as a Modbus client and the V570 as a Modbus slave device in this situation.

 

Did no projects with kepware and Unitronics but in our plant we have some Unitronics plc,s besides TI(CTI) PLC,s connected to Control Maestro(Wizcon) scada using Kepserver so this is why I could quickly made a simple test.

 

Hope it will help you

Regards

Henny

  • Upvote 3
Link to comment
Share on other sites

  • 2 years later...

It would be helpful to submit your ladder and screenshot of tags settings, that's probably where the problem is. If you did all as in Henny's post maybe you have a problem in network. Did you try to ping V570? Also try pinging with cable disconnected, maybe you have two devices with same IP address.

Link to comment
Share on other sites

Solve the problem. just change TCP/IP Project Setting Port Number Change to 20257

Thanks All.

 

 

one more question.....

I already connect plc with KepserverEX, But I want to connect and see values on internet browser same time. 

when i cahge tcp/ip socket init ; socket 0, protokol: HTTP, Port: 80, server, i see on web browser but i cant see on KepserverEX

How can i make it ?

Link to comment
Share on other sites

  • 2 years later...
  • 1 year later...

image.png.3db489249bc654b07398bda9c2347a55.png

So this is how I currently have it.  Originally I had Socket 0 with TCP and port 502 (slave) and that by itself didn't seem to work.  I added the last instruction 'Modbus IP Config' and set the Network ID to 20 etc.  I'm just confused, do I need both of those instructions?  Do I only need the Modbus IP Config?  And if I want to open two sockets do I use two Modbus IP Config instructions?  Set them both to Network ID 20 or two different ID's?

Link to comment
Share on other sites

  • MVP 2023

Yes you need to initialize and configure each socket you're going to use for MODBUS IP. Pick any two sockets, though I would leave Socket 1 initialized to Port 20256 to use for a VisiLogic connection. I would keep Socket 2 at the default of Port 502 and initialize Socket 3 to Port 503, but it doesn't really matter - just don't initialize two sockets to the same port number, keeping in mind the default assignments.

You also need to configure each socket you're going to use for MODBUS IP with a MODBUS IP Configuration block. Don't duplicate addresses. The network ID isn't important with TCP, as I understand it, but you can assign them any way you want.

Then you will need two separate MODBUS IP SCAN_EX function blocks. Be sure the SCAN_EX block assignments match to the relevant MODBUS configuration names.

Set up one of the masters to communicate with port 502 and the other to port 503.

That's all there is to it.

Link to comment
Share on other sites

  • MVP 2023

Socket 2 defaults to Port 502. You have both Socket 0 and Socket 2 set to Port 502. Sometimes that works, but it is very bad practice to do that. Unitronics generally recommends that you Initialize all 4 sockets, even if don't plan to use them all so that you can be sure there are no conflicts.

image.png.50fd85e26bc3a0c91d07dfec0641127f.png

Link to comment
Share on other sites

image.thumb.png.1e57a07f4779012b2579bd805d8a9c0a.png

OK, these are the new rungs.  So the default for socket 3 is TCP(20257) but I've initialized it to TCP 503.  It still shows up in the config as TCP(20257) though.  Guess that's just documentation saying thats the default?  See any issues with this?  Forgive any mistakes, I have no experience with Unitronics. 

Link to comment
Share on other sites

  • MVP 2023

Yes that all looks correct assuming you have the SCAN_EX blocks addressed correctly. And yes, you are correct that the MODBUS Configuration block is just showing you the defaults.

There is no need to pack your ladder rungs so much. I like to tell people that Unitronics does not charge you by the rung. Break those logic pieces into separate rungs. What you have should work, but new users often get in trouble with overly complicated ladder rungs that don't compile the way you think they would. I would place each Socket Initialization, with its accompanying MODBUS Config into a separate rung (with SB 2 in front), and each SCAN_EX block into a separate rung.

Link to comment
Share on other sites

  • MVP 2023

A couple of things:

1) Please do NOT place multiple logic threads in a single ladder rung. You did not break them up into separate rungs. The whole point of ladder rungs is to separate out the logic so there are no conflicts or confusion within a logic statement.

2) You don't really need anything in front of the SCAN_EX blocks. Just hang them directly on the left ladder rail. If you feel like something should be there, use SB 145 & SB 146 instead.

Link to comment
Share on other sites

11 minutes ago, Flex727 said:

A couple of things:

1) Please do NOT place multiple logic threads in a single ladder rung. You did not break them up into separate rungs. The whole point of ladder rungs is to separate out the logic so there are no conflicts or confusion within a logic statement.

2) You don't really need anything in front of the SCAN_EX blocks. Just hang them directly on the left ladder rail. If you feel like something should be there, use SB 145 & SB 146 instead.

Yes, used ladder logic in AB of course but I think things are defined differently.  Looks like what you're calling a rung is the whole blank space between the lines with the number 1,2,3 etc.  And what I'd call a rung you're referring to as a logic thread.  AB constructs the rung lines automatically as you drop in instructions.  I believe this format is similar to Modicon and others I've used on occasion.  Calling the whole space or rung a 'Net'.  Just different and I have to orient myself and figure it out. 

So I need to create a new  'Net' and put each individual rung or logic thread per Net.  I think I can see why it didn't work now...

Exactly what I meant by new at Unitronics.  :)

Link to comment
Share on other sites

  • MVP 2023

Make sure your sockets are set up as TCP slaves

image.png.ce42f40392a811252d9fbe54edc8a201.png

 

You don't have to pull the output instructions all the way to the right.  Unitronics is much more free-form than AB.  Back in the day, Modicon 984s also programmed in "nets".  

I still program AB when the customer calls for it and, yes, Unitronics takes some getting used to if that's your background.  If you're still getting hung up post your program so we can "zoom in" to the blocks.

 

Joe T.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...