Jump to content

Recommended Posts

Posted

Hi 
i am trying to connect to omron plc (cj2m ) using modbus tcp/ip , by using the port 502 i  get an error saying that the port can't be reached

is there any method to fix that or change the port number ?

 

thank you 


Posted

OK, I'm not very familiar with Omron, but did you set it up as a ModbusTCP server (your C# code is the client right?)? My guess is that you'll need a little setup in the PLC. Again, I'm not very familiar with Omron, but the CJ2M supports ModbusTCP correct (not just RTU)?

And as a small side note: Since this basically is an Omron question, you might get more help in the Omron section of this forum instead of the HMI & SCADA section.

Posted

the plc is the client , my code is the master ..my goal is to be able to read from my plc ( a basic scada/him application ) 

-yes , it supports the tcp/ip.

thanks for the beside note , just because it was said that for modbus tcp/ip communication goes throw 502  ...i just don't know where the plc keep telling me (the port can't be reached ) , i even tried others (random ) and can't be reached also 

 

 

thanks a lot 

Posted

Yes, ModbusTCP uses standard port 502 for communication, so you're good there. If the PLC doesn't respond to any handshakes for 502, you should really check your setup. Many PLC's don't open ports unless you explicitly open them. In other words you must probably configure something in the PLC for it to answer requests.

Posted

hi , i am sorry i didn't quit catch the meaning of  ( configure something in the plc ? )

i thought that was a direct communication : imean code the connexion function , insert the plc's IP @ and the port  and using the ethernet cable ..voilà ?

Posted

As said; I don't know about Omron, but other brands you must configure the device to e.g. allow external devices to connect. Normally the function must be "enabled" or similar just to make sure it's safe. I don't think you'll have to do any programming, but most likely you'll have to enable ModbusTCP. In Mitsubishi you can specify to enable or disable, and you can specify which IP(s) to accept connections from, which ports to use etc. etc.

Basically it's the same as opening a specific port and service in your PC's firewall (you don't want to open your PC or PLC to all and everyone by default).

Posted

 

 

@Crossbow please excuse my ignorance  first isn't modbus tcp/ip  and using ethernet cable  is considered as modbus ethernet ?  i mean using c# i coded using the modbustcp.dll ? and please would you do me a favor and give me the link to that post ?

Posted

OK, here's a simple explanation:

ModbusTCP = Protocol 1
Ethernet/IP = Protocol 2

The difference is that ModbusTCP is a completely different protocol than Ethernet/IP (two different protocols). It's like DNS and DHCP. Two completely different protocols serving two different goals. So you cannot use ModbusTCP if your device only supports Ethernet/IP.

So basically DNS != DHCP, and ModbusTCP != Ethernet/IP.

Posted

oh , no i get that , i was wondering about what exactly the diffrence , i looked in google  , but for  omron cj2m (i've checked it in their documentation )  they do support modbus tcp/ip via ethernet cable 

Posted

No, they do not.  Omron supports Ethernet/IP.  It's like trying to talk to someone in Frnech who is speaking German.

Show me the document that says they do.

Posted

Your links are about CP1L, not CJ.  

Someone has written a function block to make a generic Ethernet message that fits the protocol.  There is no internal support for communication via the Modbus TCP protocol.  You can't just send it a Modbus TCP message.  And it's using a CJ1W-ETN21, not the built in Ethernet port.  Read the information at the links you just posted, there is a sample.  

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
×
×
  • Create New...