- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Link copied. Please paste this link to share this article on your social media post.
Posted: 2025-03-20 08:53 PM
M172* having the IEC code detect if the code is running in simulation
Hi,
I have mostly been testing using PLC hardware and would like to speed up the process by testing in simulation. Is there a way that I can have the PLC code detect that it is running in simulation? I would use this for mocking other devices, as well as getting around some of the bugs that exist in the simulation environment.
Thanks.
- Labels:
-
HVAC
- Tags:
- english
Link copied. Please paste this link to share this article on your social media post.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Link copied. Please paste this link to share this article on your social media post.
Posted: 2025-03-21 01:00 AM
Hi,
TM172P hasn't a dedicated target variable to know if application is running in the physical controller or in the simulator, but, like workaround, it is possible to test the target variable sysMacAddress. When M172P is in simulation sysMacAddress has all elements to 0, otherwise there is the MAC address of hardware.
Best regards
Marco Cervati
Link copied. Please paste this link to share this article on your social media post.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Link copied. Please paste this link to share this article on your social media post.
Posted: 2025-03-21 01:00 AM
Hi,
TM172P hasn't a dedicated target variable to know if application is running in the physical controller or in the simulator, but, like workaround, it is possible to test the target variable sysMacAddress. When M172P is in simulation sysMacAddress has all elements to 0, otherwise there is the MAC address of hardware.
Best regards
Marco Cervati
Link copied. Please paste this link to share this article on your social media post.

