Nirtec Studio Forum

General Category => EasyPLC v.5 => Topic started by: RBeersJr on February 02, 2016, 05:20:13 PM

Title: How to: combine ladder programs
Post by: RBeersJr on February 02, 2016, 05:20:13 PM
If I program two separate Ladder programs, how can I set one as as primary and one as secondary?
Program a lead lag switch?
Or do all machine systems  need to be on one Ladder program?

Thank You for any input.
Richard

Title: Re: How to: combine ladder programs
Post by: EasyPLC_Master on February 02, 2016, 07:01:47 PM
Hello!

I suppose you talk about program sequences.
Then I refer to the manual:

Programs are composed by sequences. Sequence is the minimum programming unit. The sequences can be programming in several languages like Ladder, Script, Logic Blocks or Grafcet.
In order to have a structured programming method, EasyPLC provides tools to sequence the logic programs.

Init:
The sequences inside the Init Program node only will be executed once, when the program starts. Useful to program initialization routines. 
Main:
The sequences inside the Main Program node will be executed cyclically and in the order showed in the node tree. Using the jump tools will be possible to change the sequences order if the program requires it.
Functions:
In this node are programmed the functions, the functions are sequences called from the Init or Main sequences. Functions also can be called from others functions. 
Functions can return a value or not. Only the functions written in Script language can return a value, using the return keyword. The functions written in Ladder or Function Blocks can't return any value.

Then about your question, all the sequences you write will be executed cyclically one after other, if you need to make flow control opearion with sequences you must use the functions, see the attached images as example.

Hope this help you.