diff --git a/DUTs/Axis_Structures/ST_AxisControl.TcDUT b/DUTs/Axis_Structures/ST_AxisControl.TcDUT index ebb7a9ec..f3c7076e 100644 --- a/DUTs/Axis_Structures/ST_AxisControl.TcDUT +++ b/DUTs/Axis_Structures/ST_AxisControl.TcDUT @@ -25,6 +25,8 @@ STRUCT bAirpadManualControl: BOOL := FALSE; //Allow manual control airpad bAirpadManualPressureOn: BOOL := FALSE; //Pressurize airpad manually bReleaseBrake AT %Q*: BOOL; //Output from method controlling brake + stExternalSetpoint: ST_ExternalSetpoint; //Input structure mapped to external setpoint feed + bEnableSetPointGen: BOOL := FALSE; //Enable external setpoint generator END_STRUCT END_TYPE ]]> diff --git a/DUTs/Axis_Structures/ST_AxisStatus.TcDUT b/DUTs/Axis_Structures/ST_AxisStatus.TcDUT index 1292791c..4c3c91d5 100644 --- a/DUTs/Axis_Structures/ST_AxisStatus.TcDUT +++ b/DUTs/Axis_Structures/ST_AxisStatus.TcDUT @@ -47,6 +47,7 @@ STRUCT bCommandHandlerBufferingCommand: BOOL; //True if CommandHandler is waiting on a permit before releasing the command bCommandHandlerTimeoutError: BOOL; //True if CommandHandler did not receive a permit in time eInternalMotionCommand: E_MotionFunctions; + bExternalSetpointGeneratorEnabled: BOOL; //True if external setpoint generator enabled. END_STRUCT END_TYPE ]]> diff --git a/DUTs/Axis_Structures/ST_ExternalSetpoint.TcDUT b/DUTs/Axis_Structures/ST_ExternalSetpoint.TcDUT new file mode 100644 index 00000000..d5a5ed16 --- /dev/null +++ b/DUTs/Axis_Structures/ST_ExternalSetpoint.TcDUT @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/POUs/Motion/FB_Axis.TcPOU b/POUs/Motion/FB_Axis.TcPOU index 4689df3d..16c386bb 100644 --- a/POUs/Motion/FB_Axis.TcPOU +++ b/POUs/Motion/FB_Axis.TcPOU @@ -55,6 +55,10 @@ VAR fbGearOut: MC_GearOut; stMcStatusGearOut: ST_McStatus; + fbExtSetPointGenEnable: MC_ExtSetPointGenEnable; + fbExtSetPointGenDisable: MC_ExtSetPointGenDisable; + eExtSetPointGen: (STANDBY, ENABLE_GEN, ENABLED, DISABLE_GEN); + stMasterAxis: ST_GearAxis := (nIndex := 1, fRatio := 0); nSlaveAxesIndex: UINT; nAxisIndex: UINT; @@ -611,6 +615,76 @@ bReady := AND _stAxis.stInputs.bBrakeReleased) OR NOT _stAxis.stConfig.stAirpadBrake.bExternalBrakeFeedbackConnected); mControl_ExternalBrake := bEnableAmp; +]]> + + + + + + = 0 THEN + nDirection := 1; +ELSE + nDirection := -1; +END_IF + +fbExtSetPointGenEnable(Axis := _stAxis.Axis); +fbExtSetPointGenDisable(Axis := _stAxis.Axis); + +MC_ExtSetPointGenFeed( + Axis := _stAxis.Axis, + Position := _stAxis.stControl.stExternalSetpoint.fPosition, + Velocity := _stAxis.stControl.stExternalSetpoint.fVelocity, + Acceleration := _stAxis.stControl.stExternalSetpoint.fAcceleration, + Direction := nDirection); + +stAxis.stStatus.bExternalSetpointGeneratorEnabled := eExtSetPointGen = ENABLED; ]]> @@ -1808,6 +1882,7 @@ stMcStatusHalt := mMove_Halt(); stMcStatusStop := mMove_Stop(); stMcStatusReset := mControl_Reset(); +mControl_ExtSetPointGen(); stMcStatusMoveAbsolute := mMove_MoveAbsolute(); stMcStatusMoveRelative := mMove_MoveRelative(); stMcStatusMoveModulo := mMove_MoveModulo();