I am using Visual Components 4.10 Premium with the Siemens S7 connectivity plugin for virtual commissioning with a physical S7-1200 G2 PLC.
The problem: Setting an IntegerSignal value via sig_TEST.Value = x in a Python script executes correctly and the print confirms the value — but the “Simulation variable” column in Connected Variables does not update during the running simulation. The value only appears in Connected Variables after the simulation is stopped and restarted.
Observed behavior:
-
OnRunexecutes correctly, all print statements appear in Output panel -
sig_TEST.Value = 99executes,print(sig_TEST.Value)returns 99 -
Connected Variables “Simulation variables” column stays at 0 during entire simulation
-
After simulation restart: value 99 appears correctly in Connected Variables and is transmitted to PLC
-
Manually writing via “Prepared Values” works immediately
Minimal reproduction script:
from vcScript import *
app = getApplication()
comp = getComponent()
sig_test = comp.findBehaviour(“TEST”)
print("Signal found: " + str(sig_test.Value))
def OnRun():
print(“OnRun started”)
delay(3.0)
sig_test.Value = 99
print("Value set to: " + str(sig_test.Value))
while True:
delay(1.0)
Expected: Connected Variables updates to 99 during simulation run and transmits to PLC.