Omron CJ2M - Modbus TCP/IP - HMI over ENT

PeterCs

Member
Join Date
Nov 2014
Location
Budapest
Posts
11
Is it possible to use the same ethernet card (ETN21) for HMI connection and also for Modbus TCP/IP server, connection are via a standard switch.

The costumer wants to read out some data from PLC.

Im trying to use OMRON standard ETN server for this. Can be found here:
http://www.myomron.com/index.php?action=kb&article=1245
"MTCP_ETN_Server.zip"

Have anyone used this? Should this work? My only job is to put the FB into my PLC program. I am not calm.

Thanks!
 
I'm using the same ETN server function block as yours, but modified quite a bit since the original code is quite bare bones. I am also planning to run an additional connection to a HMI in addition to the Modbus TCP, just like your situation. Unfortunately, I can't definitively answer your question as I haven't had a chance to try this out yet. Still waiting for a test HMI unit from the customer.

However, I don't see any issues why it wouldn't work. Currently, my laptop is talking to the Omron PLC via Ethernet connection which uses FINS protocol. While online to the PLC, I can monitor the ETN FB working perfectly fine, so I don't see why it wouldn't work if the FINS connection went to the HMI instead of a laptop. This setup is using a standard switch as well.
 
I'm using the same ETN server function block as yours, but modified quite a bit since the original code is quite bare bones. I am also planning to run an additional connection to a HMI in addition to the Modbus TCP, just like your situation. Unfortunately, I can't definitively answer your question as I haven't had a chance to try this out yet. Still waiting for a test HMI unit from the customer.

However, I don't see any issues why it wouldn't work. Currently, my laptop is talking to the Omron PLC via Ethernet connection which uses FINS protocol. While online to the PLC, I can monitor the ETN FB working perfectly fine, so I don't see why it wouldn't work if the FINS connection went to the HMI instead of a laptop. This setup is using a standard switch as well.

Thanks for your answer. I am not calm beacuse in documentation of the FB I have read if not listen or established it restarts the ETN unit. Or it restarts only the tcp socket? im not sure about this part
 
Thanks for your answer. I am not calm beacuse in documentation of the FB I have read if not listen or established it restarts the ETN unit. Or it restarts only the tcp socket? im not sure about this part

The restart is only for the TCP socket connection. If the ETN module loses the TCP link and it doesn't re-establish within 10 seconds, it will reset itself. It does that by simply monitoring the ETN TCP status and starting a 10 second timer if the connection drops. The Omron FB only does basic error-checking on the TCP level. It doesn't actually do any error-checking on the Modbus layer. If that is not acceptable by your standards, you will have to write some additional code to compensate for those shortcomings.

As I said, the FB provided as-is is pretty bare-bones. As an example, it only supports ETN configured as Unit 0 because the addresses of all the ETN status variables are hard-coded. Luckily though, it is pretty easy to go through and manually change all the addressing to make it work for a different Unit Number. The FB also does not support any coil function codes except for single coil write, since digital values are bit-packed into input registers. If you want to do stuff like coil reads, you're gonna have to write that code yourself. It is definitely doable, but it may require just a bit of work.

I suggest going through the documentation to see what the FB code does and does not support. Depending on your needs, it may not be as simple as just putting the FB in there and expecting everything to work as you want. You might have to modify the FB a bit or write some extra code to make it fit into your project. However, I can say that the core Modbus TCP functionality in the FB works fine.
 
Last edited:
The restart is only for the TCP socket connection. If the ETN module loses the TCP link and it doesn't re-establish within 10 seconds, it will reset itself. It does that by simply monitoring the ETN TCP status and starting a 10 second timer if the connection drops. The Omron FB only does basic error-checking on the TCP level. It doesn't actually do any error-checking on the Modbus layer. If that is not acceptable by your standards, you will have to write some additional code to compensate for those shortcomings.

As I said, the FB provided as-is is pretty bare-bones. As an example, it only supports ETN configured as Unit 0 because the addresses of all the ETN status variables are hard-coded. Luckily though, it is pretty easy to go through and manually change all the addressing to make it work for a different Unit Number. The FB also does not support any coil function codes except for single coil write, since digital values are bit-packed into input registers. If you want to do stuff like coil reads, you're gonna have to write that code yourself. It is definitely doable, but it may require just a bit of work.

I suggest going through the documentation to see what the FB code does and does not support. Depending on your needs, it may not be as simple as just putting the FB in there and expecting everything to work as you want. You might have to modify the FB a bit or write some extra code to make it fit into your project. However, I can say that the core Modbus TCP functionality in the FB works fine.


More then enough for me. Luckily, i just have to ensure to BMS is available to read out. Reading out from CIO memory is enough. Anyway i'll share my onsite experiance next day after tomorrow.
 
Good luck bro, let us know how it goes.

Hi, yesterday i could test on site finally, i could read out with a freewere TCP client, so everything went smoothly, but (!) may you have answer this.

After i disconnetected with the client, it resulted in "freezed" FB, new connection to it is impossible, (getting various ERROR msgs), it can be used again only if i reset the ETN21 card (which is not possible during running/monitor state of PLC), and then one new connection is possible again and works fine until disconnection, may you have any idea for this? Thanks!
 
Hey mate,

The Omron Modbus FB actually has an error code output that tells you what error it has encountered. The FB documentation should have a list of error codes and what they mean. Honestly, most of them are really quite vague and probably won't be much help to you but it's a good place to start troubleshooting.

However, I will mention that your issue actually sounds similar to an issue that I also had when I was testing the Omron Modbus FB. My testing with a freeware Modbus Slave simulator on my laptop, possibly similar to what you were using for testing.

Initially, I could connect to the ETN card and read registers from the Omron PLC. However, if I disconnected the TCP session, the ETN card would not accept any reconnections for a variable amount of time, ranging from 10 seconds to several minutes. After waiting a while, I could reconnect to the ETN card. If I restarted the PLC, I could immediately reconnect once the ETN initialized. The error code that I got from the FB during this disconnect issue was 0x82 (Connection could not be established with specified remote node) which did not help me at all.

Unfortunately, I never really found the cause of this issue. Interestingly enough, this disconnect issue only happened with the simulator. When I tested this with a SCADAPack RTU acting as the client, the RTU did not have any issues reconnecting to the ETN card after a comms loss. So this problem may depend on what the Modbus client that you're connecting to and how well they handle TCP connections. I don't believe you've mentioned what Modbus client the ETN card is meant to be connected to, but chances are it'd probably fare better than a freeware Modbus simulator that you were using to test.
 
Hey mate,

Thanks for the information.

Yes, my collague just said similiar things, sth like that, modbus tcp need some FIN standard msg to be send out to close the socket, just before before disconncetion, and he says most of these sim programs does not have this.

I hope i'll be not problem later, however thanks for the tip regarding the error codes, i'll check it next time when i'll be on site.
 
Dear Scrambled,

I have tried to reconfigure the Omron FB to go from slot 0 to slot 1, basically I have changed all the references for slot 0 (1500) to slot 1 (1525 addressing), but the FB failed to work thereafter, is there any pointer you could give me for the FB to properly work?

Thank you and very much appreciated
 

Similar Topics

Hello Is possible to communicate an PLC Omron CJ2M CPU33 with HMI thorough Modbus TCP, if is possible, how? whats is de modbus map register Thanks
Replies
2
Views
4,575
I would like to do some very simple MODBUS RTU communication using the built in port in CJ2M-CPU1[] I have been reading in the forums and manuals...
Replies
3
Views
5,923
I have PLC Omron CJ2M with OD211 module. I want to use the pulse output and PWM output and this module. But i confuse how to activated this, i...
Replies
0
Views
95
I have a project to control the speed of motor DC using PWM Output on PLC and when im on working i have a several trouble and of of them is the...
Replies
6
Views
203
Hi Everyone, i am modifying an OMRON Cj2M program and have run into an issue. How do you find the timer, counter, registers that have already...
Replies
11
Views
717
Back
Top Bottom