<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.0">
  <POU Name="MAIN" Id="{eaceb1e4-5544-4368-a12f-3e05dd0be17a}" SpecialFunc="None">
    <Declaration><![CDATA[PROGRAM MAIN
VAR
    lineSim : FB_LineSim;
    i       : INT;
    j       : INT;
    k       : INT;
END_VAR
]]></Declaration>
    <Implementation>
      <ST><![CDATA[// Smoke-test contract: monotonic counter on GVL_Fixture.nCounter.
// See TwinCAT3SmokeTests.cs (Driver_reads_seeded_DINT_through_real_ADS +
// Driver_subscribe_receives_native_ADS_notifications_on_counter_changes).
GVL_Fixture.nCounter := GVL_Fixture.nCounter + 1;

// Drive the complex fixture.
lineSim(Line := GVL_Plant.Line1);

// Keep the standalone enum / alias globals churning so browse + subscribe
// tests against GVL_Enums see changes without reaching into GVL_Plant.
IF (GVL_Fixture.nCounter MOD 10) = 0 THEN
    GVL_Enums.currentAxisState := GVL_Plant.Line1.Stations[1].Axes[1].State;
    GVL_Enums.currentSeverity  := E_Severity.Info;
    GVL_Enums.cabinetTemperature := GVL_Plant.Line1.Stations[1].Axes[1].Motor.Temperature;
    GVL_Enums.conveyorSpeed      := GVL_Plant.Line1.Stations[1].Axes[1].VelocityMps;
END_IF

// Stir a 2-D / 3-D array entry so multi-rank subscribes see value churn.
i := 1 + (GVL_Fixture.nCounter MOD 4);
j := 1 + ((GVL_Fixture.nCounter / 4) MOD 4);
GVL_Arrays.aReal2D[i, j] := LREAL_TO_REAL(SIN(DINT_TO_LREAL(GVL_Fixture.nCounter) * 0.01));

k := GVL_Fixture.nCounter MOD 3;
GVL_Arrays.aDInt3D[k, k, k] := GVL_Fixture.nCounter;

GVL_Arrays.aInt1D[GVL_Fixture.nCounter MOD 10] := DINT_TO_INT(GVL_Fixture.nCounter MOD 10000);
]]></ST>
    </Implementation>
  </POU>
</TcPlcObject>
