Codesys Ladder program, how to call other programs?

go to where the coil will be defined
click on block with enable
then use F2 and you can start any program you have in the POU list.
as enable is standard on it will run.
a better way is to use tasks in the resource tab.
this allows you to use multitasking.
 
"Click on block with enable" you have lost me there.

also, I forgot to note I am using Codesys 2.3 and not 3.0, if that means anything.
 
it has the looks of a function block, it works all the same, however not possible to have inputs or outputs (other than global ones)
if you add a function block you will have the choice to have a user defined block or program when you press F2
depending on what type used you will have to highlight the ADD instruction and then press F2
 
for example on rung 1
press on the line you see, on the right handside a dashed rectangle will appear, now click one of the blocks above (a function block will appear, default with ADD, highlight the ADD and press F2 (input assistant)
when you have made a program for yourself already it will appear in the list.

attention the other rungs will be processed after the called program is finished, so be aware of timing.
 
Ok I think I follow, you are referring to "Box with EN"?

If this is correct then I tried this and it created a box with AND at the top and EN as like an input. I clicked on AND and pressed F2 and then selected my program. When I compile I now get the error "Error 4053: PLC_PRG (18): '???' must be a declared instance of function block 'HPA2'

HPA2 is the name of my program.
 
oke gaz, under project you will find export, the file name will end on exp
zip this file as plcs.net will not accept it.
then give it to us
and please make description of what you want the program to do, then i will give you example of how to accomplish it.
 
Sorry for the late reply, my works internet has been down. Anyway I seem to have got it working but I don't know what the issue was before. I followed your steps over and over again and it would not work. This morning I made some changes to other aspects of the program and thought I would give your steps another go.

Now it works, thanks! :)
 

Similar Topics

See the Codesys LD program below; I would expect Rungs 2 and 3 to produce functionally identical results, but they do not. Does anyone have any...
Replies
36
Views
2,031
Hello, I am having some trouble converting my Elapsed Time from TIME data type to INT data type so that I can display it on my HMI. While I can...
Replies
6
Views
1,731
Hello, So in RSLogix 5K I would be used to doing the following: 1. Double click the left of the rung, to bring the rung text editor, will be...
Replies
4
Views
2,106
Could use some help. New to Codesys. Was told to convert some logic from Step transition into ladder. Having issues with 'Wait'...
Replies
9
Views
4,125
Using CoDeSys 2.3 for the first time. I've not been able to use in line comparison operators successfully in Ladder - and haven't found any...
Replies
11
Views
9,135
Back
Top Bottom