This paper presents a multiagent architecture applied to factory automation. These agents detect faults in process automation and allocate intelligent algorithms in field device function blocks to solve these faults. It is also present a dynamic function block parameter exchange strategy which allows agent fieldbus allocation. The objective is to enable problem detection activities independent of user intervention. The use of Artificial Neural Network (ANN)-based algorithms enables the agents to learn about fault problem patterns and adapt an algorithm that can be used in fault situations. With this, the intention is reduce supervisor intervention in selecting and implementing an appropriate structure of function block algorithms. These algorithms, when implemented in device function blocks, provide a solution at fieldbus level, reducing data traffic between gateway and device.