Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bmk10k
telescope_firmware
Commits
a832c482
Commit
a832c482
authored
Feb 03, 2020
by
Jörg Weingrill
Browse files
cleaned comments; Buffer mode; added McHalt
parent
9a1cdecc
Changes
1
Hide whitespace changes
Inline
Side-by-side
BMK10k/BMK10kRuntime/POUs/FunctionBlocks/FB_Axis.TcPOU
View file @
a832c482
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject
Version=
"1.1.0.1"
ProductVersion=
"3.1.402
2.12
"
>
<TcPlcObject
Version=
"1.1.0.1"
ProductVersion=
"3.1.402
4.0
"
>
<POU
Name=
"FB_Axis"
Id=
"{18cf88d0-9c12-4f7c-90a6-943ec400ede8}"
SpecialFunc=
"None"
>
<Declaration>
<![CDATA[FUNCTION_BLOCK FB_Axis
VAR_INPUT
//
/=============GROUP ADMINISTRATIVE==============
//
Enable Axis ("Achsfreigabe")
bPowerEnable: BOOL;
// enable forward motion
bEnable_Positive: BOOL := TRUE;
//enable backward motion
bEnable_Negative: BOOL := TRUE;
//override controls
fPowerOverride: LREAL := 100;
// reset axis error
bReset: BOOL;
//
/=============GROUP MOVE==============
//
execute axis movement
bMoveAbsExec: BOOL;
// axis target position
fMoveAbsPos: LREAL;
// axis velocity
fMoveAbsVelo: LREAL;
// lock axis with error
bStop: BOOL;
// halt axis
bHalt: BOOL;
END_VAR
VAR_OUTPUT
//
/=============GROUP ADMINISTRATIVE==============
//
power status of the axis
bPowerStatus: BOOL;
// reset done
bResetDone: BOOL;
//
/=============GROUP MOVE==============
//
axis has reached target
bMoveAbsDone: BOOL;
// axis is busy moving
bMoveAbsBusy: BOOL;
// axis error on movement
bMoveAbsErr: BOOL;
//
/=============GROUP STATUS==============
//
axis error
bAxError: BOOL;
// axis error id
nAxErrId: DWORD;
// current velocity
fActVelo: LREAL;
// current position
fActPos: LREAL;
END_VAR
VAR
(*
Aufgabe
fbMcPower vom MC_Power anlegen;
fbMc_Reset vom Typ MC_Reset anlegen;
fbMoveAbsolute vom Typ MC_MoveAbsolute anlegen;
*)
// Baustein Reglerfreigabe
fbMcPower: MC_Power;
...
...
@@ -65,18 +73,10 @@ VAR
(* MC_Stop *)
fbMcStop : MC_Stop;
st_fbMcStopOut: ST_McOutputs;
(*
fbMoveAbsolute1: MC_MoveAbsolute;
st_fbMoveAbsolute1Out: ST_McOutputs;
fbMoveAbsolute2: MC_MoveAbsolute;
st_fbMoveAbsolute2Out: ST_McOutputs;
fbMoveAbsolute3: MC_MoveAbsolute;
st_fbMoveAbsolute3Out: ST_McOutputs;
*)
nstate: INT;
fb_RTrig1: R_TRIG;
fbMcHalt: MC_Halt;
// nstate: INT;
// fb_RTrig1: R_TRIG;
MC_ReadActualPosition: MC_ReadActualPosition;
END_VAR
...
...
@@ -97,7 +97,6 @@ nAxErrId := stAxis.Status.ErrorID;
fActVelo := stAxis.NcToPlc.ActVelo;
fActPos := stAxis.NcToPlc.ActPos;
(*============TO DO MC Power===============================*)
fbMcPower(
Axis := stAxis,
Enable := bPowerEnable,
...
...
@@ -143,7 +142,7 @@ fbMoveAbsolute(
Acceleration := 0, // 0 heisst default aus SystemManager "Dynamik"
Deceleration := 0,
Jerk := 0,
BufferMode := ,
BufferMode :=
MC_BlendingNext
,
Options := ,
Done => StfbMcMoveAbsolut.Done,
Busy => StfbMcMoveAbsolut.Busy,
...
...
@@ -174,10 +173,16 @@ fbMcStop(
Error => st_fbMcStopOut.Error,
ErrorID => st_fbMcStopOut.ErrorID );
]]>
</ST>
fbMcHalt(
Axis := stAxis,
Execute := bHalt,
Deceleration := 0,
Jerk := 0,
BufferMode := MC_Aborting);]]>
</ST>
</Implementation>
<LineIds
Name=
"FB_Axis"
>
<LineId
Id=
"3"
Count=
"14"
/>
<LineId
Id=
"3"
Count=
"9"
/>
<LineId
Id=
"14"
Count=
"3"
/>
<LineId
Id=
"170"
Count=
"1"
/>
<LineId
Id=
"20"
Count=
"10"
/>
<LineId
Id=
"255"
Count=
"0"
/>
...
...
@@ -189,7 +194,10 @@ fbMcStop(
<LineId
Id=
"259"
Count=
"0"
/>
<LineId
Id=
"258"
Count=
"0"
/>
<LineId
Id=
"260"
Count=
"0"
/>
<LineId
Id=
"68"
Count=
"18"
/>
<LineId
Id=
"68"
Count=
"17"
/>
<LineId
Id=
"360"
Count=
"0"
/>
<LineId
Id=
"365"
Count=
"0"
/>
<LineId
Id=
"361"
Count=
"3"
/>
</LineIds>
</POU>
</TcPlcObject>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment