Initial commit
This commit is contained in:
9
TC3_CNCPLCBase/CNC/Global_CNC.TcGVL
Normal file
9
TC3_CNCPLCBase/CNC/Global_CNC.TcGVL
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.6">
|
||||
<GVL Name="Global_CNC" Id="{53b0382d-e5c1-4d3c-90f4-a474264a53f5}">
|
||||
<Declaration><![CDATA[VAR_GLOBAL CONSTANT
|
||||
MAX_USED_CHANNEL_IDX : INT := 0; (* Max index of channel that is used starting at 0, example: 1 -> totally 2 channels, maximum of 11 (12 channels) is allowed here *)
|
||||
libVersion : ST_LibVersion := stLibVersion_Tc3_CNC;
|
||||
END_VAR]]></Declaration>
|
||||
</GVL>
|
||||
</TcPlcObject>
|
||||
247
TC3_CNCPLCBase/CNC/PRG_CNCAxesHandler.TcPOU
Normal file
247
TC3_CNCPLCBase/CNC/PRG_CNCAxesHandler.TcPOU
Normal file
@@ -0,0 +1,247 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.6">
|
||||
<POU Name="PRG_CNCAxesHandler" Id="{09e86179-f0c7-4e63-9c4c-17d3691b5ccb}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[PROGRAM PRG_CNCAxesHandler
|
||||
VAR
|
||||
nHliAxisIdx : INT;
|
||||
fbCNC_Axis : ARRAY[0..HLI_SYS_AX_MAXIDX] OF FB_CNCAxis;
|
||||
|
||||
nFirstSpindle : INT := -1;
|
||||
fbHandleSpindleTechno : HLI3_HandleSpindleTechnoGearChange;
|
||||
M3,M4,M5,M19 : BOOL;
|
||||
MDummy : BOOL;
|
||||
M40, M41, M42, M43, M44, M45: BOOL;
|
||||
|
||||
fbAxesError : FB_AxesError;
|
||||
|
||||
// FB_CNCAxis Sample
|
||||
// fbAxis_X : FB_CNCAxis;
|
||||
// stParameter : ST_CNC_AX_Parameter;
|
||||
stOptions : ST_CNC_AX_Options;
|
||||
// stPLCopen : ST_CNC_AX_PLCopen;
|
||||
|
||||
(*
|
||||
fbHandleSpindleTechnoPlcSp : HLI3_HandleSpindleTechno;
|
||||
SM3,SM4,SM5,SM19 : bool;
|
||||
*)
|
||||
bCalibrationCam: BOOL;
|
||||
fbMoveSpindle: HLI3_MoveSpindle;
|
||||
END_VAR
|
||||
|
||||
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><,
|
||||
bEnable := PLCAxisEnable);
|
||||
IF (NOT fbCNC_Axis[nHliAxisIdx].stStatus.bIsEnabled) THEN // if one axis status is "not enabled" -> reset PLCStatusAxisEnabled
|
||||
PLCStatusAxisEnabled := FALSE;
|
||||
END_IF
|
||||
IF HLI3_CheckAxisValid(nHliAxisIdx) THEN
|
||||
IF nFirstSpindle = -1 AND gpAx[nHliAxisIdx]^.ipo_state.spindle_axis_r THEN (* store HLIIndex of first spindle *)
|
||||
nFirstSpindle := nHliAxisIdx;
|
||||
END_IF
|
||||
END_IF
|
||||
END_FOR
|
||||
|
||||
|
||||
// FB_CNCAxis Sample
|
||||
|
||||
// CNC Axis Options
|
||||
|
||||
// stOptions.strPathCompTable;
|
||||
// stOptions.bActivateCompTable;
|
||||
|
||||
// stOptions.bReducedSpeed;
|
||||
// stOptions.bReducedSpeedZone1;
|
||||
// stOptions.bReducedSpeedZone2;
|
||||
// stOptions.bResetCalibration;
|
||||
|
||||
// CNC Parameters
|
||||
|
||||
// stParameter.bWriteParameter;
|
||||
// stParameter.nNumParameters := 2;
|
||||
// stParameter.strTempPath := 'C:\';
|
||||
|
||||
// stParameter.ParamList[0].strName := 'kenngr.swe_pos';
|
||||
// stParameter.ParamList[0].strValue := '30000000';
|
||||
|
||||
// stParameter.ParamList[1].strName := 'kenngr.swe_neg';
|
||||
// stParameter.ParamList[1].strValue := '0';
|
||||
|
||||
// PLCOpen
|
||||
// stPLCopen.nOverride;
|
||||
// stPLCopen.bExecuteHoming;
|
||||
// stPLCopen.bCamSignal;
|
||||
// stPLCopen.bExecuteMoveAbsolute;
|
||||
// stPLCopen.bExecuteReset;
|
||||
// stPLCopen.fPosition;
|
||||
// stPLCopen.fVelocity;
|
||||
// stPLCopen.fAcceleration;
|
||||
// stPLCopen.fJerk;
|
||||
|
||||
(*
|
||||
fbAxis_X(
|
||||
nLogAxisNo:=1,
|
||||
bEnable:= PLCAxisEnable,
|
||||
bCalibrationCam:= bCalibrationCam,
|
||||
bSetRefOffset:= ,
|
||||
fRefOffset:= ,
|
||||
bFeedhold:= ,
|
||||
stOptions:= stOptions,
|
||||
stParameter:= stParameter,
|
||||
stPLCopen:= stPLCopen,
|
||||
stStatus=> );
|
||||
*)
|
||||
|
||||
|
||||
(* if there exits spindles use the first one for spindleoverride *)
|
||||
IF nFirstSpindle <> -1 THEN
|
||||
HLI3_SetAxisOverride(nHliAxisIdx:= nFirstSpindle , nOverride:= PLCSpindleOverride *10);
|
||||
|
||||
fbHandleSpindleTechno(
|
||||
nHliAxisIdx:=nFirstSpindle ,
|
||||
bIsChannelSpecific:= FALSE,
|
||||
bHandleGearChange := FALSE,
|
||||
nRevolution=> ,
|
||||
nPosition=> ,
|
||||
bError=> ,
|
||||
nErrorId=> ,
|
||||
M03:= M3,
|
||||
M04:= M4,
|
||||
M05:= M5,
|
||||
M19:= M19,
|
||||
M40 := M40,
|
||||
M41 := M41,
|
||||
M42 := M42,
|
||||
M43 := M43,
|
||||
M44 := M44,
|
||||
M45 := M45,
|
||||
);
|
||||
(* acknowledge all spindle M funnctions immediately *)
|
||||
M3 := FALSE;
|
||||
M4 := FALSE;
|
||||
M5 := FALSE;
|
||||
M19 := FALSE;
|
||||
|
||||
|
||||
|
||||
(* Example for starting and stopping a spindle in manual mode in first channel *)
|
||||
IF (CNCSystem.Channel[0].ActMode = HLI_IMCM_MANUAL_MODE) THEN
|
||||
fbMoveSpindle(
|
||||
nHliAxisIdx:=nFirstSpindle ,
|
||||
nSpeed:= nSpindleRpm , (* defined in Global_HMI *)
|
||||
bStart:=bSpindleStart, (* defined in Global_HMI *)
|
||||
bStop:= bSpindleStop , (* defined in Global_HMI *)
|
||||
bBusy=> ,
|
||||
bError=> ,
|
||||
nErrID=> ,
|
||||
sErrText=> );
|
||||
END_IF
|
||||
IF (bSpindleStart AND NOT fbMoveSpindle.bBusy) THEN
|
||||
bSpindleStart := FALSE;
|
||||
END_IF
|
||||
IF (bSpindleStop AND NOT fbMoveSpindle.bBusy) THEN
|
||||
bSpindleStop := FALSE;
|
||||
END_IF
|
||||
|
||||
|
||||
END_IF
|
||||
|
||||
|
||||
|
||||
(* Howto use plc controlled spindle : *)
|
||||
(*
|
||||
fbHandleSpindleTechnoPlcSp(
|
||||
nHliAxisIdx:= 0 ,
|
||||
nHliChannelIdx:= 0 ,
|
||||
bIsChannelSpecific:= TRUE,
|
||||
nLogAxisNoChannelSpecific:= 95 ,
|
||||
bHandleGearChange:= FALSE ,
|
||||
bChannelReset:= FALSE,
|
||||
nRevolution=> ,
|
||||
nPosition=> ,
|
||||
bError=> ,
|
||||
nErrorId=> ,
|
||||
M03:= SM3,
|
||||
M04:= SM4,
|
||||
M05:= SM5,
|
||||
M19:= SM19);
|
||||
*)
|
||||
|
||||
]]></ST>
|
||||
</Implementation>
|
||||
<LineIds Name="PRG_CNCAxesHandler">
|
||||
<LineId Id="3" Count="8" />
|
||||
<LineId Id="308" Count="1" />
|
||||
<LineId Id="12" Count="3" />
|
||||
<LineId Id="226" Count="0" />
|
||||
<LineId Id="446" Count="0" />
|
||||
<LineId Id="16" Count="0" />
|
||||
<LineId Id="103" Count="0" />
|
||||
<LineId Id="106" Count="0" />
|
||||
<LineId Id="104" Count="0" />
|
||||
<LineId Id="337" Count="1" />
|
||||
<LineId Id="98" Count="0" />
|
||||
<LineId Id="20" Count="5" />
|
||||
<LineId Id="108" Count="0" />
|
||||
<LineId Id="107" Count="0" />
|
||||
<LineId Id="109" Count="0" />
|
||||
<LineId Id="187" Count="0" />
|
||||
<LineId Id="174" Count="0" />
|
||||
<LineId Id="188" Count="0" />
|
||||
<LineId Id="186" Count="0" />
|
||||
<LineId Id="176" Count="0" />
|
||||
<LineId Id="179" Count="5" />
|
||||
<LineId Id="177" Count="0" />
|
||||
<LineId Id="192" Count="0" />
|
||||
<LineId Id="113" Count="7" />
|
||||
<LineId Id="26" Count="0" />
|
||||
<LineId Id="193" Count="0" />
|
||||
<LineId Id="191" Count="0" />
|
||||
<LineId Id="206" Count="0" />
|
||||
<LineId Id="197" Count="0" />
|
||||
<LineId Id="194" Count="0" />
|
||||
<LineId Id="199" Count="0" />
|
||||
<LineId Id="201" Count="0" />
|
||||
<LineId Id="208" Count="0" />
|
||||
<LineId Id="210" Count="0" />
|
||||
<LineId Id="212" Count="0" />
|
||||
<LineId Id="214" Count="0" />
|
||||
<LineId Id="213" Count="0" />
|
||||
<LineId Id="211" Count="0" />
|
||||
<LineId Id="217" Count="5" />
|
||||
<LineId Id="281" Count="0" />
|
||||
<LineId Id="223" Count="2" />
|
||||
<LineId Id="209" Count="0" />
|
||||
<LineId Id="255" Count="0" />
|
||||
<LineId Id="229" Count="0" />
|
||||
<LineId Id="28" Count="7" />
|
||||
<LineId Id="366" Count="0" />
|
||||
<LineId Id="36" Count="19" />
|
||||
<LineId Id="394" Count="1" />
|
||||
<LineId Id="399" Count="17" />
|
||||
<LineId Id="396" Count="2" />
|
||||
<LineId Id="56" Count="22" />
|
||||
<LineId Id="2" Count="0" />
|
||||
</LineIds>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
141
TC3_CNCPLCBase/CNC/PRG_CNCChannelHandler.TcPOU
Normal file
141
TC3_CNCPLCBase/CNC/PRG_CNCChannelHandler.TcPOU
Normal file
@@ -0,0 +1,141 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4022.10">
|
||||
<POU Name="PRG_CNCChannelHandler" Id="{1fecdf9c-539b-4107-8f04-7fd2431b36ce}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[PROGRAM PRG_CNCChannelHandler
|
||||
VAR
|
||||
nChan : INT;
|
||||
nOldSelectedChannel : UDINT;
|
||||
CNCChannel : ARRAY[0..MAX_USED_CHANNEL_IDX] OF HLI3_CNCChannel;
|
||||
BlockSearch_Channel : ARRAY[0..MAX_USED_CHANNEL_IDX] OF HLI3_BlockSearch;
|
||||
ErrorHandler_Channel : ARRAY[0..MAX_USED_CHANNEL_IDX] OF FB_ChannelError;
|
||||
nChanNo: UDINT;
|
||||
i: INT;
|
||||
stOptions : ST_CNC_CH_Options;
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[(****************************************************************************************)
|
||||
(* POU: PRG_ChannelHandler *)
|
||||
(* Type: PRG *)
|
||||
(* Author: HR / TV / MiB *)
|
||||
(* Date: 23.01.11 *)
|
||||
(* Last: 29.03.18 *)
|
||||
(* Rev.: 1.6 *)
|
||||
(* ------------------------------------------------------------------------------------ *)
|
||||
(* Desc: Description *)
|
||||
(****************************************************************************************)
|
||||
|
||||
(****************************************************************************************)
|
||||
(* Map CNC function selection from HMI to selected channel (and state vice versa) *)
|
||||
(****************************************************************************************)
|
||||
IF (nOldSelectedChannel <>INT_TO_UDINT(PLCSelectedChannel)) THEN
|
||||
PLCChannelSignals.SingleBlock := PLCMachineMode[PLCSelectedChannel].ChannelSignals.SingleBlock;
|
||||
PLCChannelSignals.PrgBlockIgnore := PLCMachineMode[PLCSelectedChannel].ChannelSignals.PrgBlockIgnore;
|
||||
PLCChannelSignals.M01Stop := PLCMachineMode[PLCSelectedChannel].ChannelSignals.M01Stop;
|
||||
PLCChannelSignals.Backward := PLCMachineMode[PLCSelectedChannel].ChannelSignals.Backward;
|
||||
PLCChannelSignals.FeedHold := PLCMachineMode[PLCSelectedChannel].ChannelSignals.FeedHold;
|
||||
nOldSelectedChannel := INT_TO_UDINT(PLCSelectedChannel);
|
||||
END_IF
|
||||
|
||||
PLCMachineMode[PLCSelectedChannel].ChannelSignals.SingleBlock := PLCChannelSignals.SingleBlock;
|
||||
PLCMachineMode[PLCSelectedChannel].ChannelSignals.PrgBlockIgnore := PLCChannelSignals.PrgBlockIgnore;
|
||||
PLCMachineMode[PLCSelectedChannel].ChannelSignals.M01Stop := PLCChannelSignals.M01Stop;
|
||||
PLCMachineMode[PLCSelectedChannel].ChannelSignals.Backward := PLCChannelSignals.Backward;
|
||||
PLCMachineMode[PLCSelectedChannel].ChannelSignals.FeedHold := PLCChannelSignals.FeedHold;
|
||||
|
||||
|
||||
stOptions.bReferenceModeStartRequired := FALSE;
|
||||
|
||||
FOR i := 0 TO MAX_USED_CHANNEL_IDX DO
|
||||
|
||||
nChan := i;
|
||||
IF (HLI3_CheckChannelValid(nChan)) THEN
|
||||
|
||||
(* Error handler for channel 1 *)
|
||||
ErrorHandler_Channel[nChan](nChanIdx := nCHan);
|
||||
|
||||
(* Channel interface *)
|
||||
CNCChannel[nChan]
|
||||
(nChanIdx := nChan,
|
||||
// Operation Mode with VAR_IN_OUT Variables
|
||||
bModeStandby := PLCMachineMode[nChan].Standby,
|
||||
bModeAutomatic := PLCMachineMode[nChan].Automatic,
|
||||
bModeManual := PLCMachineMode[nChan].Manual,
|
||||
bModeMDI := PLCMachineMode[nChan].MDI,
|
||||
bModeReference := PLCMachineMode[nChan].Homing,
|
||||
// Operation State with VAR_IN_OUT Variables
|
||||
bStateSelect := PLCMachineMode[nChan].Select,
|
||||
bStateReady := PLCMachineMode[nChan].Ready,
|
||||
bStateStart := PLCMachineMode[nChan].Start,
|
||||
bStateStop := PLCMachineMode[nChan].Stop,
|
||||
bStateReset := PLCMachineMode[nChan].Reset,
|
||||
// Operation Mode with VAR_IN Varaibles, the command is executed with a rising edge
|
||||
bCmdAutomatic := FALSE,
|
||||
bCmdManual := FALSE,
|
||||
bCmdReference := FALSE,
|
||||
bCmdMDI := FALSE,
|
||||
// Operation State with VAR_IN Varaibles, the command is executed with a rising edge
|
||||
bCmdStart := FALSE,
|
||||
bCmdStop := FALSE,
|
||||
bCmdReset := FALSE,
|
||||
// EmergencyStop
|
||||
bEmergencyStop := FALSE, (* If TRUE the interpolation will be aborted, Signal is no TwinSAFE function !*)
|
||||
// Override
|
||||
nFeedOverride := PLCFeedOverride * 10,
|
||||
nRapidFeedOverride := PLCFeedOverride * 10,
|
||||
// Special Functions
|
||||
sProgramName := PLCMachineMode[nChan].ProgramName,
|
||||
sMDIString := PLCMachineMode[nChan].MDIString,
|
||||
bBackwardMotion := PLCMachineMode[nChan].ChannelSignals.Backward,
|
||||
bPrgBlockIgnore := PLCMachineMode[nChan].ChannelSignals.PrgBlockIgnore,
|
||||
bFeedHold := PLCMachineMode[nChan].ChannelSignals.FeedHold,
|
||||
bSingleBlock := PLCMachineMode[nChan].ChannelSignals.SingleBlock,
|
||||
bDoSingleBlock := PLCMachineMode[nChan].ChannelSignals.DoSingleBlock,
|
||||
bM01Stop := PLCMachineMode[nChan].ChannelSignals.M01Stop,
|
||||
nSyntaxCheck := PLCMachineMode[nChan].SyntaxCheck.nType,
|
||||
bM30Acknowledgement:= TRUE,
|
||||
// Manual Mode
|
||||
stManualModeParameter := stManualModeParameter[nChan],
|
||||
stManualModeControlElements := stManualModeControlElements[nChan],
|
||||
stManualModeControlElementState := stManualModeControlElementState,
|
||||
// Options
|
||||
stOptions := stOptions
|
||||
);
|
||||
|
||||
(* Handle block search *)
|
||||
BlockSearch_Channel[nChan]
|
||||
(nChanIdx := nChan,
|
||||
bStartRead := PLCMachineMode[nChan].BlockSearch.bStartRead, (* Edge signal *)
|
||||
bStartWrite := PLCMachineMode[nChan].BlockSearch.bStartWrite, (* Edge signal *)
|
||||
BlockSearch := PLCMachineMode[nChan].BlockSearch
|
||||
);
|
||||
|
||||
CNCSystem.Channel[nChan].ActDistance := DINT_TO_LREAL(BlockSearch_Channel[nChan].coveredDistance_AfterReset) / 10.0;
|
||||
CNCSystem.Channel[nChan].ActBlockCount := BlockSearch_Channel[nChan].actualBlockCount_AfterReset;
|
||||
|
||||
END_IF
|
||||
END_FOR
|
||||
]]></ST>
|
||||
</Implementation>
|
||||
<LineIds Name="PRG_CNCChannelHandler">
|
||||
<LineId Id="3" Count="28" />
|
||||
<LineId Id="143" Count="0" />
|
||||
<LineId Id="32" Count="8" />
|
||||
<LineId Id="47" Count="15" />
|
||||
<LineId Id="123" Count="0" />
|
||||
<LineId Id="125" Count="2" />
|
||||
<LineId Id="124" Count="0" />
|
||||
<LineId Id="118" Count="0" />
|
||||
<LineId Id="129" Count="1" />
|
||||
<LineId Id="128" Count="0" />
|
||||
<LineId Id="107" Count="1" />
|
||||
<LineId Id="103" Count="2" />
|
||||
<LineId Id="63" Count="9" />
|
||||
<LineId Id="102" Count="0" />
|
||||
<LineId Id="101" Count="0" />
|
||||
<LineId Id="73" Count="2" />
|
||||
<LineId Id="140" Count="1" />
|
||||
<LineId Id="77" Count="14" />
|
||||
<LineId Id="2" Count="0" />
|
||||
</LineIds>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
67
TC3_CNCPLCBase/CNC/PRG_CNCManualMode.TcPOU
Normal file
67
TC3_CNCPLCBase/CNC/PRG_CNCManualMode.TcPOU
Normal file
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.3">
|
||||
<POU Name="PRG_CNCManualMode" Id="{3480dcd1-b4df-4004-b394-897655766feb}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[PROGRAM PRG_CNCManualMode
|
||||
VAR
|
||||
fbUintUdInt: ARRAY [0..MAX_USED_CHANNEL_IDX] OF FB_Uint_Udint;
|
||||
nHandwheel : UINT; (* increments for handwheel (e.g. EL5101 *)
|
||||
nHandWheelBig: UDINT;
|
||||
i: INT;
|
||||
END_VAR]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[
|
||||
FOR i := 0 TO MAX_USED_CHANNEL_IDX DO
|
||||
|
||||
IF (HLI3_CheckChannelValid(i)) THEN
|
||||
|
||||
stManualModeParameter[i].stChannelParameter.nChanIdx := i; (* Channel 1 *)
|
||||
stManualModeParameter[i].stChannelParameter.nInc := PLCMachineMode[i].ManualMode.nInc * 10;
|
||||
stManualModeParameter[i].stChannelParameter.bG200ConfigurationViaPLC := TRUE;
|
||||
|
||||
stManualModeParameter[i].stChannelParameter.eManualType := UINT_TO_INT(PLCMachineMode[i].ManualMode.nManualTyp);
|
||||
IF (stManualModeParameter[i].stChannelParameter.eManualType = E_CNC_ManualType.Handwheel AND i <> PLCSelectedChannel) THEN (* if in Handwheel mode and the channel is NOT selected -> leave handwheel mode and change to TippMode*)
|
||||
stManualModeParameter[i].stChannelParameter.eManualType := E_CNC_ManualType.TippMode;
|
||||
END_IF
|
||||
|
||||
stManualModeParameter[i].stChannelParameter.stManualOption.bTrafoActive := PLCMachineMode[i].ManualMode.stManualOption.bTrafoActive;
|
||||
stManualModeParameter[i].stChannelParameter.stManualOption.bEcsActive := PLCMachineMode[i].ManualMode.stManualOption.bEcsActive;
|
||||
stManualModeParameter[i].stChannelParameter.stManualOption.eZeroOffset := PLCMachineMode[i].ManualMode.stManualOption.eZeroOffset;
|
||||
|
||||
|
||||
stManualModeParameter[i].stChannelParameter.nHandwheelResolution := UDINT_TO_DINT(PLCMachineMode[i].ManualMode.nHwResolution); (* 0.1 µm /rev (from HMI) *)
|
||||
stManualModeParameter[i].stAxisParameter.stControlUnit[0].nLogAxisNr := PLCMachineMode[i].ManualMode.nLogAxisNumber; (* Log. Achs Nummer *)
|
||||
IF stManualModeParameter[i].stAxisParameter.stControlUnit[0].nLogAxisNr = 0 THEN
|
||||
stManualModeParameter[i].stAxisParameter.stControlUnit[0].nLogAxisNr := gpCh[i]^.bahn_state.coord_r[0].log_achs_nr_r;
|
||||
PLCMachineMode[i].ManualMode.nLogAxisNumber := gpCh[i]^.bahn_state.coord_r[0].log_achs_nr_r;
|
||||
END_IF
|
||||
stManualModeParameter[i].stAxisParameter.stControlUnit[0].nSpeed := LREAL_TO_UDINT(PLCMachineMode[i].ManualMode.nSpeed * 16.666);
|
||||
stManualModeControlElements[i].stControlKeys[0].bKeyNeg := PLCMachineMode[i].ManualMode.bKeyNeg;
|
||||
stManualModeControlElements[i].stControlKeys[0].bKeyPos := PLCMachineMode[i].ManualMode.bKeyPos;
|
||||
stManualModeControlElements[i].stControlKeys[0].bKeyRapid := PLCMachineMode[i].ManualMode.bKeyRapid;
|
||||
|
||||
(* the cnc needs an UDINT for handwheel increments, fbUintUdint extends an UInt to an UDINT *)
|
||||
(* the resoltion of the handwheel is parameterized in CNC-Task GEO/Manual MDS: (e.g. 400 handwheel inc / handwheel revolution
|
||||
|
||||
hr_data[0].hr_aufl_z 400 ( P-MANU-00005 : Handwheel resolution numerator
|
||||
hr_data[0].hr_aufl_n 1 ( P-MANU-00006 : Handwheel resolution denominator
|
||||
*)
|
||||
fbUintUdInt[i](nInSmall := nHandwheel, nBig := nHandWheelBig);
|
||||
stManualModeControlElements[i].nHandwheelInc[0] := UDINT_TO_DINT(nHandWheelBig);
|
||||
END_IF
|
||||
END_FOR
|
||||
|
||||
|
||||
|
||||
|
||||
]]></ST>
|
||||
</Implementation>
|
||||
<LineIds Name="PRG_CNCManualMode">
|
||||
<LineId Id="3" Count="6" />
|
||||
<LineId Id="52" Count="0" />
|
||||
<LineId Id="10" Count="8" />
|
||||
<LineId Id="59" Count="0" />
|
||||
<LineId Id="19" Count="25" />
|
||||
<LineId Id="2" Count="0" />
|
||||
</LineIds>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
22
TC3_CNCPLCBase/CNC/PRG_CNCVariablesViewer.TcPOU
Normal file
22
TC3_CNCPLCBase/CNC/PRG_CNCVariablesViewer.TcPOU
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4022.6">
|
||||
<POU Name="PRG_CNCVariablesViewer" Id="{da8e67fd-e008-4579-a9d5-34610f25362d}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[PROGRAM PRG_CNCVariablesViewer
|
||||
VAR
|
||||
fbReadCNCVariables : FB_ReadCNCVariables;
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[fbReadCNCVariables(
|
||||
bEnable:= TRUE,
|
||||
nChanIdx:= PLCSelectedChannel,
|
||||
eVariablesType:= eVariablesType,
|
||||
tIntervall:= T#1S,
|
||||
stCNCVariablesViewer_Data:= stCNCVariablesViewer_Data);]]></ST>
|
||||
</Implementation>
|
||||
<LineIds Name="PRG_CNCVariablesViewer">
|
||||
<LineId Id="3" Count="4" />
|
||||
<LineId Id="2" Count="0" />
|
||||
</LineIds>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
116
TC3_CNCPLCBase/CNC/PRG_ManualFnc.TcPOU
Normal file
116
TC3_CNCPLCBase/CNC/PRG_ManualFnc.TcPOU
Normal file
@@ -0,0 +1,116 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4022.17">
|
||||
<POU Name="PRG_ManualFnc" Id="{5971ccc3-5532-4fb7-82e7-175bb16004d6}" SpecialFunc="None">
|
||||
<Declaration><![CDATA[PROGRAM PRG_ManualFnc
|
||||
VAR
|
||||
END_VAR
|
||||
]]></Declaration>
|
||||
<Implementation>
|
||||
<ST><![CDATA[
|
||||
|
||||
ManualFnc[0].headerText := 'HeaderText 1';
|
||||
ManualFnc[0].addText := 'addText';
|
||||
ManualFnc[0].infoText1 := 'infoText1';
|
||||
ManualFnc[0].infoText2 := 'infoText2';
|
||||
ManualFnc[0].infoText3 := 'infoText3';
|
||||
ManualFnc[0].infoText4 := 'infoText4';
|
||||
ManualFnc[0].error := FALSE;
|
||||
|
||||
ManualFnc[0].left.key.text := 'left.key.text';
|
||||
ManualFnc[0].left.status.text := 'left.status.text';
|
||||
ManualFnc[0].left.key.disable := TRUE;
|
||||
ManualFnc[0].left.status.colorChange := TRUE;
|
||||
|
||||
ManualFnc[0].right.key.text := 'right.key.text';
|
||||
ManualFnc[0].right.status.text := 'right.status.text';
|
||||
ManualFnc[0].right.key.colorChange := TRUE;
|
||||
|
||||
|
||||
|
||||
|
||||
ManualFnc[1].headerText := 'HeaderText 2';
|
||||
ManualFnc[1].addText := '';
|
||||
ManualFnc[1].infoText1 := 'infoText1';
|
||||
ManualFnc[1].infoText2 := 'infoText2';
|
||||
ManualFnc[1].infoText3 := 'infoText3';
|
||||
ManualFnc[1].infoText4 := 'infoText4';
|
||||
ManualFnc[1].error := FALSE;
|
||||
ManualFnc[1].select := FALSE;
|
||||
|
||||
ManualFnc[1].left.key.text := 'left.key.text';
|
||||
ManualFnc[1].left.status.text := 'left.status.text';
|
||||
ManualFnc[1].left.key.disable := FALSE;
|
||||
ManualFnc[1].left.status.colorChange := FALSE;
|
||||
|
||||
ManualFnc[1].right.key.text := 'right.key.text';
|
||||
ManualFnc[1].right.status.text := 'right.status.text';
|
||||
ManualFnc[1].right.key.colorChange := FALSE;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ManualFnc[2].headerText := 'HeaderText 3';
|
||||
ManualFnc[2].addText := 'addText';
|
||||
ManualFnc[2].infoText1 := 'infoText1';
|
||||
ManualFnc[2].infoText2 := 'infoText2';
|
||||
ManualFnc[2].infoText3 := 'infoText3';
|
||||
ManualFnc[2].infoText4 := 'infoText4';
|
||||
ManualFnc[2].error := TRUE;
|
||||
|
||||
ManualFnc[2].left.key.text := 'left.key.text';
|
||||
ManualFnc[2].left.status.text := 'left.status.text';
|
||||
ManualFnc[2].left.key.disable := TRUE;
|
||||
ManualFnc[2].left.status.colorChange := TRUE;
|
||||
|
||||
ManualFnc[2].right.key.text := 'right.key.text';
|
||||
ManualFnc[2].right.status.text := 'right.status.text';
|
||||
ManualFnc[2].right.key.colorChange := TRUE;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
ManualFnc[3].headerText := 'HeaderText 4';
|
||||
ManualFnc[3].addText := '';
|
||||
ManualFnc[3].infoText1 := 'infoText1';
|
||||
ManualFnc[3].infoText2 := 'infoText2';
|
||||
ManualFnc[3].infoText3 := 'infoText3';
|
||||
ManualFnc[3].infoText4 := 'infoText4';
|
||||
ManualFnc[3].error := FALSE;
|
||||
ManualFnc[3].select := FALSE;
|
||||
|
||||
ManualFnc[3].left.key.text := 'left.key.text';
|
||||
ManualFnc[3].left.status.text := 'left.status.text';
|
||||
ManualFnc[3].left.key.disable := FALSE;
|
||||
ManualFnc[3].left.status.colorChange := FALSE;
|
||||
|
||||
ManualFnc[3].right.key.text := 'right.key.text';
|
||||
ManualFnc[3].right.status.text := 'right.status.text';
|
||||
ManualFnc[3].right.key.colorChange := FALSE;
|
||||
|
||||
|
||||
]]></ST>
|
||||
</Implementation>
|
||||
<LineIds Name="PRG_ManualFnc">
|
||||
<LineId Id="6" Count="17" />
|
||||
<LineId Id="85" Count="0" />
|
||||
<LineId Id="24" Count="0" />
|
||||
<LineId Id="86" Count="0" />
|
||||
<LineId Id="25" Count="9" />
|
||||
<LineId Id="36" Count="6" />
|
||||
<LineId Id="5" Count="0" />
|
||||
<LineId Id="43" Count="0" />
|
||||
<LineId Id="87" Count="2" />
|
||||
<LineId Id="44" Count="0" />
|
||||
<LineId Id="50" Count="14" />
|
||||
<LineId Id="45" Count="1" />
|
||||
<LineId Id="90" Count="1" />
|
||||
<LineId Id="47" Count="1" />
|
||||
<LineId Id="68" Count="7" />
|
||||
<LineId Id="77" Count="7" />
|
||||
<LineId Id="65" Count="2" />
|
||||
<LineId Id="49" Count="0" />
|
||||
</LineIds>
|
||||
</POU>
|
||||
</TcPlcObject>
|
||||
Reference in New Issue
Block a user