This paper attempts to illustrate the development of software for intelligent automation systems using the reference architecture of new international standard IEC61499. In particular, it is shown how to encapsulate the code that determines the agent-based behavior of autonomous automated machines into IEC61499 function blocks and how to connect the corresponding software capsules to each other via the underlying communication media