Simulation of cyber-physical systems using IEC61499