Prepared Multitool Operation
Added Tool 2 (just Copy)
This commit is contained in:
@@ -11,9 +11,24 @@ TYPE
|
||||
enTool1Step_WAIT_START_HOME, (*Auf Startbefehl warten f<>r Grundstellung*)
|
||||
enTool1Step_HOMEPOS (*Grundstellung*)
|
||||
);
|
||||
typ_enStepTool2 :
|
||||
( (*Werkzeug 1 Schritte*)
|
||||
enTool2Step_INIT, (*Grundstellung pr<70>fen*)
|
||||
enTool2Step_WAIT_START_MOUNT, (*Auf Startbefehl warten (mit Teil)*)
|
||||
enTool2Step_START_MOUNT, (*Montage Start*)
|
||||
enTool2Step_CYL1_FW, (*Zylinder 1 Ausfahren*)
|
||||
enTool2Step_CYL2_FW, (*Zylinder 2 Ausfahren*)
|
||||
enTool2Step_WAIT_START_HOME, (*Auf Startbefehl warten f<>r Grundstellung*)
|
||||
enTool2Step_HOMEPOS (*Grundstellung*)
|
||||
);
|
||||
typ_enStepTool1Home :
|
||||
( (*Werkzeug 1 Schritte Grundstellung*)
|
||||
enTool1StepHome_WAIT_START_HOME, (*Auf Startbefehl warten f<>r Grundstellung*)
|
||||
enTool1StepHome_HOMEPOS (*Grundstellung*)
|
||||
);
|
||||
typ_enStepTool2Home :
|
||||
( (*Werkzeug 2 Schritte Grundstellung*)
|
||||
enTool2StepHome_WAIT_START_HOME, (*Auf Startbefehl warten f<>r Grundstellung*)
|
||||
enTool2StepHome_HOMEPOS (*Grundstellung*)
|
||||
);
|
||||
END_TYPE
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
VAR
|
||||
gbTool1Homepos : BOOL;
|
||||
gbTool2Homepos : BOOL;
|
||||
gbTool1Homepos : BOOL; (*Werkzeug 1 ist in GST*)
|
||||
gbTool2Homepos : BOOL; (*Werkzeug 2 ist in GST*)
|
||||
gbTool1CountUp : BOOL; (*St<53>ckz<6B>hler erh<72>hen*)
|
||||
gbTool2CountUp : BOOL; (*St<53>ckz<6B>hler erh<72>hen*)
|
||||
genStepTool1 : typ_enStepTool1; (*Schritte Werkzeug 1*)
|
||||
genStepTool2 : typ_enStepTool2; (*Schritte Werkzeug 2*)
|
||||
genStepTool1Home : typ_enStepTool1Home; (*Schritte Werkzeug 1*)
|
||||
genStepTool2Home : typ_enStepTool2Home; (*Schritte Werkzeug 2*)
|
||||
gudPartCountShift : UDINT; (*Schichtz<74>hler*)
|
||||
gudPartCountOverall : UDINT; (*Gesamtz<74>hler*)
|
||||
gusCurrentTool : USINT; (*Eingebautes Werkzeug*)
|
||||
gusSelectedTool : USINT; (*Angew<65>hltes Werkzeug*)
|
||||
END_VAR
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
<Object Type="File" Description="Package variables">GlobalTool.var</Object>
|
||||
<Object Type="Program" Language="IEC" Description="Controller">PressCtrl</Object>
|
||||
<Object Type="Program" Language="IEC" Description="Werkzeug 1">Tool1</Object>
|
||||
<Object Type="Program" Language="IEC" Description="Werkzeug 2">Tool2</Object>
|
||||
<Object Type="Program" Language="IEC" Description="Shift/Overallcounter">PartCount</Object>
|
||||
<Object Type="Program" Language="IEC" Description="Multi Axis Trace">MAxTrace</Object>
|
||||
<Object Type="Program" Language="IEC" Description="Ctrl PowerSupply">AxisPS</Object>
|
||||
@@ -20,5 +21,6 @@
|
||||
<Object Type="Package">Init</Object>
|
||||
<Object Type="Package">ACPPar</Object>
|
||||
<Object Type="DataObject" Language="Ett">acp10etxde</Object>
|
||||
<Object Type="Program" Language="IEC" Description="Werkzeugselektor">ToolCtrl</Object>
|
||||
</Objects>
|
||||
</Package>
|
||||
@@ -178,11 +178,11 @@ PROGRAM _CYCLIC
|
||||
MoveConditions.bEnablePosShaft3 := (lAxisShaft3.rActPosition < rPressPosMax);
|
||||
MoveConditions.bEnableNegShaft4 := (lAxisShaft4.rActPosition > rPressPosMin);
|
||||
MoveConditions.bEnablePosShaft4 := (lAxisShaft4.rActPosition < rPressPosMax);
|
||||
MoveConditions.bEnableNegShaftMaster := (lAxisShaftMaster.rActPosition > rPressPosMin) AND bAllAxisesInSync AND gPS.DriveStatus.bTrigger1;
|
||||
MoveConditions.bEnableNegShaftMaster := (gMachine.bSetupMode OR (lAxisShaftMaster.rActPosition > rPressPosMin)) AND bAllAxisesInSync AND gPS.DriveStatus.bTrigger1;
|
||||
MoveConditions.bEnableReferencePress := bAllAxisesInSync AND gPS.DriveStatus.bTrigger1;
|
||||
MoveConditions.bEnableReferencePressABS := bAllAxisesSingle AND bAllAxisesControllerRdy;
|
||||
MoveConditions.bEnablePosShaftMaster := (lAxisShaftMaster.rActPosition < rPressPosMax) AND bAllAxisesInSync AND gPS.DriveStatus.bTrigger2 AND
|
||||
(bToolslayIsOut OR (bToolslay1IsDown AND bToolslayIsIn)) AND
|
||||
MoveConditions.bEnablePosShaftMaster := (gMachine.bSetupMode OR (lAxisShaftMaster.rActPosition < rPressPosMax)) AND bAllAxisesInSync AND gPS.DriveStatus.bTrigger2 AND
|
||||
(gMachine.bSetupMode OR bToolslayIsOut OR (bToolslay1IsDown AND bToolslayIsIn)) AND
|
||||
((gMachine.enMode <> enMACH_JOG) OR
|
||||
((lAxisShaft1.rActTorque < 6.5) AND
|
||||
(lAxisShaft2.rActTorque < 6.5) AND
|
||||
@@ -190,11 +190,11 @@ PROGRAM _CYCLIC
|
||||
(lAxisShaft4.rActTorque < 6.5)));
|
||||
|
||||
|
||||
MoveConditions.bEnableToolslay1Up := bPressIsInHomepos;
|
||||
MoveConditions.bEnableToolslay1Up := bPressIsInHomepos OR TRUE ; //FixMe
|
||||
MoveConditions.bEnableToolslay1Down := bToolslayIsIn OR bToolslayIsOut; //Slay Home or in Workpos
|
||||
MoveConditions.bEnableNegSlay1 := bPressIsInHomepos AND bToolslay1IsUp;
|
||||
MoveConditions.bEnablePosSlay1 := bPressIsInHomepos AND bToolslay1IsUp;
|
||||
MoveConditions.bEnableReferenceSlay1 := bPressIsInHomepos AND bToolslay1IsUp;
|
||||
MoveConditions.bEnableNegSlay1 := (gMachine.bSetupMode OR bPressIsInHomepos) AND bToolslay1IsUp;
|
||||
MoveConditions.bEnablePosSlay1 := (gMachine.bSetupMode OR bPressIsInHomepos) AND bToolslay1IsUp;
|
||||
MoveConditions.bEnableReferenceSlay1 := (gMachine.bSetupMode OR bPressIsInHomepos) AND bToolslay1IsUp;
|
||||
|
||||
|
||||
//Status Control vor Visual Component Controls
|
||||
@@ -403,7 +403,7 @@ PROGRAM _CYCLIC
|
||||
//Wait for Start
|
||||
//---------------------------
|
||||
enPressStepHoming_WAIT_START:
|
||||
IF bSafetyOkFP OR (EDGEPOS (gbInResetKeyTool1) AND bSafetyOk) THEN
|
||||
IF EDGEPOS (gbInResetKeyTool1) AND bSafetyOk THEN
|
||||
enStepPressHoming := enPressStepHoming_WAIT_AX_SINGLE;
|
||||
bDevelEnalbeGear := FALSE;
|
||||
END_IF
|
||||
@@ -541,13 +541,24 @@ PROGRAM _CYCLIC
|
||||
//Tool Homing
|
||||
//---------------------------
|
||||
enPressStepHoming_TOOL:
|
||||
IF (genStepTool1Home = enTool1StepHome_WAIT_START_HOME) AND NOT gbTool1Homepos THEN
|
||||
genStepTool1Home := enTool1StepHome_HOMEPOS;
|
||||
END_IF
|
||||
IF (genStepTool1Home = enTool1StepHome_WAIT_START_HOME) AND gbTool1Homepos THEN
|
||||
IF (gusCurrentTool = 0) AND (gusSelectedTool = 0) THEN
|
||||
enStepPressHoming := enPressStepHoming_DONE;
|
||||
ELSIF (gusCurrentTool = 1) AND (gusSelectedTool = 1) THEN
|
||||
IF (genStepTool1Home = enTool1StepHome_WAIT_START_HOME) AND NOT gbTool1Homepos THEN
|
||||
genStepTool1Home := enTool1StepHome_HOMEPOS;
|
||||
END_IF
|
||||
IF (genStepTool1Home = enTool1StepHome_WAIT_START_HOME) AND gbTool1Homepos THEN
|
||||
enStepPressHoming := enPressStepHoming_DONE;
|
||||
END_IF
|
||||
ELSIF (gusCurrentTool = 2) AND (gusSelectedTool = 2) THEN
|
||||
IF (genStepTool2Home = enTool2StepHome_WAIT_START_HOME) AND NOT gbTool2Homepos THEN
|
||||
genStepTool2Home := enTool2StepHome_HOMEPOS;
|
||||
END_IF
|
||||
IF (genStepTool2Home = enTool2StepHome_WAIT_START_HOME) AND gbTool2Homepos THEN
|
||||
enStepPressHoming := enPressStepHoming_DONE;
|
||||
END_IF
|
||||
END_IF
|
||||
|
||||
|
||||
enPressStepHoming_DONE:
|
||||
gMachine.bRequestHoming := FALSE;
|
||||
enStepPressHoming := enPressStepHoming_INIT;
|
||||
|
||||
@@ -7,6 +7,7 @@ END_PROGRAM
|
||||
|
||||
|
||||
PROGRAM _CYCLIC
|
||||
bToolIsActive := (gusSelectedTool = usTOOLID) AND (gusCurrentTool = usTOOLID);
|
||||
|
||||
MoveConditions.bEnableCylinder1Fw := gbInTool1Cyl3Bw;
|
||||
MoveConditions.bEnableCylinder1Bw := TRUE;
|
||||
@@ -135,13 +136,14 @@ PROGRAM _CYCLIC
|
||||
|
||||
|
||||
//Set Outputs
|
||||
gbOuTool1Cyl1Fw := bCylinder1Fw;
|
||||
gbOuTool1Cyl1Bw := NOT bCylinder1Fw;
|
||||
gbOuTool1Cyl2Fw := bCylinder2Fw;
|
||||
gbOuTool1Cyl2Bw := NOT bCylinder2Fw;
|
||||
gbOuTool1Cyl3Fw := bCylinder3Fw;
|
||||
gbOuTool1Cyl3Bw := NOT bCylinder3Fw;
|
||||
|
||||
IF bToolIsActive THEN
|
||||
gbOuTool1Cyl1Fw := bCylinder1Fw;
|
||||
gbOuTool1Cyl1Bw := NOT bCylinder1Fw;
|
||||
gbOuTool1Cyl2Fw := bCylinder2Fw;
|
||||
gbOuTool1Cyl2Bw := NOT bCylinder2Fw;
|
||||
gbOuTool1Cyl3Fw := bCylinder3Fw;
|
||||
gbOuTool1Cyl3Bw := NOT bCylinder3Fw;
|
||||
END_IF
|
||||
//Generate Alarms
|
||||
Cylinder1Check (bInOutputCylinderBw := gbOuTool1Cyl1Bw,
|
||||
bInOutputCylinderFw := gbOuTool1Cyl1Fw,
|
||||
@@ -167,6 +169,18 @@ PROGRAM _CYCLIC
|
||||
lToolalarms.Alarm[7] := Cylinder3Check.bOuErrorCylinderFw;
|
||||
lToolalarms.Alarm[8] := Cylinder3Check.bOuErrorBothSensorsHigh;
|
||||
|
||||
IF NOT bToolIsActive THEN
|
||||
lToolalarms.Alarm[0] := FALSE;
|
||||
lToolalarms.Alarm[1] := FALSE;
|
||||
lToolalarms.Alarm[2] := FALSE;
|
||||
lToolalarms.Alarm[3] := FALSE;
|
||||
lToolalarms.Alarm[4] := FALSE;
|
||||
lToolalarms.Alarm[5] := FALSE;
|
||||
lToolalarms.Alarm[6] := FALSE;
|
||||
lToolalarms.Alarm[7] := FALSE;
|
||||
lToolalarms.Alarm[8] := FALSE;
|
||||
END_IF
|
||||
|
||||
END_PROGRAM
|
||||
|
||||
PROGRAM _EXIT
|
||||
|
||||
@@ -1,7 +1,13 @@
|
||||
VAR
|
||||
bToolIsActive : BOOL; (*Werkzeug ist aktiv*)
|
||||
bCylinder1Fw : BOOL;
|
||||
bCylinder2Fw : BOOL;
|
||||
bCylinder3Fw : BOOL;
|
||||
END_VAR
|
||||
VAR CONSTANT
|
||||
usTOOLID : USINT := 1; (*Werkzeugnummer*)
|
||||
END_VAR
|
||||
VAR
|
||||
StatusVCControls : typStatusToolVCControls;
|
||||
ManualCommands : typManualCommnands; (*Kommandos Betriebsart Hand*)
|
||||
MoveConditions : typMoveConditions;
|
||||
|
||||
11
Logical/Axises/Tool2/IEC.prg
Normal file
11
Logical/Axises/Tool2/IEC.prg
Normal file
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=3.0.90.24 SP06?>
|
||||
<Program xmlns="http://br-automation.co.at/AS/Program">
|
||||
<Files>
|
||||
<File Description="Implementation code">Tool2.st</File>
|
||||
<File Description="Local data types" Private="true">Tool2.typ</File>
|
||||
<File Description="Local variables" Private="true">Tool2.var</File>
|
||||
<File Private="true">Tool2.fun</File>
|
||||
<File Reference="true">\Logical\Axises\Tool1\FUB_CylinderCheck.st</File>
|
||||
</Files>
|
||||
</Program>
|
||||
20
Logical/Axises/Tool2/Tool2.fun
Normal file
20
Logical/Axises/Tool2/Tool2.fun
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
FUNCTION_BLOCK FUB_CylinderCheck (*Zylinder<EFBFBD>berwachung*)
|
||||
VAR_INPUT
|
||||
bInOutputCylinderFw : BOOL; (*Ausgang Zylinder Ausfahren*)
|
||||
bInOutputCylinderBw : BOOL; (*Ausgang Zylinder Einfahren*)
|
||||
bInSensorCylinderFw : BOOL; (*Sensor Zylinder Ausfahren*)
|
||||
bInSensorCylinderBw : BOOL; (*Sensor Zylinder Einfahren*)
|
||||
END_VAR
|
||||
VAR_OUTPUT
|
||||
bOuErrorCylinderFw : BOOL; (*Fehler Zylinder Ausfahren*)
|
||||
bOuErrorCylinderBw : BOOL; (*Fehler Zylinder Einfahren*)
|
||||
bOuErrorBothSensorsHigh : BOOL; (*Fehler beide Zynlinderschalter bet<EFBFBD>tigt*)
|
||||
END_VAR
|
||||
VAR
|
||||
tInCylinderFw : TIME := T#2s; (*<EFBFBD>berwachungszeit Zylinder Ausfahren*)
|
||||
tInCylinderBw : TIME := T#2s; (*<EFBFBD>berwachungszeit Zylinder Ausfahren*)
|
||||
TON_CylinderFw : TON;
|
||||
TON_CylinderBw : TON;
|
||||
END_VAR
|
||||
END_FUNCTION_BLOCK
|
||||
192
Logical/Axises/Tool2/Tool2.st
Normal file
192
Logical/Axises/Tool2/Tool2.st
Normal file
@@ -0,0 +1,192 @@
|
||||
|
||||
PROGRAM _INIT
|
||||
|
||||
lToolalarms ACCESS ADR (gToolalarms);
|
||||
|
||||
END_PROGRAM
|
||||
|
||||
|
||||
PROGRAM _CYCLIC
|
||||
bToolIsActive := (gusSelectedTool = usTOOLID) AND (gusCurrentTool = usTOOLID);
|
||||
|
||||
MoveConditions.bEnableCylinder1Fw := gbInTool1Cyl3Bw;
|
||||
MoveConditions.bEnableCylinder1Bw := TRUE;
|
||||
MoveConditions.bEnableCylinder2Fw := gbInTool1Cyl1Fw AND gbInTool1Cyl3Fw;
|
||||
MoveConditions.bEnableCylinder2Bw := TRUE;
|
||||
MoveConditions.bEnableCylinder3Fw := gbInTool1Cyl1Fw;
|
||||
MoveConditions.bEnableCylinder3Bw := TRUE;
|
||||
|
||||
StatusVCControls.usCylinder1Fw := SHL (BOOL_TO_USINT (NOT MoveConditions.bEnableCylinder1Fw), VC_LOCK_BITPOS) +
|
||||
SHL (BOOL_TO_USINT ((gMachine.enMode <> enMACH_JOG) OR bCylinder1Fw), VC_HIDE_BITPOS);
|
||||
StatusVCControls.usCylinder1Bw := SHL (BOOL_TO_USINT (NOT MoveConditions.bEnableCylinder1Bw), VC_LOCK_BITPOS) +
|
||||
SHL (BOOL_TO_USINT ((gMachine.enMode <> enMACH_JOG) OR NOT bCylinder1Fw), VC_HIDE_BITPOS);
|
||||
StatusVCControls.usCylinder2Fw := SHL (BOOL_TO_USINT (NOT MoveConditions.bEnableCylinder2Fw), VC_LOCK_BITPOS) +
|
||||
SHL (BOOL_TO_USINT ((gMachine.enMode <> enMACH_JOG) OR bCylinder2Fw), VC_HIDE_BITPOS);
|
||||
StatusVCControls.usCylinder2Bw := SHL (BOOL_TO_USINT (NOT MoveConditions.bEnableCylinder2Bw), VC_LOCK_BITPOS) +
|
||||
SHL (BOOL_TO_USINT ((gMachine.enMode <> enMACH_JOG) OR NOT bCylinder2Fw), VC_HIDE_BITPOS);
|
||||
StatusVCControls.usCylinder3Fw := SHL (BOOL_TO_USINT (NOT MoveConditions.bEnableCylinder3Fw), VC_LOCK_BITPOS) +
|
||||
SHL (BOOL_TO_USINT ((gMachine.enMode <> enMACH_JOG) OR bCylinder3Fw), VC_HIDE_BITPOS);
|
||||
StatusVCControls.usCylinder3Bw := SHL (BOOL_TO_USINT (NOT MoveConditions.bEnableCylinder3Bw), VC_LOCK_BITPOS) +
|
||||
SHL (BOOL_TO_USINT ((gMachine.enMode <> enMACH_JOG) OR NOT bCylinder3Fw), VC_HIDE_BITPOS);
|
||||
|
||||
|
||||
gbTool2Homepos := TRUE;// gbInTool1Cyl1Bw AND gbInTool1Cyl2Bw AND gbInTool1Cyl3Bw;
|
||||
|
||||
//Jog Mode
|
||||
//==========================================================================================
|
||||
IF gMachine.enMode = enMACH_JOG THEN
|
||||
IF ManualCommands.bCylinder1Bw AND MoveConditions.bEnableCylinder1Bw THEN
|
||||
bCylinder1Fw := FALSE;
|
||||
ELSIF ManualCommands.bCylinder1Fw AND MoveConditions.bEnableCylinder1Fw THEN
|
||||
bCylinder1Fw := TRUE;
|
||||
END_IF
|
||||
IF ManualCommands.bCylinder2Bw AND MoveConditions.bEnableCylinder2Bw THEN
|
||||
bCylinder2Fw := FALSE;
|
||||
ELSIF ManualCommands.bCylinder2Fw AND MoveConditions.bEnableCylinder2Fw THEN
|
||||
bCylinder2Fw := TRUE;
|
||||
END_IF
|
||||
IF ManualCommands.bCylinder3Bw AND MoveConditions.bEnableCylinder3Bw THEN
|
||||
bCylinder3Fw := FALSE;
|
||||
ELSIF ManualCommands.bCylinder3Fw AND MoveConditions.bEnableCylinder3Fw THEN
|
||||
bCylinder3Fw := TRUE;
|
||||
END_IF
|
||||
|
||||
ELSIF (gMachine.enMode = enMACH_HOMEPOS) THEN
|
||||
CASE genStepTool1Home OF
|
||||
//Wait for Start Home
|
||||
//---------------------------
|
||||
enTool1StepHome_WAIT_START_HOME:
|
||||
//Set in Pressstepchain
|
||||
|
||||
//Home Cylinder
|
||||
//---------------------------
|
||||
enTool1StepHome_HOMEPOS:
|
||||
bCylinder1Fw := FALSE;
|
||||
bCylinder2Fw := FALSE;
|
||||
bCylinder3Fw := FALSE;
|
||||
IF gbTool2Homepos THEN
|
||||
genStepTool1Home := enTool1StepHome_WAIT_START_HOME;
|
||||
END_IF
|
||||
END_CASE;
|
||||
|
||||
//(Semi) - Automaticmode
|
||||
//==========================================================================================
|
||||
ELSIF (gMachine.enMode = enMACH_MANUAL) OR (gMachine.enMode = enMACH_AUTOMATIC) THEN
|
||||
//Wirefeed
|
||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
CASE genStepTool1 OF
|
||||
//Init
|
||||
//---------------------------
|
||||
enTool1Step_INIT:
|
||||
IF gbTool1Homepos THEN
|
||||
genStepTool1 := enTool1Step_WAIT_START_MOUNT;
|
||||
END_IF
|
||||
|
||||
//Wait for Start Mount
|
||||
//---------------------------
|
||||
enTool1Step_WAIT_START_MOUNT:
|
||||
//Set in Pressstepchain
|
||||
|
||||
//Wait for Start Mount
|
||||
//---------------------------
|
||||
enTool1Step_START_MOUNT:
|
||||
genStepTool1 := enTool1Step_CYL1_FW;
|
||||
|
||||
//Cylinder 1 FW
|
||||
//---------------------------
|
||||
enTool1Step_CYL1_FW:
|
||||
bCylinder1Fw := TRUE;
|
||||
IF gbInTool1Cyl1Fw THEN
|
||||
genStepTool1 := enTool1Step_CYL3_FW;
|
||||
END_IF
|
||||
|
||||
//Cylinder 3 FW
|
||||
//---------------------------
|
||||
enTool1Step_CYL3_FW:
|
||||
bCylinder3Fw := TRUE;
|
||||
IF gbInTool1Cyl3Fw THEN
|
||||
genStepTool1 := enTool1Step_CYL2_FW;
|
||||
END_IF
|
||||
|
||||
//Cylinder 2 FW
|
||||
//---------------------------
|
||||
enTool1Step_CYL2_FW:
|
||||
bCylinder2Fw := TRUE;
|
||||
IF gbInTool1Cyl2Fw THEN
|
||||
genStepTool1 := enTool1Step_WAIT_START_HOME;
|
||||
END_IF
|
||||
|
||||
//Wait for Start Home
|
||||
//---------------------------
|
||||
enTool1Step_WAIT_START_HOME:
|
||||
//Set in Pressstepchain
|
||||
|
||||
//Home Cylinder
|
||||
//---------------------------
|
||||
enTool1Step_HOMEPOS:
|
||||
bCylinder1Fw := FALSE;
|
||||
bCylinder2Fw := FALSE;
|
||||
bCylinder3Fw := FALSE;
|
||||
IF gbTool1Homepos THEN
|
||||
genStepTool1 := enTool1Step_INIT;
|
||||
END_IF
|
||||
END_CASE;
|
||||
END_IF;
|
||||
|
||||
|
||||
|
||||
//Set Outputs
|
||||
IF bToolIsActive THEN
|
||||
gbOuTool1Cyl1Fw := FALSE; //bCylinder1Fw;
|
||||
gbOuTool1Cyl1Bw := FALSE; // NOT bCylinder1Fw;
|
||||
gbOuTool1Cyl2Fw := FALSE; //bCylinder2Fw;
|
||||
gbOuTool1Cyl2Bw := FALSE; // NOT bCylinder2Fw;
|
||||
gbOuTool1Cyl3Fw := FALSE; //bCylinder3Fw;
|
||||
gbOuTool1Cyl3Bw := FALSE; // NOT bCylinder3Fw;
|
||||
END_IF
|
||||
//Generate Alarms
|
||||
Cylinder1Check (bInOutputCylinderBw := gbOuTool1Cyl1Bw,
|
||||
bInOutputCylinderFw := gbOuTool1Cyl1Fw,
|
||||
bInSensorCylinderBw := gbInTool1Cyl1Bw,
|
||||
bInSensorCylinderFw := gbInTool1Cyl1Fw);
|
||||
lToolalarms.Alarm[20] := Cylinder1Check.bOuErrorCylinderBw;
|
||||
lToolalarms.Alarm[21] := Cylinder1Check.bOuErrorCylinderFw;
|
||||
lToolalarms.Alarm[22] := Cylinder1Check.bOuErrorBothSensorsHigh;
|
||||
|
||||
Cylinder2Check (bInOutputCylinderBw := gbOuTool1Cyl2Bw,
|
||||
bInOutputCylinderFw := gbOuTool1Cyl2Fw,
|
||||
bInSensorCylinderBw := gbInTool1Cyl2Bw,
|
||||
bInSensorCylinderFw := gbInTool1Cyl2Fw);
|
||||
lToolalarms.Alarm[23] := Cylinder2Check.bOuErrorCylinderBw;
|
||||
lToolalarms.Alarm[24] := Cylinder2Check.bOuErrorCylinderFw;
|
||||
lToolalarms.Alarm[25] := Cylinder2Check.bOuErrorBothSensorsHigh;
|
||||
|
||||
Cylinder3Check (bInOutputCylinderBw := gbOuTool1Cyl3Bw,
|
||||
bInOutputCylinderFw := gbOuTool1Cyl3Fw,
|
||||
bInSensorCylinderBw := gbInTool1Cyl3Bw,
|
||||
bInSensorCylinderFw := gbInTool1Cyl3Fw);
|
||||
lToolalarms.Alarm[26] := Cylinder3Check.bOuErrorCylinderBw;
|
||||
lToolalarms.Alarm[27] := Cylinder3Check.bOuErrorCylinderFw;
|
||||
lToolalarms.Alarm[28] := Cylinder3Check.bOuErrorBothSensorsHigh;
|
||||
|
||||
IF TRUE OR NOT bToolIsActive THEN
|
||||
lToolalarms.Alarm[20] := FALSE;
|
||||
lToolalarms.Alarm[21] := FALSE;
|
||||
lToolalarms.Alarm[22] := FALSE;
|
||||
lToolalarms.Alarm[23] := FALSE;
|
||||
lToolalarms.Alarm[24] := FALSE;
|
||||
lToolalarms.Alarm[25] := FALSE;
|
||||
lToolalarms.Alarm[26] := FALSE;
|
||||
lToolalarms.Alarm[27] := FALSE;
|
||||
lToolalarms.Alarm[28] := FALSE;
|
||||
END_IF
|
||||
|
||||
END_PROGRAM
|
||||
|
||||
PROGRAM _EXIT
|
||||
|
||||
|
||||
(* TODO : Add your code here *)
|
||||
|
||||
|
||||
END_PROGRAM
|
||||
33
Logical/Axises/Tool2/Tool2.typ
Normal file
33
Logical/Axises/Tool2/Tool2.typ
Normal file
@@ -0,0 +1,33 @@
|
||||
|
||||
TYPE
|
||||
typStatusToolVCControls : STRUCT (*Controlbytes f<>r Visu*)
|
||||
usCylinder1Fw : USINT; (*Zylinder 1 Ausfahren (AS)*)
|
||||
usCylinder1Bw : USINT; (*Zylinder 1 Einfahren (GS)*)
|
||||
usCylinder2Fw : USINT; (*Zylinder 2 Ausfahren (AS)*)
|
||||
usCylinder2Bw : USINT; (*Zylinder 2 Einfahren (GS)*)
|
||||
usCylinder3Fw : USINT; (*Zylinder 3 Ausfahren (AS)*)
|
||||
usCylinder3Bw : USINT; (*Zylinder 3 Einfahren (GS)*)
|
||||
usCylinderMaintFw : USINT; (*Wartungszylinder Ausfahren (Wartungspos)*)
|
||||
usCylinderMaintBw : USINT; (*Wartungszylinder Einfahren (Presspos)*)
|
||||
END_STRUCT;
|
||||
typManualCommnands : STRUCT
|
||||
bCylinder1Fw : BOOL; (*Zylinder 1 Ausfahren (AS)*)
|
||||
bCylinder1Bw : BOOL; (*Zylinder 1 Einfahren (GS)*)
|
||||
bCylinder2Fw : BOOL; (*Zylinder 2 Ausfahren (AS)*)
|
||||
bCylinder2Bw : BOOL; (*Zylinder 2 Einfahren (GS)*)
|
||||
bCylinder3Fw : BOOL; (*Zylinder 3 Ausfahren (AS)*)
|
||||
bCylinder3Bw : BOOL; (*Zylinder 3 Einfahren (GS)*)
|
||||
bCylinderMaintFw : BOOL; (*Wartungszylinder Ausfahren (Wartungspos)*)
|
||||
bCylinderMaintBw : BOOL; (*Wartungszylinder Einfahren (Presspos)*)
|
||||
END_STRUCT;
|
||||
typMoveConditions : STRUCT (*Bewegungsfreigaben*)
|
||||
bEnableCylinder1Fw : BOOL; (*Zylinder 1 Ausfahren (AS)*)
|
||||
bEnableCylinder1Bw : BOOL; (*Zylinder 1 Einfahren (GS)*)
|
||||
bEnableCylinder2Fw : BOOL; (*Zylinder 2 Ausfahren (AS)*)
|
||||
bEnableCylinder2Bw : BOOL; (*Zylinder 2 Einfahren (GS)*)
|
||||
bEnableCylinder3Fw : BOOL; (*Zylinder 3 Ausfahren (AS)*)
|
||||
bEnableCylinder3Bw : BOOL; (*Zylinder 3 Einfahren (GS)*)
|
||||
bEnalbeCylinderMaintFw : BOOL; (*Wartungszylinder Ausfahren (Wartungspos)*)
|
||||
bEnableCylinderMaintBw : BOOL; (*Wartungszylinder Einfahren (Presspos)*)
|
||||
END_STRUCT;
|
||||
END_TYPE
|
||||
18
Logical/Axises/Tool2/Tool2.var
Normal file
18
Logical/Axises/Tool2/Tool2.var
Normal file
@@ -0,0 +1,18 @@
|
||||
VAR
|
||||
bToolIsActive : BOOL; (*Werkzeug ist aktiv*)
|
||||
bCylinder1Fw : BOOL;
|
||||
bCylinder2Fw : BOOL;
|
||||
bCylinder3Fw : BOOL;
|
||||
END_VAR
|
||||
VAR CONSTANT
|
||||
usTOOLID : USINT := 2; (*Werkzeugnummer*)
|
||||
END_VAR
|
||||
VAR
|
||||
StatusVCControls : typStatusToolVCControls;
|
||||
ManualCommands : typManualCommnands; (*Kommandos Betriebsart Hand*)
|
||||
MoveConditions : typMoveConditions;
|
||||
lToolalarms : REFERENCE TO typAlarm; (*Werkzeugalarme*)
|
||||
Cylinder1Check : FUB_CylinderCheck;
|
||||
Cylinder2Check : FUB_CylinderCheck;
|
||||
Cylinder3Check : FUB_CylinderCheck;
|
||||
END_VAR
|
||||
9
Logical/Axises/ToolCtrl/IEC.prg
Normal file
9
Logical/Axises/ToolCtrl/IEC.prg
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=3.0.90.24 SP06?>
|
||||
<Program xmlns="http://br-automation.co.at/AS/Program">
|
||||
<Files>
|
||||
<File Description="Implementation code">ToolCtrl.st</File>
|
||||
<File Description="Local data types" Private="true">ToolCtrl.typ</File>
|
||||
<File Description="Local variables" Private="true">ToolCtrl.var</File>
|
||||
</Files>
|
||||
</Program>
|
||||
42
Logical/Axises/ToolCtrl/ToolCtrl.st
Normal file
42
Logical/Axises/ToolCtrl/ToolCtrl.st
Normal file
@@ -0,0 +1,42 @@
|
||||
(********************************************************************
|
||||
* COPYRIGHT --
|
||||
********************************************************************
|
||||
* Program: ToolCtrl
|
||||
* File: ToolCtrl.st
|
||||
* Author: michi
|
||||
* Created: January 28, 2013
|
||||
********************************************************************
|
||||
* Implementation of program ToolCtrl
|
||||
********************************************************************)
|
||||
|
||||
PROGRAM _INIT
|
||||
|
||||
|
||||
(* TODO : Add your code here *)
|
||||
|
||||
|
||||
END_PROGRAM
|
||||
|
||||
|
||||
PROGRAM _CYCLIC
|
||||
IF gbInTool1Code1 THEN
|
||||
gusCurrentTool := 1;
|
||||
ELSIF gbInTool1Code2 THEN
|
||||
gusCurrentTool := 2;
|
||||
ELSE
|
||||
gusCurrentTool := 0;
|
||||
END_IF
|
||||
|
||||
IF (gusSelectedTool = 0) AND (gusCurrentTool = 0) THEN
|
||||
gbOuTool1Cyl1Fw := FALSE;
|
||||
gbOuTool1Cyl1Bw := FALSE;
|
||||
gbOuTool1Cyl2Fw := FALSE;
|
||||
gbOuTool1Cyl2Bw := FALSE;
|
||||
gbOuTool1Cyl3Fw := FALSE;
|
||||
gbOuTool1Cyl3Bw := FALSE;
|
||||
END_IF
|
||||
|
||||
(* TODO : Add your code here *)
|
||||
|
||||
|
||||
END_PROGRAM
|
||||
14
Logical/Axises/ToolCtrl/ToolCtrl.typ
Normal file
14
Logical/Axises/ToolCtrl/ToolCtrl.typ
Normal file
@@ -0,0 +1,14 @@
|
||||
(********************************************************************
|
||||
* COPYRIGHT --
|
||||
********************************************************************
|
||||
* Program: ToolCtrl
|
||||
* File: ToolCtrl.typ
|
||||
* Author: michi
|
||||
* Created: January 28, 2013
|
||||
********************************************************************
|
||||
* Local data types of program ToolCtrl
|
||||
********************************************************************)
|
||||
|
||||
TYPE
|
||||
|
||||
END_TYPE
|
||||
18
Logical/Axises/ToolCtrl/ToolCtrl.var
Normal file
18
Logical/Axises/ToolCtrl/ToolCtrl.var
Normal file
@@ -0,0 +1,18 @@
|
||||
(********************************************************************
|
||||
* COPYRIGHT --
|
||||
********************************************************************
|
||||
* Program: ToolCtrl
|
||||
* File: ToolCtrl.var
|
||||
* Author: michi
|
||||
* Created: January 28, 2013
|
||||
********************************************************************
|
||||
* Local variables of program ToolCtrl
|
||||
********************************************************************)
|
||||
|
||||
VAR
|
||||
|
||||
END_VAR
|
||||
|
||||
VAR CONSTANT
|
||||
|
||||
END_VAR
|
||||
@@ -18,6 +18,7 @@ VAR
|
||||
udClosePortID : UDINT;
|
||||
udClientID : UDINT;
|
||||
udSocketID : UDINT;
|
||||
udTemp : UDINT;
|
||||
strServerIP : STRING[20];
|
||||
enState : Steps_enum;
|
||||
RequestTelegram : typUE410_REQUEST;
|
||||
|
||||
@@ -1,4 +1,20 @@
|
||||
PROGRAM _CYCLIC
|
||||
usTemp := 0;
|
||||
FOR usi:=0 TO UDINT_TO_USINT (strlen (ADR (gstrIPAddress))) DO
|
||||
IF (memcmp (ADR (gstrIPAddress) + usi, ADR ('.'), 1) = 0) THEN
|
||||
usTemp := usTemp + 1;
|
||||
END_IF
|
||||
IF (usTemp = 3) THEN
|
||||
udTemp := atoi (ADR (gstrIPAddress) + usi + 1);
|
||||
IF (udTemp < 254) THEN
|
||||
strcpy (ADR (strServerIP), ADR (gstrIPAddress));
|
||||
itoa (udTemp + 1, ADR (strServerIP) + usi + 1);
|
||||
EXIT;
|
||||
END_IF
|
||||
END_IF
|
||||
END_FOR
|
||||
|
||||
|
||||
|
||||
TON_RepowerUE410.PT := t#1s;
|
||||
TON_RepowerUE410 ();
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
PROGRAM _INIT
|
||||
strcpy (ADR (strServerIP), ADR ('192.168.11.74'));
|
||||
|
||||
FUB_TcpOpen.pIfAddr := ADR (gstrIPAddress);
|
||||
FUB_TcpOpen.port := 0;
|
||||
FUB_TcpOpen.options := tcpOPT_REUSEADDR;
|
||||
|
||||
@@ -26,6 +26,7 @@ TYPE
|
||||
bAxisSimulation : BOOL;
|
||||
bMachineON : BOOL; (*Anlage EIN*)
|
||||
bRequestHoming : BOOL := 1; (*Anforderung Grundstellungsfahrt*)
|
||||
bSetupMode : BOOL; (*Inbetriebnahme (Plausibilit<69>t deaktivieren)*)
|
||||
enMode : enMACHMODE := enMACH_HOMEPOS; (*Betriebsart*)
|
||||
END_STRUCT;
|
||||
enMACHMODE :
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<Task Name="AxisctrlEx" Source="Axises.AxisctrlExtra1.prg" Memory="UserROM" Language="IEC" Debugging="true" />
|
||||
<Task Name="PressCtrl" Source="Axises.PressCtrl.prg" Memory="UserROM" Language="IEC" Debugging="true" />
|
||||
<Task Name="Tool1" Source="Axises.Tool1.prg" Memory="UserROM" Language="IEC" Debugging="true" />
|
||||
<Task Name="Tool2" Source="Axises.Tool2.prg" Memory="UserROM" Language="IEC" Debugging="true" />
|
||||
</TaskClass>
|
||||
<TaskClass Name="Cyclic#2">
|
||||
<Task Name="machine" Source="Machine.machine.prg" Memory="UserROM" Language="IEC" Debugging="true" />
|
||||
@@ -20,6 +21,7 @@
|
||||
<TaskClass Name="Cyclic#3" />
|
||||
<TaskClass Name="Cyclic#4">
|
||||
<Task Name="blinker" Source="Common.blinker.prg" Memory="UserROM" Language="IEC" Debugging="true" />
|
||||
<Task Name="ToolCtrl" Source="Axises.ToolCtrl.prg" Memory="UserROM" Language="IEC" Debugging="true" />
|
||||
</TaskClass>
|
||||
<TaskClass Name="Cyclic#5" />
|
||||
<TaskClass Name="Cyclic#6" />
|
||||
@@ -85,13 +87,13 @@
|
||||
<BinaryObject Name="vcpfmtcx" Source="" Memory="UserROM" Language="Binary" />
|
||||
<BinaryObject Name="Visu03" Source="" Memory="UserROM" Language="Binary" />
|
||||
<BinaryObject Name="vccslider" Source="" Memory="UserROM" Language="Binary" />
|
||||
<BinaryObject Name="Acp10map" Source="" Memory="UserROM" Language="Binary" />
|
||||
<BinaryObject Name="Acp10cfg" Source="" Memory="UserROM" Language="Binary" />
|
||||
<BinaryObject Name="arconfig" Source="" Memory="SystemROM" Language="Binary" />
|
||||
<BinaryObject Name="asfw" Source="" Memory="SystemROM" Language="Binary" />
|
||||
<BinaryObject Name="ashwd" Source="" Memory="SystemROM" Language="Binary" />
|
||||
<BinaryObject Name="sysconf" Source="" Memory="SystemROM" Language="Binary" />
|
||||
<BinaryObject Name="iomap" Source="" Memory="UserROM" Language="Binary" />
|
||||
<BinaryObject Name="sysconf" Source="" Memory="SystemROM" Language="Binary" />
|
||||
<BinaryObject Name="ashwd" Source="" Memory="SystemROM" Language="Binary" />
|
||||
<BinaryObject Name="asfw" Source="" Memory="SystemROM" Language="Binary" />
|
||||
<BinaryObject Name="arconfig" Source="" Memory="SystemROM" Language="Binary" />
|
||||
<BinaryObject Name="Acp10cfg" Source="" Memory="UserROM" Language="Binary" />
|
||||
<BinaryObject Name="Acp10map" Source="" Memory="UserROM" Language="Binary" />
|
||||
<BinaryObject Name="vccscale" Source="" Memory="UserROM" Language="Binary" />
|
||||
</Binaries>
|
||||
<Libraries>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?AutomationStudio Version=3.0.90.23 SP05?>
|
||||
<?AutomationStudio Version=3.0.90.24 SP06?>
|
||||
<PLC xmlns="http://br-automation.co.at/AS/PLC">
|
||||
<Objects>
|
||||
<Object Type="File" Description="Software configuration">Cpu.sw</Object>
|
||||
@@ -25,6 +25,6 @@
|
||||
</CpuModule>
|
||||
</CpuModules>
|
||||
<Communication>
|
||||
<OnlineConfiguration Name="PresseII" DeviceType="TCPIP" DeviceParameters="/IF=tcpip /LOPO=11159 /SA=101" ConnectionParameters="/RT=1000 /DAIP=192.168.11.73 /REPO=11159 /ANSL=1" Description="" UserName="michi" />
|
||||
<OnlineConfiguration Name="PresseII" DeviceType="TCPIP" DeviceParameters="/IF=tcpip /LOPO=11159 /SA=101" ConnectionParameters="/RT=1000 /DAIP=192.168.11.75 /REPO=11159 /ANSL=1" Description="" UserName="michi" />
|
||||
</Communication>
|
||||
</PLC>
|
||||
Reference in New Issue
Block a user