Jump to content
Flex727

Transfer data between PLCs using MODBUS IP over Ethernet

Recommended Posts

I am fairly experienced with Unitronics PLCs and have done quite a few projects requiring communications with no major problems encountered until now. On this project I am sending data from one V570 PLC to another using MODBUS IP over Ethernet. My need is to send 160 registers (MIs) using R.H.R #3. I've found that I cannot send more than 125 registers without encountering status errors 4, 5, & 6. Is this to be expected? Are there any tips on how to handle this? If I were to break it down to two separate reads, what would be the best procedure - should there be a delay between the two reads?

 

Thanks.

Share this post


Link to post
Share on other sites

As a followup, I need to say that I really needed to transfer much more than 160 registers. My intent is to move 96 user-entered names of 10 characters each stored in 480 MIs from one PLC to another so that the customer doesn't have to enter them twice (they were in 3 vectors of 160 MIs, hence my need to read 160 in my original question). These names might change from time-to-time so I wanted a pushbutton to grab the names off the other PLC when needed. I broke the read into 5 pieces and tried executing them all at once without any delay and, surprisingly, it worked perfectly. The PB SETs 5 MBs. Each read is the standard line of code where the MB is N.O. and the power flows through the usual check for connected Socket and no other comm in progress, then a RESET of the MB at the end. Even though every single read is initiated in the same PLC cycle, they all execute properly. I may add the delay in anyway just for safety, but apparently Unitronics has some well-written MODBUS function code.

Share this post


Link to post
Share on other sites

If it works without the delay then I'd smile and leave it alone.  I've experienced problems with other functions that the delay fixed, but empirical data is the best data.

 

Joe T. 

  • Upvote 1

Share this post


Link to post
Share on other sites

I'm not sure I follow how the TCP/IP FB applies to my situation. I've never used it before and probably don't understand it properly. I'm always looking to learn something new - can you elaborate, Cara?

Share this post


Link to post
Share on other sites

I am fairly experienced with Unitronics PLCs and have done quite a few projects requiring communications with no major problems encountered until now. On this project I am sending data from one V570 PLC to another using MODBUS IP over Ethernet. My need is to send 160 registers (MIs) using R.H.R #3. I've found that I cannot send more than 125 registers without encountering status errors 4, 5, & 6. Is this to be expected? Are there any tips on how to handle this? If I were to break it down to two separate reads, what would be the best procedure - should there be a delay between the two reads?

 

Thanks.

Hi Flex: I understand you are going to send MIs between 2 V570 (or Unitronics PLC´s). You can send the 160 registers in one action (but only if the 2 PLC´S are Unitronics). You need to use the Read/Write Mixed Data (you can send a max of 240 MI´s) in a single action command. I only use the Read/Write Mixed Data if working with Unitronics PLC´s. If you need to communicate with 3rd party then use the standard commands.

  • Upvote 2

Share this post


Link to post
Share on other sites

I tried using the Read/Write Mixed Data FB today and it works well. One issue I came across was an offset when reading the slave registers. I was trying to read 200 MIs (MI 3700 - MI 3899) but when I entered MI 3700 into the FB, the data returned starts at MI 3701. Obviously it is easy to just start reading at 3699 instead and that worked properly, but should that offset be expected? There was no offset when I wrote MIs, just on the read.

Share this post


Link to post
Share on other sites

I'm going to bump this since I'm working on another project where I'd like to use the Read/Write Mixed Data FB. I'm just a bit concerned about that offset on the MI read, but not on the write. Is there just an inconsistency in the underlying code for this FB or am I doing something wrong, or what?

Share this post


Link to post
Share on other sites

Thanks, Cara. I did it a bit differently this time. I truly have a mix of MIs & MBs and a mix of reads and writes and don't see the offset this time. Before, I think I was just reading a single block of MIs. Also, I'm now using Visilogic 9.7.24, whereas before I was using 9.4.0. I'll have to revisit my previous project to look for other differences.

 

I'll say this, that R/W Mixed Data FB is mighty handy for what I do.

Share this post


Link to post
Share on other sites

I tried using the Read/Write Mixed Data FB today and it works well. One issue I came across was an offset when reading the slave registers. I was trying to read 200 MIs (MI 3700 - MI 3899) but when I entered MI 3700 into the FB, the data returned starts at MI 3701. Obviously it is easy to just start reading at 3699 instead and that worked properly, but should that offset be expected? There was no offset when I wrote MIs, just on the read.

Hi Flex,

I was just testing the Modbus IP R/W Mixed Data FB and I didn't encounter the issue you reported.

Can you please post your application and mention the PLC's you are working with?

Share this post


Link to post
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...