Logopaede
Hello,

I try to merge two OpenPLC projects into one new. So I created a new project folder and copied my two programs and one own FunctionBlock into the new project, using the "Copy POU" feature. Great.

But what to do with the Ressources (Res0, instances, tasks)?
Is it possible to copy these settings into the new project?

It seems I'm having just the default Res0 of the new opened project. This seems to be the reason, why I can't generate my new merge:

Start build in /home/me/HelloTMP36/build
Generating SoftPLC IEC-61131 ST/IL/SFC code...
Compiling IEC Program into C code...
"/home/me/OpenPLC_Editor/matiec/iec2c" -f -l -p -I "/home/me/OpenPLC_Editor/matiec/lib" -T "/home/me/HelloTMP36/build" "/home/me/HelloTMP36/build/plc.st"
exited with status 1 (pid 2513)
/home/me/HelloTMP36/build/plc.st:155-10..156-14: error: unknown error in resource declaration.
In section: CONFIGURATION Config0
0155: RESOURCE Res0 ON PLC
0156: END_RESOURCE

1 error(s) found. Bailing out!

Error : IEC to C compiler returned 1
PLC code generation failed !


PS: Working on OpenPLC Editor 1.29b
Reply 0 0
Logopaede
... hello again,

I solved my problem by adding a task manually to the default empty Res0 of the new project. In this example both programs share the same cycle with T#250ms. This is now the representing code in my ~/OpenPLC_Editor/*.st file:

[...]
CONFIGURATION Config0

RESOURCE Res0 ON PLC
TASK task0(INTERVAL := T#250ms,PRIORITY := 0);
PROGRAM instance0 WITH task0 : Hello_World;
PROGRAM instance1 WITH task0 : program0;
END_RESOURCE
END_CONFIGURATION


Works without problem now.
Reply 1 0
thiagoralves
That's exactly what I was about to suggest you to do 🙂
Reply 0 0
Reply