Sign in to follow this  
steveandrews

Modbus omron E5CC temperature controller

Recommended Posts

Hi,

I am having some issues with Modbus and a temp controller. I think I am ok with daqfactory but very new to modbus. In the past I have used my own comms protocol over rs232 but now trying modbus over rs485. I have an omron K3SC-10 usb to rs485 converter and used this with a Yokogawa temperature controller absolutely fine. I used Modbus ASCII, found the registers in the manual and used the standard daqfactory commands to read holding S16 for each register. Surprisingly easy! I couldnt get hold of another yokogawa temp controller so bought an equivalent Omron E5CC model. Its running Modbus RTU and I have SD and RD traffic so everything is working comms wise. The manual wasn't so easy to understand so this took a while.

My problem is that I just get modbus timeouts when I try to read any registers, sometimes I got some random (to me) data but then it stopped. I think this is because it doesn't recognise the commands I am sending? I found the quickmod program that you made (screenshot attached) and i can see some of the data I want: 248 is 24.8 degrees C! I don't really understand the tag number and number of points? Is tag the register? Is number of points trying to read an array or a range of registers?? I'm very confused but think I am close. I've attached the temp controller comms manual. I don't really understand about 2 or 4 byte modes and if the registers are in hex or what!? 

I think I have got as far as I can now using trial and error and very basic understanding but now maybe I need to actually understand what's going on! I'm ok with rs232 because you send it a command and it sends something back, simple conversation. I think modbus is the same, but I don't really understand the conversation between devices and the upper, GUI level isn't working for me. Maybe it's simple and you can explain what I am missing or if you have a suggestion for some easy learning material for me? I need to read the temperature controller PV and setpoint and write setpoints and PID values.

Cheers

Steve

Capture2.JPG

 

E5_C_CommunicationsManual_EN_201404_H175-E1-08 (1).pdf

Share this post


Link to post
Share on other sites

Yeah, the Omron E5 manual for the controller is a bit confusing.  Obviously written by someone without a real grasp of what is important, and what's just filler.  They also say things like "Set in hexadecimal" but that's not right unless they are talking about ModbusASCII.  "Hexadecimal" doesn't really apply in binary protocols like RTU.  Hexadecimal is just a way of describing a particular number.  So is decimal.  The number 0F in hexidecimal is the same number as the number 15 in decimal, which is the same number as 1111 in binary.  So when you see all the "hexidecimal" in the manual, really just think "number".  The exception is when they actually show a value in hexadecimal.  Then they are using the hex notation so you need to know.  In many cases they use the rather non-standard H' in front of hex represented numbers, but they don't do this consistently.  I, for one, had to look through the two-byte mode addresses to see whether they were decimal or hex since you can't tell the difference unless its notated, or you see the letters A through F in the number.

Anyhow, I rant.  Mostly because Modbus shouldn't be this complicated, and manufacturers seem to insist on writing bad manuals.

OK, now to your questions.  A tag is the same as a Modbus address, though really the tag is the thing at a particular address.  So, for example, "10 Downing Street" is an address, and the UK prime minister's house at that address is the tag.

Now on to the addressing they documented.  This controller has two sets of addresses for the exact same thing.  This is the 2 byte vs 4 byte mode.  So, address 0 and address hex 2000 are the same value, the PV or temperature, but address 0 returns the value as a 32 bit integer, while address hex 2000 returns the value as a 16 bit integer.  Which you use I think largely depends on the software you use.  DAQFactory supports 32 bit values, so you might as well use those addresses.  You'll just need to tell DAQFactory to read 32 bits, not 16, so you need Read Holding S32, or perhaps the reverse word version.  Then you'll see that the addresses increment by 2.  This is because Modbus addresses can only hold a 16 bit value, so it takes two consecutive addresses to create a single value.  You can see this in your data in your screen shot.  Its why you see "0" in the 0 section, then "248" then another "0" then 28672.  The value is 32 bit, it just isn't use the first 16 bits and those are all 0.

So, use 4 byte mode by using Read Holding S32 (or U32, or the reverse word versions), then use the addresses listed in the 4 byte column converted to decimal.  DAQFactory does not accept hex represented addresses in the Channel #, so you'll have to use a calculator, like the one built into Windows, to convert from hex to decimal.  So for example, if you wanted to read the Set Point at address hex 0106, you'd have to put in 262 decimal into the channel # in DAQFactory.  These are the same number just represented two different ways.

 

Share this post


Link to post
Share on other sites

Hi, that's perfect! Thanks as always for your quick reply and help. You just made it all so much more simple.

You are right, the manual just confused the hell out of me. Omron is Japanese and therefore there is no such thing as "filler" every detail is important and must be listed. This is my experience from living here at least. There will be a quickstart manual, likely with animal cartoons and not enough info, then a detailed manual with so much info it could be used to clone the product. My IT classes at high school are coming back to me now. Of course 2 bytes is 16 bit and 4 is 32 so the manual should just say "if you want to read the register as a 32 bit long, use the address in the 4 byte column. Each register is 16 bit so a 32 bit long integer uses two registers. Addresses are written in hex". It would also be nice if they made it clear which registers are read/write and if there are limits to the number of writes. I'm assuming not for now!

The 32bit signed reverse word read holding worked for me. The other issue I had is my timeout was too short and depending on what reply i was requesting it would timeout sporadically.  Changed it to 1000 ms and it's perfect. I'm just writing to the set point register and that works great too. If I pull the power and reset the controller it remembers the setpoint so is non volatile but not sure if there is a write limit. Maybe newer hardware like this uses better memory?

On the subject of pulling the power. Is there a way to re-establish comms after a power cycle? Currently it will restart if i go into comms setup. I could catch the timeout error and loop a sequence to attempt re-connection until it replies? I had a look at your quick mod program but it doesn't reconnect after a power cycle

Thanks again

Share this post


Link to post
Share on other sites

There is always a write limit on flash memory.  Usually its around 10,000 iterations, but may be better now.  SSD's use wear leveling to help with this, but I doubt a PLC is going to use anything too modern or fancy.  Its also possible that its not flash, but instead either battery or capacitance backed memory, in which case there shouldn't be a wear limit.

As for reestablishing, you can do:

device.myDevice.initComm()

to reestablish the socket or reinit the serial port, though serial connections don't typically need to be reconnected.  I'd just create a watch dog to do it.  Something like:

while(1)
   if (systime() - someInputChannel.time[0] > 10)
      device.myDevice.initComm()
      delay(60)
  endif
  delay(1)
endwhile

and let that run in the background.  Note that you probably don't want to initComm() more often than once a minute for ethernet comms, thus the delay(60) inside the if().

 

Share this post


Link to post
Share on other sites

Ah nice, so the code just re-initialises the serial every 60 seconds if data is not received from the input channel for more than 10 seconds.

I'd not thought of using the .time of a channel like that but that's really useful.

Cheers 

Share this post


Link to post
Share on other sites

Can you please tell how to RUN/ STOP OMRON E5DC controller using Modbus RS-485?

Share this post


Link to post
Share on other sites

You would need to look through the Omron Modbus communication manual for the register list.  I took a brief look and there isn't a register explicitly labelled on/off.  The closest is labelled PID On/Off and it is register 11540.  This is presumably a holding register, U16 that you set to either 0 or 1.  I selected the 2 byte mode registers.  If you want the 4 byte, it would then be a holding register U32 at address 3368.  

That all said, I have not worked with these controllers so can't say for sure if that is the register you want.  

Share this post


Link to post
Share on other sites

PID is used to switch between ON/OFF control technique or PID technique.

I need modbus address for RUN/ STOP command.

It is present in topic 2-3-8 but I am unable to understand.

Please someone help.

Share this post


Link to post
Share on other sites

Section 2 is for CompoWay protocol, which is some proprietary format.  You need to stick with section 5 which is for Modbus.

Share this post


Link to post
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
Sign in to follow this