RobotStudio event

Modules Program Flow

Hi All, 

I am newish to Rapid and ABB robots although I have some prior experience on different platforms

What I am looking to find out is Modules and their relationship in the program flow.

I get that its better to break up the code into smaller modules that can also be reused later.

What I don't understand is how the different modules are read by Rapid. I come from a PLC background and would be inclined to to thing the modules are read from top to bottom sequentially. 

I know this is rpob not the case.

what I would like to know is how there are called in relation to the main program module or Are do they just running in parallel ?

I have read through the programn ABB Rapid flow/stucture manual and it still didn't make it much clearer to me. 


The reason I am asking is because I have an application coming up that requires palletising lots of different size of product. i want to create a function or module that I can just input the data and get the resulting pattern points out from.

If anyone has any recommendations on how to stu this it would also be greatly appreciated