Connect to OpenPLC Ethernet/IP soft-plc

917 views
Skip to first unread message

Pieter Jan Bonestroo

unread,
Jul 25, 2022, 1:05:24 PM7/25/22
to libplctag
Hi all,

Before buying a Allen Bradley PLC I would like to use libplctag in my development environment to connect to a OpenPLC device, which I can install as soft-plc. Do you think this is possible? Or what need to be done before this is possible? I tried it already (using libplctag by python) but I get errors when creating tags. I didn't dive into the errors yet, but first wanted to know from someone more experienced if I'm trying something feasible or not.

Kyle

unread,
Jul 26, 2022, 10:58:05 PM7/26/22
to libplctag
Thanks for looking at libplctag.

It does not look like OpenPLC supports the CIP protocol.  It does appear to support Modbus and so does libplctag.  You will need to configure OpenPLC as a Modbus PLC and set up some registers in it.  Then you can read and write them with libplctag.

Note that libplctag does not create tags in a PLC.   It reads and writes existing tags in PLCs that support the CIP protocol (Allen-Bradley, some Omron and other PLCs) and Modbus protocols (almost all PLCs have some sort of option to support Modbus).

Best,
Kyle

Fernando B

unread,
Jul 27, 2022, 8:44:06 AM7/27/22
to libplctag
I'd like to mention that there is almost no correlation between developing plc code in OpenPLC and an Allen Bradley PLC, essentially you'll be doing it twice. For AB PLC's you'll need rslogix/studio5K to program the PLC's.
A development environment is one where you can easily swap few config variables and you're good to go.

Unless you plan on having an AB plc as dummy just for I/O communication in which case there's really no need to buy an expensive PLC, when there are IO systems on the market.

Pieter Jan Bonestroo

unread,
Aug 5, 2022, 4:38:20 PM8/5/22
to libplctag
Thanks for the answers!

The reason I ask is that I'm developing PC software (HMI, etc) which will connect to PLC in the end. Development of the PLC program will be done in later stage of the project, but for now it would be good to simulate the PLC (only basic functionality implemented), and being able to setup the communication between PC and PLC already, without having PLC hardware.

I prefer CIP communication over Modbus. I still think OpenPLC has support for this, but I don't know to what extent. A couple of years ago someone stated this: "Yes, there are plans to implement ENIP simulating an Allen-Bradley MicroLogix 1400" here. Which sounds promising in my opinion. Also, on the github sources I find some related stuff regarding CIP support.

At this moment I'm also looking to this, a PLC simulator from automationdirect, also capable to communicate using CIP.

Regarding CIP, for my project I will mostly need explicit messages, connected or unconnected. I don't know exactly what libplctag does, so maybe someone can give me a brief intro or links to this information? That might give me boundaries for selecting simulation devices.



Op woensdag 27 juli 2022 om 14:44:06 UTC+2 schreef fred...@gmail.com:

Kyle

unread,
Aug 16, 2022, 3:17:37 AM8/16/22
to libplctag
If you really want to use OpenPLC, then you would need to add the ability to be a CIP server to it.   That's not libplctag.  

I have used the ab_server test program in the core libplctag library release to simulate some tags (there is no logic).   Then I used some simple scripting around the tag_rw2 example program to write values into those tags.  My test program would read the tags and I could pretend that there was a PLC program (the scripts).

The ab_server test program runs on all main platforms that the core library runs on.  It emulates part of the CIP protocol as a server rather than client.  It is not complete at all, but I use it for the CI tests on GitHub when I check in code.

Best,
Kyle
Reply all
Reply to author
Forward
0 new messages