I'm experienced in programming PLC's and starting with Arduino. Biggest difference I realized is for example FOR (for(int i=0; i <= 255; i++){}) instruction. In PLC all code is executed in once cycle, so FOR instruction increase "i" just by one and rest of the code is executed. Arduino will execute complete FOR function and then continue to execute rest of the code.
But what if I want to do some calculation and also control I/O in real time. Right now when Arduino start executing FOR function and it doesn't execute anything else, for few seconds.
I'm probably using wrong mindset, could anyone point me to some article about right way to make a program (like structure, cycle etc.)
This is not behaviour of the Arduino but patterns of C/C++ language so you should read more about the C. The 'for' statement has conditional expression in the middle and while it is evaluated nonzero (TRUE) the code closed inside of braces will be executed.
You've got to get used to the setup() loop() paradigm.
Using your own loop construct (say with for ) is less usual here, although there are circumstances where it is perfectly valid. It is more usual to rely on the inherent repetition in the loop() function so other statements can also be interleaved and excude pseudo simultaneously.