Hello,
Would it be possible to use the Ethernet port instead of the USB port to download programs to Opta and to monitor/debug?
@cloudDev if you are going to use AI generated content when providing help here, it must be done responsibly.
Just as with any other information you find on the Internet, you must carefully evaluate AI-generated content for accuracy, relevance, and appropriateness within the context. Copy/pasting without giving any thought to the information is irresponsible, regardless of the source of that information. If you are not able to make such an evaluation, then please don't share the content here on the forum.
Thanks in advance for your cooperation.
Mod edit
AI generated junk and associated replies deleted, with the exception of this one.
@yannickasselin Hi, yes, you can (at least using the PLC IDE). This is how I've done it (only a couple of times, to be honest):
- First, if you haven't done it already, you have to get the Opta working with the PLC IDE and then configure the Ethernet connection by uncommenting the code in the "Sketch" under the Resources tab. After sending this changes to the Opta, make sure that you can "ping it" over the network.
- You'll notice that under the Communications options in the PLC IDE you have ModBus (Active by default) and ModBus TCP options. Check the properties for the active ModBus connection and it should be associated with one of the COM ports (on my PC, I have COM15 and COM23 for the Opta and COM23 is the one for ModBus).
- Once you are online, connected and all is well over the USB connection, change the Communication options and activate ModBus TCP and change its properties: enter the IP address for the Opta and the device id/ModBus address should be 255 when using ModBus TCP (I believe that the default is 1). You should be able to connect and upload and monitor/watch online values using just the Ethernet connection.
- Why do you have to configure/use ModBus TCP for this? I don't know... (I haven't "sniffed" the network traffic to/from the Opta -yet-)
I hope this helps,
Nicolas
Thanks a lot!
It is working! This is great news as I mostly rely on ethernet communication over vpn to give remote support to customers. Not that it is impossible to do USB over IP but it is a little more cumbersome.
This was one thing that would prevent me from putting an Opta in a real industrial project.
I will continue testing it, but so far it is great.
Thanks again.
@yannickasselin Glad it worked! I stumbled on it by chance while trying to find out how to configure the Opta as a ModBus Slave (Server)
@yannickasselin I just had to try something else... CAUTION: using the Ethernet connection to download a program ONLY WORKS for some types of changes but not others. It seems to work if you need to make a change to "PLC code" (LD, FBD, etc.) but it DOES NOT work if you need to make a change to the Sketch in the Resources tab:
- I just changed a comment in the Sketch (not the actual code at all), compiled it and then it stopped me when trying to download it saying that communication through a COM port was required to download the sketch. I had to change the communication options back to just Modbus (changed the Modbus address to 247 because it had been defaulted to 1 !!) and then I was able to re-download.
So, if someone else makes changes to a part of the application that requires a download through a COM port, you might NOT be able to connect over Ethernet to diagnose a problem... ouch, sorry.
Ah, I took a Wireshark capture of the traffic to/from the Opta while connected over Ethernet and here are a couple of comments:
- Holding Registers 65006 and 65009/65010 (as a pair) are written (with a Multiple Write function code 16, even for just 65006) and re-read at the beginning and end of the process of getting connected over Ethernet to the Opta. (Something getting setup?)
- Holding Registers 65001 and 65002 are queried periodically (every 200ms, it seems) as long as you are connected.
- During the download of the "PLC programs" and/or while monitoring the PLC programs or variables, the PLC IDE uses Modbus ONLY, it seems (no "large binary data transfers"). It actually uses function code 13 (0x0D), which is only documented as "Program Controller" in the official "Modicon Modbus Protocol Reference Guide", but there are no details other than the data payload is up to 32/33 byes (depending on the Modicon PLC that supports the function code).
==> Sooo, it seems that downloading/monitoring over Ethernet uses ONLY Modbus function code 13 (0x0D), which is not documented even by Modicon. It kind of makes sense that it does NOT support downloads of non-PLC program content (like the compiled Sketch)... it is a shame that an Ethernet connection is NOT a fully functional replacement for the USB one.
QUESTION: Since downloading the PLC programs uses "just Modbus" (no user access protection, data encryption, nothing it seems...) would it be possible for an "unauthorized entity" to intentionally alter the program/s and/or data in the PLC and potentially cause problems?
This is very good informations.
Thank you.
I just wanted to help. I'm sorry if I used an AI to help further. This will not happen again.
Sorry again!
Does anyone have any in general videos or direction? I have tried to connect my Opta to my computer, and during the phase of connection via usb to c, it freezes like the computer is struggling to connect to the PLC. Any help would be great guys.
Hello!
To confirm: As @nsubotich said you can only update IEC programs over ethernet.
@clschnak Please open another forum post or contact with the Arduino Support team.