Running and communicating with software running in ARSim

After I have transferred my PLC software to the ARSim simulator. I tried to run my application that connects to the PLC software. However, the application does not function the same as when the actual PLC is present. Does the application connect to the PLC software in the same way as with ARSim? How do we tell that the software in ARSim is running? Can we set a breakpoint for debugging?

The TCP/IP protocols are not identical in simulation and runing in the PLC.
The main reason: windows and the ports.

Does the application connect to the PLC software in the same way as with ARSim?
What type of protocol are you using?
have you performed a analysis via port scan to ensure that is available in your PC?

How do we tell that the software in ARSim is running?

Crystal clear:
image

Can we set a breakpoint for debugging?
You can debugg the source code, but the communications… no breakpoints for that
1-the software whireshark for ethernet based is a good tool

Thanks for your help.

I managed to configure my ip address and port and seem to have a connection to the software running in ARSim currently. I am not able to stop at any breakpoints yet.

I was wondering if we are able to set some I/Os in the software running in ARSim to high or low to simulate some states?

You can force the I/Os when you open IOMapping in monitor mode. Works the same whether in simulation or real HW.

Automation Help: Forcing in the I/O monitor

1 Like

DiagCpuIsARsim () and DiagCpuIsSimulated() are useful function blocks in this situation, too. E.g. activate an IO- Simulation when application is simulated.

https://help.br-automation.com/#/en/4/libraries%2Fasiodiag%2Ffbks%2Ffbks_asiodiag.html

1 Like

Thanks for your helps. I managed to set the I/O in monitor mode. Is DiagCpuIsARsim used to determine different behavior of software depending which type of CPU it is running? What is an IO-Simulation?

What is an IO-Simulation?

in case of a project simulation it is always a good idea to have a separate program/task that simulates your physical machine.
For example, in the case of a simulation (DiagCpuIsSimulated() = TRUE) , all variables that are normally declared as inputs are set by these program parts instead of by the IO mapping.
On real machine (DiagCpuIsSimulated() = FALSE) these programm parts can be deactivated with ST_tmp_suspend().

1 Like

In the AsIO library the function blocks AsIO - AsIOEnableForcing(), AsIOSetForceValue() and AsIODisableForcing() are available, which you could use to force I/O when the cpu is in simulation mode with software.

1 Like

Thanks all for the information.