Robots need to be dependable to work closely with humans. Further they must be accountable for the system design and development process. This makes some of the safety related standards such as IEC61508 adopt module based architecture and model driven engineering process. On the other hand, module-based architectures using middlewares are popular in the integration phase, when developing robot systems. To elaborate the behaviors of realtime control modules, IEC61499 function blocks derived from PLC languages is useful. Therefore, in this paper, we combine them and present a development process consisting of system design in SysML, elaboration in function blocks and integration using RTMSafety, which is an implementation of RT-middleware for the use of safety-related systems. We also show an example system for a dual-arm robot intended to work with human workers.