The other day I replied to a thread about calling blocks of code conditionally.
Attached is a sample of creating a function block in an FX2N.
The function block is a standard valve control that is called twice as a demo, the function is written as a subroutine using temporary bits/words.
Before calling the routine the bits/words for the valve are passed to the temps, the block called & then the bits/words are returned.
In the attached file the function is a simple one however more complex functions could be written & in this case is only for demonstration.
It will work on GX Simulator & you could use a simular idea on other plc's like SLC.
This may prove useful for some of the less experienced programmers.
Attached is a sample of creating a function block in an FX2N.
The function block is a standard valve control that is called twice as a demo, the function is written as a subroutine using temporary bits/words.
Before calling the routine the bits/words for the valve are passed to the temps, the block called & then the bits/words are returned.
In the attached file the function is a simple one however more complex functions could be written & in this case is only for demonstration.
It will work on GX Simulator & you could use a simular idea on other plc's like SLC.
This may prove useful for some of the less experienced programmers.