openCN-New PLC addition - user space file path

Hi, I was referring this document to understand each and every component of openCN:
https://mecatronyx.gitlab.io/opencnc/opencn/components/plc/plc.html#new-plc-creation

While i was going to the documentation of I cam across adding a new PLC component in openCN.

The path mentioned in the document to add a new PLC component in user space is → Inserted the new plc in the supported_cfg array (usr/target/include/components/plc/plc.c file).

  • I cannot find the file at this given path

  • I found another file at below path with same name
    usr/target/components/plc/plc.c

It took me a lot of time to find the file manually. If someone can confirm this is same file then i can keep a note of this and we can later update in the document.

Regards
NRK

Hi Nadim,

You’re right. The correct path is usr/target/components/plc/plc.c

Thanks to point it out.

Have a nice day
J-P

1 Like

Hi @jmi

While i was going through the documentations of PLC, further I could not find anywhere so have a question

whether the PLC runs on realtime CPU#1 or non realtime CPUs?

In linux cnc there is a plc ladder programming tool, can we plan of making similar kind of functionality in openCN for user programmable logic? Classicladder Programming

Since I am studying openCN and once I understand it i would also like to contribute to feature additions in openCN.

Regards
NRK

Hi Nadim,

it would indeed be very useful having a PLC component in OpenCN.
I believe the “PLC ladder” tool in LinuxCNC is old-fashioned and should be replaced by something newer with a graphical user interface.

I know that there are existing opensource PLC proojects in Linux.
We should evaluate and look what efforts are needed to integrate in OpenCN.

In my opinion this is a BIG project for the future, but I encourage you to do so.

best regards,

Raoul

Hi @Raoul ,

Thanks for the encouragement. Yes indeed the PLC Ladder tool is very old fashioned.

Since I have worked many years on PLC systems, I will compile a list of basic functionalities present in PLC system which are needed by user. I will also compile a with a list of open source PLC projects.
We should add those functionalities step by step. I will comeup with a document for suggestions from forum users.

Since I am a learning developer, Big projects will only help me learn and contribute.

Regards
NRK

Hi Nadim,

The PLC component is a standard OpenCN component. Its functionality runs in RT CPU.

Yes, having support for real PLC apps will be great and any help on this topic will be appreciated.

As Raoul said it is a big project and then to be well specified before starting its implementation/integration.

Regards
J-P

Hi J-P and Nadim,

for me it’s not so clear if we really need RT CPU (kernel space) for PLC.
Typically we are talking about maybe 100 Hz refresh rate.

Our EtherCAT Master needs of course hard real time and runs in kernel space.
Maybe this is not necessary for PLC functionalities.

To be discussed …

Hi Raoul,

The current PLC component is an OpenCN component. So its functionality is implemented in a RT function.
This component was created to put “not generic” code somewhere during Micro5 implementation as we have no real PLC support yet.

For the implementation, a full specification has to be made before implementation to deal with all PLC aspect. One of the question is “should PLC code runs in RT domain”.

J-P

J-P, I fully agree with you !

Hi @Raoul and @jmi

A study can be done to try out the functionality in both Realtime and non realtime cpu one by one and note the significant differences practically.

As per my experience, I will prepare a document on full specification with also a point about RT domain or not.

Do we have a way to attach docs on this forum? How to share docs?

Regards
NRK

pdf files can be attached on this forum.
But I believe that another solution would be better.
@jmi : what do you suggest ?

Hi Nadim, Raoul,

I think it is better do make the spec in a Google doc. It is easier to work together this way.
I will prepare a PLC folder where the doc and image (we use draw.io generally) can be place.

Is it OK for you ?

Have a nice day
J-P

Ok for me.

Thanks
NRK

Perfect, can you share your google user name (or email) ?

Thanks
J-P

My email id is
nadim4114@gmail.com

I’ve sent you an initiation.

The folder contains empty Gdoc and draw.io documents.

Thanks @jmi ,

I have checked and put in some very basic details. Need details from openCN users to help segregatewhat all is available in openCN and what we have to work on. Later we can decide the roadmap.

I will prepare a draw.io file about architecture soon and update you