bmm31397
I am currently working on programming an Arduino Opta PLC. I have had great luck with programming the Opta module itself in the OpenPLC editor. However, I am having a difficult time receiving any inputs or outputs from the expansion module that you can add on to the system. I can fire the outputs by using some sample logic in the Arduino IDE but was just curious if anyone has had any luck with OpenPLC.
thiagoralves
The OpenPLC Opta driver must be updated to handle expansion modules. Currently OpenPLC can only handle the Opta itself. You might be able to address the expansion modules using Arduino Sketch code on an Arduino Extension inside OpenPLC Editor. Just click on the gray plus icon on the left panel and select "Arduino Expansion" to bring the sketch code.
Reply 0 0
jwstagetech
The OpenPLC Opta driver must be updated to handle expansion modules. Currently OpenPLC can only handle the Opta itself. You might be able to address the expansion modules using Arduino Sketch code on an Arduino Extension inside OpenPLC Editor. Just click on the gray plus icon on the left panel and select "Arduino Expansion" to bring the sketch code.
Is there any update to this?
Reply 0 0
thiagoralves
Unfortunately no
Reply 0 0
jwstagetech
I am not a software developer so I don’t know how helpful this is but it looks like there was a big update to this library as recently as July. https://github.com/arduino-libraries/Arduino_Opta_Blueprint Would this be helpful in getting it working?
Reply 0 0
jwstagetech
Thanks to some incredible improvements to Claude over the last several months, I finally have a working solution using the Opta RS485 and one digital D1608E expansion module with all 16 Inputs and 8 Electro-mechanical Relays available to use within OpenPLC. Theoretically, it should work with the D1608S Solid State Version as well (but I do not have one to test). The attached files just need to be added to the HAL files of the OpenPLC Editor application resources. I have also added a new hal.json file to go in to the boards folder and there is a readme in the attached archive that can help with the initial configuration too. @thiagoralves this stuff may help others if it can get added.
 
Here are the addresses set in the new arduino_opta_###.cpp files:
 
I/O Memory Map
 
Address
Example Label
Description
%IX0.0 – %IX0.7
I1 – I8
Opta screw terminal digital inputs
%QX0.0 – %QX0.3
O1 – O4
Opta relay outputs (LED_D0–D3 mirror state)
%IW0 – %IW3
AIN1–4
Opta analog inputs (0–10 V → 0–65535)
%IX1.0 – %IX1.7
IE1 – IE8
Expansion digital inputs 0–7
%IX2.0 – %IX2.7
IE9 – IE16
Expansion digital inputs 8–15
%QX1.0 – %QX1.7
OE1 – OE8
Expansion relay / SSR outputs 0–7
%QX2.0
LED_RED
Status LED red (TRUE = ON)
%QX2.1
LED_GREEN
Status LED green (TRUE = ON)
%IX3.0
BTN
User button (TRUE = pressed)
Reply 0 0
thiagoralves
Thanks for the contribution. This works for your particular setup but won’t work for all. The driver is tied to the specific module connected to the bus. The ideal implementation would have to be customizable
Reply 0 0
Codegineer
Are there folk actively looking into this?

I'm currently learning PLC programming techniques in with a long term view to replace a propietary PLC sytem with an open system. I chose the opta as it seemed a sensible start, are there other openplc ready industrially options which offer a similar number of inputs and outputs to a fully expanded opta?
 
When you first plug an expanded opta into Arduino PLC IDE (yes, an horrid experience I know) it scans the device and configures it for you. Is it possibke to create a hello world style sketch in the IDE, then trawl through the project files to find the configuration information?

Sure, a pain to need to use both IDEs but at least it would be only once per physical configuration?
Reply 0 0
jwstagetech
I set this up once and have continued to be able to use open PLC regularly with my equipment, but I don’t have more than one unit to test if it can be repeated so if you can try it, that would be fantastic. My biggest issue is that I am primarily a Mac user and while parallels works for the Arduino IDE it is more painful than even having to create a custom HAL file was. I followed the steps I posted here once, got it set up and now I can use openPLC On my Mac natively and it works great.
Reply 0 0
thiagoralves
I think the easiest way to currently access expansion IOs on the Opta using OpenPLC is to create a Function Block in your project in C/C++ and just use Arduino code to access the IOs according to the Arduino Opta examples
Reply 1 0
thiagoralves
are there other openplc ready industrially options which offer a similar number of inputs and outputs to a fully expanded opta?
I would recommend you take a look at the P1AM series from AutomationDirect. They are compatible with OpenPLC and very affordable.
Reply 1 0
Codegineer
Thanks for that, I will look into those suggestions.
Reply 0 0
thiagoralves
Hello,
The OpenPLC forum has a new home: Autonomy Edge https://edge.autonomylogic.com. We migrated every member, profiles, topics, categories and attachments. Please redo your post on the new forum so we can continue our conversation.
Note: If you already have an Autonomy Edge account, you can simply login with your credentials to have access to your forum profile and posts. If you don't have an Autonomy Edge account, we ask you to set a fresh password on first sign-in using the same e-mail you used on this forum.
To set a fresh password, access the link https://edge.autonomylogic.com/forgot-password and insert the e-mail address used on this forum. You will receive an e-mail on your inbox with a link to choose a new password. Once you reset your password you will be able to login on edge.autonomylogic.com using your new credentials.
Reply 0 0
Reply