Getting an IEC61131 Program into a dll

A

Thread Starter

AlecMack

I like the IEC 61131 -3 environments that you get from a couple of PLC vendors. Especially the ability to view all the variables in the code as it is running and that the language does all the things I want it to and not too much else.

The application that I have is for wind turbines.

The normal way to design a wind turbine is to design your controller and incorporate it into a simulation with wind, tower structure, blade dynamics and so on. The controller heavily influences the loads that the machine experiences and how heavy/strong/expensive the components need to be.

I'd like to take my 61131 code and put it in a simulation environment, probably wrapped up in a dll.

I could use hardware in the loop, but that would seriously slow down the 1000's of simulations that need to be done and I'd need a load of hardware that I don't think I should.

Any ideas would be greatly appreciated.

Many Thanks
 
R

Rainer Poisel

Dear AlecMack,

that sounds like an interesting project you are working on. Our company offers a IEC 61131-3 conforming developing environment (logi.CAD3) including a soft PLC solution (logi.RTS).

It should be possible to conduct the simulations you are describing. In our environment the PLC code is compiled into a .dll (or .so depending on the target platform) which is then called by our soft PLC solution.

The interface to our generated .dll is well-known of course. So it should be feasible with some C-Code to write a wrapper that invokes the PLC code directly. In this regard it is important to know, that you should not depend too much on an accurate timing of your code, because that's what our soft PLC takes care of. But even here, you could also implement the callback interfaces of our code for your platform, so that it is provided with correct timing information (e. g. for TON or TOF function blocks).

If you want to get an idea of how things work, please have a look at our free logi.CAD3 compact version which is available in the download section of our homepage:
* http://www.logicals.com/de/download/

Please do not hesitate to contact us if you need any further information!

Kind regards,
Rainer Poisel (Software development)
 
Thank you Rainer

I am looking at many different methods at the moment, also using Simulink to develop the controller or C.

I did not know that it would be possible to place a 61131 program into a dll, but now that it is an option. hopefully one day in the future I will be able to take advantage of your system.

Alec
 
A

Armin Steinhoff

Hi Alec,

> I did not know that it would be possible to place a 61131 program
> into a dll, but now that it is an option. hopefully one day in the
> future I will be able to take advantage of your system.

every IEC61131-3 program must be embedded for its execution into a target IEC61131-3 system . The target system is a process of its own...

it does processing by polling and also co-operative scheduling of the so called PLC threads. These Threads are not system threads. If you want to call (or reuse) the IEC61131-3 code you have also to simulate the environment provided by an IEC61131-3 target system. Please have also in mind that a IEC61131-3 program doesn't allow blocking calls or blocking waits on events.

It would be better to setup a communication between your simulation application and the IEC61131-3 target and program ...IMHO.

Best Regards

Armin Steinhoff
http://www.steinhoff-automation.com
 
Top