Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: reverse the in/out order in the in/out example fbs to match their enum #209

Merged
merged 3 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ IF stOut.sName = '' THEN
stOut.sName := 'OUT';
END_IF

// Assemble the states array, matching the enum values (IN is 1, OUT is 2)
astPositionState[1] := stIn;
astPositionState[2] := stOut;
// Assemble the states array, matching the enum values
astPositionState[E_EpicsInOut.OUT] := stOut;
astPositionState[E_EpicsInOut.IN] := stIn;

// Call the main function block, passing our motors, states, enums and an enable
fbPositionState1D(
Expand All @@ -61,8 +61,8 @@ fbPositionState1D(
);

// Send updates made on the array back to the inputs (VAR_IN_OUT) for maximum clarity
stIn := astPositionState[1];
stOut := astPositionState[2];]]></ST>
stOut := astPositionState[E_EpicsInOut.OUT];
stIn := astPositionState[E_EpicsInOut.IN];]]></ST>
</Implementation>
</POU>
</TcPlcObject>
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ IF stOut2.sName = '' THEN
stOut2.sName := 'OUT';
END_IF

// Assemble the states arrays, matching the enum values (IN is 1, OUT is 2)
astPositionState1[1] := stIn1;
astPositionState1[2] := stOut1;
astPositionState2[1] := stIn2;
astPositionState2[2] := stOut2;
// Assemble the states arrays, matching the enum values
astPositionState1[E_EpicsInOut.OUT] := stOut1;
astPositionState1[E_EpicsInOut.IN] := stIn1;
astPositionState2[E_EpicsInOut.OUT] := stOut2;
astPositionState2[E_EpicsInOut.IN] := stIn2;

// Call the main function block, passing our motors, states, and an enable
fbPositionState2D(
Expand All @@ -75,10 +75,10 @@ fbPositionState2D(
);

// Send updates made on the array back to the inputs (VAR_IN_OUT) for maximum clarity
stIn1 := astPositionState1[1];
stOut1 := astPositionState1[2];
stIn2 := astPositionState2[1];
stOut2 := astPositionState2[2];]]></ST>
stOut1 := astPositionState1[E_EpicsInOut.OUT];
stIn1 := astPositionState1[E_EpicsInOut.IN];
stOut2 := astPositionState2[E_EpicsInOut.OUT];
stIn2 := astPositionState2[E_EpicsInOut.IN];]]></ST>
</Implementation>
</POU>
</TcPlcObject>
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ IF stOut.sName = '' THEN
stOut.sName := 'OUT';
END_IF

// Assemble the states array, matching the enum values (IN is 1, OUT is 2)
astPositionState[1] := stIn;
astPositionState[2] := stOut;
// Assemble the states array, matching the enum values
astPositionState[E_EpicsInOut.OUT] := stOut;
astPositionState[E_EpicsInOut.IN] := stIn;

// Call the main function block, passing our motors, states, and an enable
fbPositionStatePMPS1D(
Expand All @@ -69,8 +69,8 @@ fbPositionStatePMPS1D(
);

// Send updates made on the array back to the inputs (VAR_IN_OUT) for maximum clarity
stIn := astPositionState[1];
stOut := astPositionState[2];]]></ST>
stOut := astPositionState[E_EpicsInOut.OUT];
stIn := astPositionState[E_EpicsInOut.IN];]]></ST>
</Implementation>
</POU>
</TcPlcObject>
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ IF stOut2.sName = '' THEN
stOut2.sName := 'OUT';
END_IF

// Assemble the states arrays, matching the enum values (IN is 1, OUT is 2)
astPositionState1[1] := stIn1;
astPositionState1[2] := stOut1;
astPositionState2[1] := stIn2;
astPositionState2[2] := stOut2;
// Assemble the states arrays, matching the enum values
astPositionState1[E_EpicsInOut.OUT] := stOut1;
astPositionState1[E_EpicsInOut.IN] := stIn1;
astPositionState2[E_EpicsInOut.OUT] := stOut2;
astPositionState2[E_EpicsInOut.IN] := stIn2;

// Call the main function block, passing our motors, states, and an enable
fbPositionStatePMPS2D(
Expand All @@ -83,10 +83,10 @@ fbPositionStatePMPS2D(
);

// Send updates made on the array back to the inputs (VAR_IN_OUT) for maximum clarity
stIn1 := astPositionState1[1];
stOut1 := astPositionState1[2];
stIn2 := astPositionState2[1];
stOut2 := astPositionState2[2];]]></ST>
stOut1 := astPositionState1[E_EpicsInOut.OUT];
stIn1 := astPositionState1[E_EpicsInOut.IN];
stOut2 := astPositionState2[E_EpicsInOut.OUT];
stIn2 := astPositionState2[E_EpicsInOut.IN];]]></ST>
</Implementation>
</POU>
</TcPlcObject>
2 changes: 1 addition & 1 deletion lcls-twincat-motion/_Config/PLC/Library.xti
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,7 @@ External Setpoint Generation:
</DataType>
</DataTypes>
<Project GUID="{E61EF94A-CFE8-4DDF-B7C9-5F7AD2CF9D83}" Name="Library" PrjFilePath="..\..\Library\Library.plcproj" TmcFilePath="..\..\Library\Library.tmc" ReloadTmc="true" AmsPort="851" FileArchiveSettings="#x000e">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="Library\Library.tmc" TmcHash="{0C997D26-FEC1-46B4-2438-632FFA910317}">
<Instance Id="#x08502000" TcSmClass="TComPlcObjDef" KeepUnrestoredLinks="2" TmcPath="Library\Library.tmc" TmcHash="{69E061D5-9F44-CF40-4E04-EDBF9AD71F5C}">
<Name>Library Instance</Name>
<CLSID ClassFactory="TcPlc30">{08500001-0000-0000-F000-000000000064}</CLSID>
<Vars VarGrpType="1">
Expand Down
Loading