i gave you answer at plcs.net
use a function block with enable (when you highlight the function (default is ADD) and press F2 you will find your program under user programs. (sometimes you need to press F11 before the list is updated)
put your marker in the enable line as a contact
you can also use the triggerup to do your sub1 only once depending on what purpose.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
you are calling a function block
it should be in the var list
just start over again, and you will see that it will be done automatic.
another way is to type in the varlist on top of ladder
anyname prefer fhpa2:hpa2;
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have my main ladder program called PLC_PRG. I have created another program called Sub1 which is also in ladder.
I wish to have it so that when say %MX0.0 is true then Sub1 is called. How do I so this?
i gave you answer at plcs.net
use a function block with enable (when you highlight the function (default is ADD) and press F2 you will find your program under user programs. (sometimes you need to press F11 before the list is updated)
put your marker in the enable line as a contact
you can also use the triggerup to do your sub1 only once depending on what purpose.
hello again shooter, yes you have and I have replied back with an error that I receive when doing what you said.
"Error 4053: PLC_PRG (18): '???' must be a declared instance of function block 'HPA2'
you are calling a function block
it should be in the var list
just start over again, and you will see that it will be done automatic.
another way is to type in the varlist on top of ladder
anyname prefer fhpa2:hpa2;