I didn’t want to necro the threads where I saw this advice given, but I was wanting to get a clearer answer on this. The inductive automation training seems to direct you to use the address mapping feature in the Gateway, but once I started reading threads on the forum I see multiple instances of users recommending against it. Why?
@pturmel In particular I’ve seen a couple threads where you suggest to not use the address mapping feature and to instead create OPC tags directly.
Beyond this, I’d appreciate any advice others have on working with PLCs using Modbus. I’m coming from the IT/software dev world so most of this is new to me. In particular I’m working with some DL205s from Automation Direct and I have had a couple engineers here warn me about polling them for data as they are very slow, or other issues such as only being able to have a single modbus master? Another issue they told me about is that our server communicates over UDP to the PLCs, but I feel like this is wrong as the protocol is literally called Modbus/TCP, and wireshark shows TCP connections. From what I’ve read and observed Modbus/TCP supports multiple clients. Am I missing something here?
Lastly, I’d appreciate any advice in terms of cybersecurity. I see modbus/TCP is a plaintext protocol, which made it very nice for me to debug and get familiar with, but I see there is a modbus/TCP/TLS version now. Our PLCs don’t support it I believe, but beyond this, is there any other advice regarding cybersecurity? I’ve seen a couple different camps online where they suggest you completely rip up and replace all the PLCs with new ones that support advanced features like encryption etc, and others who say this isn’t necessary and to instead just keep it on a private network.
The address mapping feature is a "convenience" feature of the IA native driver that assigns some browsable names to specific ranges of bit or register addresses. That convenience adds complexity to your configuration and, as the driver author pointed out recently, add complexity to any troubleshooting you might need to do. (Error logging uses the raw addresses, requiring the troubleshooter to translate from raw address to mapped names to find troublesome tags.) You should just use the "raw" manual addresses in your OPC tags' OPC Item Paths.
If the convenience of browsable addresses is important to you, consider my alternate driver. It offers OPC browse of the raw addresses and their various data type transforms.
To my knowledge, no Ignition driver implements Modbus UDP.
The DL205 CPU only has serial ports, not ethernet, so you must use Modbus RTU with them. All forms of serial modbus can only have a single master. (And are 100x to 1000x slower than Modbus TCP, simply due to slow serial speeds.)
Modbus TLS is on the roadmap both for IA and for my alternate driver. But you should keep control system devices on private networks anyways. Modbus TLS is protection against bad actors that penetrate to that level.
Thank you for the response! I’ve written a script to generate the OPC item paths for me from our PLC software and I’ve seen you have made a similar tool in the past.
We have some HX-ECOM modules that provide Ethernet connectivity so no worries there. I have a mean response time of around 30ms to Ignition but hopefully it shouldn’t cause us troubles; I’ll try to stay lean on the tags. I’m mainly worried about how polling the PLC is going to affect the manufacturing line - it is my first time working with PLCs in general and I’m concerned I will cause poor performance on the PID routine that is running on them. I try to find documentation online to see what sort of behavior I should expect but I’m not finding any good write-ups, so I’ll just have to experiment and see what happens.
I do know that I can reorganize the memory in the PLC to make tags adjacent to eachother to lower the amount of modbus requests required. Hoping I won’t need to do this, not a fan ladder logic on the PLC Wish it supported structured text.
Honestly I didn’t realize this existed until I googled it and it appeared in my search results this time. I had read through the documentation for our PLCs and from the modbus.org website and saw no such thing, but it exists for some PLCs it seems!
Just keep in mind the others who may need to troubleshoot and work on the system. Many times these are electricians with no experience with structured text, but can read electrical prints.
I'm a computer science major and learned about ladder logic at my first job because "if you're gonna write software to interface with a PLC you need to learn how to program a PLC". Now I personally prefer ladder or function blocks (depending on what I'm doing) for programming and try to stay away from structured text unless it really is the better tool for the job. When troubleshooting a process, visually being able to see the ladder and things light up and quickly see what the problem is without reading any code makes it so much easier and faster in my opinion.
But again, just use the right tool for the job. Ladder is literally a bunch of IF...THEN statements...nothing more.
One best practice I use (across protocols including DNP3) is to treat everything as zero-based, even if I have to translate from someone’s address map.
Yeah I think my issue is more the software we have to use to program the PLC. For example, I wanted to find a specific V-Memory location that holds a value related to a recipe. I try to CTR+F to find “recipe”, but it doesn’t work. Instead CTR+F will take in a V-Memory location and return the attached documentation… that feels backwards to me, I want to search the semantics of things, I don’t speak in V-mem locations. I’m using DirectSOFT 5. I’ve been spoiled by modern IDEs and documentation, trying to go through the PLC programming feels harder than it should be.
My other qualm with PLC programming is version control. Doesn’t seem like there is any easy way to get git to track these files, as the program is split across multiple binary files. Again, it feels harder than it needs to be. I’m learning though, PLCs are used everywhere in industrial settings so I’m glad to get the experience with them.