This paper presents a multiagent architecture applied to factory automation. These agents detect faults in automated processes and allocate intelligent algorithms in field device function blocks (FBs) to solve these faults. We also present a dynamic FB parameter exchange strategy that allows agent fieldbus allocation. This architecture is a foundation for intelligent physical agents standard-based agent platform developed using Foundation Fieldbus technology. The aim 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 patterns and adapt an algorithm that can be used in fault situations. Thus, we intend to reduce supervisor intervention in selecting and implementing an appropriate structure for FB algorithms. Furthermore, these algorithms, when implemented in device FBs, provide a solution at the fieldbus level, reducing data traffic between gateway and device, and speeding up the process of problem resolution. We also show some examples of our approach. The first is a neural network architecture change that allocates different types of neural networks in field devices without interrupting the fieldbus network operation. The second shows a multiagent architecture that implements the neural network change in a laboratory test process, where fault scenarios have been simulated.