Hardware-in-the-loop simulation - HIL - simulation by Arduino

How can make Hardware-in-the-loop simulation - HIL - simulation by Arduino

useing APM

How can I create this??