How to simulate with Citect comms
I have been successfully running simulation on one PC with Citect on another without any problem.
How to setup the PLC simulator to behave as a PLC
1. Set the PC IP address to the PLC IP address to be simulated.
2. Run the simulator, and check the Host IP address displayed on the panel matches the correct IP address. If it is not correct, you have more than one network card. Disable other networks. I have not figured out any way to force it to a particular network adaptor.
3. Set Unity to Simulator mode, and set the simulator IP address to the PLC address.
4. Connect to the simulator and load the program.
5. Run Citect, and it should all communicate the same as being connected to a PLC. Note: if you want to run Citect in Demo mode, be sure to have "[LAN] TCPIP=0" in the Citect ini file.
How to simulate IO in the PLC
I normally map all my Digital and Analog inputs with simulation tags in ST, which I enable with a SimMode tag. I then write full simulation logic elswhere.
Here is some ST logic that I use
IF SimMode THEN
DigitalInput := WRITE_INPUT_EBOOL (INP := SimState );
AI.Value := WRITE_INPUT_INT (INP := Sim_AI_Raw );
End_If;
The WRITE_INPUT_* functions effectively force the inputs in the logic. If you want to do this in a live PLC overriding the actual connected IO, be sure to place the routine at the top, so it overwrites any IO updates.
I hope this clears up how to do it.