Page 1 of 2

Modbus communications - problems when using Data Exchange

Posted: Thu Jun 20, 2013 9:47 am
by PeteLam
I have a T10A screen.

I'm communicating to a bank of 6 dual-loop temperature controllers (Ascon Tecnologic) via Modbus RTU at 9600 baud.

I need to communicate Setpoint and Measured values back and forth to a PLC (Panasonic/Matsushita FP-X).

Generally, things are working, but I get a lot of communications failures on the Modbus network. These failures seem to occur only when I use Data Exchange.

For testing purposes, I created a barebones program/screen that ONLY displays the SP and temp variables for the 12 control loops. 24 analog numeric tags on one sceen, and there are no other screens. Everything works fine with no comm errors. Once I set up a few tags to perform Data Exchange, however, the comm errors begin immediately. Generally, out of the six Temp Controllers, at least one of them will generate an error every 5 seconds or so. I have masked these failures from the operator by setting the "Hide Comm Error" flag to TRUE.

If I were only monitoring the measured values, this would be sufficient, as the temperatures don't vary and I don't need fast update rates. The problem is that the failures sometimes occur when the PLC needs to communicate a new Setpoint, or if I load a new recipe from the touchscreen. There have been instances when the T10A thinks it has changed the setpoint, but it hasn't taken effect because the temperature controller never received the change. The workaround for this is to manually change the temperature to something else, and then change it back to what the recipe value was. However, the operator usually does not know that the failure occurred.

Any ideas? I'm going to experiment with baud rates, but I don't hold out much hope for that. The Ascon's can only do 1200/2400/4800/9600 baud. I'm not sure that slowing it down will help with the errors.

Re: Modbus communications - problems when using Data Exchang

Posted: Thu Jun 20, 2013 9:50 am
by PeteLam
I also wonder if it might be helpful to use Internal memory variables as an intermediate storage container for the purposes of Data Exchange. It's kind of kludgy, but could it work?

Re: Modbus communications - problems when using Data Exchang

Posted: Thu Jun 20, 2013 10:27 am
by mark.monroe
You should take a look at this forum post on how to debug serial port communication issues. You should use maxterm and monitor the communication on the serial port line. More than one of your controllers may be sending out data on the line at the same time. If you monitor the serial communication you will hopefully see the corrupted messages and get a better idea of what is going on.

Re: Modbus communications - problems when using Data Exchang

Posted: Thu Jun 20, 2013 11:28 am
by PeteLam
Thanks Mark.

I'll give that a try.

Re: Modbus communications - problems when using Data Exchang

Posted: Thu Jun 20, 2013 11:38 am
by PeteLam
Mark, do you know if Maxterm will work with RS-485?

Like most computers nowadays, my laptop does not have legacy serial ports. It looks like in order to use Maxterm, I will need to have (2) USB-RS485 converters. I think I have a second converter, but I'm not certain how nicely they will play with each other. Have you had any success with this type of setup?

Thanks,
Pete

Re: Modbus communications - problems when using Data Exchang

Posted: Thu Jun 20, 2013 12:04 pm
by mark.monroe
Yes, maxterm will work with RS-485 converters. To maxterm RS-485 looks like a normal serial single. You may want to verify that you have terminated the RS-485 line.

Re: Modbus communications - problems when using Data Exchang

Posted: Thu Jun 20, 2013 12:17 pm
by PeteLam
Okay, I'll try this after playing with baud rates.

It occurs to me that I can probably get rid of Data Exchange if there is a way to have a tag that changes multiple controller addresses simultaneously.

In this case, although I have 12 Temperature Loops, the setpoints for all 12 loops will usually be the same. One of my uses for Data Exchange is for the PLC to copy the SP from one controller to all the rest, but if I could take the PLC out of that loop, then I can just have the tag update the values in both controllers without using Data Exchange.

Specifically, I'd like one tag that will update two specific Modbus registers (#40000 and 40034) at six different Modbus addresses (1 through 6). I tried to do this earlier, but I couldn't figure it out so I put in my current workaround. Is there a way to do this without any C# scripting? I'm not familiar yet with C/C#, so I'm not comfortable troubleshooting any issues that may occur.

Re: Modbus communications - problems when using Data Exchang

Posted: Thu Jun 20, 2013 12:39 pm
by mark.monroe
You can put code in the value change event of one of the tags and then have it copy the value of it to other tags. There are a lot of examples on how to do this on the forum. Just search for scripting.

Code: Select all

void Tag1_ValueChange(System.Object sender, Neo.ApplicationFramework.Interfaces.Events.ValueChangedEventArgs e)
		{
Globals.Tags.MyTag.Value = Globals.Tags.MyTag1.Value;
		}

Re: Modbus communications - problems when using Data Exchang

Posted: Wed Jun 26, 2013 2:35 pm
by PeteLam
Thanks Mark. The scripting worked out really well.

It turns out that Data Exchange is probably not the culprit here. Even after elimininating DE, I was still having a lot of Comm errors in my "real" program, not the barebones one I created for testing purposes. I played around with baud rates, but that didn't help. I also tried adjusting the communication "silent time" and timeout values. These seemed to help a little, but did not resolve the problems.

One other thing I tried was lengthening the polling intervals. Same result as above. I did not get a chance to play with Maxterm.

I did manage to redo my controls so that the comm failures can are better toloerated, however that is not a perfect situation. I am successfully using DE, but I've limited it to a single direction only (Ascon controller to PLC), rather than bi-directional. Seems to work OK.

Is it possible that the CPU on the T10A could get bogged down with managing three different controllers? How about the number of tags on-screen at any one time?

Current setup is as follows:

COM1 - Single Panasonic FP-X PLC via RS-232
COM3 - Single Animatics Smartmotor via RS-232
COM4 - (6) Ascon Temperature controllers (12 PID loops) via RS-485

Re: Modbus communications - problems when using Data Exchang

Posted: Wed Jun 26, 2013 3:40 pm
by mark.monroe
Yes, the CPU could be having issues servicing all the requests. iX will only poll tags that are on the currently displayed screen, unless you have the tag associated with a datalogger or set to "Always Active". There is a CPU system tag that will tell you the percentage of CPU the system is using. If the value is at 100% when you error occurs you might have found the issue. If that is the case, purchasing a more powerful HMI, like a TxB, might solve your communication problems.