C# Application of OpenPLCProject

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

C# Application of OpenPLCProject

Usman Ali Butt
Hi Team OpenPlcProject!
I am interested to know about the application that you made in C#. How it is working with your hardware. Can you have its description. How you are monitoring simulation of the processes going on? 

Reply | Threaded
Open this post in threaded view
|

Re: C# Application of OpenPLCProject

Arnav Gupta
I  am a software guy, and have some LADDER experience. First thing I did was rush to see if your source is on Github and if I can help in building the IDE.

Saddened to see two things

 1. Source not on github (Why?)
 2. Windows-only targetted audience. (again why? If it's an open source project, you'll get huge support from the Linux crowd)

Instead of the C# based project, we could fork Processing, and create the Ladder Editor from that.

Arduino and Fritzing are exammples of Processing's versatility. From PCB graphic design to Atmega binary compiling and uploading, a lot can be done. I am sure handling Ladder wouldn't be hard.

Also I would love to contribute to this project (mainly from the perspective of developing Arduino <--> OpenPLC interfacing libraries, and on the IDE (Ladder Editor). So where do I start with that ? smiley
Reply | Threaded
Open this post in threaded view
|

Re: C# Application of OpenPLCProject

thiagoralves
Administrator
In reply to this post by Usman Ali Butt
Hi Usman,

I made only two simple C# applications. The first one was made to change OpenPLC's configurations, such as network stuff (IP, Subnet, Gateway, etc) and expansion card's logical address. The second one is called when you click at the Compile button from the OpenPLC Ladder Editor menu. It's just a graphical arduino uploader to upload the ladder diagram created to the OpenPLC hardware.

Unfortunately, for now, there isn't any software to monitor the OpenPLC in real time. You can simulate the behavior of your ladder program in the OpenPLC Ladder Editor, but it is not online with the OpenPLC hardware. You need to manually change the variables value by double-clicking them at the simulation window.
Reply | Threaded
Open this post in threaded view
|

Re: C# Application of OpenPLCProject

thiagoralves
Administrator
In reply to this post by Arnav Gupta
As an electrical engineer, my knowledge about high level Windows / Linux programming is limited. I'm much stronger with low level programming and hardware design. For this reason, the ladder editor for the OpenPLC is based on LDmicro, a simple Ladder editor/compiler. Since LDmicro is windows-only, the OpenPLC Ladder Editor has to be windows-only too. I wanted to support linux, but since I was running out of time for my graduation, and I had LDmicro working perfectly, my option was just to modify it to make it work with the OpenPLC hardware.

Currently, I use LDmicro simply as a Ladder -> ANSI C compiler. Once the ANSI C code is generated from the ladder diagram, I call the AVR GCC to compile the OpenPLC firmware with the LDmicro generated code included as a header file. It means that the ladder instructions are compiled to machine code with the firmware every time you upload a new ladder program. I found this process to be easier to build and faster to run on an 8-bit hardware.

Some people suggested me to change this process to interpreted instructions, for instance, the ladder editor generates a XML file with the ladder instructions, then it is uploaded to OpenPLC's flash and interpreted at runtime, just like any other standard PLC. But this approach requires a complete change in the OpenPLC's hardware. The actual 8-bit architecture can't achieve that at a reasonable speed.

So I'm going for the Ladder -> ANSI C idea until I create a faster version of the OpenPLC. If you are willing to help, I need your knowledge to build a brand new ladder -> ANSI C compiler, like LDmicro, but, as you suggested, based on processing and multiplatform. I'm open to suggestions, but I think that this will be the easiest approach, at least to start with. If you manage to build that, the integration with the OpenPLC hardware will be seamless.

About the source code, actually it is available at github. If you go to the downloads section, the OpenPLC Ladder Editor source link points to my github page.
Reply | Threaded
Open this post in threaded view
|

Re: C# Application of OpenPLCProject

DeusInvictus
Hi my name is Carl, I actually was talking with Thiago by e-mail back in June about improving the ladder editor.  I thought if I could find the time I would be willing to try and contribute.   I figured a UI written in Qt that could be compiled on Windows/Mac/Linux would be useful.  My reasoning for this was

1. Cross Platform
2. Qt/C++ is the PC Programming language/widget set I'm most familiar with.

My biggest concern at the time was would I have time to actually spend on the project, and I told him I would try and find some time to get some stuff going and get back with him and see what he thinks.  Unfortunately I had some personal problems crop up about 2 weeks later, and never started doing anything.  I am still interested in helping, and having the time is still a concern for me, but I think I have a bit more time to work on stuff, and could use the distraction of a project to work on.  Arnav, what kind of thoughts did you have in mind, since you are also interested in Linux support? Are you familiar with Qt/C++, do you have something else in mind?  Perhaps we could try and collaborate and get something going?