Added Collectd Logging

Added Energymeter
This commit is contained in:
Michael Rest
2012-10-19 13:35:34 +02:00
parent f5f2a9e963
commit 6a89343bc6
122 changed files with 4226 additions and 6171 deletions

2
README
View File

@@ -1 +1 @@
Franz Halle 1 Linie 1
Franz Halle 1 Linie 1

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.22 SP04?>
<?AutomationStudio Version=3.0.90.23 SP05?>
<ProjectSettings xmlns="http://br-automation.co.at/AS/ProjectSettings">
<Print Header="%lProject: %n%c%x" Footer="%cPage: %p" />
<ConfigurationManager ActiveConfigurationName="ConfigCPU" />

View File

@@ -28,7 +28,7 @@
1 ;Key Full
1 ;Carrier Lift
1 ;Recipe Mode (0: Nothing, 1: Reset Step, 2: Load Recipe)
0 ;Log Mode (1: Nothing, 1: Write Log)
1 ;Log Mode (1: Nothing, 1: Write Log)
;SINK (Sink Funktions also adapted to ACTIVE Baths
;--------------------------------------------------

View File

@@ -2,10 +2,10 @@
TYPE
typBathGroup : STRUCT (*Bathgroup of similar Baths*)
usBath : ARRAY[0..7]OF USINT;
usBath : ARRAY[0..7]OF USINT; (*List of Baths in this group*)
END_STRUCT;
typBathGroups : STRUCT (*Available Bathgroups (0 invalid)*)
Group : ARRAY[0..8]OF typBathGroup;
Group : ARRAY[0..8]OF typBathGroup; (*Bathgroups 1-8*)
END_STRUCT;
END_TYPE
@@ -33,33 +33,33 @@ TYPE
uiNrPoints : UINT;
LCCurvePoints : ARRAY[0..9]OF lcCurveByPoints_TabEntry_type;
END_STRUCT;
typBathFunctionCommon : STRUCT
typBathFunctionCommon : STRUCT (*Common Bath functions*)
bBusySensor : BOOL;
bTemperature : BOOL;
bDrumRotation : BOOL;
bCarrierShaker : BOOL;
END_STRUCT;
typBathFunctionDepot : STRUCT
typBathFunctionDepot : STRUCT (*Depot Bath functions*)
bReadyCarrierSpare : BOOL; (*Button for Spare Carrier*)
bReadyCarrierFull : BOOL; (*Button for Full Carrier*)
bCarrierLift : BOOL; (*Lift for Carrier*)
usRecipeMode : USINT; (*0: Nothing, 1: Reset Carrier Step. 2: Copy Recipe*)
usLogMode : USINT; (*0: Nothing, 1: Write LogFile*)
END_STRUCT;
typBathFunctionSink : STRUCT
typBathFunctionSink : STRUCT (*Sink Bath functions*)
usSprayreg : USINT;
bAirInjection : BOOL;
END_STRUCT;
typBathFunctionDryer : STRUCT
typBathFunctionDryer : STRUCT (*Blowdryer Bath functions*)
bBlowDryer : BOOL;
END_STRUCT;
typBathFunctionActive : STRUCT
bBathmovement : BOOL;
bCurrent : BOOL;
typBathFunctionActive : STRUCT (*Active Batch - functions*)
bBathmovement : BOOL; (*Bath Movement*)
bCurrent : BOOL; (*Old Sytle Current Module*)
bCurrentAnalog : BOOL; (*New Analog Current Module*)
bPoleChanger : BOOL;
bPoleChanger : BOOL; (*Pole Changer*)
END_STRUCT;
typBathFunction : STRUCT
typBathFunction : STRUCT (*Bathfunctions*)
Common : typBathFunctionCommon;
Depot : typBathFunctionDepot;
Sink : typBathFunctionSink;
@@ -87,7 +87,7 @@ TYPE
iSetVoltage : USINT;
usCurrentProg : USINT;
END_STRUCT;
typBathVariable : STRUCT
typBathVariable : STRUCT (*Bath Variables*)
Common : typBathVariableCommon;
Depot : typBathVariableDepot;
Sink : typBathVariableSink;
@@ -104,7 +104,7 @@ TYPE
Common : typBathParaSetupVarCommon;
Active : typBathParaSetupVarActive;
END_STRUCT;
typBathPara : STRUCT
typBathPara : STRUCT (*Bath Parameters*)
strCaption : STRING[25];
usTYPE : USINT;
Func : typBathFunction;
@@ -118,18 +118,25 @@ TYPE
udInAdr : ARRAY[0..4]OF UDINT;
udOuAdr : ARRAY[0..4]OF UDINT;
END_STRUCT;
typBath : STRUCT
Para : typBathPara;
Variable : typBathVariable;
bBusy : BOOL;
bLocked : BOOL;
bDone : BOOL;
bInit_Carrier : BOOL;
usCarrierIdx : USINT;
dtStartTime : DATE_AND_TIME;
udRuntime : UDINT;
Digital : typBathDigital;
Analog : typBathAnalog;
typBathValues : STRUCT (*Actual Bathvalues*)
iTemperature : INT;
iScaledVoltage : INT;
iScaledCurrent : INT;
udAmperhours : UDINT; (*Amperhour Counter [Ah]*)
END_STRUCT;
typBath : STRUCT (*Bathtype itself*)
Para : typBathPara; (*Parameters for Bath*)
Variable : typBathVariable; (*Variables for Baths*)
bBusy : BOOL; (*Bath is Busy*)
bLocked : BOOL; (*Bath is Locked*)
bDone : BOOL; (*Bath is Done*)
bInit_Carrier : BOOL; (*Trigger Initialize the Carrier*)
usCarrierIdx : USINT; (*Actual Carrier in Bath*)
dtStartTime : DATE_AND_TIME; (*Starttime in this Bath*)
udRuntime : UDINT; (*Runtime of current Carrier*)
Values : typBathValues;
Digital : typBathDigital; (*Digital IOs*)
Analog : typBathAnalog; (*Analog IOs*)
END_STRUCT;
typBathCommands : STRUCT
bSprayregs : BOOL;

View File

@@ -14,6 +14,7 @@ END_VAR
VAR
gCurrentProg : ARRAY[0..9] OF typCurrentProgram; (*Currentprograms*)
gbInitAllBaths : BOOL := FALSE; (*Init all Baths*)
gbEnergymeterPulse : BOOL := FALSE;
END_VAR
VAR CONSTANT
gudBATH_CURRENT_DELAY : UDINT := 3; (*Delay for current*)

View File

@@ -16,7 +16,7 @@
;Gruppe (18-19) Wattsches Nickel 3:10
000, 000, 002, 0, 00000190, 00000280, 00400, 00500, 00610 ,0 ,0
;Gruppe (20-22) Wattsches Nickel 60% 25:00 1500
000, 000, 003, 0, 00001000, 00001620, 00600, 00500, 00400 ,0 ,0
000, 000, 003, 0, 00001000, 00001620, 01000, 00500, 00400 ,0 ,0
;Gruppe (15-17) Halbglanznickel 29:00
000, 000, 001, 0, 00001740, 00001860, 03000, 00500, 00600 ,0 ,0
;Gruppe (29,30) Chrom 18:20

View File

@@ -8,7 +8,6 @@ VAR
lBathalarm : REFERENCE TO typAlarm;
lBathCommands : REFERENCE TO typBathCommands;
lCurrentProg : REFERENCE TO typCurrentProgram;
lBathVarLog : REFERENCE TO typ_BathVarLog;
END_VAR
(*Dynamic Outputs*)
VAR
@@ -113,13 +112,9 @@ VAR
iCurrentHist : INT;
usTW : USINT;
usFreeCarrierIdx : USINT;
iScaledVoltage : INT;
iAIVoltageMAX : INT;
iScaledCurrent : INT; (*Scaled Input Current*)
iActSetpointCurrent : INT; (*Current from Profile gen*)
iLogTemperature : INT;
iLogVoltage : INT;
iLogCurrent : INT;
udPowermeter : UDINT := 0; (*Amperhours 1/10A / s*)
END_VAR
(*FUB instances*)
VAR

View File

@@ -6,6 +6,7 @@ IF EDGEPOS (gbInitAllBaths) THEN
bInit = TRUE
ENDIF
IF bInit THEN
b1stCycle = TRUE
;bath Structures
@@ -16,7 +17,6 @@ IF bInit THEN
lBathHS ACCESS ADR (gBathHS[lBathNr])
lCarrier ACCESS ADR (gCarrier[0])
lCarrierStep ACCESS ADR (lCarrierStepNull)
lBathVarLog ACCESS ADR (gBathVarLog[lBathNr])
lCarrierLog ACCESS ADR (gCarrierLog[lBathNr])
IF lBath.bBusy THEN
lBath.bInit_Carrier = TRUE
@@ -748,6 +748,7 @@ ENDIF
;Temperature control
IF lBath.Para.Func.Common.bTemperature THEN
lBath.Values.iTemperature = iAInTemp
IF (lBath.Variable.Common.usTemperatureIdleTimeTableIdx > 0) AND \
(lBath.Variable.Common.usTemperatureIdleTimeTableIdx <= gusMaxTimeTable) THEN
bTemperatureIdleMode = NOT gTimeTable[lBath.Variable.Common.usTemperatureIdleTimeTableIdx].bState
@@ -801,17 +802,6 @@ IF lBath.Para.Func.Common.bTemperature THEN
TON_TemperatureErrorBath.PT = t#1m
TON_TemperatureErrorBath FUB TON ()
lBathalarm.Alarm[8] = TON_TemperatureErrorBath.Q
;Log Temperature Changes > 0.2 <20>C
IF b1stCycle THEN
iLogTemperature = iAInTemp
ENDIF
IF NOT lBathVarLog.bLogValue AND (ABS (iLogTemperature - iAInTemp) >= 2) THEN
lBathVarLog.usBathVar = eVAR_TEMPERATURE
lBathVarLog.iValue = iAInTemp
lBathVarLog.dtsLogTime = gDTSActTimeUTC
iLogTemperature = iAInTemp
lBathVarLog.bLogValue = TRUE
ENDIF
ENDIF
@@ -1082,8 +1072,8 @@ ENDIF
;CurrentControl
IF lBath.Para.Func.Active.bCurrent THEN
;Scale Analot input
iScaledVoltage = INT (REAL (iAInVoltage) / REAL (iAIVoltageOverflow) * REAL (lBath.Para.SetupVar.Active.iScaleVoltage))
iScaledCurrent = INT (REAL (iAInCurrent) / REAL (iAIVoltageOverflow) * REAL (lBath.Para.SetupVar.Active.iScaleCurrent))
lBath.Values.iScaledVoltage = INT (REAL (iAInVoltage) / REAL (iAIVoltageOverflow) * REAL (lBath.Para.SetupVar.Active.iScaleVoltage))
lBath.Values.iScaledCurrent = INT (REAL (iAInCurrent) / REAL (iAIVoltageOverflow) * REAL (lBath.Para.SetupVar.Active.iScaleCurrent))
IF lBath.bBusy THEN
IF (lBath.usCarrierIdx > 0) AND (lCarrier.udProdID > gudProdID_EMPTY) THEN
;Error Fullcarrier without Current preset
@@ -1156,7 +1146,7 @@ IF lBath.Para.Func.Active.bCurrent THEN
;Control Current control
iCurrentHist = 3
LC3PHy_Current.enable = lBath.Para.Func.Active.bCurrent
LC3PHy_Current.x = iScaledCurrent
LC3PHy_Current.x = lBath.Values.iScaledCurrent
LC3PHy_Current.xstart = 0
LC3PHy_Current.xsetvalue1 = lBath.Variable.Active.iSetCurrent - 2 * iCurrentHist
LC3PHy_Current.xsetvalue2 = lBath.Variable.Active.iSetCurrent + 2* iCurrentHist
@@ -1180,11 +1170,11 @@ IF lBath.Para.Func.Active.bCurrent THEN
;Bath has startup time 3min
TON_CurrentError.IN = FALSE
IF (lBath.udRuntime <= 240) THEN
IF (ABS (iActSetpointCurrent - iScaledCurrent) > (iActSetpointCurrent / 2)) AND (lBath.udRuntime > 10) THEN
IF (ABS (iActSetpointCurrent - lBath.Values.iScaledCurrent) > (iActSetpointCurrent / 2)) AND (lBath.udRuntime > 10) THEN
TON_CurrentError.IN = TRUE
ENDIF
ELSE
IF ABS (iActSetpointCurrent - iScaledCurrent) > (iActSetpointCurrent / 10) THEN
IF ABS (iActSetpointCurrent - lBath.Values.iScaledCurrent) > (iActSetpointCurrent / 10) THEN
TON_CurrentError.IN = TRUE
ENDIF
ENDIF
@@ -1211,15 +1201,21 @@ IF lBath.Para.Func.Active.bCurrent THEN
ELSE
bDOuCurrentOn = FALSE
ENDIF
;Block Logging
iLogVoltage = iScaledVoltage
iLogCurrent = iScaledCurrent
TON_CurrentError.IN = FALSE
lBathalarm.Alarm[6] = FALSE
lBathalarm.Alarm[7] = FALSE ; Error Full Carrier without current setting
ENDIF
;Energymeter
IF gbEnergymeterPulse AND lBath.bBusy AND NOT bDOuCurrentBlocking THEN
udPowermeter = udPowermeter + lBath.Values.iScaledCurrent
IF (udPowermeter > 36000) THEN
lBath.Values.udAmperhours = lBath.Values.udAmperhours + (udPowermeter / 36000)
udPowermeter = udPowermeter MOD 36000
ENDIF
ENDIF
//Power up digital Current Supply
IF lBath.Para.Func.Active.bCurrentAnalog THEN
;Activate Current if Machine is on
@@ -1234,30 +1230,6 @@ IF lBath.Para.Func.Active.bCurrent THEN
lBathalarm.Alarm[3] = FALSE
ENDIF
;Log Voltage Changes > 2 V
IF b1stCycle THEN
iLogVoltage = iScaledVoltage
ENDIF
IF NOT lBathVarLog.bLogValue AND ((ABS (iLogVoltage - iScaledVoltage) >= 20) OR EDGEPOS (bBlink5_0)) THEN
lBathVarLog.usBathVar = eVAR_VOLTAGE
lBathVarLog.iValue = iScaledVoltage
lBathVarLog.dtsLogTime = gDTSActTimeUTC
iLogVoltage = iScaledVoltage
lBathVarLog.bLogValue = TRUE
ENDIF
;Log Current Changes > 2 A
IF b1stCycle THEN
iLogCurrent = iScaledCurrent
ENDIF
IF NOT lBathVarLog.bLogValue AND ((ABS (iLogCurrent - iScaledCurrent) >= 20) OR EDGENEG (bBlink5_0)) THEN
lBathVarLog.usBathVar = eVAR_CURRENT
lBathVarLog.iValue = iScaledCurrent
lBathVarLog.dtsLogTime = gDTSActTimeUTC
iLogCurrent = iScaledCurrent
lBathVarLog.bLogValue = TRUE
ENDIF
;Errors and Borderchecks
lBathalarm.Alarm[4] = (iAInCurrent = iAIVoltageOverflow) AND NOT lBath.bLocked
lBathalarm.Alarm[5] = (iAInCurrent = iAIVoltageUnderflow) AND NOT lBath.bLocked

View File

@@ -6,4 +6,5 @@ VAR
strBathNr : STRING[1];
lDORead : DatObjRead;
lDOInfo : DatObjInfo := (0);
TON_AhPulse : TON := (0);
END_VAR

View File

@@ -2,37 +2,49 @@ PROGRAM _CYCLIC
(* cyclic program *)
;=================================================================
;Initialization
if bInit then
IF bInit THEN
;bathgroups
;define source Dataobject
strcpy (adr (strDOName), "bathgroups")
strcpy (ADR (strDOName), "bathgroups")
lDOInfo.enable = true
lDOInfo.pName = adr (strDOName)
lDOInfo.enable = TRUE
lDOInfo.pName = ADR (strDOName)
lDOInfo FUB DatObjInfo ()
if (lDOInfo.len >= sizeof (gBathgroups)) then
if (lDOInfo.status = 0) then
lDORead.enable = true
IF (lDOInfo.len >= SIZEOF (gBathgroups)) THEN
IF (lDOInfo.status = 0) THEN
lDORead.enable = TRUE
lDORead.ident = lDOInfo.ident
lDORead.Offset = 0
;bathgroups
lDORead.pDestination = adr (gBathgroups)
lDORead.len = sizeof (gBathgroups)
lDORead.pDestination = ADR (gBathgroups)
lDORead.len = SIZEOF (gBathgroups)
lDORead FUB DatObjRead ()
if lDOInfo.status <> 0 then
IF lDOInfo.status <> 0 THEN
;FixME ReadError
ERRxfatal(50900, 0 , "Bathgroups DO read error")
endif
else
ENDIF
ELSE
;FixMe DO doesn't exist
ERRxfatal(50901, 0 , "Bathgroups DO does not exist")
endif
else
ENDIF
ELSE
;FixMe DO too small
ERRxfatal(50902, 0 , "Bathgroups DO too small")
endif
bInit = False
endif
ENDIF
bInit = FALSE
TON_AhPulse.IN = TRUE;
TON_AhPulse.PT = T#1000ms
ENDIF
TON_AhPulse.IN = TRUE;
TON_AhPulse FUB TON();
gbEnergymeterPulse = FALSE
;Generate Pulse for Energymeter
IF TON_AhPulse.Q THEN
gbEnergymeterPulse = TRUE
TON_AhPulse.IN = FALSE;
TON_AhPulse FUB TON()
ENDIF
END_PROGRAM

View File

@@ -1,21 +1,21 @@
TYPE
typCLift_Command : STRUCT (*CarrierLift Commands*)
bLock : BOOL; (*Lock Lift (From Bath)*)
bLockFromTW : ARRAY[1..4]OF BOOL; (*Lock Lift (From TW)*)
bUp : BOOL; (*Lift Up*)
bDown : BOOL; (*Lift Down*)
END_STRUCT;
typCLift_Stat : STRUCT (*CarrierLift Status*)
bError : BOOL; (*CarrierLift is in Error*)
bPosUp : BOOL; (*CarrierLift is Home*)
bPosDown : BOOL; (*CarrierLift is away*)
bLocked : BOOL; (*CarrierLift is Locked (by TW for example)*)
END_STRUCT;
typCLift : STRUCT (*CarrierLift Object with ACP Inv*)
AcoposInvAdr : UDINT; (*Address to Acopos Inverter*)
usBathNhr : USINT; (*Need BathNr to calculate Colisisons*)
Command_Local : typCLift_Command; (*Command of local Machine*)
Stat : typCLift_Stat; (*States of CLift*)
END_STRUCT;
END_TYPE
TYPE
typCLift_Command : STRUCT (*CarrierLift Commands*)
bLock : BOOL; (*Lock Lift (From Bath)*)
bLockFromTW : ARRAY[1..4]OF BOOL; (*Lock Lift (From TW)*)
bUp : BOOL; (*Lift Up*)
bDown : BOOL; (*Lift Down*)
END_STRUCT;
typCLift_Stat : STRUCT (*CarrierLift Status*)
bError : BOOL; (*CarrierLift is in Error*)
bPosUp : BOOL; (*CarrierLift is Home*)
bPosDown : BOOL; (*CarrierLift is away*)
bLocked : BOOL; (*CarrierLift is Locked (by TW for example)*)
END_STRUCT;
typCLift : STRUCT (*CarrierLift Object with ACP Inv*)
AcoposInvAdr : UDINT; (*Address to Acopos Inverter*)
usBathNhr : USINT; (*Need BathNr to calculate Colisisons*)
Command_Local : typCLift_Command; (*Command of local Machine*)
Stat : typCLift_Stat; (*States of CLift*)
END_STRUCT;
END_TYPE

View File

@@ -1,3 +1,3 @@
VAR
gCLift : ARRAY[1..2] OF typCLift := [2(0)]; (*Crosstransports*)
END_VAR
VAR
gCLift : ARRAY[1..2] OF typCLift := [2(0)]; (*Crosstransports*)
END_VAR

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<Package xmlns="http://br-automation.co.at/AS/Package">
<Objects>
<Object Type="File">GlobalCLift.typ</Object>
<Object Type="File">GlobalCLift.var</Object>
<Object Type="Program" Language="IEC" Description="Carrier Lift 1">clift1</Object>
</Objects>
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<Package xmlns="http://br-automation.co.at/AS/Package">
<Objects>
<Object Type="File">GlobalCLift.typ</Object>
<Object Type="File">GlobalCLift.var</Object>
<Object Type="Program" Language="IEC" Description="Carrier Lift 1">clift1</Object>
</Objects>
</Package>

View File

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<Program xmlns="http://br-automation.co.at/AS/Program">
<Files>
<File>clift1Init.ab</File>
<File Description="Cyclic code">clift1Cyclic.ab</File>
<File Description="Local variables" Private="true">clift1.var</File>
</Files>
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<Program xmlns="http://br-automation.co.at/AS/Program">
<Files>
<File>clift1Init.ab</File>
<File Description="Cyclic code">clift1Cyclic.ab</File>
<File Description="Local variables" Private="true">clift1.var</File>
</Files>
</Program>

View File

@@ -1,22 +1,22 @@
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: CT
* File: CTTest.var
* Author: Administrator
* Created: July 15, 2011
********************************************************************
* Local variables of program CT
********************************************************************)
VAR
lCarrierLift : REFERENCE TO typCLift; (*Reference to Crosstransport*)
lAcoposInverter : REFERENCE TO ACPinverter_typ; (*Reference to Inverter*)
bLockCommand : BOOL := FALSE;
bInit : BOOL := FALSE;
bResetError : BOOL := FALSE;
iSpeedFast : INT := 1000; (*Speed for Transfer*)
END_VAR
(*Temp*)
VAR
us : USINT := 0;
END_VAR
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: CT
* File: CTTest.var
* Author: Administrator
* Created: July 15, 2011
********************************************************************
* Local variables of program CT
********************************************************************)
VAR
lCarrierLift : REFERENCE TO typCLift; (*Reference to Crosstransport*)
lAcoposInverter : REFERENCE TO ACPinverter_typ; (*Reference to Inverter*)
bLockCommand : BOOL := FALSE;
bInit : BOOL := FALSE;
bResetError : BOOL := FALSE;
iSpeedFast : INT := 1000; (*Speed for Transfer*)
END_VAR
(*Temp*)
VAR
us : USINT := 0;
END_VAR

View File

@@ -1,65 +1,65 @@
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: CT
* File: CT.ab
* Author: Administrator
* Created: July 15, 2011
********************************************************************
* Implementation of program QTTest
********************************************************************)
PROGRAM _CYCLIC
IF (lCarrierLift.AcoposInvAdr > 0) THEN
;Access Inverter instance
lAcoposInverter ACCESS lCarrierLift.AcoposInvAdr
;Check if TW is in Collision Area
;Enable if Module is OK
lAcoposInverter.Out.bCmd01_DisableVoltage = lAcoposInverter.bModuleOK
lAcoposInverter.Out.bCmd02_QuickStop = lAcoposInverter.bModuleOK
;Hardware error
;Power Up
IF lAcoposInverter.In.bStat00_ReadytoSwitchOn AND (gMachine.usMode <> MACH_OFFLINE) THEN
lAcoposInverter.Out.bCmd00_SwitchOn = TRUE
lAcoposInverter.Out.bCmd03_EnableOperation = TRUE
ENDIF
IF (gMachine.usMode = MACH_OFFLINE) OR lAcoposInverter.In.bStat06_SwitchedOnDisabled THEN
lAcoposInverter.Out.bCmd00_SwitchOn = FALSE
lAcoposInverter.Out.bCmd03_EnableOperation = FALSE
ENDIF
;Reset Error
lAcoposInverter.Out.bCmd07_ResetFault = bResetError
;Lock Commands
bLockCommand = FALSE
LOOP us = 1 TO gMachPara.usTWs DO
bLockCommand = bLockCommand OR \
lCarrierLift.Command_Local.bLockFromTW[us]
ENDLOOP
;Start drive
IF lCarrierLift.Command_Local.bUp AND lAcoposInverter.In.bInputLI2 AND NOT bLockCommand THEN
lAcoposInverter.Out.iLFR_Setpointspeed = -iSpeedFast
ELSE IF lCarrierLift.Command_Local.bDown AND lAcoposInverter.In.bInputLI3 THEN
lAcoposInverter.Out.iLFR_Setpointspeed = iSpeedFast
ELSE
lAcoposInverter.Out.iLFR_Setpointspeed = 0
ENDIF
;Brake
lAcoposInverter.Out.bOR_Relay2 = (lAcoposInverter.In.iRFRD_Velocity <> 0)
;States
lCarrierLift.Stat.bError = NOT lAcoposInverter.bModuleOK
lCarrierLift.Stat.bPosUp = NOT lAcoposInverter.In.bInputLI2
lCarrierLift.Stat.bPosDown = lAcoposInverter.In.bInputLI4
lCarrierLift.Stat.bLocked = bLockCommand
ENDIF
END_PROGRAM
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: CT
* File: CT.ab
* Author: Administrator
* Created: July 15, 2011
********************************************************************
* Implementation of program QTTest
********************************************************************)
PROGRAM _CYCLIC
IF (lCarrierLift.AcoposInvAdr > 0) THEN
;Access Inverter instance
lAcoposInverter ACCESS lCarrierLift.AcoposInvAdr
;Check if TW is in Collision Area
;Enable if Module is OK
lAcoposInverter.Out.bCmd01_DisableVoltage = lAcoposInverter.bModuleOK
lAcoposInverter.Out.bCmd02_QuickStop = lAcoposInverter.bModuleOK
;Hardware error
;Power Up
IF lAcoposInverter.In.bStat00_ReadytoSwitchOn AND (gMachine.usMode <> MACH_OFFLINE) THEN
lAcoposInverter.Out.bCmd00_SwitchOn = TRUE
lAcoposInverter.Out.bCmd03_EnableOperation = TRUE
ENDIF
IF (gMachine.usMode = MACH_OFFLINE) OR lAcoposInverter.In.bStat06_SwitchedOnDisabled THEN
lAcoposInverter.Out.bCmd00_SwitchOn = FALSE
lAcoposInverter.Out.bCmd03_EnableOperation = FALSE
ENDIF
;Reset Error
lAcoposInverter.Out.bCmd07_ResetFault = bResetError
;Lock Commands
bLockCommand = FALSE
LOOP us = 1 TO gMachPara.usTWs DO
bLockCommand = bLockCommand OR \
lCarrierLift.Command_Local.bLockFromTW[us]
ENDLOOP
;Start drive
IF lCarrierLift.Command_Local.bUp AND lAcoposInverter.In.bInputLI2 AND NOT bLockCommand THEN
lAcoposInverter.Out.iLFR_Setpointspeed = -iSpeedFast
ELSE IF lCarrierLift.Command_Local.bDown AND lAcoposInverter.In.bInputLI3 THEN
lAcoposInverter.Out.iLFR_Setpointspeed = iSpeedFast
ELSE
lAcoposInverter.Out.iLFR_Setpointspeed = 0
ENDIF
;Brake
lAcoposInverter.Out.bOR_Relay2 = (lAcoposInverter.In.iRFRD_Velocity <> 0)
;States
lCarrierLift.Stat.bError = NOT lAcoposInverter.bModuleOK
lCarrierLift.Stat.bPosUp = NOT lAcoposInverter.In.bInputLI2
lCarrierLift.Stat.bPosDown = lAcoposInverter.In.bInputLI4
lCarrierLift.Stat.bLocked = bLockCommand
ENDIF
END_PROGRAM

View File

@@ -1,7 +1,7 @@
PROGRAM _INIT
(* init program *)
lCarrierLift ACCESS ADR (gCLift[1])
bInit = TRUE
END_PROGRAM
PROGRAM _INIT
(* init program *)
lCarrierLift ACCESS ADR (gCLift[1])
bInit = TRUE
END_PROGRAM

View File

@@ -1,5 +1,5 @@
VAR
gCT : ARRAY[1..2] OF typCT := [2((0))]; (*Crosstransports*)
gbCTLocal : ARRAY[1..2] OF BOOL := [2(FALSE)]; (*CT is Local or Remote*)
gCTAlarms : ARRAY[1..2] OF typAlarm := [2((0))]; (*Alarms for CT*)
END_VAR
VAR
gCT : ARRAY[1..2] OF typCT := [2((0))]; (*Crosstransports*)
gbCTLocal : ARRAY[1..2] OF BOOL := [2(FALSE)]; (*CT is Local or Remote*)
gCTAlarms : ARRAY[1..2] OF typAlarm := [2((0))]; (*Alarms for CT*)
END_VAR

View File

@@ -24,7 +24,7 @@ END_VAR
(*## DEPOT/TRANSPORT LogMode*)
VAR CONSTANT
gLOGMODE_NOP : USINT := 0; (*Logmode No Operation*)
gLOGMODE_WRITE : USINT := 0; (*Logmode Write Logfile*)
gLOGMODE_WRITE : USINT := 1; (*Logmode Write Logfile*)
END_VAR
(*## Carriertypes*)
VAR CONSTANT

View File

@@ -1,7 +1,11 @@
TYPE
typ_enParamtypes :
(
enParam_Temperature
);
typAlarm : STRUCT
Alarm : ARRAY[0..127] OF BOOL;
Alarm : ARRAY[0..127]OF BOOL;
END_STRUCT;
typDOName : STRUCT
strName : STRING[8];

View File

@@ -2,3 +2,9 @@ VAR
gbEmStop : BOOL := FALSE;
gbResetEmStop : BOOL := FALSE;
END_VAR
(*//Save Parameters to SQL*)
VAR
gbSaveMachParam : BOOL := FALSE; (*Save Machine Params*)
gusParamBath : USINT := 0;
gParamType : typ_enParamtypes := enParam_Temperature;
END_VAR

View File

@@ -1,14 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<Package Version="1.28.1" xmlns="http://br-automation.co.at/AS/Package">
<Objects>
<Object Type="DataObject" Language="Cnc">gmcipsys</Object>
<Object Type="DataObject" Language="Cnc">gmciplbr</Object>
<Object Type="DataObject" Language="Cnc">gmcipcbr</Object>
<Object Type="DataObject" Language="Cnc">gmciplsm</Object>
<Object Type="DataObject" Language="Cnc">gmcipcsm</Object>
<Object Type="DataObject" Language="Cnc">gmcipcfg</Object>
<Object Type="DataObject" Language="Cnc">gmcipiec</Object>
<Object Type="DataObject" Language="Cnc">gmciplog</Object>
</Objects>
</Package>

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<DataObject Version="1.28.1" xmlns="http://br-automation.co.at/AS/DataObject">
<Files>
<File>gmcipcbr.cnc</File>
</Files>
</DataObject>

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<DataObject Version="1.28.1" xmlns="http://br-automation.co.at/AS/DataObject">
<Files>
<File>gmcipcfg.cnc</File>
</Files>
</DataObject>

View File

@@ -1,68 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?ARNC0 Version="1.28.1"?>
<CONFIG>
<!-- Example default language configuration (number and name from gmcipsys: <LANG .../>)
<DEFAULT_LANG LangId="<number>" ...or... LangName="<name>" />
Note: Either specify LangId or LangName
If not specified, gmcipsys: <LANGS defaultLangId=".." >... is used
-->
<XML_INCLUDE Name="gmcipvar" IfNotExist="Warn" />
<XML_INCLUDE Name="gmcipfun" IfNotExist="Warn" />
<XML_INCLUDE Name="gmcipfub" IfNotExist="Warn" />
<!-- Example .typ file loading instructions:
<LANG_INCLUDE LangName="IEC-ST" Name="MyTypes" FileExt=".typ"
FileDevice="CNC_PrgDir" DataObject="No"
Scope="plc_global" IfNotExist="Warn" OnError="Error" />
<LANG_INCLUDE LangName="IEC-ST" Name="Acp10man.typ" DataObject="No" />
<LANG_INCLUDE LangName="IEC-ST" Name="arnc0man.typ" DataObject="No" />
<LANG_INCLUDE LangName="IEC-ST" Name="acp10sdc.typ" DataObject="No" />
Note: We strongly recommend not storing type files as data objects
as this may cause confusion with the binary object of the same library name
-->
<MPQUEUE NumPackets="200" LookaheadMinBlocks="5" LookaheadMaxBlocks="20" LookaheadMode="any" MaxPathJobs="256" />
<!-- Example Debug feature configuration (can be ommitted to adopt defaults)
<DBG_IPVAR_ACCESS TableSize="24" />
<DBG_BREAKPOINTS TableSize="48" />
<DBG_EVAL_QUERY TableSize="12" MaxRetry="25" />
-->
<!-- Motion Packet Logging configuration. Note: FileDevice="mplog*" means Ch1:"mplogA", Ch2:"mplogB", ... -->
<MPLOG MaxBuffers="10" MinBuffers="4" EarlyCircleBufferLookahead="2" DefaultBufferSize="131072" TaskCycleDelay="1"
FileDevice="mplog*" MaxLogFiles="20" MaxLogFileSize="1048576" CopyLineTextMaxChars="80" />
<AXES StandardCNCAxes="Yes">
<!--
<CNCAXIS CNCIndex="3" Alias1="X1">A</CNCAXIS>
<CNCAXIS CNCIndex="4" Alias1="Y1">B</CNCAXIS>
<CNCAXIS CNCIndex="5" Alias1="Z1">C</CNCAXIS>
<AUXAXIS PVRef="ax_obj[0]" Alias1="CENTER">ax1_obj</AUXAXIS>
<AUXAXIS PVRef="ax_obj[1]" Alias1="LINEAR">ax2_obj</AUXAXIS>
<AUXAXIS PVRef="ax_obj[2]" Alias1="ROTATION">ax3_obj</AUXAXIS>
<AUXAXIS PVRef="ax_obj[3]" Alias1="UP_DOWN">ax4_obj</AUXAXIS>
<AUXAXIS PVRef="ax_obj[4]" Alias1="LEFT_RIGHT">ax5_obj</AUXAXIS>
<AUXAXIS PVRef="ax_obj[5]" Alias1="BEND_1">ax6_obj</AUXAXIS>
<AUXAXIS PVRef="ax_obj[6]" Alias1="BEND_2">ax7_obj</AUXAXIS>
-->
</AXES>
<FUBOutputs>
<!-- Standard FUB Output rules -->
<FUBOutput Name="PLCOpen">
<ERROR condition="$Error == 1"/>
<BUSY condition="$Busy == 1"/>
</FUBOutput>
<FUBOutput Name="BuR">
<ERROR condition="$status != 65535 &amp;&amp; $status != 0"/>
<BUSY condition="$status == 65535"/>
</FUBOutput>
</FUBOutputs>
</CONFIG>

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<DataObject Version="1.28.1" xmlns="http://br-automation.co.at/AS/DataObject">
<Files>
<File>gmcipcsm.cnc</File>
</Files>
</DataObject>

View File

@@ -1,364 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<?ARNC0 Version="1.28.1"?>
<Root LangModule="ailgcode" Version="1.0">
<Constants>
<NumAxes Type="INT">15</NumAxes>
</Constants>
<Preprocess>
<!-- Support for AltLang1 system-global (NCK), and interpreter-global (CHAN) variable scope specifiers -->
<PP_RULE_STOPRE Search="STOPRE" Replace="G172" />
</Preprocess>
<Types>
<RotationAngleSpecifier type="ENUM" EnumType="REGEXP" Value6="H" />
<RadiusSpecifier type="ENUM" EnumType="REGEXP" Value1="R\s*=" />
<InterpolParam type="ENUM" EnumType="REGEXP"
Value0="I" Value1="J" Value2="K"
Value100="G161\s*I" Value101="G161\s*J" Value102="G161\s*K"
Value200="G162\s*I" Value201="G162\s*J" Value202="G162\s*K"
Value0300="I\s*=\s*AC" Value0301="J\s*=\s*AC" Value0302="K\s*=\s*AC"
Value0400="I\s*=\s*IC" Value0401="J\s*=\s*IC" Value0402="K\s*=\s*IC"
/>
<CirclePointParam type="ENUM" EnumType="REGEXP"
Value0="I1\s*=" Value1="J1\s*=" Value2="K1\s*="
Value100="G161\s*I1\s*=" Value101="G161\s*J1\s*=" Value102="G161\s*K1\s*="
Value200="G162\s*I1\s*=" Value201="G162\s*J1\s*=" Value202="G162\s*K1\s*="
Value0300="I1\s*=\s*AC" Value0301="J1\s*=\s*AC" Value0302="K1\s*=\s*AC"
Value0400="I1\s*=\s*IC" Value0401="J1\s*=\s*IC" Value0402="K1\s*=\s*IC"
/>
<RPYAngleName type="ENUM" EnumType="REGEXP"
Value1="ROLL" Value0="PITCH" Value2="YAW"
/>
<EulerAngleName type="ENUM" EnumType="REGEXP"
Value3="PHI" Value4="THETA" Value5="PSI"
/>
<RotaryVectorName type="ENUM" EnumType="REGEXP"
Value0="P\s*=" Value1="Q\s*=" Value2="R\s*="
/>
<DwellTime type="FLOAT" />
<RParamIndex type="INT" MinValue="0" MaxValue="999" />
<EXParamIndex type="INT" MinValue="0" MaxValue="99" />
<MParamIndex type="INT" MinValue="0" MaxValue="99" />
<Byte type="INT" MinValue="0" MaxValue="255" />
<Word type="INT" MinValue="-32768" MaxValue="32767" />
<Long type="INT" />
</Types>
<PVMacros> <!-- Syntax that looks like PV refs, but is actually mapped to a defined bit of AIL -->
<SAVE ArrayDims="0" Group="500" > <!-- issue MP to save state of modal GCodes, restore state on return from subprog -->
<!-- implementation requires motion packet support -->
<CALL>
Info(:id:52101, msg:"Save Modal GCode State NOT SUPPORTED YET":);
</CALL>
</SAVE>
</PVMacros>
<SysVars>
<!-- Note 1: Path synchronous system variables - prefix AIL variable with "@" -->
<!-- Note 2: variable type is as declared in ARNC0 -->
<!-- Note 3: CanRead and CanWrite permissions default to "Yes" if not specified -->
<!-- Note 4: If using <SET> and <GET> instead of <REF>, then do not specify CanRead/Write -->
<!-- CNC sourced system variables -->
<P_F Name="$P_F">
<GET>
return @%_CNC.v_ncprog;
</GET>
</P_F>
<P_GG Name="$P_GG">
<GET>
return @%_CNC.typ_ncblock;
</GET>
</P_GG>
<LIM_PATH_V Name="$LIM_PATH_V">
<GET>
return %_CNC.lim_path_v;
</GET>
<SET>
<ARG ref="EXPR" DataType="FLOAT" />
%_CNC.lim_path_v = ${EXPR};
#next_motion.Data.SystemVariable.SysVarIdx = 2;
#next_motion.Data.SystemVariable.AxIdx = -1;
#next_motion.Data.SystemVariable.Data.R8_value = %_CNC.lim_path_v;
#next_motion.Command = MPCMD_CNC_SYS_VAR;
PushPacket(::);
</SET>
</LIM_PATH_V>
<LIM_PATH_ACC_P Name="$LIM_PATH_ACC_P">
<GET>
return %_CNC.lim_path_acc_p;
</GET>
<SET>
<ARG ref="EXPR" DataType="FLOAT" />
%_CNC.lim_path_acc_p = ${EXPR};
#next_motion.Data.SystemVariable.SysVarIdx = 3;
#next_motion.Data.SystemVariable.AxIdx = -1;
#next_motion.Data.SystemVariable.Data.R8_value = %_CNC.lim_path_acc_p;
#next_motion.Command = MPCMD_CNC_SYS_VAR;
PushPacket(::);
</SET>
</LIM_PATH_ACC_P>
<LIM_PATH_ACC_N Name="$LIM_PATH_ACC_N">
<GET>
return %_CNC.lim_path_acc_n;
</GET>
<SET>
<ARG ref="EXPR" DataType="FLOAT" />
%_CNC.lim_path_acc_n = ${EXPR};
#next_motion.Data.SystemVariable.SysVarIdx = 4;
#next_motion.Data.SystemVariable.AxIdx = -1;
#next_motion.Data.SystemVariable.Data.R8_value = %_CNC.lim_path_acc_n;
#next_motion.Command = MPCMD_CNC_SYS_VAR;
PushPacket(::);
</SET>
</LIM_PATH_ACC_N>
<S_JUMP_T Name="$S_JUMP_T">
<GET>
return %_CNC.s_jump_t;
</GET>
<SET>
<ARG ref="EXPR" DataType="FLOAT" />
%_CNC.s_jump_t = ${EXPR};
#next_motion.Data.SystemVariable.SysVarIdx = 5;
#next_motion.Data.SystemVariable.AxIdx = -1;
#next_motion.Data.SystemVariable.Data.R8_value = %_CNC.s_jump_t;
#next_motion.Command = MPCMD_CNC_SYS_VAR;
PushPacket(::);
</SET>
</S_JUMP_T>
<RADIUS_ERR Name="$RADIUS_ERR">
<GET>
return %_CNC.radius_err;
</GET>
<SET>
<ARG ref="EXPR" DataType="FLOAT" />
%_CNC.radius_err = ${EXPR};
#next_motion.Data.SystemVariable.SysVarIdx = 6;
#next_motion.Data.SystemVariable.AxIdx = -1;
#next_motion.Data.SystemVariable.Data.R8_value = %_CNC.radius_err;
#next_motion.Command = MPCMD_CNC_SYS_VAR;
PushPacket(::);
</SET>
</RADIUS_ERR>
<V_JUMP_T Name="$V_JUMP_T">
<GET>
return %_CNC.v_jump_t;
</GET>
<SET>
<ARG ref="EXPR" DataType="FLOAT" />
%_CNC.v_jump_t = ${EXPR};
#next_motion.Data.SystemVariable.SysVarIdx = 11;
#next_motion.Data.SystemVariable.AxIdx = -1;
#next_motion.Data.SystemVariable.Data.R8_value = %_CNC.v_jump_t;
#next_motion.Command = MPCMD_CNC_SYS_VAR;
PushPacket(::);
</SET>
</V_JUMP_T>
<LIM_AX_ACC Name="$LIM_AX_ACC" ArrayDims="1">
<GET>
return %_AX.a_max_ncdy[$[1]];
</GET>
<SET>
<ARG ref="EXPR" DataType="FLOAT" />
%_AX.a_max_ncdy[$[1]] = ${EXPR};
#next_motion.Data.SystemVariable.SysVarIdx = 11;
#next_motion.Data.SystemVariable.AxIdx = $[1];
#next_motion.Data.SystemVariable.Data.R8_value = %_AX.a_max_ncdy[$[1]];
#next_motion.Command = MPCMD_AX_SYS_VAR;
PushPacket(::);
</SET>
</LIM_AX_ACC>
<LIM_AX_V Name="$LIM_AX_V" ArrayDims="1">
<GET>
return %_AX.v_max_ncdy[$[1]];
</GET>
<SET>
<ARG ref="EXPR" DataType="FLOAT" />
%_AX.v_max_ncdy[$[1]] = ${EXPR};
#next_motion.Data.SystemVariable.SysVarIdx = 12;
#next_motion.Data.SystemVariable.AxIdx = $[1];
#next_motion.Data.SystemVariable.Data.R8_value = %_AX.v_max_ncdy[$[1]];
#next_motion.Command = MPCMD_AX_SYS_VAR;
PushPacket(::);
</SET>
</LIM_AX_V>
<AX_A_JUMP Name="$AX_A_JUMP" ArrayDims="1">
<GET>
return %_AX.a_jump_ncdy[$[1]];
</GET>
<SET>
<ARG ref="EXPR" DataType="FLOAT" />
%_AX.a_jump_ncdy[$[1]] = ${EXPR};
#next_motion.Data.SystemVariable.SysVarIdx = 13;
#next_motion.Data.SystemVariable.AxIdx = $[1];
#next_motion.Data.SystemVariable.Data.R8_value = %_AX.a_jump_ncdy[$[1]];
#next_motion.Command = MPCMD_AX_SYS_VAR;
PushPacket(::);
</SET>
</AX_A_JUMP>
<AX_V_JUMP Name="$AX_V_JUMP" ArrayDims="1">
<GET>
return %_AX.v_jump_ncdy[$[1]];
</GET>
<SET>
<ARG ref="EXPR" DataType="FLOAT" />
%_AX.v_jump_ncdy[$[1]] = ${EXPR};
#next_motion.Data.SystemVariable.SysVarIdx = 14;
#next_motion.Data.SystemVariable.AxIdx = $[1];
#next_motion.Data.SystemVariable.Data.R8_value = %_AX.v_jump_ncdy[$[1]];
#next_motion.Command = MPCMD_AX_SYS_VAR;
PushPacket(::);
</SET>
</AX_V_JUMP>
<AX_T_INPOS Name="$AX_T_INPOS" ArrayDims="1">
<GET>
return %_AX.t_inpos[$[1]];
</GET>
</AX_T_INPOS>
<AX_T_JOLT Name="$AX_T_JOLT" ArrayDims="1">
<GET>
return %_AX.t_jolt_ax[$[1]];
</GET>
</AX_T_JOLT>
<PATH_T_JOLT Name="$PATH_T_JOLT">
<GET>
return %_CNC.path_t_jolt;
</GET>
</PATH_T_JOLT>
<!-- to calculate the absoulute value for G108/G110+percent value -->
<LIM_PATH_ACC_P_INI Name="$LIM_PATH_ACC_P_INI">
<GET>
return %_CNC.lim_path_acc_p_ini;
</GET>
</LIM_PATH_ACC_P_INI>
<!-- to calculate the absoulute value for G109/G110+percent value -->
<LIM_PATH_ACC_N_INI Name="$LIM_PATH_ACC_N_INI">
<GET>
return %_CNC.lim_path_acc_n_ini;
</GET>
</LIM_PATH_ACC_N_INI>
<!-- AXIS sourced system variables, CNC axis index number is the argument $AA_IM[0] -->
<AA_IM Name="$AA_IM" ArrayDims="1">
<GET>
return @%_AX.set_pos_mcs[$[1]];
</GET>
</AA_IM>
<AA_IW Name="$AA_IW" ArrayDims="1">
<GET>
return @%_AX.set_pos[$[1]];
</GET>
</AA_IW>
<P_SIM Name="$P_SIM" ArrayDims="1">
<GET>
return %_AX.sim_status[$[1]];
</GET>
</P_SIM>
<MA_MAX_AX_ACCEL Name="$MA_MAX_AX_ACCEL" ArrayDims="1">
<GET>
return %_AX.a_max[$[1]];
</GET>
</MA_MAX_AX_ACCEL>
<MA_MAX_AX_VELO Name="$MA_MAX_AX_VELO" ArrayDims="1">
<GET>
return %_AX.v_max[$[1]];
</GET>
</MA_MAX_AX_VELO>
<MA_MAX_AX_JERK Name="$MA_MAX_AX_JERK" ArrayDims="1">
<GET>
return %_AX.jerk_max[$[1]];
</GET>
</MA_MAX_AX_JERK>
<MA_POSCTRL_GAIN Name="$MA_POSCTRL_GAIN" ArrayDims="1">
<GET>
return %_AX.servo_gain[$[1]];
</GET>
</MA_POSCTRL_GAIN>
<MA_REFP_SET_POS Name="$MA_REFP_SET_POS" ArrayDims="1">
<GET>
return %_AX.home_pos[$[1]];
</GET>
</MA_REFP_SET_POS>
<MA_POS_LIMIT_PLUS Name="$MA_POS_LIMIT_PLUS" ArrayDims="1">
<GET>
return %_AX.pos_sw_end[$[1]];
</GET>
</MA_POS_LIMIT_PLUS>
<MA_POS_LIMIT_MINUS Name="$MA_POS_LIMIT_MINUS" ArrayDims="1">
<GET>
return %_AX.neg_sw_end[$[1]];
</GET>
</MA_POS_LIMIT_MINUS>
</SysVars>
<Parameters>
<!--Parameters are assumed to be asynchronous unless specified as Synchronous-->
<R IndexType="RParamIndex" ValueType="FLOAT">
<ARG ref="EXPR" DataType="RParamIndex" />
#sys_vars.R[${EXPR}]
</R>
<QUOTED QuotedName="$R" Synchronous="Yes" IndexType="RParamIndex" ValueType="FLOAT">
<ARG ref="EXPR" DataType="RParamIndex" />
@#sys_vars.R[${EXPR}]
</QUOTED>
<!-- P## is the subroutine call repetition specifier -->
<QUOTED QuotedName="$P" Synchronous="Yes" IndexType="RParamIndex" ValueType="FLOAT">
<ARG ref="EXPR" DataType="RParamIndex" />
@#sys_vars.R[@#sys_vars.R[${EXPR}]]
</QUOTED>
<EXB IndexType="EXParamIndex" ValueType="Byte">
<ARG ref="EXPR" DataType="EXParamIndex" />
#sys_vars.EXB[${EXPR}]
</EXB>
<EXW IndexType="EXParamIndex" ValueType="Word">
<ARG ref="EXPR" DataType="EXParamIndex" />
#sys_vars.EXW[${EXPR}]
</EXW>
<EXL IndexType="EXParamIndex" ValueType="Long">
<ARG ref="EXPR" DataType="EXParamIndex" />
#sys_vars.EXL[${EXPR}]
</EXL>
<EXF IndexType="EXFParamIndex" ValueType="FLOAT">
<ARG ref="EXPR" DataType="EXFParamIndex" />
#sys_vars.EXF[${EXPR}]
</EXF>
<!-- TODO: synchronous M-parameter support -->
<MW Synchronous="Yes" IndexType="MParamIndex" ValueType="Word">
<ARG ref="EXPR" DataType="MParamIndex" />
@#sys_vars.MW[${EXPR}]
</MW>
<ML Synchronous="Yes" IndexType="MParamIndex" ValueType="Long">
<ARG ref="EXPR" DataType="MParamIndex" />
@#sys_vars.ML[${EXPR}]
</ML>
<MF Synchronous="Yes" IndexType="MParamIndex" ValueType="FLOAT">
<ARG ref="EXPR" DataType="MParamIndex" />
@#sys_vars.MF[${EXPR}]
</MF>
</Parameters>
<MCodes>
<!-- Scope-End M-Codes must be translated inline otherwise the "return;" calls have no effect -->
<M17 Value="17" Group="41" Alias="RET:[^\d\w\(]" Eval="Early" Inline="Yes" AliasIsPattern="Yes">
<ARG ref="VALUE" DataType="FLOAT" RequireLiteral="Yes" />
#next_motion.Command = MPCMD_SET_M_FCT;
#next_motion.Data.I4_value = ${VALUE};
PushPacket(::);
return;
</M17>
<M17_1 Value="17.1" Group="41" Alias="CONDRET" Eval="Early" Inline="Yes">
<ARG ref="VALUE" DataType="FLOAT" RequireLiteral="Yes" />
return;
</M17_1>
</MCodes>
</Root>

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<DataObject Version="1.28.1" xmlns="http://br-automation.co.at/AS/DataObject">
<Files>
<File>gmcipiec.cnc</File>
</Files>
</DataObject>

View File

@@ -1,64 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<?ARNC0 Version="1.28.1"?>
<Root LangModule="ailgcode" Version="1.0">
<AxesSpec>
</AxesSpec>
<!-- avoid primtypes matching when followed by # to avoid conflicts with IEC literals (e.g. TIME#...) -->
<PrimTypes PatternSuffix=":[^\d\w$#]">
<!-- Specify what B&R datatypes correspond to the user-language defined types -->
<!-- If the user declares a variable in their program, and the corresponding PV is
of a different type, then a warning is issued -->
<!-- Support for specifying B&R specific types -->
<BOOL BRType="BOOL" />
<STRING BRType="STRING" />
<TIME BRType="TIME" />
<SINT BRType="SINT" />
<INT BRType="INT" />
<DINT BRType="DINT" />
<USINT BRType="USINT" />
<UINT BRType="UINT" />
<UDINT BRType="UDINT" />
<REAL BRType="REAL" />
<LREAL BRType="LREAL" />
<DATE_AND_TIME BRType="DATE_AND_TIME" />
<DT BRType="DT" />
</PrimTypes>
<ParserData NestedComments="Yes" DefaultCaseSensitive="Yes" CommentsSpanLines="Yes"
ReadWholeFileBeforeParsing="Yes" ExpectMainProgStmts="No" UseFubTemplates="No" >
<!--Patterns are specified as Perl regular expressions-->
<!--Token Names should not be changed-->
<!--Tokens without a Pattern or without TOKEN entry are not in use in this dialect-->
<!--Restricted means this token can only match on a FollowedBy request-->
<TKG_END_OF_LINE IsPattern="No">\n</TKG_END_OF_LINE>
<TKG_OPEN_COMMENT>(*</TKG_OPEN_COMMENT>
<TKG_CLOSE_COMMENT>*)</TKG_CLOSE_COMMENT>
<TKG_TRUE IsPattern="Yes">TRUE:\W</TKG_TRUE>
<TKG_FALSE IsPattern="Yes">FALSE:\W</TKG_FALSE>
<TKG_PRIM_TYPE IsPattern="Yes" />
<TKG_OPEN_BRACKET>(</TKG_OPEN_BRACKET>
<TKG_CLOSE_BRACKET>)</TKG_CLOSE_BRACKET>
<TKG_OPEN_INDEXBRACKET>[</TKG_OPEN_INDEXBRACKET>
<TKG_CLOSE_INDEXBRACKET>]</TKG_CLOSE_INDEXBRACKET>
<TKG_COMMA>,</TKG_COMMA>
<TKG_INTEGER IsPattern="Yes">\d[\d_]+|\d</TKG_INTEGER>
<TKG_POSITIVE>+</TKG_POSITIVE>
<TKG_NEGATIVE>-</TKG_NEGATIVE>
<TKG_REFERENCE FollowedBy="TKG_IEC_TO" IsPattern="Yes">REFERENCE:\W</TKG_REFERENCE>
<TKG_IEC_TO IsPattern="Yes">TO:\W</TKG_IEC_TO>
<TKG_SUBRANGE>..</TKG_SUBRANGE >
<TKG_TIME_LITERAL CaseSensitive="no" IsPattern="yes" >time#\-[dDhHmMsS_\.\d]+|time#[dDhHmMsS_\.\d]+|t#\-[dDhHmMsS_\.\d]+|t#[dDhHmMsS_\.\d]+</TKG_TIME_LITERAL>
<TKG_ASSIGN_EQ>:=</TKG_ASSIGN_EQ>
<TKG_IEC_OPEN_TYPE IsPattern="Yes">TYPE:\W</TKG_IEC_OPEN_TYPE>
<TKG_IEC_CLOSE_TYPE IsPattern="Yes">END_TYPE:\W</TKG_IEC_CLOSE_TYPE>
<TKG_IEC_DATATYPE_SPEC>:</TKG_IEC_DATATYPE_SPEC>
<TKG_IEC_ARRAY IsPattern="Yes">ARRAY:\W</TKG_IEC_ARRAY>
<TKG_IEC_OF IsPattern="Yes">OF:\W</TKG_IEC_OF>
<TKG_IEC_DELIM>;</TKG_IEC_DELIM>
<TKG_IEC_OPEN_STRUCT IsPattern="Yes">STRUCT:\W</TKG_IEC_OPEN_STRUCT>
<TKG_IEC_CLOSE_STRUCT IsPattern="Yes">END_STRUCT:\W</TKG_IEC_CLOSE_STRUCT>
<TKG_WORD IsPattern="Yes">\w|\w[\w\d$]+</TKG_WORD>
<!-- This is a temporary token to allow the entire right hand side of
a struct member initialization statement to be stored. -->
<TKG_STRUCT_INIT IsPattern="Yes" Restricted="Yes">[^;]+</TKG_STRUCT_INIT>
</ParserData>
</Root>

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<DataObject Version="1.28.1" xmlns="http://br-automation.co.at/AS/DataObject">
<Files>
<File>gmciplbr.cnc</File>
</Files>
</DataObject>

View File

@@ -1,434 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<?ARNC0 Version="1.28.1"?>
<Root LangModule="ailgcode" Version="1.0">
<BuiltInProcs>
<cancel MinArgs="1" MaxArgs="*">
<!-- cancel modal Synch Action groups -->
beginpathsynch
StopCyclicGroups(:${*}:);
endpathsynch
<!-- Note: alternative, blocking version:
#job->mp_command = MPCMD_PATH_SYNC_EXEC_WAIT;
beginpathsynch
WaitStopCyclicGroups(:${*}:);
endpathsynch
-->
</cancel>
</BuiltInProcs>
<BuiltInFns PatternSuffix=":\[" >
<!-- The PatternSuffix can be defined to set lookahead requirements -->
<ABS NumArgs="1" Inline="Yes">Abs(:$[1]:)</ABS>
<SQR NumArgs="1">($[1] * $[1])</SQR>
<ACOS NumArgs="1" Inline="Yes">ACos(:$[1]:)</ACOS>
<ASIN NumArgs="1" Inline="Yes">ASin(:$[1]:)</ASIN>
<ATAN NumArgs="1" Inline="Yes">ATan(:$[1]:)</ATAN>
<COS NumArgs="1" Inline="Yes">Cos(:$[1]:)</COS>
<DEXP NumArgs="1" Inline="Yes">DExp(:$[1]:)</DEXP>
<EXP NumArgs="1" Inline="Yes">Exp(:$[1]:)</EXP>
<FIX NumArgs="1" Inline="Yes">Fix(:$[1]:)</FIX>
<FRACT NumArgs="1" Inline="Yes">Fract(:$[1]:)</FRACT>
<FUP NumArgs="1" Inline="Yes">Fup(:$[1]:)</FUP>
<INV NumArgs="1" Inline="Yes">~($[1])</INV>
<LN NumArgs="1" Inline="Yes">Ln(:$[1]:)</LN>
<LOG NumArgs="1" Inline="Yes">Log(:$[1]:)</LOG>
<ROUND NumArgs="1" Inline="Yes">ToInt(:$[1]:)</ROUND>
<SIN NumArgs="1" Inline="Yes">Sin(:$[1]:)</SIN>
<SQRT NumArgs="1" Inline="Yes">Sqrt(:$[1]:)</SQRT>
<TAN NumArgs="1" Inline="Yes">Tan(:$[1]:)</TAN>
<!-- type conversion functions need explicit pattern specifying to distinguish them from the PrimType keyword -->
<BOOL NumArgs="1" Inline="Yes">ToBool(:$[1]:)</BOOL>
<INT NumArgs="1" Inline="Yes">Fix(:$[1]:)</INT>
<ADR NumArgs="1" Inline="Yes">Adr(:\$[1]:)</ADR>
<SIZEOF NumArgs="1" Inline="Yes">Sizeof(:\$[1]:)</SIZEOF>
<!-- system information functions -->
<NUM_LOADED_FILES NumArgs="0">NumLoadedFiles(::)</NUM_LOADED_FILES>
<NUM_LOADED_PROG_FILES NumArgs="0">NumLoadedProgFiles(::)</NUM_LOADED_PROG_FILES>
<MEM_SIZE_IP_ALL NumArgs="0">MemSizeIpInstAll(::)</MEM_SIZE_IP_ALL>
<MEM_SIZE_IP_LIB NumArgs="0">MemSizeIpInst(::)</MEM_SIZE_IP_LIB>
<MEM_SIZE_SHLIB NumArgs="0">MemSizeShLib(::)</MEM_SIZE_SHLIB>
<MEM_SIZE_FILE MinArgs="0" MaxArgs="1">MemSizeFile(:$[1]:)</MEM_SIZE_FILE>
<MEM_SIZE_IP_STACK_SPACE NumArgs="0">MemStackSpace(::)</MEM_SIZE_IP_STACK_SPACE>
</BuiltInFns>
<AxesSpec>
<!-- additional axis name patterns -->
<AxisRef Mode="3">$\s*=\s*AC</AxisRef>
<AxisRef Mode="4">$\s*=\s*IC</AxisRef>
</AxesSpec>
<PVMacros> <!-- Syntax that looks like PV refs, but is actually mapped to a defined bit of AIL -->
<RDISABLE ArrayDims="0" Group="500" >
<CALL Inline="Yes">
@#job->sa.keep_alive = 1;
@#thread.sa_keep_alive = 1;
</CALL>
</RDISABLE>
</PVMacros>
<Parameters>
<!--Parameters are assumed to be asynchronous unless specified as Synchronous-->
<R IndexType="RParamIndex" ValueType="FLOAT">
<ARG ref="EXPR" DataType="RParamIndex" />
#sys_vars.R[${EXPR}]
</R>
<P IndexType="RParamIndex" ValueType="FLOAT">
<ARG ref="EXPR" DataType="RParamIndex" />
#sys_vars.R[#sys_vars.R[${EXPR}]]
</P>
<EXB IndexType="EXParamIndex" ValueType="Byte">
<ARG ref="EXPR" DataType="EXParamIndex" />
#sys_vars.EXB[${EXPR}]
</EXB>
<EXW IndexType="EXParamIndex" ValueType="Word">
<ARG ref="EXPR" DataType="EXParamIndex" />
#sys_vars.EXW[${EXPR}]
</EXW>
<EXL IndexType="EXParamIndex" ValueType="Long">
<ARG ref="EXPR" DataType="EXParamIndex" />
#sys_vars.EXL[${EXPR}]
</EXL>
<EXF IndexType="EXFParamIndex" ValueType="FLOAT">
<ARG ref="EXPR" DataType="EXFParamIndex" />
#sys_vars.EXF[${EXPR}]
</EXF>
<!-- TODO: synchronous M-parameter support -->
<MW Synchronous="Yes" IndexType="MParamIndex" ValueType="Word">
<ARG ref="EXPR" DataType="MParamIndex" />
@#sys_vars.MW[${EXPR}]
</MW>
<ML Synchronous="Yes" IndexType="MParamIndex" ValueType="Long">
<ARG ref="EXPR" DataType="MParamIndex" />
@#sys_vars.ML[${EXPR}]
</ML>
<MF Synchronous="Yes" IndexType="MParamIndex" ValueType="FLOAT">
<ARG ref="EXPR" DataType="MParamIndex" />
@#sys_vars.MF[${EXPR}]
</MF>
</Parameters>
<PrimTypes PatternSuffix=":[^\[]" MapIECTypes="Yes" />
<Preprocess>
<PP_RULE_FRAME_I Search="$FRAME_I" Replace="[1,0,0,0,1,0,0,0,1,0,0,0]"/>
<PP_RULE_FRAME_DEF Search="FRAME" Replace="LREAL{12}"/>
</Preprocess>
<FubTemplates>
<StdFubTemplate IsDefault="Yes" Inline="Yes" >
<!-- a precompiled FubTemplate instance is created for each defined FubType from the ICF file
o AIL code snippets (e.g. conditions) are text-substituted from the ICF content
before precompilation occurs
* This template function is called once for each FUB call in the user program
o The template starts the cyclic execution of the fub
o if the fub is configured as blocking, then the block is done in this template
-->
<Arg ref="FUBINST" DataType="FLOAT" /> <!-- VAR -->
<Arg ref="FUBERRLEV" DataType="FLOAT" />
<Arg ref="PATHSYNCH" DataType="FLOAT" />
<Arg ref="BLOCKING" DataType="FLOAT" />
<!-- string substitution from the ICF FUB entry is done on the following vars:
${ERRORCOND} ${BUSYCOND} ${FN}
For path synchronous FUB calls we use "beginpathsynch" which is different to "recordpathsynch"
beginpathsynch : saves the stack (with the args to this template fn.) without recording the path-data
recordpathsynch : records a new instruction stream with ip-synch vars replaced by their value
-->
#job->error_level = ${FUBERRLEV};
#job->enable = 1;
#job->group_id = -2;
#job->is_fub = 1;
if (${BLOCKING})
#job->mp_command = MPCMD_PATH_SYNC_EXEC_WAIT;
#job->is_blocking = 1;
endif
if (${PATHSYNCH})
beginpathsynch
endif
begincyclic
${FN}(:${FUBINST}:);
if (${ERRORCOND})
#job->eval_status = ERR_FUB_ERROR;
#job->terminate = 1;
elif (${BUSYCOND})
#job->eval_status = ERR_FUB_BUSY;
else
#job->eval_status = ERR_OK;
#job->terminate = 1;
endif
endcyclic
if (${BLOCKING})
WaitForCyclicJob(:#last_job_id:);
endif
endpathsynch
</StdFubTemplate>
</FubTemplates>
<SynchActions>
<SABlocks>
<!-- synch action code templates...
* Prepare a path-synch evaluation packet to:
(a) define the cyclic behaviour of this SA
o Content of "cyclic ... endcyclic" block
(b) if modal group specified, activate the SA immediately
o Set the cyclic.enable flag before the cyclic block start instr.
-->
<default IsDefault="Yes"> <!-- default SA is used when no temporal condition specified -->
<cyclic Inline="Yes"> <!-- essential to call INLINE as any ip-synch vars in the ACTIONS must be resolved to values -->
<Arg ref="ACTIONS" DataType="STATEMENTS" />
<Arg ref="ID" DataType="FLOAT" DefaultInt="-1" MinCount="0" MaxCount="1" />
#job->is_sa = 1;
#job->group_id = ${ID};
#job->is_blocking = 1;
if (#job->group_id &gt;= 0)
#job->enable = 1;
else
#mplist.trigger_nmsa = 1;
#mplist.delay_trigger_nmsa = 1;
endif
recordpathsynch
if (#job->group_id &gt;= 0)
StopCyclicGroups(:(:#job->group_id:):);
endif
begincyclic
${ACTIONS}
endcyclic
endpathsynch
</cyclic>
</default>
<whenever>
<cyclic Inline="Yes">
<Arg ref="COND" DataType="FLOAT" />
<Arg ref="ACTIONS" DataType="STATEMENTS" />
<Arg ref="ID" DataType="FLOAT" DefaultInt="-1" MinCount="0" MaxCount="1" />
#job->is_sa = 1;
#job->group_id = ${ID};
#job->is_blocking = 1;
if (#job->group_id &gt;= 0)
#job->enable = 1;
else
#mplist.trigger_nmsa = 1;
#mplist.delay_trigger_nmsa = 1;
endif
recordpathsynch
if (#job->group_id &gt;= 0)
StopCyclicGroups(:(:#job->group_id:):);
endif
begincyclic
@#job->sa.cond = ${COND};
if (@#job->sa.cond)
${ACTIONS}
endif
endcyclic
endpathsynch
</cyclic>
</whenever>
<when>
<cyclic Inline="Yes">
<Arg ref="COND" DataType="FLOAT" />
<Arg ref="ACTIONS" DataType="STATEMENTS" />
<Arg ref="ID" DataType="FLOAT" DefaultInt="-1" MinCount="0" MaxCount="1" />
#job->is_sa = 1;
#job->group_id = ${ID};
#job->is_blocking = 1;
if (#job->group_id &gt;= 0)
#job->enable = 1;
else
#mplist.trigger_nmsa = 1;
#mplist.delay_trigger_nmsa = 1;
endif
recordpathsynch
if (#job->group_id &gt;= 0)
StopCyclicGroups(:(:#job->group_id:):);
endif
begincyclic
@#job->sa.cond = ${COND};
if (@#job->sa.cond)
${ACTIONS}
@#job->terminate = 1;
endif
endcyclic
endpathsynch
</cyclic>
</when>
<every>
<cyclic Inline="Yes">
<Arg ref="COND" DataType="FLOAT" />
<Arg ref="ACTIONS" DataType="STATEMENTS" />
<Arg ref="ID" DataType="FLOAT" DefaultInt="-1" MinCount="0" MaxCount="1" />
#job->is_sa = 1;
#job->group_id = ${ID};
#job->is_blocking = 1;
if (#job->group_id &gt;= 0)
#job->enable = 1;
else
#mplist.trigger_nmsa = 1;
#mplist.delay_trigger_nmsa = 1;
endif
recordpathsynch
if (#job->group_id &gt;= 0)
StopCyclicGroups(:(:#job->group_id:):);
endif
begincyclic
@#job->sa.cond_prev = @#job->sa.cond;
@#job->sa.cond = ${COND};
if (!@#job->sa.cond_prev &amp;&amp; @#job->sa.cond)
${ACTIONS}
endif
endcyclic
endpathsynch
</cyclic>
</every>
<from>
<cyclic Inline="Yes">
<Arg ref="COND" DataType="FLOAT" />
<Arg ref="ACTIONS" DataType="STATEMENTS" />
<Arg ref="ID" DataType="FLOAT" DefaultInt="-1" MinCount="0" MaxCount="1" />
#job->is_sa = 1;
#job->group_id = ${ID};
#job->is_blocking = 1;
if (#job->group_id &gt;= 0)
#job->enable = 1;
else
#mplist.trigger_nmsa = 1;
#mplist.delay_trigger_nmsa = 1;
endif
recordpathsynch
if (#job->group_id &gt;= 0)
StopCyclicGroups(:(:#job->group_id:):);
endif
begincyclic
@#job->sa.cond = @#job->sa.cond || ${COND};
if (@#job->sa.cond)
${ACTIONS}
endif
endcyclic
endpathsynch
</cyclic>
</from>
</SABlocks>
<NonModalActivation>
<!-- Start & Stop commands are executed path synchronous immediately before and after a triggering block
(a triggering block is the first MPList that is dispatched with the following vars set:
#thread.trigger_nmsa = 1;
#thread.delay_nmsa_trigger = 0;
Note: modal SA usage does not use these commands (start is automatic and they run until explicitly stopped)
-->
<Start>
@#thread.sa_last_keep_alive = 1;
ActivateCyclicGroup(:-1:);
</Start>
<!-- TryStop... will stop the cyclic jobs unless they have set keep_alive in last complete eval cycle -->
<Stop>
WaitStopCyclicGroups(:(:-1:):);
</Stop>
</NonModalActivation>
</SynchActions>
<ParserData NestedComments="Yes" DefaultCaseSensitive="No" CommentsSpanLines="No"
SubDeclsLocalToFile="Yes" ProgDeclsLocalToFile="Yes" AllowUnprefixedFileCalls="No"
LocalVarScopeForMainProg="No" FileScopeVarsVisibleInSub="Yes" MainPrgReturnAtNextMainPrgHdr="Yes"
AllowVarReadBeforeAssign="No" AllowArrayRefWithoutIndex="Yes" >
<!--Patterns are specified as Perl regular expressions-->
<!--Token Names should not be changed-->
<!--Tokens without a Pattern or without TOKEN entry are not in use in this dialect-->
<!--Restricted means this token can only match on a FollowedBy request-->
<TKG_END_OF_LINE IsPattern="No">\n</TKG_END_OF_LINE>
<TKG_ARITH_BINARY_MODULO>MOD</TKG_ARITH_BINARY_MODULO>
<TKG_TRUE IsPattern="Yes">TRUE:\W</TKG_TRUE>
<TKG_FALSE IsPattern="Yes">FALSE:\W</TKG_FALSE>
<TKG_PAREVAL_MODAL_ID FileXLInvalid="Yes" IsPattern="Yes">ID:[\s=]</TKG_PAREVAL_MODAL_ID>
<TKG_OPEN_COMMENT>(</TKG_OPEN_COMMENT>
<TKG_CLOSE_COMMENT>)</TKG_CLOSE_COMMENT>
<TKG_OPEN_BRACKET>[</TKG_OPEN_BRACKET>
<TKG_CLOSE_BRACKET>]</TKG_CLOSE_BRACKET>
<TKG_OPEN_INDEXBRACKET>{</TKG_OPEN_INDEXBRACKET>
<TKG_CLOSE_INDEXBRACKET>}</TKG_CLOSE_INDEXBRACKET>
<TKG_NUMBER IsPattern="Yes">\d+\.\d+|\d+\.|\.\d+</TKG_NUMBER>
<TKG_INTEGER IsPattern="Yes">\d+</TKG_INTEGER>
<TKG_DOT IsPattern="Yes" FollowedBy="TKG_STRUCT_MEMBER_REF">\.:\w</TKG_DOT>
<TKG_STRUCT_MEMBER_REF IsPattern="Yes" Restricted="Yes">\w|\w[\w\d]+</TKG_STRUCT_MEMBER_REF>
<TKG_NUMBER_EXP IsPattern="Yes">EX:[\s\d\+\-\.]</TKG_NUMBER_EXP>
<TKG_QUOTED_STRING IsPattern="Yes">""|"[^"]+"</TKG_QUOTED_STRING> <!-- New for direct-to-binary -->
<TKG_COMMA>,</TKG_COMMA>
<TKG_MACRO_DEFINE IsPattern="Yes" FollowedBy="TKG_MACRO_NAME">define\s</TKG_MACRO_DEFINE>
<TKG_MACRO_AS IsPattern="Yes" FollowedBy="TKG_MACRO_TEXT">as\s</TKG_MACRO_AS>
<TKG_MACRO_NAME Restricted="Yes" IsPattern="Yes">[$\w][$\w\d]+</TKG_MACRO_NAME>
<TKG_MACRO_TEXT Restricted="Yes" IsPattern="Yes">[^\n]+</TKG_MACRO_TEXT>
<TKG_BUILTIN_NUM_FN_NAME/> <!-- each BuiltInFn added adds itself to the parse token string-cache, this just defines priority of that token -->
<TKG_SUBPROG_START FileXLInvalid="Yes" IsPattern="Yes" FollowedBy="TKG_SUBPROG_NAME">%:L</TKG_SUBPROG_START>
<TKG_SUBPROG_NAME IsPattern="Yes" Restricted="Yes">L\d+</TKG_SUBPROG_NAME>
<TKG_SUBPROG_CALL IsPattern="Yes" FollowedBy="TKG_SUBPROG_NAME">L:L\d</TKG_SUBPROG_CALL>
<!-- NCIP 04m new definitions (for review and activation)
<TKG_SUBPROG_PROTO IsPattern="Yes" FollowedBy="TKG_SUBPROG_NAME">%D:L</TKG_SUBPROG_PROTO>
<TKG_SUBCALL_REPEAT_PREFIX IsPattern="Yes" FollowedBy="TKG_INTEGER">O:[\s\d]</TKG_SUBCALL_REPEAT_PREFIX>
<TKG_EXTERN IsPattern="Yes" FollowedBy="TKG_PROG_FILE_NAME">%D:[^L]</TKG_EXTERN>
<TKG_ARG_PASSBYREF IsPattern="Yes">VAR\s</TKG_ARG_PASSBYREF>
<TKG_SET_MODAL_SUB FileXLInvalid="Yes" IsPattern="Yes">MCALL:\W</TKG_SET_MODAL_SUB>
...END 04m new definitions -->
<TKG_PROG_START IsPattern="Yes" FollowedBy="TKG_PROG_NAME">%:\d</TKG_PROG_START>
<TKG_PROG_NAME IsPattern="Yes" Restricted="Yes">\d+</TKG_PROG_NAME>
<TKG_PROG_CALL IsPattern="Yes" FollowedBy="TKG_PROG_FILE_NAME">L:[^L]</TKG_PROG_CALL>
<TKG_PROG_FILE_NAME IsPattern="Yes" Restricted="Yes">[\^#&amp;@']?[\w\d\.\\]+</TKG_PROG_FILE_NAME>
<TKG_NC_BLOCK_PREFIX IsPattern="Yes">N:[\d\s]</TKG_NC_BLOCK_PREFIX>
<TKG_PARAM_PREFIX IsPattern="Yes">R:\d|P:\d|M[WLF]:\d|EX[WLBF]:\d</TKG_PARAM_PREFIX>
<TKG_G_CODE_PREFIX IsPattern="Yes">G:[\s\d]</TKG_G_CODE_PREFIX>
<TKG_M_CODE_PREFIX IsPattern="Yes">M:[\s\d]</TKG_M_CODE_PREFIX>
<TKG_PAREVAL_DO FileXLInvalid="Yes" IsPattern="Yes">do\s</TKG_PAREVAL_DO>
<TKG_GOTO FileXLInvalid="Yes" IsPattern="Yes" OptFollowedBy="TKG_GOTO_DEST">$GOTO:\s</TKG_GOTO>
<TKG_GOTO_DEST IsPattern="Yes" Restricted="Yes">\w[\w\d]*</TKG_GOTO_DEST>
<TKG_LOGICAL_BINARY_AND>&amp;&amp;</TKG_LOGICAL_BINARY_AND>
<TKG_LOGICAL_BINARY_OR>||</TKG_LOGICAL_BINARY_OR>
<TKG_LOGICAL_BINARY_XOR>XOR</TKG_LOGICAL_BINARY_XOR>
<TKG_COMP_BINARY_GREATER_THAN_OR_EQ>&gt;=</TKG_COMP_BINARY_GREATER_THAN_OR_EQ>
<TKG_COMP_BINARY_LESS_THAN_OR_EQ>&lt;=</TKG_COMP_BINARY_LESS_THAN_OR_EQ>
<TKG_COMP_BINARY_EQUAL_TO>==</TKG_COMP_BINARY_EQUAL_TO>
<TKG_COMP_BINARY_NOT_EQUAL_TO>!=</TKG_COMP_BINARY_NOT_EQUAL_TO>
<TKG_COMP_BINARY_GREATER_THAN>&gt;</TKG_COMP_BINARY_GREATER_THAN>
<TKG_COMP_BINARY_LESS_THAN>&lt;</TKG_COMP_BINARY_LESS_THAN>
<TKG_ASSIGN_EQ>=</TKG_ASSIGN_EQ>
<TKG_LOGICAL_UNARY_NOT>!</TKG_LOGICAL_UNARY_NOT>
<TKG_BITWISE_BINARY_AND>&amp;</TKG_BITWISE_BINARY_AND>
<TKG_BITWISE_BINARY_OR>|</TKG_BITWISE_BINARY_OR>
<TKG_BITWISE_BINARY_XOR>^</TKG_BITWISE_BINARY_XOR>
<TKG_BITWISE_UNARY_COMPLEMENT>~</TKG_BITWISE_UNARY_COMPLEMENT>
<TKG_ARITH_BINARY_PLUS>+</TKG_ARITH_BINARY_PLUS>
<TKG_ARITH_BINARY_MINUS>-</TKG_ARITH_BINARY_MINUS>
<TKG_ARITH_BINARY_POWER>**</TKG_ARITH_BINARY_POWER>
<TKG_ARITH_BINARY_MULTIPLY>*</TKG_ARITH_BINARY_MULTIPLY>
<TKG_ARITH_BINARY_DIVIDE>/</TKG_ARITH_BINARY_DIVIDE>
<TKG_IF FileXLInvalid="Yes">$IF</TKG_IF>
<TKG_BLOCK_ELSEIF FileXLInvalid="Yes">$ELSEIF</TKG_BLOCK_ELSEIF>
<TKG_BLOCK_ELSE FileXLInvalid="Yes">$ELSE</TKG_BLOCK_ELSE>
<TKG_BLOCK_ENDIF FileXLInvalid="Yes">$ENDIF</TKG_BLOCK_ENDIF>
<TKG_SWITCH FileXLInvalid="Yes">$SWITCH</TKG_SWITCH>
<TKG_SWITCH_CASE FileXLInvalid="Yes">$CASE</TKG_SWITCH_CASE>
<TKG_SWITCH_DEFAULT FileXLInvalid="Yes">$DEFAULT</TKG_SWITCH_DEFAULT>
<TKG_ENDSWITCH FileXLInvalid="Yes">$ENDSWITCH</TKG_ENDSWITCH>
<TKG_FOR FileXLInvalid="Yes">$FOR</TKG_FOR>
<TKG_ENDFOR FileXLInvalid="Yes">$ENDFOR</TKG_ENDFOR>
<TKG_WHILE FileXLInvalid="Yes">$WHILE</TKG_WHILE>
<TKG_ENDWHILE FileXLInvalid="Yes">$ENDWHILE</TKG_ENDWHILE>
<TKG_DO FileXLInvalid="Yes">$DO</TKG_DO>
<TKG_ENDDO FileXLInvalid="Yes">$ENDDO</TKG_ENDDO>
<TKG_BREAK FileXLInvalid="Yes">$BREAK</TKG_BREAK>
<TKG_CONTINUE FileXLInvalid="Yes">$CONTINUE</TKG_CONTINUE>
<!-- GCode specific parse tokens -->
<TKG_PRIM_TYPE IsPattern="Yes" />
<TKG_PV_DECL IsPattern="Yes">def\s</TKG_PV_DECL>
<TKG_PV_UNDECL IsPattern="Yes">~def\s</TKG_PV_UNDECL>
<TKG_PV_DECL_REF IsPattern="Yes" Restricted="Yes">\w[\w\d\.\:\*]+|\w</TKG_PV_DECL_REF>
<TKG_VARSCOPE_IP_LOCAL IsPattern="Yes">local\s</TKG_VARSCOPE_IP_LOCAL>
<TKG_VARSCOPE_IP_GLOBAL IsPattern="Yes">ip_global:[\s\n]</TKG_VARSCOPE_IP_GLOBAL>
<TKG_VARSCOPE_NC_GLOBAL IsPattern="Yes">nc_global:[\s\n]</TKG_VARSCOPE_NC_GLOBAL>
<TKG_VARSCOPE_PLC_GLOBAL IsPattern="Yes">plc_global:[\s\n]</TKG_VARSCOPE_PLC_GLOBAL>
<TKG_VAR_RETAIN IsPattern="Yes">retain\s</TKG_VAR_RETAIN>
<TKG_VARSYNCH_IP IsPattern="Yes">ip_synch\s</TKG_VARSYNCH_IP>
<TKG_VARSYNCH_PATH IsPattern="Yes">path_synch\s</TKG_VARSYNCH_PATH>
<TKG_QUOTED_STRING IsPattern="Yes">""|"[^"]+"</TKG_QUOTED_STRING>
<TKG_LABEL_DEF IsPattern="Yes" FollowedBy="TKG_LABEL_SUFFIX">\w:\:|\w[\w\d]+:\:</TKG_LABEL_DEF>
<TKG_LABEL_SUFFIX Restricted="Yes">:</TKG_LABEL_SUFFIX>
<TKG_FUB_DECL IsPattern="Yes">fub\s</TKG_FUB_DECL>
<TKG_FUB_ERR_LEV_1 IsPattern="Yes">error_level_1\s</TKG_FUB_ERR_LEV_1>
<TKG_FUB_ERR_LEV_2 IsPattern="Yes">error_level_2\s</TKG_FUB_ERR_LEV_2>
<TKG_FUB_ERR_LEV_3 IsPattern="Yes">error_level_3\s</TKG_FUB_ERR_LEV_3>
<TKG_FUB_ERR_LEV_4 IsPattern="Yes">error_level_4\s</TKG_FUB_ERR_LEV_4>
<TKG_FUB_BLOCKING IsPattern="Yes">blocking\s</TKG_FUB_BLOCKING>
<TKG_FUB_NON_BLOCKING IsPattern="Yes">non_blocking\s</TKG_FUB_NON_BLOCKING>
<!-- TKG_WORD Must be the final token in the list -->
<TKG_WORD IsPattern="Yes">\w|\w[\w\d\.]+</TKG_WORD>
</ParserData>
</Root>

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<DataObject Version="1.28.1" xmlns="http://br-automation.co.at/AS/DataObject">
<Files>
<File>gmciplog.cnc</File>
</Files>
</DataObject>

View File

@@ -1,410 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<?ARNC0 Version="1.28.1"?>
<Root LangModule="ailgcode" Version="1.0">
<AxesSpec>
<!-- specify empty axes section to avoid warning -->
</AxesSpec>
<PVMacros>
<!-- MP Data fields mapped as PVMacros -->
<DR8><REF>#next_motion.Data.R8_value</REF></DR8>
<DI4><REF>#next_motion.Data.I4_value</REF></DI4>
<DU4><REF>#next_motion.Data.UI4_value</REF></DU4>
<DR8_G211>
<SET>
%_CNC.TA = ${EXPR};
if (%_CNC.TA &lt; 0)
%_CNC.TA = 0;
endif
#next_motion.Data.R8_value = ${EXPR};
</SET>
</DR8_G211>
<!-- LINEAR POSITION DATA -->
<Dlp><REF>#next_motion.Data.LinMovement.Position</REF></Dlp>
<Dli>
<SET>
<!-- data members need to be initialized to -1 -->
#next_motion.Data.LinMovement.Idx[0] = ArrayRep(:(:-1:):);
#next_motion.Data.LinMovement.Idx = ${EXPR};
</SET>
</Dli>
<Dlm>
<SET>
<!-- data members need to be initialized to -1 -->
#next_motion.Data.LinMovement.Mode[0] = ArrayRep(:(:-1:):);
#next_motion.Data.LinMovement.Mode = ${EXPR};
</SET>
</Dlm>
<!-- TRANS/ROT OFFSET DATA, note: (A)ROT_RPL just uses R8_value -->
<Dto><REF>#next_motion.Data.Trans.Offset</REF></Dto>
<Dti>
<SET>
<!-- data members need to be initialized to -1 -->
#next_motion.Data.Trans.AxIdx[0] = ArrayRep(:(:-1:):);
#next_motion.Data.Trans.AxIdx = ${EXPR};
</SET>
</Dti>
<Dtm>
<SET>
<!-- data members need to be initialized to -1 -->
#next_motion.Data.Trans.Mode[0] = ArrayRep(:(:-1:):);
#next_motion.Data.Trans.Mode = ${EXPR};
</SET>
</Dtm>
<!-- CIRCULAR MOVEMENT DATA -->
<Dcp><REF>#next_motion.Data.CircMovement.Parameter</REF></Dcp>
<Dci>
<SET>
<!-- data members need to be initialized to -1 -->
#next_motion.Data.CircMovement.Idx[0] = ArrayRep(:(:-1:):);
#next_motion.Data.CircMovement.Idx = ${EXPR};
</SET>
</Dci>
<Dcm>
<SET>
<!-- data members need to be initialized to -1 or do they? -->
#next_motion.Data.CircMovement.Mode[0] = ArrayRep(:(:-1:):);
#next_motion.Data.CircMovement.Mode = ${EXPR};
</SET>
</Dcm>
<Dtp><REF>#next_motion.Data.ToolAxOrient.Parameter</REF></Dtp>
<Dts><REF>#next_motion.Data.ToolAxOrient.Sign</REF></Dts>
<Daz><REF>#next_motion.Data.AbsZeroPtShift.ZpRecIdx</REF></Daz>
<!-- PROGRAMMED ZERO POINT OFFSET DATA -->
<Dpt>
<SET>
<!-- data members need to be initialized to -1 -->
#next_motion.Data.ProgZeroPtShift.Type[0] = ArrayRep(:(:-1:):);
#next_motion.Data.ProgZeroPtShift.Type = ${EXPR};
</SET>
</Dpt>
<Dpm>
<SET>
<!-- data members need to be initialized to -1 -->
#next_motion.Data.ProgZeroPtShift.Mode[0] = ArrayRep(:(:-1:):);
#next_motion.Data.ProgZeroPtShift.Mode = ${EXPR};
</SET>
</Dpm>
<Dpa> <REF>#next_motion.Data.ProgZeroPtShift.AxShift</REF></Dpa>
<!-- FULL TOOL TRANSFORMATION DATA -->
<Dfdx> <REF>#next_motion.Data.FullTrfTool.Dx</REF></Dfdx>
<Dfdy> <REF>#next_motion.Data.FullTrfTool.Dy</REF></Dfdy>
<Dfdz> <REF>#next_motion.Data.FullTrfTool.Dz</REF></Dfdz>
<Dfph> <REF>#next_motion.Data.FullTrfTool.Phi</REF></Dfph>
<Dft> <REF>#next_motion.Data.FullTrfTool.Theta</REF></Dft>
<Dfps> <REF>#next_motion.Data.FullTrfTool.Psi</REF></Dfps>
<!-- latch configuration data -->
<DPLDli><REF>#next_motion.Data.PosLatchDistance.LatchIdx</REF></DPLDli>
<DPLDts><REF>#next_motion.Data.PosLatchDistance.TriggSource</REF></DPLDts>
<DPLDe> <REF>#next_motion.Data.PosLatchDistance.Edge</REF></DPLDe>
<DPLDti><REF>#next_motion.Data.PosLatchDistance.HwTrigIdx</REF></DPLDti>
<DPLDd> <REF>#next_motion.Data.PosLatchDistance.Distance</REF></DPLDd>
<DPLli> <REF>#next_motion.Data.PosLatch.LatchIdx</REF></DPLli>
<DPLts> <REF>#next_motion.Data.PosLatch.TriggSource</REF></DPLts>
<DPLe> <REF>#next_motion.Data.PosLatch.Edge</REF></DPLe>
<DPLti> <REF>#next_motion.Data.PosLatch.HwTrigIdx</REF></DPLti>
<!-- RADIUS FEED ADJUSTMENT DATA -->
<Drma> <REF>#next_motion.Data.R_DependFeed.MaxRadius</REF></Drma>
<Drmi> <REF>#next_motion.Data.R_DependFeed.MinRadius</REF></Drmi>
<Drr> <REF>#next_motion.Data.R_DependFeed.Rate</REF></Drr>
<!-- V JUMP DATA -->
<Dsvp>
<SET>
<!-- data membeRs need to be initialized to ncOff -->
#next_motion.Data.Set_v_jump.programmed[0] = ArrayRep(:(:ncOFF:):);
#next_motion.Data.Set_v_jump.programmed = ${EXPR};
</SET>
</Dsvp>
<Dsvv> <REF>#next_motion.Data.Set_v_jump.value</REF></Dsvv>
<!-- A JUMP DATA -->
<Dsap>
<SET>
<!-- data membeRs need to be initialized to ncOff -->
#next_motion.Data.Set_a_jump.programmed[0] = ArrayRep(:(:ncOFF:):);
#next_motion.Data.Set_a_jump.programmed = ${EXPR};
</SET>
</Dsap>
<Dsav> <REF>#next_motion.Data.Set_a_jump.value</REF></Dsav>
<!-- AXIS LIMIT DATA -->
<Dsep>
<SET>
<!-- data membeRs need to be initialized to ncOff -->
#next_motion.Data.SetAxLimit.programmed[0] = ArrayRep(:(:ncOFF:):);
#next_motion.Data.SetAxLimit.programmed = ${EXPR};
</SET>
</Dsep>
<Dser> <REF>#next_motion.Data.SetAxLimit.RecordIdx</REF></Dser>
<!-- CAMWRAPPING DATA -->
<Dcad> <REF>#next_motion.Data.CamWrapping.Diameter</REF></Dcad>
<Dcap> <REF>#next_motion.Data.CamWrapping.ParameterP1</REF></Dcap>
<Dsu><REF>#next_motion.Data.SetPathAccDec.UnitType</REF></Dsu>
<!-- ACC DEC DATA -->
<Dsv108>
<SET>
#next_motion.Data.SetPathAccDec.value = ${EXPR};
if (#next_motion.Data.SetPathAccDec.UnitType == 1)
%_CNC.lim_path_acc_p = ${EXPR} / 100.0 * %_CNC.lim_path_acc_p_ini;
else
%_CNC.lim_path_acc_p = ${EXPR};
endif
</SET>
</Dsv108>
<Dsv109>
<SET>
#next_motion.Data.SetPathAccDec.value = ${EXPR};
if (#next_motion.Data.SetPathAccDec.UnitType == 1)
%_CNC.lim_path_acc_n = ${EXPR} / 100.0 * %_CNC.lim_path_acc_n_ini;
else
%_CNC.lim_path_acc_n = ${EXPR};
endif
</SET>
</Dsv109>
<Dsv110>
<SET>
#next_motion.Data.SetPathAccDec.value = ${EXPR};
if (#next_motion.Data.SetPathAccDec.UnitType == 1)
%_CNC.lim_path_acc_p = ${EXPR} / 100.0 * %_CNC.lim_path_acc_p_ini;
%_CNC.lim_path_acc_n = ${EXPR} / 100.0 * %_CNC.lim_path_acc_n_ini;
else
%_CNC.lim_path_acc_p = ${EXPR};
%_CNC.lim_path_acc_n = ${EXPR};
endif
</SET>
</Dsv110>
<Dsma> <REF>#next_motion.Data.SetTransSpeed.MaxAngle</REF></Dsma>
<Dsmi> <REF>#next_motion.Data.SetTransSpeed.MinAngle</REF></Dsmi>
<Dsr> <REF>#next_motion.Data.SetTransSpeed.RedFactor</REF></Dsr>
<!-- BEZIER SPLINE DATA -->
<Dbrp> <REF>#next_motion.Data.BezierSpline.RadiusProgrammed</REF></Dbrp>
<Dbr> <REF>#next_motion.Data.BezierSpline.Radius</REF></Dbr>
<Dbvp> <REF>#next_motion.Data.BezierSpline.VeProgrammed</REF></Dbvp>
<Dbv> <REF>#next_motion.Data.BezierSpline.Ve</REF></Dbv>
<Dbl> <REF>#next_motion.Data.BezierSpline.LinProgrammed</REF></Dbl>
<Dao> <REF>#next_motion.Data.AutomTangentialAx.Offset</REF></Dao>
<Daa> <REF>#next_motion.Data.AutomTangentialAx.AxIdx</REF></Daa>
<!-- AXIS MAPPING DATA -->
<DAMa> <REF>#next_motion.Data.AxisMapping.AxIdx</REF></DAMa>
<DAMf> <REF>#next_motion.Data.AxisMapping.factor</REF></DAMf>
<DAMp> <REF>#next_motion.Data.AxisMapping.ParameterP1</REF></DAMp>
<!-- SIGNAL PATH END DATA -->
<DSPEt> <REF>#next_motion.Data.SignalPathEnd.Time</REF></DSPEt>
<DSPEst> <REF>#next_motion.Data.SignalPathEnd.SignalType</REF></DSPEst>
<DSPEsi> <REF>#next_motion.Data.SignalPathEnd.SignalIdx</REF></DSPEsi>
<DSPEsd> <REF>#next_motion.Data.SignalPathEnd.SourceData</REF></DSPEsd>
<DSPEd> <REF>#next_motion.Data.SignalPathEnd.DataLength </REF></DSPEd>
<DSPEp>
<SET>
#next_motion.Data.SignalPathEnd.pDestination = \#sys_vars.EXF[0];
</SET>
</DSPEp>
<!-- SIGNAL PATH END DISTDATA -->
<DSPEDst><REF>#next_motion.Data.SignalPathEndDist.SignalType</REF></DSPEDst>
<DSPEDsi><REF>#next_motion.Data.SignalPathEndDist.SignalIdx</REF></DSPEDsi>
<DSPEDsd><REF>#next_motion.Data.SignalPathEndDist.SourceData</REF></DSPEDsd>
<DSPEDd> <REF>#next_motion.Data.SignalPathEndDist.DataLength </REF></DSPEDd>
<DSPEDp>
<SET>
#next_motion.Data.SignalPathEndDist.pDestination = \#sys_vars.EXF[0];
</SET>
</DSPEDp>
<!-- SIGNAL PREDICT DATA -->
<DSPo> <REF>#next_motion.Data.SignalPredict.Override</REF></DSPo>
<!-- WS_CTRL DATA -->
<DWCx1> <REF>#next_motion.Data.WS_Ctrl.x1</REF></DWCx1>
<DWCz1> <REF>#next_motion.Data.WS_Ctrl.z1</REF></DWCz1>
<DWCy1> <REF>#next_motion.Data.WS_Ctrl.y1</REF></DWCy1>
<DWCx2> <REF>#next_motion.Data.WS_Ctrl.x2</REF></DWCx2>
<DWCz2> <REF>#next_motion.Data.WS_Ctrl.y2</REF></DWCz2>
<DWCy2> <REF>#next_motion.Data.WS_Ctrl.z2</REF></DWCy2>
<DWCi> <REF>#next_motion.Data.WS_Ctrl.index</REF></DWCi>
<DWCc> <REF>#next_motion.Data.WS_Ctrl.coord</REF></DWCc>
<DWCp> <REF>#next_motion.Data.WS_Ctrl.pplane</REF></DWCp>
<DWCo> <REF>#next_motion.Data.WS_Ctrl.orient</REF></DWCo>
<DWCa>
<SET>
#next_motion.Data.WS_Ctrl.arm_diameter[0] = ArrayRep(:(:ncOFF:):);
#next_motion.Data.WS_Ctrl.arm_diameter = ${EXPR};
</SET>
</DWCa>
<!-- TOOL DATA RECORD DATA -->
<DTDRt> <REF>#next_motion.Data.ToolDataRecord.ToolIdx</REF></DTDRt>
<!-- SYS VARS -->
<Sz> <REF>#sys_vars.ZP</REF></Sz>
<!-- SPINDLE SPEED DATA -->
<DSSi> <REF>#next_motion.Data.SpindleSpeed.Idx</REF></DSSi>
<DSSs> <REF>#next_motion.Data.SpindleSpeed.speed</REF></DSSs>
<!-- C2_SPLINE_START DATA -->
<DCSSt> <REF>#next_motion.Data.C2_SplineStart.BCType</REF></DCSSt>
<DCSSv> <REF>#next_motion.Data.C2_SplineStart.BCValue</REF></DCSSv>
<DCSSp>
<SET>
#next_motion.Data.C2_SplineStart.BCProgrammed[0] = ArrayRep(:(:ncOFF:):);
#next_motion.Data.C2_SplineStart.BCProgrammed = ${EXPR};
</SET>
</DCSSp>
<DCSSsp> <REF>#next_motion.Data.C2_SplineStart.SegmentParameter</REF></DCSSsp>
<DCSSst> <REF>#next_motion.Data.C2_SplineStart.SegmentType</REF></DCSSst>
<!-- C2_SPLINE_END DATA -->
<DCSEt> <REF>#next_motion.Data.C2_SplineEnd.BCType</REF></DCSEt>
<DCSEv> <REF>#next_motion.Data.C2_SplineEnd.BCValue</REF></DCSEv>
<DCSEp>
<SET>
#next_motion.Data.C2_SplineEnd.BCProgrammed[0] = ArrayRep(:(:ncOFF:):);
#next_motion.Data.C2_SplineEnd.BCProgrammed = ${EXPR};
</SET>
</DCSEp>
<DFd> <REF>#next_motion.Data.Frame.Data</REF></DFd>
<!-- SYSTEM VARIABLE DATA -->
<DSVs> <REF>#next_motion.Data.SystemVariable.SysVarIdx</REF></DSVs>
<DSVa> <REF>#next_motion.Data.SystemVariable.AxIdx</REF></DSVa>
<DSVd> <REF>#next_motion.Data.SystemVariable.Data.R8_value</REF></DSVd>
</PVMacros>
<Constants>
<PathBusy type="STRING">BUSY</PathBusy>
<PathStatus type="STRING">STATUS</PathStatus>
<PathErrLevel type="STRING">ERRLEV</PathErrLevel>
</Constants>
<BuiltInProcs>
<!-- SendCommand only used prior to ARNC0 V1.25.0 -->
<SendCommand MinArgs="1" MaxArgs="1" Inline="Yes">
SendCommand(:$[1]:);
</SendCommand>
<DispatchAndWait MinArgs="1" MaxArgs="1" Inline="Yes">
DispatchAndWait(:$[1]:);
</DispatchAndWait>
</BuiltInProcs>
<Preprocess>
<MP_PJN Search="MP22000 " Replace="PJN " />
<MP_PJB Search="MP22100 " Replace="PJB " />
</Preprocess>
<GCodes>
<!-- For MPLogging GCodes only used for commands that take args -->
<G_DELAY GNum="0" Alias="@" AliasIsPattern="Yes" Inline="Yes">
<Arg DataType="FLOAT" ref="tickdelay"/>
#cycle_counter = 0;
WaitUntil(:#cycle_counter &gt;= ${tickdelay}:);
</G_DELAY>
<!-- Path synchronous exec job : Non-Blocking -->
<G_PJN GNum="22000" Alias="PJN" Inline="Yes"> <!-- need inline because we're using path-synch -->
<Arg Name="PathBusy" DataType="FLOAT" ref="busy_count"/>
<Arg Name="PathStatus" DataType="FLOAT" ref="final_status"/>
<Arg Name="PathErrLevel" DataType="FLOAT" ref="error_level"/>
#job->group_id = 0;
#job->enable = 1;
#job->is_fub = 1;
#job->error_level = ${error_level};
if (${busy_count} == 0)
beginpathsynch
@#job->terminate = 1;
@#job->eval_status = ${final_status};
endpathsynch
else
beginpathsynch
begincyclic
if (${busy_count} == @#job->eval_count)
@#job->terminate = 1;
@#job->eval_status = ${final_status};
else
@#job->eval_status = 65535;
endif
endcyclic
endpathsynch
endif
</G_PJN>
<!-- Path synchronous exec job : Blocking -->
<G_PJB GNum="22100" Alias="PJB" Inline="Yes"> <!-- need inline because we're using path-synch -->
<Arg Name="PathBusy" DataType="FLOAT" ref="busy_count"/>
<Arg Name="PathStatus" DataType="FLOAT" ref="final_status"/>
<Arg Name="PathErrLevel" DataType="FLOAT" ref="error_level"/>
#job->group_id = 0;
#job->enable = 1;
#job->is_fub = 1;
#job->error_level = ${error_level};
#job->mp_command = MPCMD_PATH_SYNC_EXEC_WAIT;
#job->is_blocking = 1;
if (${busy_count} == 0)
beginpathsynch
@#job->terminate = 1;
@#job->eval_status = ${final_status};
endpathsynch
else
beginpathsynch
begincyclic
if (${busy_count} == @#job->eval_count)
@#job->terminate = 1;
@#job->eval_status = ${final_status};
else
@#job->eval_status = 65535;
endif
endcyclic
WaitForCyclicJob(:#last_job_id:);
endpathsynch
endif
</G_PJB>
</GCodes>
<MCodes>
<!-- MPLogging M-Codes are used for processing MPxxxx consts and the ; pushpacket call -->
<M_DEFAULT IsDefault="Yes" MinValue="0" MaxValue="999999">
<!-- MP Command number: MP<num> -->
<ARG ref="VALUE" DataType="FLOAT" RequireLiteral="Yes" />
#next_motion.Command = ${VALUE};
</M_DEFAULT>
<M10003 Value="10003" Inline="Yes">
<!-- Abort MP must trigger a runtime error from the MPLog run -->
<ARG ref="VALUE" DataType="FLOAT" RequireLiteral="Yes" />
Error(:id:10003,msg:"LogAbort":);
</M10003>
<M1000000 Value="1000000" Alias=";" AliasIsPattern="Yes" Inline="Yes">
<!-- PushPacket call -->
<ARG ref="VALUE" DataType="FLOAT" RequireLiteral="Yes" />
PushPacket(::);
</M1000000>
</MCodes>
<ParserData NestedComments="No" DefaultCaseSensitive="Yes" CommentsSpanLines="No"
ReadWholeFileBeforeParsing="No" ExpectMainProgStmts="Yes" UseFubTemplates="No" >
<TKG_END_OF_LINE IsPattern="No">\n</TKG_END_OF_LINE>
<TKG_OPEN_COMMENT>#</TKG_OPEN_COMMENT>
<TKG_NC_BLOCK_PREFIX IsPattern="Yes">N:[\s\d]</TKG_NC_BLOCK_PREFIX>
<TKG_QUOTED_STRING IsPattern="Yes">""|"[^"]+"</TKG_QUOTED_STRING>
<TKG_OPEN_LISTBRACKET>(</TKG_OPEN_LISTBRACKET>
<TKG_CLOSE_LISTBRACKET>)</TKG_CLOSE_LISTBRACKET>
<TKG_COMMA>,</TKG_COMMA>
<TKG_NUMBER IsPattern="Yes">\d+\.\d+|\d+\.|\.\d+</TKG_NUMBER>
<TKG_INTEGER IsPattern="Yes">\d+</TKG_INTEGER>
<TKG_NUMBER_EXP IsPattern="Yes">e:[\s\d\+\-\.]</TKG_NUMBER_EXP>
<TKG_ASSIGN_EQ>=</TKG_ASSIGN_EQ>
<TKG_ARITH_BINARY_MINUS>-</TKG_ARITH_BINARY_MINUS>
<TKG_M_CODE_PREFIX IsPattern="Yes">MP:\d</TKG_M_CODE_PREFIX>
</ParserData>
</Root>

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<DataObject Version="1.28.1" xmlns="http://br-automation.co.at/AS/DataObject">
<Files>
<File>gmciplsm.cnc</File>
</Files>
</DataObject>

View File

@@ -1,464 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<?ARNC0 Version="1.28.1"?>
<Root LangModule="ailgcode" Version="1.0">
<PrimTypes CaseSensitive="No" >
<!-- Specify what B&R datatypes correspond to the user-language defined types -->
<!-- If the user declares a variable in their program, and the corresponding PV is
of a different type, then a warning is issued -->
<REAL BRType="LREAL" />
<INT BRType="DINT" />
<CHAR BRType="USINT" />
<BOOL BRType="BOOL" />
<STRING BRType="STRING" />
<AXIS BRType="AXIS" />
<!-- Support for specifying B&R specific types -->
<BR_LREAL BRType="LREAL" />
<BR_REAL BRType="REAL" />
<BR_UDINT BRType="UDINT" />
<BR_DINT BRType="DINT" />
<BR_UINT BRType="UINT" />
<BR_INT BRType="INT" />
<BR_USINT BRType="USINT" />
<BR_SINT BRType="SINT" />
<BR_BOOL BRType="BOOL" />
<BR_TIME BRType="TIME" />
<BR_DATE_AND_TIME BRType="DATE_AND_TIME" />
</PrimTypes>
<Preprocess>
<!-- Support for AltLang1 system-global (NCK), and interpreter-global (CHAN) variable scope specifiers -->
<PP_RULE_NCK Search="NCK " Replace="nc_global " />
<PP_RULE_CHAN Search="CHAN " Replace="ip_global " />
<PP_RULE_FRAME_I Search="$FRAME_I" Replace="(1,0,0,0,1,0,0,0,1,0,0,0)"/>
<PP_RULE_FRAME_DEF Search="FRAME" Replace="REAL[12]"/>
</Preprocess>
<BuiltInProcs>
<cancel MinArgs="1" MaxArgs="*">
beginpathsynch
StopCyclicGroups(:${*}:);
endpathsynch
</cancel>
<RET MinArgs="0" MaxArgs="4" Eval="Early" Inline="Yes">
<!-- ReturnTo(: dest_string, num_lines_after_dest, num_return_levels, return_to_start :) ... all args are optional -->
<!-- Send M17 and return -->
#next_motion.Command = MPCMD_SET_M_FCT;
#next_motion.Data.I4_value = 17;
PushPacket(::);
ReturnTo(:${*}:);
</RET>
</BuiltInProcs>
<BuiltInFns>
<ABS NumArgs="1" Inline="Yes">Abs(:$[1]:)</ABS>
<SIN NumArgs="1" Inline="Yes">Sin(:$[1]:)</SIN>
<COS NumArgs="1" Inline="Yes">Cos(:$[1]:)</COS>
<TAN NumArgs="1" Inline="Yes">Tan(:$[1]:)</TAN>
<ASIN NumArgs="1" Inline="Yes">ASin(:$[1]:)</ASIN>
<ACOS NumArgs="1" Inline="Yes">ACos(:$[1]:)</ACOS>
<ATAN NumArgs="1" Inline="Yes">ATan(:$[1]:)</ATAN>
<ATAN2 NumArgs="2" Inline="Yes">ATan2(:$[1],$[2]:)</ATAN2>
<SQRT NumArgs="1" Inline="Yes">Sqrt(:$[1]:)</SQRT>
<POT NumArgs="1" Inline="Yes">(($[1])*($[1]))</POT>
<TRUNC NumArgs="1" Inline="Yes">Fix(:$[1]:)</TRUNC>
<ROUND NumArgs="1" Inline="Yes">Round(:$[1]:)</ROUND>
<LN NumArgs="1" Inline="Yes">Ln(:$[1]:)</LN>
<EXP NumArgs="1" Inline="Yes">Exp(:$[1]:)</EXP>
<MINVAL NumArgs="2" Inline="Yes">MinVal(:$[1], $[2]:)</MINVAL>
<MAXVAL NumArgs="2" Inline="Yes">MaxVal(:$[1], $[2]:)</MAXVAL>
<BOUND NumArgs="3" Inline="Yes">Bounds(:$[1], $[2], $[3]:)</BOUND>
<!-- Type conversion functions -->
<TO_BOOL NumArgs="1" Inline="Yes">ToBool(:$[1]:)</TO_BOOL>
<TO_INT NumArgs="1" Inline="Yes">ToInt(:$[1]:)</TO_INT>
<TO_CHAR NumArgs="1" Inline="Yes">ToChar(:$[1]:)</TO_CHAR>
<TO_REAL NumArgs="1" Inline="Yes">ToLReal(:$[1]:)</TO_REAL>
<TO_FLOAT NumArgs="1" Inline="Yes">ToFloat(:$[1]:)</TO_FLOAT>
<DEFINED NumArgs="1" Inline="Yes">Defined(:$[1]:)</DEFINED>
<!-- compare against undef value -->
<TIME_MS NumArgs="0">TimeMs(::)</TIME_MS>
<!-- Array functions now mixed in with regular functions -->
<!-- SET: just return the arg list as passed in and allow the assign instruction to assign the values to the array -->
<SET MinArgs="0" MaxArgs="*" Inline="Yes">${*}</SET>
<REP MinArgs="1" MaxArgs="2" Inline="Yes">ArrayRep(:${*}:)</REP>
<!-- Adr, Sizeof etc. -->
<ADR NumArgs="1" Inline="Yes">Adr(:\$[1]:)</ADR>
<SIZEOF NumArgs="1" Inline="Yes">Sizeof(:\$[1]:)</SIZEOF>
<!-- system information functions -->
<NUM_LOADED_FILES NumArgs="0">NumLoadedFiles(::)</NUM_LOADED_FILES>
<NUM_LOADED_PROG_FILES NumArgs="0">NumLoadedProgFiles(::)</NUM_LOADED_PROG_FILES>
<MEM_SIZE_IP_ALL NumArgs="0">MemSizeIpInstAll(::)</MEM_SIZE_IP_ALL>
<MEM_SIZE_IP_LIB NumArgs="0">MemSizeIpInst(::)</MEM_SIZE_IP_LIB>
<MEM_SIZE_SHLIB NumArgs="0">MemSizeShLib(::)</MEM_SIZE_SHLIB>
<MEM_SIZE_FILE MinArgs="0" MaxArgs="1">MemSizeFile(:$[1]:)</MEM_SIZE_FILE>
<MEM_SIZE_IP_STACK_SPACE NumArgs="0">MemStackSpace(::)</MEM_SIZE_IP_STACK_SPACE>
</BuiltInFns>
<AxesSpec>
<!-- additional axis name patterns -->
<AxisRef Mode="3">$\s*=\s*AC</AxisRef>
<AxisRef Mode="4">$\s*=\s*IC</AxisRef>
</AxesSpec>
<PVMacros> <!-- Syntax that looks like PV refs, but is actually mapped to a defined bit of AIL -->
<!-- Subprogram attributes "PROC myproc( ... ) SAVE SBLOF" etc, but also valid in N blocks -->
<SBLOF ArrayDims="0" Group="500" >
<CALL Inline="Yes">
#call->forbid_stepping = 1;
</CALL>
</SBLOF>
<SBLON ArrayDims="0" Group="500" >
<CALL Inline="Yes">
#call->forbid_stepping = 0;
</CALL>
</SBLON>
<DISPLOF ArrayDims="0" Group="500" >
<CALL Inline="Yes">
#call->forbid_display = 1;
</CALL>
</DISPLOF>
<DISPLON ArrayDims="0" Group="500" >
<CALL Inline="Yes">
#call->forbid_display = 0;
</CALL>
</DISPLON>
<RDISABLE ArrayDims="0" Group="500" >
<CALL Inline="Yes">
@#job->sa.keep_alive = 1;
@#thread.sa_keep_alive = 1;
</CALL>
</RDISABLE>
<P_SUBPAR Name="$P_SUBPAR" ArrayDims="1" Group="500" >
<!-- $P_SUBPAR[1] means: is the first subproc argument defined?: TRUE/FALSE -->
<GET>
return ArgNumIsDefined(:$[1]:);
</GET>
</P_SUBPAR>
<P_STACK Name="$P_STACK">
<GET>
return UserCallDepth(::);
</GET>
</P_STACK>
</PVMacros>
<FubTemplates>
<StdFubTemplate IsDefault="Yes" Inline="Yes" >
<!-- a precompiled FubTemplate instance is created for each defined FubType from the ICF file
o AIL code snippets (e.g. conditions) are text-substituted from the ICF content
before precompilation occurs
* This template function is called once for each FUB call in the user program
o The template starts the cyclic execution of the fub
o if the fub is configured as blocking, then the block is done in this template
-->
<Arg ref="FUBINST" DataType="FLOAT" /> <!-- VAR -->
<Arg ref="FUBERRLEV" DataType="FLOAT" />
<Arg ref="PATHSYNCH" DataType="FLOAT" />
<Arg ref="BLOCKING" DataType="FLOAT" />
<!-- string substitution from the ICF FUB entry is done on the following vars:
${ERRORCOND} ${BUSYCOND} ${FN}
For path synchronous FUB calls we use "beginpathsynch" which is different to "recordpathsynch"
beginpathsynch : saves the stack (with the args to this template fn.) without recording the path-data
recordpathsynch : records a new instruction stream with ip-synch vars replaced by their value
-->
#job->error_level = ${FUBERRLEV};
#job->enable = 1;
#job->group_id = -2;
#job->is_fub = 1;
if (${BLOCKING})
#job->mp_command = MPCMD_PATH_SYNC_EXEC_WAIT;
#job->is_blocking = 1;
endif
if (${PATHSYNCH})
beginpathsynch
endif
begincyclic
${FN}(:${FUBINST}:);
if (${ERRORCOND})
#job->eval_status = ERR_FUB_ERROR;
#job->terminate = 1;
elif (${BUSYCOND})
#job->eval_status = ERR_FUB_BUSY;
else
#job->eval_status = ERR_OK;
#job->terminate = 1;
endif
endcyclic
if (${BLOCKING})
WaitForCyclicJob(:#last_job_id:);
endif
endpathsynch
</StdFubTemplate>
</FubTemplates>
<SynchActions>
<SABlocks>
<!-- synch action code templates...
* Prepare a path-synch evaluation packet to:
(a) define the cyclic behaviour of this SA
o Content of "cyclic ... endcyclic" block
(b) if modal group specified, activate the SA immediately
o Set the cyclic.enable flag before the cyclic block start instr.
-->
<default IsDefault="Yes"> <!-- default SA is used when no temporal condition specified -->
<cyclic Inline="Yes"> <!-- essential to call INLINE as any ip-synch vars in the ACTIONS must be resolved to values -->
<Arg ref="ACTIONS" DataType="STATEMENTS" />
<Arg ref="ID" DataType="FLOAT" DefaultInt="-1" MinCount="0" MaxCount="1" />
#job->is_sa = 1;
#job->group_id = ${ID};
#job->is_blocking = 1;
if (#job->group_id &gt;= 0)
#job->enable = 1;
else
#mplist.trigger_nmsa = 1;
#mplist.delay_trigger_nmsa = 1;
endif
recordpathsynch
if (#job->group_id &gt;= 0)
StopCyclicGroups(:(:#job->group_id:):);
endif
begincyclic
${ACTIONS}
endcyclic
endpathsynch
</cyclic>
</default>
<whenever>
<cyclic Inline="Yes">
<Arg ref="COND" DataType="FLOAT" />
<Arg ref="ACTIONS" DataType="STATEMENTS" />
<Arg ref="ID" DataType="FLOAT" DefaultInt="-1" MinCount="0" MaxCount="1" />
#job->is_sa = 1;
#job->group_id = ${ID};
#job->is_blocking = 1;
if (#job->group_id &gt;= 0)
#job->enable = 1;
else
#mplist.trigger_nmsa = 1;
#mplist.delay_trigger_nmsa = 1;
endif
recordpathsynch
if (#job->group_id &gt;= 0)
StopCyclicGroups(:(:#job->group_id:):);
endif
begincyclic
@#job->sa.cond = ${COND};
if (@#job->sa.cond)
${ACTIONS}
endif
endcyclic
endpathsynch
</cyclic>
</whenever>
<when>
<cyclic Inline="Yes">
<Arg ref="COND" DataType="FLOAT" />
<Arg ref="ACTIONS" DataType="STATEMENTS" />
<Arg ref="ID" DataType="FLOAT" DefaultInt="-1" MinCount="0" MaxCount="1" />
#job->is_sa = 1;
#job->group_id = ${ID};
#job->is_blocking = 1;
if (#job->group_id &gt;= 0)
#job->enable = 1;
else
#mplist.trigger_nmsa = 1;
#mplist.delay_trigger_nmsa = 1;
endif
recordpathsynch
if (#job->group_id &gt;= 0)
StopCyclicGroups(:(:#job->group_id:):);
endif
begincyclic
@#job->sa.cond = ${COND};
if (@#job->sa.cond)
${ACTIONS}
@#job->terminate = 1;
endif
endcyclic
endpathsynch
</cyclic>
</when>
<every>
<cyclic Inline="Yes">
<Arg ref="COND" DataType="FLOAT" />
<Arg ref="ACTIONS" DataType="STATEMENTS" />
<Arg ref="ID" DataType="FLOAT" DefaultInt="-1" MinCount="0" MaxCount="1" />
#job->is_sa = 1;
#job->group_id = ${ID};
#job->is_blocking = 1;
if (#job->group_id &gt;= 0)
#job->enable = 1;
else
#mplist.trigger_nmsa = 1;
#mplist.delay_trigger_nmsa = 1;
endif
recordpathsynch
if (#job->group_id &gt;= 0)
StopCyclicGroups(:(:#job->group_id:):);
endif
begincyclic
@#job->sa.cond_prev = @#job->sa.cond;
@#job->sa.cond = ${COND};
if (!@#job->sa.cond_prev &amp;&amp; @#job->sa.cond)
${ACTIONS}
endif
endcyclic
endpathsynch
</cyclic>
</every>
<from>
<cyclic Inline="Yes">
<Arg ref="COND" DataType="FLOAT" />
<Arg ref="ACTIONS" DataType="STATEMENTS" />
<Arg ref="ID" DataType="FLOAT" DefaultInt="-1" MinCount="0" MaxCount="1" />
#job->is_sa = 1;
#job->group_id = ${ID};
#job->is_blocking = 1;
if (#job->group_id &gt;= 0)
#job->enable = 1;
else
#mplist.trigger_nmsa = 1;
#mplist.delay_trigger_nmsa = 1;
endif
recordpathsynch
if (#job->group_id &gt;= 0)
StopCyclicGroups(:(:#job->group_id:):);
endif
begincyclic
@#job->sa.cond = @#job->sa.cond || ${COND};
if (@#job->sa.cond)
${ACTIONS}
endif
endcyclic
endpathsynch
</cyclic>
</from>
</SABlocks>
<NonModalActivation>
<!-- Start & Stop commands are executed path synchronous immediately before and after a triggering block
(a triggering block is the first MPList that is dispatched with the following vars set:
#thread.trigger_nmsa = 1;
#thread.delay_nmsa_trigger = 0;
Note: modal SA usage does not use these commands (start is automatic and they run until explicitly stopped)
-->
<Start>
@#thread.sa_last_keep_alive = 1;
ActivateCyclicGroup(:-1:);
</Start>
<!-- TryStop... will stop the cyclic jobs unless they have set keep_alive in last complete eval cycle -->
<Stop>
WaitStopCyclicGroups(:(:-1:):);
</Stop>
</NonModalActivation>
</SynchActions>
<ParserData NestedComments="Yes" DefaultCaseSensitive="No" CommentsSpanLines="No"
SubDeclsLocalToFile="Yes" ProgDeclsLocalToFile="Yes" AllowUnprefixedFileCalls="Yes" AllowUnprefixedSubCalls="Yes"
LocalVarScopeForMainProg="No" FileScopeVarsVisibleInSub="Yes" MainPrgReturnAtNextMainPrgHdr="Yes"
AllowVarReadBeforeAssign="No" AllowArrayRefWithoutIndex="Yes"
AllowBuiltInProcCallWithoutBrackets="Yes" AllowBuiltInFnCallWithoutBrackets="No" AllowPLCFnCallWithoutBrackets="No" >
<!--Patterns are specified as Perl regular expressions-->
<!--Token Names should not be changed-->
<!--Tokens without a Pattern or without TOKEN entry are not in use in this dialect-->
<!--Restricted means this token can only match on a FollowedBy request-->
<TKG_END_OF_LINE IsPattern="No">\n</TKG_END_OF_LINE>
<TKG_OPEN_COMMENT>;</TKG_OPEN_COMMENT>
<TKG_CLOSE_COMMENT />
<TKG_TRUE IsPattern="Yes">TRUE:\W</TKG_TRUE>
<TKG_FALSE IsPattern="Yes">FALSE:\W</TKG_FALSE>
<TKG_PAREVAL_MODAL_ID FileXLInvalid="Yes" IsPattern="Yes">ID:[\s=]</TKG_PAREVAL_MODAL_ID>
<TKG_MACRO_DEFINE IsPattern="Yes" FollowedBy="TKG_MACRO_NAME">define\s</TKG_MACRO_DEFINE>
<TKG_MACRO_AS IsPattern="Yes" FollowedBy="TKG_MACRO_TEXT">as\s</TKG_MACRO_AS>
<TKG_PROG_START IsPattern="Yes" CaseSensitive="Yes" FollowedBy="TKG_PROG_NAME">%:[^L]</TKG_PROG_START>
<TKG_PROG_NAME IsPattern="Yes" Restricted="Yes">[\w\d]+</TKG_PROG_NAME>
<TKG_SET_MODAL_SUB FileXLInvalid="Yes" IsPattern="Yes">MCALL:\W</TKG_SET_MODAL_SUB>
<TKG_INDIR_PROG_CALL IsPattern="Yes">CALL:\s</TKG_INDIR_PROG_CALL>
<TKG_INDIR_PROG_BLOCK FileXLInvalid="Yes" IsPattern="Yes">BLOCK:\s</TKG_INDIR_PROG_BLOCK>
<TKG_PROC_START FileXLInvalid="Yes" IsPattern="Yes" FollowedBy="TKG_PROC_NAME">PROC\s</TKG_PROC_START>
<TKG_PROC_NAME IsPattern="Yes" Restricted="Yes">\w[\w\d]+</TKG_PROC_NAME>
<TKG_ARG_PASSBYREF IsPattern="Yes">VAR\s</TKG_ARG_PASSBYREF>
<!-- NCIP 04m new definitions -->
<TKG_SUBPROG_PROTO IsPattern="Yes" FollowedBy="TKG_SUBPROG_NAME">INTERN\s</TKG_SUBPROG_PROTO>
<TKG_SUBPROG_START FileXLInvalid="Yes" IsPattern="Yes" CaseSensitive="Yes" FollowedBy="TKG_SUBPROG_NAME">SUB\s|%:L</TKG_SUBPROG_START>
<TKG_SUBPROG_NAME IsPattern="Yes" Restricted="Yes">\w[\w\d]+</TKG_SUBPROG_NAME>
<!-- END 04m new definitions -->
<!-- subprog calls done without prefix -->
<TKG_EXTERN IsPattern="Yes" FollowedBy="TKG_PROG_FILE_NAME">EXTERN\s</TKG_EXTERN>
<TKG_PROG_FILE_NAME IsPattern="Yes" Restricted="Yes">[\^#&amp;@']?[\w\d\.]+</TKG_PROG_FILE_NAME>
<!-- AltLang1 subprog/main-prog calls are done without prefix -->
<TKG_PV_DECL IsPattern="Yes">def\s</TKG_PV_DECL>
<TKG_PV_UNDECL IsPattern="Yes">~def\s</TKG_PV_UNDECL>
<TKG_VAR_RETAIN IsPattern="Yes">retain\s</TKG_VAR_RETAIN>
<TKG_VARSCOPE_IP_LOCAL IsPattern="Yes">local\s</TKG_VARSCOPE_IP_LOCAL>
<TKG_VARSCOPE_IP_GLOBAL IsPattern="Yes">ip_global:[\s\n]</TKG_VARSCOPE_IP_GLOBAL>
<TKG_VARSCOPE_NC_GLOBAL IsPattern="Yes">nc_global:[\s\n]</TKG_VARSCOPE_NC_GLOBAL>
<TKG_VARSCOPE_PLC_GLOBAL IsPattern="Yes">plc_global:[\s\n]</TKG_VARSCOPE_PLC_GLOBAL>
<TKG_VARSYNCH_IP IsPattern="Yes">ip_synch\s</TKG_VARSYNCH_IP>
<TKG_VARSYNCH_PATH IsPattern="Yes">path_synch\s</TKG_VARSYNCH_PATH>
<TKG_PAREVAL_DO FileXLInvalid="Yes" IsPattern="Yes">do\s</TKG_PAREVAL_DO>
<TKG_GOTOF FileXLInvalid="Yes" IsPattern="Yes" OptFollowedBy="TKG_GOTO_DEST">gotof:\s</TKG_GOTOF>
<TKG_GOTOB FileXLInvalid="Yes" IsPattern="Yes" OptFollowedBy="TKG_GOTO_DEST">gotob:\s</TKG_GOTOB>
<TKG_GOTO FileXLInvalid="Yes" IsPattern="Yes" OptFollowedBy="TKG_GOTO_DEST">goto:\s</TKG_GOTO>
<TKG_GOTO_DEST IsPattern="Yes" Restricted="Yes">\w[\w\d]*</TKG_GOTO_DEST>
<!-- can only use * quantifier in TKG_GOTO_DEST because of Restricted="Yes" -->
<TKG_ARITH_BINARY_INT_DIVIDE IsPattern="Yes">DIV:[\s(]</TKG_ARITH_BINARY_INT_DIVIDE>
<TKG_ARITH_BINARY_MODULO IsPattern="Yes">MOD:[\s(]</TKG_ARITH_BINARY_MODULO>
<TKG_FOR FileXLInvalid="Yes" IsPattern="Yes">FOR:\s</TKG_FOR>
<TKG_ENDFOR FileXLInvalid="Yes" IsPattern="Yes">ENDFOR:[\s\n]</TKG_ENDFOR>
<TKG_FORTO IsPattern="Yes">TO:\W</TKG_FORTO>
<TKG_DO FileXLInvalid="Yes" IsPattern="Yes">repeat:[\s\n]</TKG_DO>
<TKG_ENDDO_UNTIL FileXLInvalid="Yes" IsPattern="Yes">until:[\s(]</TKG_ENDDO_UNTIL>
<TKG_LOGICAL_UNARY_NOT IsPattern="Yes">not:\W</TKG_LOGICAL_UNARY_NOT>
<TKG_NC_BLOCK_PREFIX IsPattern="Yes">N:[\s\d]</TKG_NC_BLOCK_PREFIX>
<!-- AltLang1 uses special logical operators with higher precedence (_HP_) than comparison operators -->
<TKG_LOGICAL_HP_BINARY_AND IsPattern="Yes">and:\W</TKG_LOGICAL_HP_BINARY_AND>
<TKG_LOGICAL_HP_BINARY_OR IsPattern="Yes">or:\W</TKG_LOGICAL_HP_BINARY_OR>
<TKG_LOGICAL_HP_BINARY_XOR IsPattern="Yes">xor:\W</TKG_LOGICAL_HP_BINARY_XOR>
<TKG_BITWISE_BINARY_AND IsPattern="Yes">b_and:\W</TKG_BITWISE_BINARY_AND>
<TKG_BITWISE_BINARY_OR IsPattern="Yes">b_or:\W</TKG_BITWISE_BINARY_OR>
<TKG_BITWISE_BINARY_XOR IsPattern="Yes">b_xor:\W</TKG_BITWISE_BINARY_XOR>
<TKG_BITWISE_UNARY_COMPLEMENT IsPattern="Yes">b_not:\W</TKG_BITWISE_UNARY_COMPLEMENT>
<TKG_IF FileXLInvalid="Yes" IsPattern="Yes">if:\W</TKG_IF>
<TKG_BLOCK_ELSE FileXLInvalid="Yes" IsPattern="Yes">else:\W</TKG_BLOCK_ELSE>
<TKG_BLOCK_ENDIF FileXLInvalid="Yes" IsPattern="Yes">endif:\W</TKG_BLOCK_ENDIF>
<TKG_WHILE FileXLInvalid="Yes" IsPattern="Yes">while:\W</TKG_WHILE>
<TKG_ENDWHILE FileXLInvalid="Yes">endwhile</TKG_ENDWHILE>
<TKG_FOREVER FileXLInvalid="Yes" IsPattern="Yes">loop:\W</TKG_FOREVER>
<TKG_ENDFOREVER FileXLInvalid="Yes" IsPattern="Yes">endloop:\W</TKG_ENDFOREVER>
<TKG_QUOTED_STRING IsPattern="Yes">""|"[^"]+"</TKG_QUOTED_STRING>
<TKG_LABEL_DEF IsPattern="Yes" FollowedBy="TKG_LABEL_SUFFIX">\w:\:|\w[\w\d]+:\:</TKG_LABEL_DEF>
<TKG_LABEL_SUFFIX Restricted="Yes">:</TKG_LABEL_SUFFIX>
<TKG_MACRO_TEXT Restricted="Yes" IsPattern="Yes">[^;\n]+</TKG_MACRO_TEXT>
<TKG_MACRO_NAME Restricted="Yes" IsPattern="Yes">[$\w][$\w\d(]+</TKG_MACRO_NAME>
<TKG_PRIM_TYPE IsPattern="Yes" /> <!-- FollowedBy="TKG_PV_DECL_REF" real:\s|int:\s|bool:\s|char:\s|axis:\s|frame:\s|br_udint:\s|br_dint:\s|br_uint:\s|br_int:\s|br_usint:\s|br_sint:\s|br_real:\s|br_lreal:\s|br_bool:\s|br_time:\s|br_date_and_time:\s</TKG_PRIM_TYPE> -->
<TKG_OPEN_BRACKET>(</TKG_OPEN_BRACKET>
<TKG_CLOSE_BRACKET>)</TKG_CLOSE_BRACKET>
<TKG_OPEN_INDEXBRACKET>[</TKG_OPEN_INDEXBRACKET>
<TKG_CLOSE_INDEXBRACKET>]</TKG_CLOSE_INDEXBRACKET>
<TKG_COMMA>,</TKG_COMMA>
<TKG_DOT IsPattern="Yes" FollowedBy="TKG_STRUCT_MEMBER_REF">\.:\w</TKG_DOT>
<TKG_STRUCT_MEMBER_REF IsPattern="Yes" Restricted="Yes">\w|\w[\w\d]+</TKG_STRUCT_MEMBER_REF>
<TKG_PARAM_PREFIX IsPattern="Yes">R:[\[\d]|$[RP]:[\[\d]|M[WLF]:[\[\d]|EX[WLBF]:[\[\d]</TKG_PARAM_PREFIX>
<TKG_NUMBER IsPattern="Yes">\d+\.\d+|\d+\.|\.\d+</TKG_NUMBER>
<TKG_INTEGER IsPattern="Yes">\d+</TKG_INTEGER>
<TKG_NUMBER_EXP IsPattern="Yes">EX:[\s\d\+\-\.]</TKG_NUMBER_EXP>
<TKG_STRING_CONCAT>&lt;&lt;</TKG_STRING_CONCAT>
<TKG_COMP_BINARY_GREATER_THAN_OR_EQ>&gt;=</TKG_COMP_BINARY_GREATER_THAN_OR_EQ>
<TKG_COMP_BINARY_LESS_THAN_OR_EQ>&lt;=</TKG_COMP_BINARY_LESS_THAN_OR_EQ>
<TKG_COMP_BINARY_EQUAL_TO>==</TKG_COMP_BINARY_EQUAL_TO>
<TKG_COMP_BINARY_NOT_EQUAL_TO>&lt;&gt;</TKG_COMP_BINARY_NOT_EQUAL_TO>
<TKG_COMP_BINARY_GREATER_THAN>&gt;</TKG_COMP_BINARY_GREATER_THAN>
<TKG_COMP_BINARY_LESS_THAN>&lt;</TKG_COMP_BINARY_LESS_THAN>
<TKG_ASSIGN_INCR IsPattern="Yes">=ic:(</TKG_ASSIGN_INCR>
<TKG_ASSIGN_EQ>=</TKG_ASSIGN_EQ>
<TKG_ARITH_BINARY_PLUS>+</TKG_ARITH_BINARY_PLUS>
<TKG_ARITH_BINARY_MINUS>-</TKG_ARITH_BINARY_MINUS>
<TKG_ARITH_BINARY_MULTIPLY>*</TKG_ARITH_BINARY_MULTIPLY>
<TKG_ARITH_BINARY_DIVIDE>/</TKG_ARITH_BINARY_DIVIDE>
<TKG_SUBCALL_REPEAT_PREFIX IsPattern="Yes" FollowedBy="TKG_INTEGER">P:[\s\d]</TKG_SUBCALL_REPEAT_PREFIX>
<TKG_PV_DECL_REF IsPattern="Yes" Restricted="Yes">\w[\w\d\.\:\*]*</TKG_PV_DECL_REF>
<TKG_G_CODE_PREFIX IsPattern="Yes">G:[\s\d]</TKG_G_CODE_PREFIX>
<TKG_M_CODE_PREFIX IsPattern="Yes">M:[\s\d]</TKG_M_CODE_PREFIX>
<TKG_FUB_DECL IsPattern="Yes">fub\s</TKG_FUB_DECL>
<TKG_FUB_ERR_LEV_1 IsPattern="Yes">error_level_1\s</TKG_FUB_ERR_LEV_1>
<TKG_FUB_ERR_LEV_2 IsPattern="Yes">error_level_2\s</TKG_FUB_ERR_LEV_2>
<TKG_FUB_ERR_LEV_3 IsPattern="Yes">error_level_3\s</TKG_FUB_ERR_LEV_3>
<TKG_FUB_ERR_LEV_4 IsPattern="Yes">error_level_4\s</TKG_FUB_ERR_LEV_4>
<TKG_FUB_BLOCKING IsPattern="Yes">blocking\s</TKG_FUB_BLOCKING>
<TKG_FUB_NON_BLOCKING IsPattern="Yes">non_blocking\s</TKG_FUB_NON_BLOCKING>
<!-- TKG_WORD Must be the final token in the list -->
<TKG_WORD IsPattern="Yes">\w|\w[\w\d\.]+</TKG_WORD>
</ParserData>
</Root>

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<DataObject Version="1.28.1" xmlns="http://br-automation.co.at/AS/DataObject">
<Files>
<File>gmcipsys.cnc</File>
</Files>
</DataObject>

View File

@@ -1,104 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<?ARNC0 Version="1.28.1"?>
<LANGS defaultLangId="1">
<!-- Command queue configuration (global setting - applies to all langauge interpreters) -->
<CMDQUEUE BufferSize="15" />
<!-- Memory configuration:
<MEM
LimitMB="<max memory usage>" (if not specified, or set to "0", then all available system mem can be used)
LimitPercent="<max memory usage>%" (percentage of free system memory (at startup) to limit the interpreter to)
ReserveMB="<reserve memory size>" (if not specified then a small default amount of memory is reserved)
-->
<MEM ReserveMB="5" LimitPercent="80%" />
<!-- Execution configuration:
<EXEC
InstrBurstBG="<number of opcodes>" How many opcodes to execute in one burst
CycleBurstBG="<max cycle burst length>" Limited number of consecutive execution cycles allowed for interpreter (0=off)
Stack="<size in bytes>" Main execution stack size
MinorStack="<size in bytes>" Default size for minor execution thread stacks, or explicitly:
CStack="<cyclic thread stack size>"
PStack="<path-synch thread stack size>"
EStack="<eval thread stack size>"
-->
<EXEC InstrBurstBG="50" CycleBurstBG="0" Stack="16384" MinorStack="2048" EStack="1024" />
<!-- Loader configuration: (how many lines to read and parse at once)
<LOAD
ReadLineBurstMax="<num_lines>" (Number of lines to read from the input buffer at once when loader has full CPU - e.g. during PRELOAD)
ReadLineBurstMin="<num_lines>" (Number of lines to read from the input buffer at once when loader is sharing CPU with execution)
ParseLineBurstMax="<num_lines>" (Number of lines to parse at once when loader has full CPU - e.g. during PRELOAD)
ParseLineBurstMin="<num_lines>" (Number of lines to parse at once when loader is sharing CPU with execution)
-->
<LOAD ReadLineBurstMax="100" ReadLineBurstMin="20"
ParseLineBurstMax="10" ParseLineBurstMin="2" />
<!-- quiet startup: disable info messages (applied after loading this config file - all messages enabled until then) -->
<DISABLE_MSG>
15238 <!-- INFO: "Interpreter lib initialised" -->
15336 <!-- INFO: "Loading interpreter config module" -->
15337 <!-- INFO: "Loading interpreter config file" -->
15666 <!-- INFO: "Precompiling language templates" -->
<!-- 15240 INFO: "Program loaded" (from LANG_INCLUDE) -->
<!-- 15778 WARN: "Logging file device does not exist" -->
15784 <!-- INFO: "Log file scan complete ...file counts..." -->
</DISABLE_MSG>
<!-- very quiet startup: disable final interpreter-init-ok message -->
<DISABLE_MSG>
15740 <!-- INFO: "Interpreter initialized" -->
</DISABLE_MSG>
<!-- Configure languages... -->
<LANG langId="1" langName="B&amp;R GCode" langModule="ailgcode">
<LANGCONFIG Name="gmciplbr" />
<LANGCONFIG Name="gmcipcbr" />
<LANGCONFIG Name="gmcipubr" />
<FILEEXT Name=".cnc" />
<FILEEXT Name=".prg" />
<MAINSEARCHPATH Name="$" FileDevice="CNC_PrgDir" />
<MAINSEARCHPATH Name="$" DataObject="Yes" />
<INCLUDEPATH Name="$" FileDevice="CNC_PrgDir" />
<INCLUDEPATH Name="$" DataObject="Yes" />
</LANG>
<LANG langId="2" langName="Alternative Language 1 GCode" langModule="ailgcode">
<LANGCONFIG Name="gmciplsm" />
<LANGCONFIG Name="gmcipcbr" />
<LANGCONFIG Name="gmcipcsm" />
<LANGCONFIG Name="gmcipusm" />
<!-- file extensions that identify this type of file -->
<FILEPREFIX>_N_</FILEPREFIX> <!-- used only to help get the program name from the filename -->
<FILEEXT>.MPF</FILEEXT>
<FILEEXT>_MPF</FILEEXT>
<FILEEXT>.SPF</FILEEXT>
<FILEEXT>_SPF</FILEEXT>
<!-- searchPath is used to find include files, and start-program file -->
<MAINSEARCHPATH FileDevice="CNC_PrgDir">\$</MAINSEARCHPATH>
<MAINSEARCHPATH FileDevice="CNC_PrgDir">\_N_MPF_DIR\$</MAINSEARCHPATH>
<MAINSEARCHPATH FileDevice="CNC_PrgDir">\_N_SPF_DIR\$</MAINSEARCHPATH>
<MAINSEARCHPATH DataObject="1">$</MAINSEARCHPATH>
<!-- standard include path -->
<INCLUDEPATH FileDevice="CNC_PrgDir">\$</INCLUDEPATH>
<INCLUDEPATH FileDevice="CNC_PrgDir">\_N_SPF_DIR\$</INCLUDEPATH>
<INCLUDEPATH FileDevice="CNC_PrgDir">\_N_MPF_DIR\$</INCLUDEPATH>
<INCLUDEPATH DataObject="1">$</INCLUDEPATH>
</LANG>
<LANG langId="3" langName="IEC-ST" langModule="ailgcode">
<LANGCONFIG Name="gmcipiec" />
<!-- initial IEC configuration only supports reading type definition files -->
<FILEEXT Name=".typ" />
<MAINSEARCHPATH Name="$" FileDevice="TypDir" DataObject="No" />
<INCLUDEPATH Name="$" FileDevice="TypDir" DataObject="No" />
</LANG>
<!-- MPLogging playback language config entry
Note: here it is configured to only read NC channel 'A' log output file device,
if necessary add MAINSEARCHPATH and INCLUDEPATH entries for other channels
Also note: desination file device for saving log files is in gmcipcfg: <MPLOG FileDevice=".."/>
<LANG langId="5" langName="MPLog" langModule="ailgcode">
<LANGCONFIG Name="gmciplog" />
<FILEEXT Name=".mpl" />
<MAINSEARCHPATH Name="\$" FileDevice="mplogA" DataObject="No" />
<INCLUDEPATH Name="\$" FileDevice="mplogA" DataObject="No" />
</LANG>
-->
</LANGS>

View File

@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<Package Version="1.28.1" xmlns="http://br-automation.co.at/AS/Package">
<Objects>
<Object Type="DataObject" Language="Cnc">gmcipvar</Object>
<Object Type="DataObject" Language="Cnc">gmcipfun</Object>
<Object Type="DataObject" Language="Cnc">gmcipfub</Object>
<Object Type="DataObject" Language="Cnc">gmcipubr</Object>
<Object Type="DataObject" Language="Cnc">gmcipusm</Object>
</Objects>
</Package>

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<DataObject Version="1.28.1" xmlns="http://br-automation.co.at/AS/DataObject">
<Files>
<File>gmcipfub.cnc</File>
</Files>
</DataObject>

View File

@@ -1,22 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<FUBS>
<!--
Declare Function Blocks ("FUBs") in this section, e.g:
<FUB Name="AsArLogWrite" OutType="BuR" />
<FUB Name="MC_MoveAbsolute" OutType="PLCOpen" />
<FUB Name="MyFub" ExecuteInSimulation="Yes" >
<ERROR condition="$status == -1"/>
<BUSY condition="$status == 1"/>
</FUB>
-->
</FUBS>
</CONFIG>

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<DataObject Version="1.28.1" xmlns="http://br-automation.co.at/AS/DataObject">
<Files>
<File>gmcipfun.cnc</File>
</Files>
</DataObject>

View File

@@ -1,31 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<FUNCTIONS>
<!--
C function prototypes to allow functions to be called directly from GCode program (or AIL template code)
Examples:
Example 1: RTC_gettime(ptr) from standard library: "SYS_LIB":
<FUNC Name="RTC_gettime" RetType="UINT" ExecuteInSimulation="No">
<ARG Name="RTCtime_struct" Type="UDINT" />
</FUNC>
Example 2: ncaction(ncobj,subject,action) from standard library: "Ncglobal":
<FUNC Name="ncaction" RetType="UINT" ExecuteInSimulation="Yes">
<ARG Name="nc_object" Type="UDINT" />
<ARG Name="subject" Type="UINT" />
<ARG Name="action" Type="UINT" />
</FUNC>
Example 3: User defined library function:
<FUNC Name="myFun">
<ARG Name="mode" Type="USINT" />
<ARG Name="value" Type="UDINT" ref="Yes" />
</FUNC>
-->
</FUNCTIONS>
</CONFIG>

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<DataObject Version="1.28.1" xmlns="http://br-automation.co.at/AS/DataObject">
<Files>
<File>gmcipubr.cnc</File>
</Files>
</DataObject>

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Root LangModule="ailgcode" Version="1.0">
<!--
Additional definitions for the B&R G-code language
-->
</Root>

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<DataObject Version="1.28.1" xmlns="http://br-automation.co.at/AS/DataObject">
<Files>
<File>gmcipusm.cnc</File>
</Files>
</DataObject>

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<Root LangModule="ailgcode" Version="1.0">
<!--
Additional definitions for the Alternative G-code language (AltLang1)
-->
</Root>

View File

@@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<DataObject Version="1.28.1" xmlns="http://br-automation.co.at/AS/DataObject">
<Files>
<File>gmcipvar.cnc</File>
</Files>
</DataObject>

View File

@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<VARIABLES>
<!--
Declarations of PLC-Variables to be available in the G-code programs (without need to redeclare)
Example 1: <PV Type="REAL">myPlcVar</PV>
Example 2: <PV Alias="my2ndPlcVar" Synch="path_synch" Type="UDINT" AryDim1="10">task:structure.ten_udints</PV>
Interpreter-internal variables to be available in every G-Code program (without need to redeclare)
Example 3: (PLC-scope - shared between interpreters):
<VAR Scope="nc_global" Type="DINT">ncg_int</VAR>
Example 4: (Channel-scope, shared between programs within a channel):
<VAR Scope="ip_global" Synch="path_synch" Type="LREAL" AryDim1="5" AryDim2="3">my2dDoubleArray</VAR>
-->
</VARIABLES>
</CONFIG>

View File

@@ -1,4 +1,5 @@
VAR
guiTemperatureCPU : UINT := 0;
gBath7Heat : BOOL := FALSE;
gBath11Heat : BOOL := FALSE;
gBath17Heat : BOOL := FALSE;

View File

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<Library Version="2.28.2" Description="Smart Device Controller" xmlns="http://br-automation.co.at/AS/Library">
<Files>
<File>acp10sdc.var</File>
<File>acp10sdc.typ</File>
</Files>
<Dependencies>
<Dependency ObjectName="Acp10man" FromVersion="2.28.2" ToVersion="2.28.2" />
</Dependencies>
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<Library Version="2.28.2" Description="Smart Device Controller" xmlns="http://br-automation.co.at/AS/Library">
<Files>
<File>acp10sdc.var</File>
<File>acp10sdc.typ</File>
</Files>
<Dependencies>
<Dependency ObjectName="Acp10man" FromVersion="2.28.2" ToVersion="2.28.2" />
</Dependencies>
</Library>

View File

@@ -1,142 +1,142 @@
/* Automation Studio generated header file */
/* Do not edit ! */
#ifndef _ACP10SDC_
#define _ACP10SDC_
#include <bur/plctypes.h>
#ifndef _IEC_CONST
#define _IEC_CONST _WEAK const
#endif
/* Constants */
#ifdef _REPLACE_CONST
#define ncSDC_ENC16 100U
#define ncSDC_ENC32 101U
#define ncSDC_DRVSM16 110U
#define ncSDC_DRVSM32 111U
#define ncSDC_DRVSM16_CTRL 112U
#define ncSDC_DRVSM32_CTRL 113U
#define ncSDC_DRVSERVO16 120U
#define ncSDC_TRIG 130U
#define ncSDC_TRIGDIGin 131U
#define ncSDC_DIDO 140U
#else
_IEC_CONST unsigned short ncSDC_ENC16 = 100U;
_IEC_CONST unsigned short ncSDC_ENC32 = 101U;
_IEC_CONST unsigned short ncSDC_DRVSM16 = 110U;
_IEC_CONST unsigned short ncSDC_DRVSM32 = 111U;
_IEC_CONST unsigned short ncSDC_DRVSM16_CTRL = 112U;
_IEC_CONST unsigned short ncSDC_DRVSM32_CTRL = 113U;
_IEC_CONST unsigned short ncSDC_DRVSERVO16 = 120U;
_IEC_CONST unsigned short ncSDC_TRIG = 130U;
_IEC_CONST unsigned short ncSDC_TRIGDIGin = 131U;
_IEC_CONST unsigned short ncSDC_DIDO = 140U;
#endif
/* Variables */
/* Datatypes and datatypes of function blocks */
typedef struct SdcHwCfg_typ
{ unsigned short EncIf1_Typ;
unsigned short EncIf2_Typ;
unsigned short DrvIf_Typ;
unsigned short TrigIf1_Typ;
unsigned short TrigIf2_Typ;
unsigned short DiDoIf_Typ;
unsigned char EncIf1_Name[34];
unsigned char EncIf2_Name[34];
unsigned char DrvIf_Name[34];
unsigned char TrigIf1_Name[34];
unsigned char TrigIf2_Name[34];
unsigned char DiDoIf_Name[34];
unsigned long NOT_USE[10];
} SdcHwCfg_typ;
typedef struct SdcEncIf16_typ
{ signed char iLifeCnt;
plcbit iEncOK;
signed short iActTime;
signed short iActPos;
signed short iRefPulsePos;
signed char iRefPulseCnt;
plcbit reserve[3];
} SdcEncIf16_typ;
typedef struct SdcEncIf32_typ
{ signed char iLifeCnt;
plcbit iEncOK;
signed short iActTime;
signed long iActPos;
signed long iRefPulsePos;
signed char iRefPulseCnt;
plcbit reserve[3];
} SdcEncIf32_typ;
typedef struct SdcDrvIf16_typ
{ signed char iLifeCnt;
plcbit iDrvOK;
signed short oSetTime;
signed short oSetPos;
plcbit oBoostCurrent;
plcbit oStandStillCurrent;
plcbit iStatusEnable;
plcbit oBrake;
plcbit reserve[2];
} SdcDrvIf16_typ;
typedef struct SdcDrvIf32_typ
{ signed char iLifeCnt;
plcbit iDrvOK;
signed short oSetTime;
signed long oSetPos;
plcbit oBoostCurrent;
plcbit oStandStillCurrent;
plcbit iStatusEnable;
plcbit oBrake;
} SdcDrvIf32_typ;
typedef struct SdcTrigIf_typ
{ signed char iLifeCnt;
signed char iTriggerCntRise;
signed char iTriggerCntFall;
plcbit iTriggerInput;
signed short iTriggerTimeRise;
signed short iTriggerTimeFall;
} SdcTrigIf_typ;
typedef struct SdcTrigIfDIGin_typ
{ signed char iLifeCnt;
plcbit iTriggerInput;
plcbit reserve[2];
} SdcTrigIfDIGin_typ;
typedef struct SdcDiDoIf_typ
{ signed char iLifeCntDriveReady;
signed char iLifeCntPosHwEnd;
signed char iLifeCntNegHwEnd;
signed char iLifeCntReference;
signed char iLifeCntDriveEnable;
plcbit iDriveReady;
plcbit iPosHwEnd;
plcbit iNegHwEnd;
plcbit iReference;
plcbit oDriveEnable;
plcbit reserve[2];
} SdcDiDoIf_typ;
/* Prototyping of functions and function blocks */
__asm__(".section \".plc\"");
__asm__(".previous");
#endif /* _ACP10SDC_ */
/* Automation Studio generated header file */
/* Do not edit ! */
#ifndef _ACP10SDC_
#define _ACP10SDC_
#include <bur/plctypes.h>
#ifndef _IEC_CONST
#define _IEC_CONST _WEAK const
#endif
/* Constants */
#ifdef _REPLACE_CONST
#define ncSDC_ENC16 100U
#define ncSDC_ENC32 101U
#define ncSDC_DRVSM16 110U
#define ncSDC_DRVSM32 111U
#define ncSDC_DRVSM16_CTRL 112U
#define ncSDC_DRVSM32_CTRL 113U
#define ncSDC_DRVSERVO16 120U
#define ncSDC_TRIG 130U
#define ncSDC_TRIGDIGin 131U
#define ncSDC_DIDO 140U
#else
_IEC_CONST unsigned short ncSDC_ENC16 = 100U;
_IEC_CONST unsigned short ncSDC_ENC32 = 101U;
_IEC_CONST unsigned short ncSDC_DRVSM16 = 110U;
_IEC_CONST unsigned short ncSDC_DRVSM32 = 111U;
_IEC_CONST unsigned short ncSDC_DRVSM16_CTRL = 112U;
_IEC_CONST unsigned short ncSDC_DRVSM32_CTRL = 113U;
_IEC_CONST unsigned short ncSDC_DRVSERVO16 = 120U;
_IEC_CONST unsigned short ncSDC_TRIG = 130U;
_IEC_CONST unsigned short ncSDC_TRIGDIGin = 131U;
_IEC_CONST unsigned short ncSDC_DIDO = 140U;
#endif
/* Variables */
/* Datatypes and datatypes of function blocks */
typedef struct SdcHwCfg_typ
{ unsigned short EncIf1_Typ;
unsigned short EncIf2_Typ;
unsigned short DrvIf_Typ;
unsigned short TrigIf1_Typ;
unsigned short TrigIf2_Typ;
unsigned short DiDoIf_Typ;
unsigned char EncIf1_Name[34];
unsigned char EncIf2_Name[34];
unsigned char DrvIf_Name[34];
unsigned char TrigIf1_Name[34];
unsigned char TrigIf2_Name[34];
unsigned char DiDoIf_Name[34];
unsigned long NOT_USE[10];
} SdcHwCfg_typ;
typedef struct SdcEncIf16_typ
{ signed char iLifeCnt;
plcbit iEncOK;
signed short iActTime;
signed short iActPos;
signed short iRefPulsePos;
signed char iRefPulseCnt;
plcbit reserve[3];
} SdcEncIf16_typ;
typedef struct SdcEncIf32_typ
{ signed char iLifeCnt;
plcbit iEncOK;
signed short iActTime;
signed long iActPos;
signed long iRefPulsePos;
signed char iRefPulseCnt;
plcbit reserve[3];
} SdcEncIf32_typ;
typedef struct SdcDrvIf16_typ
{ signed char iLifeCnt;
plcbit iDrvOK;
signed short oSetTime;
signed short oSetPos;
plcbit oBoostCurrent;
plcbit oStandStillCurrent;
plcbit iStatusEnable;
plcbit oBrake;
plcbit reserve[2];
} SdcDrvIf16_typ;
typedef struct SdcDrvIf32_typ
{ signed char iLifeCnt;
plcbit iDrvOK;
signed short oSetTime;
signed long oSetPos;
plcbit oBoostCurrent;
plcbit oStandStillCurrent;
plcbit iStatusEnable;
plcbit oBrake;
} SdcDrvIf32_typ;
typedef struct SdcTrigIf_typ
{ signed char iLifeCnt;
signed char iTriggerCntRise;
signed char iTriggerCntFall;
plcbit iTriggerInput;
signed short iTriggerTimeRise;
signed short iTriggerTimeFall;
} SdcTrigIf_typ;
typedef struct SdcTrigIfDIGin_typ
{ signed char iLifeCnt;
plcbit iTriggerInput;
plcbit reserve[2];
} SdcTrigIfDIGin_typ;
typedef struct SdcDiDoIf_typ
{ signed char iLifeCntDriveReady;
signed char iLifeCntPosHwEnd;
signed char iLifeCntNegHwEnd;
signed char iLifeCntReference;
signed char iLifeCntDriveEnable;
plcbit iDriveReady;
plcbit iPosHwEnd;
plcbit iNegHwEnd;
plcbit iReference;
plcbit oDriveEnable;
plcbit reserve[2];
} SdcDiDoIf_typ;
/* Prototyping of functions and function blocks */
__asm__(".section \".plc\"");
__asm__(".previous");
#endif /* _ACP10SDC_ */

View File

@@ -1,83 +1,83 @@
TYPE
SdcHwCfg_typ : STRUCT
EncIf1_Typ :UINT;
EncIf2_Typ :UINT;
DrvIf_Typ :UINT;
TrigIf1_Typ :UINT;
TrigIf2_Typ :UINT;
DiDoIf_Typ :UINT;
EncIf1_Name :ARRAY[0..33] OF USINT;
EncIf2_Name :ARRAY[0..33] OF USINT;
DrvIf_Name :ARRAY[0..33] OF USINT;
TrigIf1_Name :ARRAY[0..33] OF USINT;
TrigIf2_Name :ARRAY[0..33] OF USINT;
DiDoIf_Name :ARRAY[0..33] OF USINT;
NOT_USE :ARRAY[0..9] OF UDINT;
END_STRUCT;
SdcEncIf16_typ : STRUCT
iLifeCnt :SINT;
iEncOK :BOOL;
iActTime :INT;
iActPos :INT;
iRefPulsePos :INT;
iRefPulseCnt :SINT;
reserve :ARRAY[0..2] OF BOOL;
END_STRUCT;
SdcEncIf32_typ : STRUCT
iLifeCnt :SINT;
iEncOK :BOOL;
iActTime :INT;
iActPos :DINT;
iRefPulsePos :DINT;
iRefPulseCnt :SINT;
reserve :ARRAY[0..2] OF BOOL;
END_STRUCT;
SdcDrvIf16_typ : STRUCT
iLifeCnt :SINT;
iDrvOK :BOOL;
oSetTime :INT;
oSetPos :INT;
oBoostCurrent :BOOL;
oStandStillCurrent :BOOL;
iStatusEnable :BOOL;
oBrake :BOOL;
reserve :ARRAY[0..1] OF BOOL;
END_STRUCT;
SdcDrvIf32_typ : STRUCT
iLifeCnt :SINT;
iDrvOK :BOOL;
oSetTime :INT;
oSetPos :DINT;
oBoostCurrent :BOOL;
oStandStillCurrent :BOOL;
iStatusEnable :BOOL;
oBrake :BOOL;
END_STRUCT;
SdcTrigIf_typ : STRUCT
iLifeCnt :SINT;
iTriggerCntRise :SINT;
iTriggerCntFall :SINT;
iTriggerInput :BOOL;
iTriggerTimeRise :INT;
iTriggerTimeFall :INT;
END_STRUCT;
SdcTrigIfDIGin_typ : STRUCT
iLifeCnt :SINT;
iTriggerInput :BOOL;
reserve :ARRAY[0..1] OF BOOL;
END_STRUCT;
SdcDiDoIf_typ : STRUCT
iLifeCntDriveReady :SINT;
iLifeCntPosHwEnd :SINT;
iLifeCntNegHwEnd :SINT;
iLifeCntReference :SINT;
iLifeCntDriveEnable :SINT;
iDriveReady :BOOL;
iPosHwEnd :BOOL;
iNegHwEnd :BOOL;
iReference :BOOL;
oDriveEnable :BOOL;
reserve :ARRAY[0..1] OF BOOL;
END_STRUCT;
END_TYPE
TYPE
SdcHwCfg_typ : STRUCT
EncIf1_Typ :UINT;
EncIf2_Typ :UINT;
DrvIf_Typ :UINT;
TrigIf1_Typ :UINT;
TrigIf2_Typ :UINT;
DiDoIf_Typ :UINT;
EncIf1_Name :ARRAY[0..33] OF USINT;
EncIf2_Name :ARRAY[0..33] OF USINT;
DrvIf_Name :ARRAY[0..33] OF USINT;
TrigIf1_Name :ARRAY[0..33] OF USINT;
TrigIf2_Name :ARRAY[0..33] OF USINT;
DiDoIf_Name :ARRAY[0..33] OF USINT;
NOT_USE :ARRAY[0..9] OF UDINT;
END_STRUCT;
SdcEncIf16_typ : STRUCT
iLifeCnt :SINT;
iEncOK :BOOL;
iActTime :INT;
iActPos :INT;
iRefPulsePos :INT;
iRefPulseCnt :SINT;
reserve :ARRAY[0..2] OF BOOL;
END_STRUCT;
SdcEncIf32_typ : STRUCT
iLifeCnt :SINT;
iEncOK :BOOL;
iActTime :INT;
iActPos :DINT;
iRefPulsePos :DINT;
iRefPulseCnt :SINT;
reserve :ARRAY[0..2] OF BOOL;
END_STRUCT;
SdcDrvIf16_typ : STRUCT
iLifeCnt :SINT;
iDrvOK :BOOL;
oSetTime :INT;
oSetPos :INT;
oBoostCurrent :BOOL;
oStandStillCurrent :BOOL;
iStatusEnable :BOOL;
oBrake :BOOL;
reserve :ARRAY[0..1] OF BOOL;
END_STRUCT;
SdcDrvIf32_typ : STRUCT
iLifeCnt :SINT;
iDrvOK :BOOL;
oSetTime :INT;
oSetPos :DINT;
oBoostCurrent :BOOL;
oStandStillCurrent :BOOL;
iStatusEnable :BOOL;
oBrake :BOOL;
END_STRUCT;
SdcTrigIf_typ : STRUCT
iLifeCnt :SINT;
iTriggerCntRise :SINT;
iTriggerCntFall :SINT;
iTriggerInput :BOOL;
iTriggerTimeRise :INT;
iTriggerTimeFall :INT;
END_STRUCT;
SdcTrigIfDIGin_typ : STRUCT
iLifeCnt :SINT;
iTriggerInput :BOOL;
reserve :ARRAY[0..1] OF BOOL;
END_STRUCT;
SdcDiDoIf_typ : STRUCT
iLifeCntDriveReady :SINT;
iLifeCntPosHwEnd :SINT;
iLifeCntNegHwEnd :SINT;
iLifeCntReference :SINT;
iLifeCntDriveEnable :SINT;
iDriveReady :BOOL;
iPosHwEnd :BOOL;
iNegHwEnd :BOOL;
iReference :BOOL;
oDriveEnable :BOOL;
reserve :ARRAY[0..1] OF BOOL;
END_STRUCT;
END_TYPE

View File

@@ -1,13 +1,13 @@
VAR CONSTANT
ncSDC_ENC16 :UINT :=100;
ncSDC_ENC32 :UINT :=101;
ncSDC_DRVSM16 :UINT :=110;
ncSDC_DRVSM32 :UINT :=111;
ncSDC_DRVSM16_CTRL :UINT :=112;
ncSDC_DRVSM32_CTRL :UINT :=113;
ncSDC_DRVSERVO16 :UINT :=120;
ncSDC_TRIG :UINT :=130;
ncSDC_TRIGDIGin :UINT :=131;
ncSDC_DIDO :UINT :=140;
END_VAR
VAR CONSTANT
ncSDC_ENC16 :UINT :=100;
ncSDC_ENC32 :UINT :=101;
ncSDC_DRVSM16 :UINT :=110;
ncSDC_DRVSM32 :UINT :=111;
ncSDC_DRVSM16_CTRL :UINT :=112;
ncSDC_DRVSM32_CTRL :UINT :=113;
ncSDC_DRVSERVO16 :UINT :=120;
ncSDC_TRIG :UINT :=130;
ncSDC_TRIGDIGin :UINT :=131;
ncSDC_DIDO :UINT :=140;
END_VAR

View File

@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.0.0?>
<Library xmlns="http://br-automation.co.at/AS/Library" Description="The AsDb library supports access to Sybase und MS SQL databases.">
<Files>
<File>AsDb.var</File>
<File>AsDb.typ</File>
<File>AsDb.fun</File>
</Files>
<Dependencies>
<Dependency ObjectName="runtime" />
</Dependencies>
</Library>
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.0.0?>
<Library xmlns="http://br-automation.co.at/AS/Library" Description="The AsDb library supports access to Sybase und MS SQL databases.">
<Files>
<File>AsDb.var</File>
<File>AsDb.typ</File>
<File>AsDb.fun</File>
</Files>
<Dependencies>
<Dependency ObjectName="runtime" />
</Dependencies>
</Library>

View File

@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.0.0?>
<Library xmlns="http://br-automation.co.at/AS/Library" Description="The AsMem library makes it possible to manage memory blocks located in large memory areas (memory partitions).">
<Files>
<File>AsMem.var</File>
<File>AsMem.fun</File>
</Files>
<Dependencies>
<Dependency ObjectName="runtime" />
</Dependencies>
</Library>
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.0.0?>
<Library xmlns="http://br-automation.co.at/AS/Library" Description="The AsMem library makes it possible to manage memory blocks located in large memory areas (memory partitions).">
<Files>
<File>AsMem.var</File>
<File>AsMem.fun</File>
</Files>
<Dependencies>
<Dependency ObjectName="runtime" />
</Dependencies>
</Library>

View File

@@ -0,0 +1,149 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: AsUDP
* File: AsUDP.fun
* Author: B+R
********************************************************************
* Functions and function blocks of library AsUDP
********************************************************************)
FUNCTION_BLOCK UdpOpen (*opens a UDP port; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
pIfAddr : UDINT; (*pointer to the IP address of the ethernet interface where the UDP socket should be connected*)
port : UINT; (*port number that the UDP socket should connect to*)
options : UDINT; (*options that can be set during opening, e.g., udpOPT_REUSEADDR*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
ident : UDINT; (*identifier used for all other UDP FBKs as an input parameter*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
FUNCTION_BLOCK UdpClose (*closes a UDP port and frees up all required resources; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier returned from UdpOpen*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
FUNCTION_BLOCK UdpConnect (*connects a UDP port to an opposite station; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier returned from UdpOpen*)
pHost : UDINT; (*pointer to the ip address of the receiver*)
port : UINT; (*port number of the receiver*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
FUNCTION_BLOCK UdpDisconnect (*connects a UDP port and the opposite station; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier returned from UdpOpen*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
FUNCTION_BLOCK UdpSend (*sends udp datagrams; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier returned from UdpOpen*)
pHost : UDINT; (*pointer to the ip address or name of the receiver*)
port : UINT; (*port number of the receiver*)
pData : UDINT; (*pointer to the send datagram*)
datalen : UDINT; (*length of send datagram*)
flags : UDINT; (*send flags*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
sentlen : UDINT; (*number of bytes sent*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
FUNCTION_BLOCK UdpRecv (*receives udp datagrams; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier returned from UdpOpen*)
pData : UDINT; (*pointer to the buffer where to store received datagram*)
datamax : UDINT; (*buffer size (max. length of received datagram)*)
flags : UDINT; (*receive flags*)
pIpAddr : UDINT; (*pointer where to store the ip address of the sender*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
recvlen : UDINT; (*lentgh of received datagram*)
port : UINT; (*port number of transmitter*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK
FUNCTION_BLOCK UdpIoctl (*changes or retrieves settings; asynchronous execution*)
VAR_INPUT
enable : BOOL; (*enables execution*)
ident : UDINT; (*identifier returned from UdpOpen*)
ioctl : UDINT; (*io control code*)
pData : UDINT; (*pointer to the input/output data buffer*)
datalen : UDINT; (*lentgh of io control input data*)
END_VAR
VAR_OUTPUT
status : UINT; (*execution status: ERR_OK, ERR_FUB_ENABLE_FALSE, ERR_FUB_BUSY, 0xXXXX = see help*)
outlen : UDINT; (*length of the input data or maximum length of the output data*)
END_VAR
VAR
i_state : UINT; (*internal variable*)
i_result : UINT; (*internal variable*)
i_tmp : UDINT; (*internal variable*)
END_VAR
END_FUNCTION_BLOCK

View File

@@ -0,0 +1,21 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: AsUDP
* File: AsUDP.typ
* Author: B+R
********************************************************************
* Data types of library AsUDP
********************************************************************)
TYPE
udpIP_MREQ_typ : STRUCT (*multicast*)
pMcastAddr : UDINT; (*pointer to the multicast address*)
pIfAddr : UDINT; (*pointer to the interface address*)
END_STRUCT;
udpSO_ADDRESS_typ : STRUCT (*socket address*)
pPort : UDINT; (*pointer where to store the portnumber*)
pIpAddr : UDINT; (*pointer where to store the socket ip address*)
END_STRUCT;
END_TYPE

View File

@@ -0,0 +1,66 @@
(********************************************************************
* COPYRIGHT -- Bernecker + Rainer
********************************************************************
* Library: AsUDP
* File: AsUDP.var
* Author: B+R
********************************************************************
* Local variables of library AsUDP
********************************************************************)
VAR CONSTANT
udpERR_INVALID_IDENT : UINT := 32500; (*invalid ident*)
udpERR_NOMORE_IDENTS : UINT := 32501; (*no more idents*)
udpERR_ALREADY_EXIST : UINT := 32502; (*socket already exists*)
udpERR_PARAMETER : UINT := 32503; (*invalid parameter, check parameter*)
udpERR_INVALID_IOCTL : UINT := 32504; (*io control not supported*)
udpERR_NO_DATA : UINT := 32505; (*no data to receive*)
udpERR_SENTLEN : UINT := 32506; (*send failed*)
udpERR_WOULDBLOCK : UINT := 32507; (*would block, call again*)
udpERR_CONNREFUSED : UINT := 32508; (*connection refused*)
udpERR_ACCESS : UINT := 32509; (*send broadcast failed (broadcast option not set)*)
udpERR_UNREACHABLE : UINT := 32510; (*network/host is unreachable*)
udpERR_INTERFACE : UINT := 32511; (*illegal inetrafce*)
udpERR_SOCKET_CREATE : UINT := 32550; (*create socket failed*)
udpERR_SOCKET_BIND : UINT := 32551; (*bind socket failed*)
udpERR_SOCKET_CONNECT : UINT := 32552; (*connect socket failed*)
udpERR_SYSTEM : UINT := 32599; (*system error*)
udpSO_BROADCAST_SET : UDINT := 1001; (*set option broadcast (true/false)*)
udpSO_BROADCAST_GET : UDINT := 1002; (*get option broadcast*)
udpSO_SNDBUF_SET : UDINT := 1003; (*set option send buffer*)
udpSO_SNDBUF_GET : UDINT := 1004; (*get option send buffer*)
udpSO_RCVBUF_SET : UDINT := 1005; (*set option receive buffer*)
udpSO_RCVBUF_GET : UDINT := 1006; (*get option receive buffer*)
udpSO_ADDRESS_GET : UDINT := 1007; (*get socket address*)
udpIP_ADD_MEMBERSHIP : UDINT := 2001; (*add multicast group*)
udpIP_DROP_MEMBERSHIP : UDINT := 2002; (*leave multicast group*)
udpIP_MULTICAST_IF_SET : UDINT := 2003; (*set interface for outgoing multicats*)
udpIP_MULTICAST_IF_GET : UDINT := 2004; (*get interface for outgoing multicats*)
udpIP_MULTICAST_TTL_SET : UDINT := 2005; (*set time to life for outgoing multicats*)
udpIP_MULTICAST_TTL_GET : UDINT := 2006; (*get time to life for outgoing multicats*)
udpIP_MULTICAST_LOOP_SET : UDINT := 2007; (*set wether or not loopback multicats*)
udpIP_MULTICAST_LOOP_GET : UDINT := 2008; (*get loopback multicats*)
udpIP_TOS_SET : UDINT := 2009; (*set type of service field for outgoing packets*)
udpIP_TOS_GET : UDINT := 2010; (*get type of service field for outgoing packets*)
udpIP_TTL_SET : UDINT := 2011; (*set time to live field for outgoing packets*)
udpIP_TTL_GET : UDINT := 2012; (*get time to live field for outgoing packets*)
udpID_LIST_GET : UDINT := 3001; (*get ident list*)
udpID_MAX_GET : UDINT := 3002; (*get max ident count*)
udpMSG_PEEK : UDINT := 1; (*don't remove data from socket (receive)*)
udpMSG_DONTROUTE : UDINT := 2; (*message don't route (send)*)
udpOPT_REUSEADDR : UDINT := 1; (*option reuse address*)
udpOPT_REUSEPORT : UDINT := 2; (*option reuse port*)
udpOPT_BROADCAST : UDINT := 4; (*option enable broadcast*)
udpIP_TOS_LOWDELAY : UDINT := 16; (*type of service priority low delay*)
udpIP_TOS_THROUGHPUT : UDINT := 8; (*type of service priority throughput*)
udpIP_TOS_RELIABILITY : UDINT := 4; (*type of service priority reliability*)
udpIP_TOS_MINCOST : UDINT := 2; (*type of service priority mincost*)
udpINVALID_IDENT : UDINT := 0; (*invlaid ident*)
END_VAR

View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.23 SP05?>
<Library Description="This library contains FBKs for exchanging data packets via datagram sockets (UDP)." xmlns="http://br-automation.co.at/AS/Library">
<Files>
<File>AsUDP.var</File>
<File>AsUDP.typ</File>
<File>AsUDP.fun</File>
</Files>
<Dependencies>
<Dependency ObjectName="runtime" />
</Dependencies>
</Library>

View File

@@ -0,0 +1,268 @@
/* Automation Studio generated header file */
/* Do not edit ! */
#ifndef _ASUDP_
#define _ASUDP_
#ifdef __cplusplus
extern "C"
{
#endif
#include <bur/plctypes.h>
#include <runtime.h>
#ifndef _IEC_CONST
#define _IEC_CONST _WEAK const
#endif
/* Constants */
#ifdef _REPLACE_CONST
#define udpINVALID_IDENT 0U
#define udpIP_TOS_MINCOST 2U
#define udpIP_TOS_RELIABILITY 4U
#define udpIP_TOS_THROUGHPUT 8U
#define udpIP_TOS_LOWDELAY 16U
#define udpOPT_BROADCAST 4U
#define udpOPT_REUSEPORT 2U
#define udpOPT_REUSEADDR 1U
#define udpMSG_DONTROUTE 2U
#define udpMSG_PEEK 1U
#define udpID_MAX_GET 3002U
#define udpID_LIST_GET 3001U
#define udpIP_TTL_GET 2012U
#define udpIP_TTL_SET 2011U
#define udpIP_TOS_GET 2010U
#define udpIP_TOS_SET 2009U
#define udpIP_MULTICAST_LOOP_GET 2008U
#define udpIP_MULTICAST_LOOP_SET 2007U
#define udpIP_MULTICAST_TTL_GET 2006U
#define udpIP_MULTICAST_TTL_SET 2005U
#define udpIP_MULTICAST_IF_GET 2004U
#define udpIP_MULTICAST_IF_SET 2003U
#define udpIP_DROP_MEMBERSHIP 2002U
#define udpIP_ADD_MEMBERSHIP 2001U
#define udpSO_ADDRESS_GET 1007U
#define udpSO_RCVBUF_GET 1006U
#define udpSO_RCVBUF_SET 1005U
#define udpSO_SNDBUF_GET 1004U
#define udpSO_SNDBUF_SET 1003U
#define udpSO_BROADCAST_GET 1002U
#define udpSO_BROADCAST_SET 1001U
#define udpERR_SYSTEM 32599U
#define udpERR_SOCKET_CONNECT 32552U
#define udpERR_SOCKET_BIND 32551U
#define udpERR_SOCKET_CREATE 32550U
#define udpERR_INTERFACE 32511U
#define udpERR_UNREACHABLE 32510U
#define udpERR_ACCESS 32509U
#define udpERR_CONNREFUSED 32508U
#define udpERR_WOULDBLOCK 32507U
#define udpERR_SENTLEN 32506U
#define udpERR_NO_DATA 32505U
#define udpERR_INVALID_IOCTL 32504U
#define udpERR_PARAMETER 32503U
#define udpERR_ALREADY_EXIST 32502U
#define udpERR_NOMORE_IDENTS 32501U
#define udpERR_INVALID_IDENT 32500U
#else
_IEC_CONST unsigned long udpINVALID_IDENT = 0U;
_IEC_CONST unsigned long udpIP_TOS_MINCOST = 2U;
_IEC_CONST unsigned long udpIP_TOS_RELIABILITY = 4U;
_IEC_CONST unsigned long udpIP_TOS_THROUGHPUT = 8U;
_IEC_CONST unsigned long udpIP_TOS_LOWDELAY = 16U;
_IEC_CONST unsigned long udpOPT_BROADCAST = 4U;
_IEC_CONST unsigned long udpOPT_REUSEPORT = 2U;
_IEC_CONST unsigned long udpOPT_REUSEADDR = 1U;
_IEC_CONST unsigned long udpMSG_DONTROUTE = 2U;
_IEC_CONST unsigned long udpMSG_PEEK = 1U;
_IEC_CONST unsigned long udpID_MAX_GET = 3002U;
_IEC_CONST unsigned long udpID_LIST_GET = 3001U;
_IEC_CONST unsigned long udpIP_TTL_GET = 2012U;
_IEC_CONST unsigned long udpIP_TTL_SET = 2011U;
_IEC_CONST unsigned long udpIP_TOS_GET = 2010U;
_IEC_CONST unsigned long udpIP_TOS_SET = 2009U;
_IEC_CONST unsigned long udpIP_MULTICAST_LOOP_GET = 2008U;
_IEC_CONST unsigned long udpIP_MULTICAST_LOOP_SET = 2007U;
_IEC_CONST unsigned long udpIP_MULTICAST_TTL_GET = 2006U;
_IEC_CONST unsigned long udpIP_MULTICAST_TTL_SET = 2005U;
_IEC_CONST unsigned long udpIP_MULTICAST_IF_GET = 2004U;
_IEC_CONST unsigned long udpIP_MULTICAST_IF_SET = 2003U;
_IEC_CONST unsigned long udpIP_DROP_MEMBERSHIP = 2002U;
_IEC_CONST unsigned long udpIP_ADD_MEMBERSHIP = 2001U;
_IEC_CONST unsigned long udpSO_ADDRESS_GET = 1007U;
_IEC_CONST unsigned long udpSO_RCVBUF_GET = 1006U;
_IEC_CONST unsigned long udpSO_RCVBUF_SET = 1005U;
_IEC_CONST unsigned long udpSO_SNDBUF_GET = 1004U;
_IEC_CONST unsigned long udpSO_SNDBUF_SET = 1003U;
_IEC_CONST unsigned long udpSO_BROADCAST_GET = 1002U;
_IEC_CONST unsigned long udpSO_BROADCAST_SET = 1001U;
_IEC_CONST unsigned short udpERR_SYSTEM = 32599U;
_IEC_CONST unsigned short udpERR_SOCKET_CONNECT = 32552U;
_IEC_CONST unsigned short udpERR_SOCKET_BIND = 32551U;
_IEC_CONST unsigned short udpERR_SOCKET_CREATE = 32550U;
_IEC_CONST unsigned short udpERR_INTERFACE = 32511U;
_IEC_CONST unsigned short udpERR_UNREACHABLE = 32510U;
_IEC_CONST unsigned short udpERR_ACCESS = 32509U;
_IEC_CONST unsigned short udpERR_CONNREFUSED = 32508U;
_IEC_CONST unsigned short udpERR_WOULDBLOCK = 32507U;
_IEC_CONST unsigned short udpERR_SENTLEN = 32506U;
_IEC_CONST unsigned short udpERR_NO_DATA = 32505U;
_IEC_CONST unsigned short udpERR_INVALID_IOCTL = 32504U;
_IEC_CONST unsigned short udpERR_PARAMETER = 32503U;
_IEC_CONST unsigned short udpERR_ALREADY_EXIST = 32502U;
_IEC_CONST unsigned short udpERR_NOMORE_IDENTS = 32501U;
_IEC_CONST unsigned short udpERR_INVALID_IDENT = 32500U;
#endif
/* Datatypes and datatypes of function blocks */
typedef struct udpIP_MREQ_typ
{ unsigned long pMcastAddr;
unsigned long pIfAddr;
} udpIP_MREQ_typ;
typedef struct udpSO_ADDRESS_typ
{ unsigned long pPort;
unsigned long pIpAddr;
} udpSO_ADDRESS_typ;
typedef struct UdpOpen
{
/* VAR_INPUT (analog) */
unsigned long pIfAddr;
unsigned short port;
unsigned long options;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long ident;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} UdpOpen_typ;
typedef struct UdpClose
{
/* VAR_INPUT (analog) */
unsigned long ident;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} UdpClose_typ;
typedef struct UdpConnect
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pHost;
unsigned short port;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} UdpConnect_typ;
typedef struct UdpDisconnect
{
/* VAR_INPUT (analog) */
unsigned long ident;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} UdpDisconnect_typ;
typedef struct UdpSend
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pHost;
unsigned short port;
unsigned long pData;
unsigned long datalen;
unsigned long flags;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long sentlen;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} UdpSend_typ;
typedef struct UdpRecv
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pData;
unsigned long datamax;
unsigned long flags;
unsigned long pIpAddr;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long recvlen;
unsigned short port;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} UdpRecv_typ;
typedef struct UdpIoctl
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long ioctl;
unsigned long pData;
unsigned long datalen;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long outlen;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} UdpIoctl_typ;
/* Prototyping of functions and function blocks */
void UdpOpen(struct UdpOpen* inst);
void UdpClose(struct UdpClose* inst);
void UdpConnect(struct UdpConnect* inst);
void UdpDisconnect(struct UdpDisconnect* inst);
void UdpSend(struct UdpSend* inst);
void UdpRecv(struct UdpRecv* inst);
void UdpIoctl(struct UdpIoctl* inst);
#ifdef __cplusplus
};
#endif
#endif /* _ASUDP_ */

View File

@@ -0,0 +1,268 @@
/* Automation Studio generated header file */
/* Do not edit ! */
#ifndef _ASUDP_
#define _ASUDP_
#ifdef __cplusplus
extern "C"
{
#endif
#include <bur/plctypes.h>
#include <runtime.h>
#ifndef _IEC_CONST
#define _IEC_CONST _WEAK const
#endif
/* Constants */
#ifdef _REPLACE_CONST
#define udpINVALID_IDENT 0U
#define udpIP_TOS_MINCOST 2U
#define udpIP_TOS_RELIABILITY 4U
#define udpIP_TOS_THROUGHPUT 8U
#define udpIP_TOS_LOWDELAY 16U
#define udpOPT_BROADCAST 4U
#define udpOPT_REUSEPORT 2U
#define udpOPT_REUSEADDR 1U
#define udpMSG_DONTROUTE 2U
#define udpMSG_PEEK 1U
#define udpID_MAX_GET 3002U
#define udpID_LIST_GET 3001U
#define udpIP_TTL_GET 2012U
#define udpIP_TTL_SET 2011U
#define udpIP_TOS_GET 2010U
#define udpIP_TOS_SET 2009U
#define udpIP_MULTICAST_LOOP_GET 2008U
#define udpIP_MULTICAST_LOOP_SET 2007U
#define udpIP_MULTICAST_TTL_GET 2006U
#define udpIP_MULTICAST_TTL_SET 2005U
#define udpIP_MULTICAST_IF_GET 2004U
#define udpIP_MULTICAST_IF_SET 2003U
#define udpIP_DROP_MEMBERSHIP 2002U
#define udpIP_ADD_MEMBERSHIP 2001U
#define udpSO_ADDRESS_GET 1007U
#define udpSO_RCVBUF_GET 1006U
#define udpSO_RCVBUF_SET 1005U
#define udpSO_SNDBUF_GET 1004U
#define udpSO_SNDBUF_SET 1003U
#define udpSO_BROADCAST_GET 1002U
#define udpSO_BROADCAST_SET 1001U
#define udpERR_SYSTEM 32599U
#define udpERR_SOCKET_CONNECT 32552U
#define udpERR_SOCKET_BIND 32551U
#define udpERR_SOCKET_CREATE 32550U
#define udpERR_INTERFACE 32511U
#define udpERR_UNREACHABLE 32510U
#define udpERR_ACCESS 32509U
#define udpERR_CONNREFUSED 32508U
#define udpERR_WOULDBLOCK 32507U
#define udpERR_SENTLEN 32506U
#define udpERR_NO_DATA 32505U
#define udpERR_INVALID_IOCTL 32504U
#define udpERR_PARAMETER 32503U
#define udpERR_ALREADY_EXIST 32502U
#define udpERR_NOMORE_IDENTS 32501U
#define udpERR_INVALID_IDENT 32500U
#else
_IEC_CONST unsigned long udpINVALID_IDENT = 0U;
_IEC_CONST unsigned long udpIP_TOS_MINCOST = 2U;
_IEC_CONST unsigned long udpIP_TOS_RELIABILITY = 4U;
_IEC_CONST unsigned long udpIP_TOS_THROUGHPUT = 8U;
_IEC_CONST unsigned long udpIP_TOS_LOWDELAY = 16U;
_IEC_CONST unsigned long udpOPT_BROADCAST = 4U;
_IEC_CONST unsigned long udpOPT_REUSEPORT = 2U;
_IEC_CONST unsigned long udpOPT_REUSEADDR = 1U;
_IEC_CONST unsigned long udpMSG_DONTROUTE = 2U;
_IEC_CONST unsigned long udpMSG_PEEK = 1U;
_IEC_CONST unsigned long udpID_MAX_GET = 3002U;
_IEC_CONST unsigned long udpID_LIST_GET = 3001U;
_IEC_CONST unsigned long udpIP_TTL_GET = 2012U;
_IEC_CONST unsigned long udpIP_TTL_SET = 2011U;
_IEC_CONST unsigned long udpIP_TOS_GET = 2010U;
_IEC_CONST unsigned long udpIP_TOS_SET = 2009U;
_IEC_CONST unsigned long udpIP_MULTICAST_LOOP_GET = 2008U;
_IEC_CONST unsigned long udpIP_MULTICAST_LOOP_SET = 2007U;
_IEC_CONST unsigned long udpIP_MULTICAST_TTL_GET = 2006U;
_IEC_CONST unsigned long udpIP_MULTICAST_TTL_SET = 2005U;
_IEC_CONST unsigned long udpIP_MULTICAST_IF_GET = 2004U;
_IEC_CONST unsigned long udpIP_MULTICAST_IF_SET = 2003U;
_IEC_CONST unsigned long udpIP_DROP_MEMBERSHIP = 2002U;
_IEC_CONST unsigned long udpIP_ADD_MEMBERSHIP = 2001U;
_IEC_CONST unsigned long udpSO_ADDRESS_GET = 1007U;
_IEC_CONST unsigned long udpSO_RCVBUF_GET = 1006U;
_IEC_CONST unsigned long udpSO_RCVBUF_SET = 1005U;
_IEC_CONST unsigned long udpSO_SNDBUF_GET = 1004U;
_IEC_CONST unsigned long udpSO_SNDBUF_SET = 1003U;
_IEC_CONST unsigned long udpSO_BROADCAST_GET = 1002U;
_IEC_CONST unsigned long udpSO_BROADCAST_SET = 1001U;
_IEC_CONST unsigned short udpERR_SYSTEM = 32599U;
_IEC_CONST unsigned short udpERR_SOCKET_CONNECT = 32552U;
_IEC_CONST unsigned short udpERR_SOCKET_BIND = 32551U;
_IEC_CONST unsigned short udpERR_SOCKET_CREATE = 32550U;
_IEC_CONST unsigned short udpERR_INTERFACE = 32511U;
_IEC_CONST unsigned short udpERR_UNREACHABLE = 32510U;
_IEC_CONST unsigned short udpERR_ACCESS = 32509U;
_IEC_CONST unsigned short udpERR_CONNREFUSED = 32508U;
_IEC_CONST unsigned short udpERR_WOULDBLOCK = 32507U;
_IEC_CONST unsigned short udpERR_SENTLEN = 32506U;
_IEC_CONST unsigned short udpERR_NO_DATA = 32505U;
_IEC_CONST unsigned short udpERR_INVALID_IOCTL = 32504U;
_IEC_CONST unsigned short udpERR_PARAMETER = 32503U;
_IEC_CONST unsigned short udpERR_ALREADY_EXIST = 32502U;
_IEC_CONST unsigned short udpERR_NOMORE_IDENTS = 32501U;
_IEC_CONST unsigned short udpERR_INVALID_IDENT = 32500U;
#endif
/* Datatypes and datatypes of function blocks */
typedef struct udpIP_MREQ_typ
{ unsigned long pMcastAddr;
unsigned long pIfAddr;
} udpIP_MREQ_typ;
typedef struct udpSO_ADDRESS_typ
{ unsigned long pPort;
unsigned long pIpAddr;
} udpSO_ADDRESS_typ;
typedef struct UdpOpen
{
/* VAR_INPUT (analog) */
unsigned long pIfAddr;
unsigned short port;
unsigned long options;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long ident;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} UdpOpen_typ;
typedef struct UdpClose
{
/* VAR_INPUT (analog) */
unsigned long ident;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} UdpClose_typ;
typedef struct UdpConnect
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pHost;
unsigned short port;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} UdpConnect_typ;
typedef struct UdpDisconnect
{
/* VAR_INPUT (analog) */
unsigned long ident;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} UdpDisconnect_typ;
typedef struct UdpSend
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pHost;
unsigned short port;
unsigned long pData;
unsigned long datalen;
unsigned long flags;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long sentlen;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} UdpSend_typ;
typedef struct UdpRecv
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pData;
unsigned long datamax;
unsigned long flags;
unsigned long pIpAddr;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long recvlen;
unsigned short port;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} UdpRecv_typ;
typedef struct UdpIoctl
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long ioctl;
unsigned long pData;
unsigned long datalen;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long outlen;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} UdpIoctl_typ;
/* Prototyping of functions and function blocks */
void UdpOpen(struct UdpOpen* inst);
void UdpClose(struct UdpClose* inst);
void UdpConnect(struct UdpConnect* inst);
void UdpDisconnect(struct UdpDisconnect* inst);
void UdpSend(struct UdpSend* inst);
void UdpRecv(struct UdpRecv* inst);
void UdpIoctl(struct UdpIoctl* inst);
#ifdef __cplusplus
};
#endif
#endif /* _ASUDP_ */

View File

@@ -0,0 +1,268 @@
/* Automation Studio generated header file */
/* Do not edit ! */
#ifndef _ASUDP_
#define _ASUDP_
#ifdef __cplusplus
extern "C"
{
#endif
#include <bur/plctypes.h>
#include <runtime.h>
#ifndef _IEC_CONST
#define _IEC_CONST _WEAK const
#endif
/* Constants */
#ifdef _REPLACE_CONST
#define udpINVALID_IDENT 0U
#define udpIP_TOS_MINCOST 2U
#define udpIP_TOS_RELIABILITY 4U
#define udpIP_TOS_THROUGHPUT 8U
#define udpIP_TOS_LOWDELAY 16U
#define udpOPT_BROADCAST 4U
#define udpOPT_REUSEPORT 2U
#define udpOPT_REUSEADDR 1U
#define udpMSG_DONTROUTE 2U
#define udpMSG_PEEK 1U
#define udpID_MAX_GET 3002U
#define udpID_LIST_GET 3001U
#define udpIP_TTL_GET 2012U
#define udpIP_TTL_SET 2011U
#define udpIP_TOS_GET 2010U
#define udpIP_TOS_SET 2009U
#define udpIP_MULTICAST_LOOP_GET 2008U
#define udpIP_MULTICAST_LOOP_SET 2007U
#define udpIP_MULTICAST_TTL_GET 2006U
#define udpIP_MULTICAST_TTL_SET 2005U
#define udpIP_MULTICAST_IF_GET 2004U
#define udpIP_MULTICAST_IF_SET 2003U
#define udpIP_DROP_MEMBERSHIP 2002U
#define udpIP_ADD_MEMBERSHIP 2001U
#define udpSO_ADDRESS_GET 1007U
#define udpSO_RCVBUF_GET 1006U
#define udpSO_RCVBUF_SET 1005U
#define udpSO_SNDBUF_GET 1004U
#define udpSO_SNDBUF_SET 1003U
#define udpSO_BROADCAST_GET 1002U
#define udpSO_BROADCAST_SET 1001U
#define udpERR_SYSTEM 32599U
#define udpERR_SOCKET_CONNECT 32552U
#define udpERR_SOCKET_BIND 32551U
#define udpERR_SOCKET_CREATE 32550U
#define udpERR_INTERFACE 32511U
#define udpERR_UNREACHABLE 32510U
#define udpERR_ACCESS 32509U
#define udpERR_CONNREFUSED 32508U
#define udpERR_WOULDBLOCK 32507U
#define udpERR_SENTLEN 32506U
#define udpERR_NO_DATA 32505U
#define udpERR_INVALID_IOCTL 32504U
#define udpERR_PARAMETER 32503U
#define udpERR_ALREADY_EXIST 32502U
#define udpERR_NOMORE_IDENTS 32501U
#define udpERR_INVALID_IDENT 32500U
#else
_IEC_CONST unsigned long udpINVALID_IDENT = 0U;
_IEC_CONST unsigned long udpIP_TOS_MINCOST = 2U;
_IEC_CONST unsigned long udpIP_TOS_RELIABILITY = 4U;
_IEC_CONST unsigned long udpIP_TOS_THROUGHPUT = 8U;
_IEC_CONST unsigned long udpIP_TOS_LOWDELAY = 16U;
_IEC_CONST unsigned long udpOPT_BROADCAST = 4U;
_IEC_CONST unsigned long udpOPT_REUSEPORT = 2U;
_IEC_CONST unsigned long udpOPT_REUSEADDR = 1U;
_IEC_CONST unsigned long udpMSG_DONTROUTE = 2U;
_IEC_CONST unsigned long udpMSG_PEEK = 1U;
_IEC_CONST unsigned long udpID_MAX_GET = 3002U;
_IEC_CONST unsigned long udpID_LIST_GET = 3001U;
_IEC_CONST unsigned long udpIP_TTL_GET = 2012U;
_IEC_CONST unsigned long udpIP_TTL_SET = 2011U;
_IEC_CONST unsigned long udpIP_TOS_GET = 2010U;
_IEC_CONST unsigned long udpIP_TOS_SET = 2009U;
_IEC_CONST unsigned long udpIP_MULTICAST_LOOP_GET = 2008U;
_IEC_CONST unsigned long udpIP_MULTICAST_LOOP_SET = 2007U;
_IEC_CONST unsigned long udpIP_MULTICAST_TTL_GET = 2006U;
_IEC_CONST unsigned long udpIP_MULTICAST_TTL_SET = 2005U;
_IEC_CONST unsigned long udpIP_MULTICAST_IF_GET = 2004U;
_IEC_CONST unsigned long udpIP_MULTICAST_IF_SET = 2003U;
_IEC_CONST unsigned long udpIP_DROP_MEMBERSHIP = 2002U;
_IEC_CONST unsigned long udpIP_ADD_MEMBERSHIP = 2001U;
_IEC_CONST unsigned long udpSO_ADDRESS_GET = 1007U;
_IEC_CONST unsigned long udpSO_RCVBUF_GET = 1006U;
_IEC_CONST unsigned long udpSO_RCVBUF_SET = 1005U;
_IEC_CONST unsigned long udpSO_SNDBUF_GET = 1004U;
_IEC_CONST unsigned long udpSO_SNDBUF_SET = 1003U;
_IEC_CONST unsigned long udpSO_BROADCAST_GET = 1002U;
_IEC_CONST unsigned long udpSO_BROADCAST_SET = 1001U;
_IEC_CONST unsigned short udpERR_SYSTEM = 32599U;
_IEC_CONST unsigned short udpERR_SOCKET_CONNECT = 32552U;
_IEC_CONST unsigned short udpERR_SOCKET_BIND = 32551U;
_IEC_CONST unsigned short udpERR_SOCKET_CREATE = 32550U;
_IEC_CONST unsigned short udpERR_INTERFACE = 32511U;
_IEC_CONST unsigned short udpERR_UNREACHABLE = 32510U;
_IEC_CONST unsigned short udpERR_ACCESS = 32509U;
_IEC_CONST unsigned short udpERR_CONNREFUSED = 32508U;
_IEC_CONST unsigned short udpERR_WOULDBLOCK = 32507U;
_IEC_CONST unsigned short udpERR_SENTLEN = 32506U;
_IEC_CONST unsigned short udpERR_NO_DATA = 32505U;
_IEC_CONST unsigned short udpERR_INVALID_IOCTL = 32504U;
_IEC_CONST unsigned short udpERR_PARAMETER = 32503U;
_IEC_CONST unsigned short udpERR_ALREADY_EXIST = 32502U;
_IEC_CONST unsigned short udpERR_NOMORE_IDENTS = 32501U;
_IEC_CONST unsigned short udpERR_INVALID_IDENT = 32500U;
#endif
/* Datatypes and datatypes of function blocks */
typedef struct udpIP_MREQ_typ
{ unsigned long pMcastAddr;
unsigned long pIfAddr;
} udpIP_MREQ_typ;
typedef struct udpSO_ADDRESS_typ
{ unsigned long pPort;
unsigned long pIpAddr;
} udpSO_ADDRESS_typ;
typedef struct UdpOpen
{
/* VAR_INPUT (analog) */
unsigned long pIfAddr;
unsigned short port;
unsigned long options;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long ident;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} UdpOpen_typ;
typedef struct UdpClose
{
/* VAR_INPUT (analog) */
unsigned long ident;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} UdpClose_typ;
typedef struct UdpConnect
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pHost;
unsigned short port;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} UdpConnect_typ;
typedef struct UdpDisconnect
{
/* VAR_INPUT (analog) */
unsigned long ident;
/* VAR_OUTPUT (analog) */
unsigned short status;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} UdpDisconnect_typ;
typedef struct UdpSend
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pHost;
unsigned short port;
unsigned long pData;
unsigned long datalen;
unsigned long flags;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long sentlen;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} UdpSend_typ;
typedef struct UdpRecv
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long pData;
unsigned long datamax;
unsigned long flags;
unsigned long pIpAddr;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long recvlen;
unsigned short port;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} UdpRecv_typ;
typedef struct UdpIoctl
{
/* VAR_INPUT (analog) */
unsigned long ident;
unsigned long ioctl;
unsigned long pData;
unsigned long datalen;
/* VAR_OUTPUT (analog) */
unsigned short status;
unsigned long outlen;
/* VAR (analog) */
unsigned short i_state;
unsigned short i_result;
unsigned long i_tmp;
/* VAR_INPUT (digital) */
plcbit enable;
} UdpIoctl_typ;
/* Prototyping of functions and function blocks */
void UdpOpen(struct UdpOpen* inst);
void UdpClose(struct UdpClose* inst);
void UdpConnect(struct UdpConnect* inst);
void UdpDisconnect(struct UdpDisconnect* inst);
void UdpSend(struct UdpSend* inst);
void UdpRecv(struct UdpRecv* inst);
void UdpIoctl(struct UdpIoctl* inst);
#ifdef __cplusplus
};
#endif
#endif /* _ASUDP_ */

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<?AutomationStudio Version=3.0.90.23 SP05?>
<Package xmlns="http://br-automation.co.at/AS/Package">
<Objects>
<Object Type="Library" Language="Binary" Description="B&amp;R Benutzer - Library">sys_lib</Object>
@@ -26,5 +26,6 @@
<Object Type="Library" Language="Binary" Description="The AsMem library makes it possible to manage memory blocks located in large memory areas (memory partitions).">AsMem</Object>
<Object Type="Library" Language="Binary" Description="The AsDb library supports access to Syba">AsDb</Object>
<Object Type="Library" Language="Binary" Description="Smart Device Controller">Acp10sdc</Object>
<Object Type="Library" Language="Binary" Description="This library contains FBKs for exchanging data packets via datagram sockets (UDP).">AsUDP</Object>
</Objects>
</Package>

View File

@@ -1,37 +1,37 @@
(*Bathgroups*)
TYPE
enBathVars :
(
eVAR_TEMPERATURE := 1,
eVAR_VOLTAGE := 2,
eVAR_CURRENT := 3,
eVAR_PH := 4
);
enCarrierLogMode :
(
eCREATE_CARRIER_LOG := 1, (*Create a New Carrier Log Entry*)
eUPDATE_CARRIER_LOG := 2, (*Update an Existing Carrier Log Entry*)
eCREATE_CARRIER_LOG_STEP := 3 (*Create a New Carrier Log Step Entry*)
);
typ_BathVarLog : STRUCT
bLogValue : BOOL := FALSE; (*Log this value*)
usBathVar : enBathVars := eVAR_TEMPERATURE; (*Type (1 Temperature....*)
iValue : INT := 0; (*Value*)
dtsLogTime : DTStructure; (*Start Time of Step in Recipe*)
END_STRUCT;
typ_CarrierLog : STRUCT (*Struct to Log Carrier*)
bCreateLog : BOOL; (*Create a Log (only from Depot/CTs)*)
enCarrierLogmode : enCarrierLogMode := eCREATE_CARRIER_LOG; (*What to do*)
usBath : USINT := 0; (*BathNr*)
usState : USINT := 0; (*Status of Carrier/Step*)
udProductionId : UDINT := 0; (*ProdID == UTC UnixTimestamp*)
udCarrierId : UDINT := 0; (*Carrier ID*)
udRackId1 : UDINT := 0; (*ID of Rack 1*)
udProductId1 : UDINT := 0; (*ID of Product on Rack 1*)
udRackId2 : UDINT := 0; (*ID of Rack 2*)
udProductId2 : UDINT := 0; (*ID of Product on Rack 2*)
dtsStart : DTStructure; (*UTC Starttime of Carrier/Step*)
dtsStop : DTStructure; (*UTC Stoptime of Carrier/Step*)
END_STRUCT;
END_TYPE
(*Bathgroups*)
TYPE
enBathVars :
(
eVAR_TEMPERATURE := 1,
eVAR_VOLTAGE := 2,
eVAR_CURRENT := 3,
eVAR_PH := 4
);
enCarrierLogMode :
(
eCREATE_CARRIER_LOG := 1, (*Create a New Carrier Log Entry*)
eUPDATE_CARRIER_LOG := 2, (*Update an Existing Carrier Log Entry*)
eCREATE_CARRIER_LOG_STEP := 3 (*Create a New Carrier Log Step Entry*)
);
typ_BathVarLog : STRUCT
bLogValue : BOOL := FALSE; (*Log this value*)
usBathVar : enBathVars := eVAR_TEMPERATURE; (*Type (1 Temperature....*)
iValue : INT := 0; (*Value*)
dtsLogTime : DTStructure; (*Start Time of Step in Recipe*)
END_STRUCT;
typ_CarrierLog : STRUCT (*Struct to Log Carrier*)
bCreateLog : BOOL; (*Create a Log (only from Depot/CTs)*)
enCarrierLogmode : enCarrierLogMode := eCREATE_CARRIER_LOG; (*What to do*)
usBath : USINT := 0; (*BathNr*)
usState : USINT := 0; (*Status of Carrier/Step*)
udProductionId : UDINT := 0; (*ProdID == UTC UnixTimestamp*)
udCarrierId : UDINT := 0; (*Carrier ID*)
udRackId1 : UDINT := 0; (*ID of Rack 1*)
udProductId1 : UDINT := 0; (*ID of Product on Rack 1*)
udRackId2 : UDINT := 0; (*ID of Rack 2*)
udProductId2 : UDINT := 0; (*ID of Product on Rack 2*)
dtsStart : DTStructure; (*UTC Starttime of Carrier/Step*)
dtsStop : DTStructure; (*UTC Stoptime of Carrier/Step*)
END_STRUCT;
END_TYPE

View File

@@ -1,5 +1,4 @@
(*//global Arrays for Baths*)
VAR
gBathVarLog : ARRAY[1..60] OF typ_BathVarLog; (*Bathvarlog (1 Entry each Bath)*)
gCarrierLog : ARRAY[1..60] OF typ_CarrierLog := [60(0)]; (*Carrierlog / Bath*)
END_VAR
(*//global Arrays for Baths*)
VAR
gCarrierLog : ARRAY[1..60] OF typ_CarrierLog := [60(0)]; (*Carrierlog / Bath*)
END_VAR

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<?AutomationStudio Version=3.0.90.23 SP05?>
<Package xmlns="http://br-automation.co.at/AS/Package">
<Objects>
<Object Type="File" Description="Logging Types">GlobalLogger.typ</Object>
@@ -8,5 +8,6 @@
<Object Type="Program" Language="IEC" Description="Logs Values in SQL Database">SQLLogger</Object>
<Object Type="Program" Language="IEC" Description="Get Process Data from SQL">SQLProcess</Object>
<Object Type="Program" Language="IEC" Description="Hardware Monitor">HWMonitor</Object>
<Object Type="Program" Language="IEC" Description="Collectd Client">collectd</Object>
</Objects>
</Package>

View File

@@ -1,57 +1,57 @@
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: SQLLogger
* File: UpdateVal.ab
* Author: michi
* Created: January 18, 2012
********************************************************************
* Implementation of program SQLLogger
********************************************************************)
(* SQL Statement for Create a Carrierlog *)
FUNCTION CreateCarrierlog
strcpy (pstrInNewSQL, "INSERT INTO carrierlog (machid,uxtimestamp,status,carrierid,rackid1,productid1,rackid2,productid2,ts_start) VALUES ('")
strcat (pstrInNewSQL, pstrInLineId)
strcat (pstrInNewSQL, "',")
itoa (udInUxtimestamp , pstrInNewSQL + strlen (pstrInNewSQL))
//2 : gCARRIER_INPROCESS
strcat (pstrInNewSQL, ",2,")
itoa (udInCarrierId , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ",")
itoa (udInRackId1 , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ",")
itoa (udInProdId1 , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ",")
itoa (udInRackId2 , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ",")
itoa (udInProdId2 , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ",'")
itoa (dtsInStartTime.year , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "-")
itoa (dtsInStartTime.month , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "-")
itoa (dtsInStartTime.day , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, " ")
itoa (dtsInStartTime.hour , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ":")
itoa (dtsInStartTime.minute , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ":")
itoa (dtsInStartTime.second , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ".")
itoa (dtsInStartTime.millisec , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "');")
IF uiInOutSQLNextFree = QUEUE_SIZE THEN
IF uiInOutSQLData = 1 THEN
udInOutLostSQL := udInOutLostSQL + 1
ELSE
uiInOutSQLNextFree := 1
ENDIF
ELSE IF uiInOutSQLData = (uiInOutSQLNextFree + 1) THEN
udInOutLostSQL := udInOutLostSQL + 1
ELSE
uiInOutSQLNextFree := uiInOutSQLNextFree + 1
ENDIF
CreateCarrierlog := 0
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: SQLLogger
* File: UpdateVal.ab
* Author: michi
* Created: January 18, 2012
********************************************************************
* Implementation of program SQLLogger
********************************************************************)
(* SQL Statement for Create a Carrierlog *)
FUNCTION CreateCarrierlog
strcpy (pstrInNewSQL, "INSERT INTO carrierlog (machid,uxtimestamp,status,carrierid,rackid1,productid1,rackid2,productid2,ts_start) VALUES ('")
strcat (pstrInNewSQL, pstrInLineId)
strcat (pstrInNewSQL, "',")
itoa (udInUxtimestamp , pstrInNewSQL + strlen (pstrInNewSQL))
//2 : gCARRIER_INPROCESS
strcat (pstrInNewSQL, ",2,")
itoa (udInCarrierId , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ",")
itoa (udInRackId1 , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ",")
itoa (udInProdId1 , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ",")
itoa (udInRackId2 , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ",")
itoa (udInProdId2 , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ",'")
itoa (dtsInStartTime.year , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "-")
itoa (dtsInStartTime.month , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "-")
itoa (dtsInStartTime.day , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, " ")
itoa (dtsInStartTime.hour , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ":")
itoa (dtsInStartTime.minute , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ":")
itoa (dtsInStartTime.second , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ".")
itoa (dtsInStartTime.millisec , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "');")
IF uiInOutSQLNextFree = QUEUE_SIZE THEN
IF uiInOutSQLData = 1 THEN
udInOutLostSQL := udInOutLostSQL + 1
ELSE
uiInOutSQLNextFree := 1
ENDIF
ELSE IF uiInOutSQLData = (uiInOutSQLNextFree + 1) THEN
udInOutLostSQL := udInOutLostSQL + 1
ELSE
uiInOutSQLNextFree := uiInOutSQLNextFree + 1
ENDIF
CreateCarrierlog := 0
END_FUNCTION

View File

@@ -1,64 +1,64 @@
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: SQLLogger
* File: UpdateVal.ab
* Author: michi
* Created: January 18, 2012
********************************************************************
* Implementation of program SQLLogger
********************************************************************)
(* SQL Statement for Create a Carrierlog *)
FUNCTION CreateCarrierlogStep
strcpy (pstrInNewSQL, "INSERT INTO carrierlog_steps (machid,uxtimestamp,bathnr,result,ts_start,ts_end) VALUES ('")
strcat (pstrInNewSQL, pstrInLineId)
strcat (pstrInNewSQL, "',")
itoa (udInUxtimestamp , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ",")
itoa (usInBathnr , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ",")
itoa (usInResult , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ",'")
itoa (dtsInStartTime.year , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "-")
itoa (dtsInStartTime.month , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "-")
itoa (dtsInStartTime.day , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, " ")
itoa (dtsInStartTime.hour , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ":")
itoa (dtsInStartTime.minute , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ":")
itoa (dtsInStartTime.second , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ".")
itoa (dtsInStartTime.millisec , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "','")
itoa (dtsInStopTime.year , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "-")
itoa (dtsInStopTime.month , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "-")
itoa (dtsInStopTime.day , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, " ")
itoa (dtsInStopTime.hour , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ":")
itoa (dtsInStopTime.minute , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ":")
itoa (dtsInStopTime.second , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ".")
itoa (dtsInStopTime.millisec , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "');")
IF uiInOutSQLNextFree = QUEUE_SIZE THEN
IF uiInOutSQLData = 1 THEN
udInOutLostSQL := udInOutLostSQL + 1
ELSE
uiInOutSQLNextFree := 1
ENDIF
ELSE IF uiInOutSQLData = (uiInOutSQLNextFree + 1) THEN
udInOutLostSQL := udInOutLostSQL + 1
ELSE
uiInOutSQLNextFree := uiInOutSQLNextFree + 1
ENDIF
CreateCarrierlogStep := 0
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: SQLLogger
* File: UpdateVal.ab
* Author: michi
* Created: January 18, 2012
********************************************************************
* Implementation of program SQLLogger
********************************************************************)
(* SQL Statement for Create a Carrierlog *)
FUNCTION CreateCarrierlogStep
strcpy (pstrInNewSQL, "INSERT INTO carrierlog_steps (machid,uxtimestamp,bathnr,result,ts_start,ts_end) VALUES ('")
strcat (pstrInNewSQL, pstrInLineId)
strcat (pstrInNewSQL, "',")
itoa (udInUxtimestamp , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ",")
itoa (usInBathnr , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ",")
itoa (usInResult , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ",'")
itoa (dtsInStartTime.year , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "-")
itoa (dtsInStartTime.month , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "-")
itoa (dtsInStartTime.day , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, " ")
itoa (dtsInStartTime.hour , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ":")
itoa (dtsInStartTime.minute , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ":")
itoa (dtsInStartTime.second , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ".")
itoa (dtsInStartTime.millisec , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "','")
itoa (dtsInStopTime.year , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "-")
itoa (dtsInStopTime.month , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "-")
itoa (dtsInStopTime.day , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, " ")
itoa (dtsInStopTime.hour , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ":")
itoa (dtsInStopTime.minute , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ":")
itoa (dtsInStopTime.second , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ".")
itoa (dtsInStopTime.millisec , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "');")
IF uiInOutSQLNextFree = QUEUE_SIZE THEN
IF uiInOutSQLData = 1 THEN
udInOutLostSQL := udInOutLostSQL + 1
ELSE
uiInOutSQLNextFree := 1
ENDIF
ELSE IF uiInOutSQLData = (uiInOutSQLNextFree + 1) THEN
udInOutLostSQL := udInOutLostSQL + 1
ELSE
uiInOutSQLNextFree := uiInOutSQLNextFree + 1
ENDIF
CreateCarrierlogStep := 0
END_FUNCTION

View File

@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<Program xmlns="http://br-automation.co.at/AS/Program">
<Files>
<File Description="Cyclic code">SQLLoggerCyclic.st</File>
<File Description="Initialization code">SQLLoggerInit.st</File>
<File Description="Local data types" Private="true">SQLLogger.typ</File>
<File Description="Local variables" Private="true">SQLLogger.var</File>
<File Description="SQL Statement for Update a Machine Value">UpdateVal.ab</File>
<File Description="SQL Statement for Update a Machine Parameter">UpdateParam.ab</File>
<File Description="SQL Statement for Update a Machine Alarm">UpdateAlarm.ab</File>
<File Description="SQL Statement for Create a Carrier Log">CreateCarrierlog.ab</File>
<File Description="SQL Statement for Update a Carrier Log">UpdateCarrierlog.ab</File>
<File Description="SQL Statement for Create a Carrier Log Step">CreateCarrierlogStep.ab</File>
<File Private="true">SQLLogger.fun</File>
</Files>
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<Program xmlns="http://br-automation.co.at/AS/Program">
<Files>
<File Description="Cyclic code">SQLLoggerCyclic.st</File>
<File Description="Initialization code">SQLLoggerInit.st</File>
<File Description="Local data types" Private="true">SQLLogger.typ</File>
<File Description="Local variables" Private="true">SQLLogger.var</File>
<File Description="SQL Statement for Update a Machine Value">UpdateVal.ab</File>
<File Description="SQL Statement for Update a Machine Parameter">UpdateParam.ab</File>
<File Description="SQL Statement for Update a Machine Alarm">UpdateAlarm.ab</File>
<File Description="SQL Statement for Create a Carrier Log">CreateCarrierlog.ab</File>
<File Description="SQL Statement for Update a Carrier Log">UpdateCarrierlog.ab</File>
<File Description="SQL Statement for Create a Carrier Log Step">CreateCarrierlogStep.ab</File>
<File Private="true">SQLLogger.fun</File>
</Files>
</Program>

View File

@@ -1,110 +1,110 @@
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: SQLLogger
* File: SQLLogger.fun
* Author: michi
* Created: January 18, 2012
********************************************************************
* Functions and function blocks of program SQLLogger
********************************************************************)
FUNCTION UpdateVal : BOOL (*SQL Statement for Update a Bathvalue*)
VAR_INPUT
pstrLineId : UDINT; (*LineId*)
usPart : USINT; (*Machine, TWNr, BathNr..*)
diLogVar : DINT; (*Variable ID to Log (DINT bec. of ENUM)*)
iValue : INT; (*Current Value*)
dtsLogTime : DTStructure; (*Time of Log*)
pstrNewSQL : UDINT; (*Pointer on New SQL*)
END_VAR
VAR_IN_OUT
uiInOutSQLNextFree : UINT; (*Next Free Dataset*)
uiInOutSQLData : UINT; (*Next Data in DataSet*)
udInOutLostSQL : UDINT; (*Number of Lost SQL Statements*)
END_VAR
END_FUNCTION
FUNCTION UpdateAlarm : BOOL
VAR_INPUT
pstrInLineId : UDINT; (*LineId*)
usInPart : USINT; (*Machine, TWNr, BathNr..*)
uiInAlarmId : UINT; (*AlarmiD*)
iInState : INT; (*Current Alarmstate*)
dtsInLogTime : DTStructure; (*Time of Log*)
pstrInNewSQL : UDINT; (*Pointer on New SQL*)
END_VAR
VAR_IN_OUT
uiInOutSQLNextFree : UINT; (*Next Free Dataset*)
uiInOutSQLData : UINT; (*Next Data in DataSet*)
udInOutLostSQL : UDINT; (*Number of Lost SQL Statements*)
END_VAR
END_FUNCTION
FUNCTION UpdateParam : BOOL (*SQL Statement for Update a Bathparam*)
VAR_INPUT
pstrLineId : UDINT; (*LineId*)
usPart : USINT; (*Machine, TWNr, BathNr..*)
diLogVar : DINT; (*Variable ID to Log (DINT bec. of ENUM)*)
pstrLogField : UDINT; (*Field in Table*)
iValue : INT; (*Current Value*)
dtsLogTime : DTStructure; (*Time of Log*)
pstrNewSQL : UDINT; (*Pointer on New SQL*)
END_VAR
VAR_IN_OUT
uiInOutSQLNextFree : UINT; (*Next Free Dataset*)
uiInOutSQLData : UINT; (*Next Data in DataSet*)
udInOutLostSQL : UDINT; (*Number of Lost SQL Statements*)
END_VAR
END_FUNCTION
FUNCTION CreateCarrierlog : BOOL (*SQL Statement for Creating a Carrierlog*)
VAR_INPUT
pstrInLineId : UDINT; (*LineId*)
udInUxtimestamp : UDINT; (*UTC Unixtimestamp*)
udInCarrierId : UDINT; (*ID of Carrier*)
udInRackId1 : UDINT; (*ID of Rack 1*)
udInProdId1 : UDINT; (*Product on Rack 1*)
udInRackId2 : UDINT; (*ID of Rack 2*)
udInProdId2 : UDINT; (*Product on Rack 2*)
dtsInStartTime : DTStructure; (*Start of Carrier*)
pstrInNewSQL : UDINT; (*Pointer on New SQL*)
END_VAR
VAR_IN_OUT
uiInOutSQLNextFree : UINT; (*Next Free Dataset*)
uiInOutSQLData : UINT; (*Next Data in DataSet*)
udInOutLostSQL : UDINT; (*Number of Lost SQL Statements*)
END_VAR
END_FUNCTION
FUNCTION UpdateCarrierlog : BOOL (*SQL Statement for Update State of a Carrierlog*)
VAR_INPUT
pstrInLineId : UDINT; (*LineId*)
udInUxtimestamp : UDINT; (*UTC Unixtimestamp*)
usInState : USINT; (*New State of CarrierLog*)
dtsInStopTime : DTStructure; (*Stop of Carrier*)
pstrInNewSQL : UDINT; (*Pointer on New SQL*)
END_VAR
VAR_IN_OUT
uiInOutSQLNextFree : UINT; (*Next Free Dataset*)
uiInOutSQLData : UINT; (*Next Data in DataSet*)
udInOutLostSQL : UDINT; (*Number of Lost SQL Statements*)
END_VAR
END_FUNCTION
FUNCTION CreateCarrierlogStep : BOOL (*SQL Statement for Creating a Carrierlog Step*)
VAR_INPUT
pstrInLineId : UDINT; (*LineId*)
udInUxtimestamp : UDINT; (*UTC Unixtimestamp*)
usInBathnr : USINT; (*BathNr*)
dtsInStartTime : DTStructure; (*Start of Carrierstep*)
dtsInStopTime : DTStructure; (*Stop of Carrierstep*)
usInResult : USINT; (*Result of Carrierstep*)
pstrInNewSQL : UDINT; (*Pointer on New SQL*)
END_VAR
VAR_IN_OUT
uiInOutSQLNextFree : UINT; (*Next Free Dataset*)
uiInOutSQLData : UINT; (*Next Data in DataSet*)
udInOutLostSQL : UDINT; (*Number of Lost SQL Statements*)
END_VAR
END_FUNCTION
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: SQLLogger
* File: SQLLogger.fun
* Author: michi
* Created: January 18, 2012
********************************************************************
* Functions and function blocks of program SQLLogger
********************************************************************)
FUNCTION UpdateVal : BOOL (*SQL Statement for Update a Bathvalue*)
VAR_INPUT
pstrLineId : UDINT; (*LineId*)
usPart : USINT; (*Machine, TWNr, BathNr..*)
diLogVar : DINT; (*Variable ID to Log (DINT bec. of ENUM)*)
iValue : INT; (*Current Value*)
dtsLogTime : DTStructure; (*Time of Log*)
pstrNewSQL : UDINT; (*Pointer on New SQL*)
END_VAR
VAR_IN_OUT
uiInOutSQLNextFree : UINT; (*Next Free Dataset*)
uiInOutSQLData : UINT; (*Next Data in DataSet*)
udInOutLostSQL : UDINT; (*Number of Lost SQL Statements*)
END_VAR
END_FUNCTION
FUNCTION UpdateAlarm : BOOL
VAR_INPUT
pstrInLineId : UDINT; (*LineId*)
usInPart : USINT; (*Machine, TWNr, BathNr..*)
uiInAlarmId : UINT; (*AlarmiD*)
iInState : INT; (*Current Alarmstate*)
dtsInLogTime : DTStructure; (*Time of Log*)
pstrInNewSQL : UDINT; (*Pointer on New SQL*)
END_VAR
VAR_IN_OUT
uiInOutSQLNextFree : UINT; (*Next Free Dataset*)
uiInOutSQLData : UINT; (*Next Data in DataSet*)
udInOutLostSQL : UDINT; (*Number of Lost SQL Statements*)
END_VAR
END_FUNCTION
FUNCTION UpdateParam : BOOL (*SQL Statement for Update a Bathparam*)
VAR_INPUT
pstrLineId : UDINT; (*LineId*)
usPart : USINT; (*Machine, TWNr, BathNr..*)
diLogVar : DINT; (*Variable ID to Log (DINT bec. of ENUM)*)
pstrLogField : UDINT; (*Field in Table*)
iValue : INT; (*Current Value*)
dtsLogTime : DTStructure; (*Time of Log*)
pstrNewSQL : UDINT; (*Pointer on New SQL*)
END_VAR
VAR_IN_OUT
uiInOutSQLNextFree : UINT; (*Next Free Dataset*)
uiInOutSQLData : UINT; (*Next Data in DataSet*)
udInOutLostSQL : UDINT; (*Number of Lost SQL Statements*)
END_VAR
END_FUNCTION
FUNCTION CreateCarrierlog : BOOL (*SQL Statement for Creating a Carrierlog*)
VAR_INPUT
pstrInLineId : UDINT; (*LineId*)
udInUxtimestamp : UDINT; (*UTC Unixtimestamp*)
udInCarrierId : UDINT; (*ID of Carrier*)
udInRackId1 : UDINT; (*ID of Rack 1*)
udInProdId1 : UDINT; (*Product on Rack 1*)
udInRackId2 : UDINT; (*ID of Rack 2*)
udInProdId2 : UDINT; (*Product on Rack 2*)
dtsInStartTime : DTStructure; (*Start of Carrier*)
pstrInNewSQL : UDINT; (*Pointer on New SQL*)
END_VAR
VAR_IN_OUT
uiInOutSQLNextFree : UINT; (*Next Free Dataset*)
uiInOutSQLData : UINT; (*Next Data in DataSet*)
udInOutLostSQL : UDINT; (*Number of Lost SQL Statements*)
END_VAR
END_FUNCTION
FUNCTION UpdateCarrierlog : BOOL (*SQL Statement for Update State of a Carrierlog*)
VAR_INPUT
pstrInLineId : UDINT; (*LineId*)
udInUxtimestamp : UDINT; (*UTC Unixtimestamp*)
usInState : USINT; (*New State of CarrierLog*)
dtsInStopTime : DTStructure; (*Stop of Carrier*)
pstrInNewSQL : UDINT; (*Pointer on New SQL*)
END_VAR
VAR_IN_OUT
uiInOutSQLNextFree : UINT; (*Next Free Dataset*)
uiInOutSQLData : UINT; (*Next Data in DataSet*)
udInOutLostSQL : UDINT; (*Number of Lost SQL Statements*)
END_VAR
END_FUNCTION
FUNCTION CreateCarrierlogStep : BOOL (*SQL Statement for Creating a Carrierlog Step*)
VAR_INPUT
pstrInLineId : UDINT; (*LineId*)
udInUxtimestamp : UDINT; (*UTC Unixtimestamp*)
usInBathnr : USINT; (*BathNr*)
dtsInStartTime : DTStructure; (*Start of Carrierstep*)
dtsInStopTime : DTStructure; (*Stop of Carrierstep*)
usInResult : USINT; (*Result of Carrierstep*)
pstrInNewSQL : UDINT; (*Pointer on New SQL*)
END_VAR
VAR_IN_OUT
uiInOutSQLNextFree : UINT; (*Next Free Dataset*)
uiInOutSQLData : UINT; (*Next Data in DataSet*)
udInOutLostSQL : UDINT; (*Number of Lost SQL Statements*)
END_VAR
END_FUNCTION

View File

@@ -1,49 +1,49 @@
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: SQLProcess
* File: SQLProcess.typ
* Author: michi
* Created: November 30, 2011
********************************************************************
* Local data types of program SQLProcess
********************************************************************)
TYPE
Steps_enum :
(
enSTEP_STOP, (*Stop - nothing to do*)
enSTEP_CONNECT, (*Connect to Database*)
enSTEP_CONNECT_X,
enSTEP_WAIT_FOR_COMMAND := 50, (*wait for command of user*)
enSTEP_SAVE_VALUE := 60, (*Save a Value*)
enSTEP_SAVE_VALUE_X, (*Execute*)
enSTEP_DISCONNECT := 150, (*disconnect from server*)
enSTEP_DISCONNECT_X, (*Execute*)
enSTEP_GET_ERROR := 200, (*receive error of server*)
enSTEP_GET_ERROR_X, (*Execute*)
enSTEP_ERROR, (*error step*)
enSTEP_DUMMY (*dummy step - for development*)
);
END_TYPE
(*Commands for receipe handling*)
TYPE
Command_enum :
(
eCMD_OFFLINE, (*Connect*)
eCMD_IDLE, (*nothing to do*)
eCMD_CONNECT := 10, (*connect to server*)
eCMD_CONNECT_w, (*wait till connected*)
eCMD_SAVE := 20, (*load receipe 'sNewReceipe'*)
eCMD_SAVE_w,
eCMD_DISCONNECT := 90, (*disconnect from server*)
eCMD_DISCONNECT_w
);
CommandInterface_typ : STRUCT
enCommand : Command_enum; (*Current Command*)
uiStatus : UINT; (*0 = OK; 1 = FAIL SQL QUERY; 2 = Unexpected Error*)
strError : STRING[100];
END_STRUCT;
END_TYPE
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: SQLProcess
* File: SQLProcess.typ
* Author: michi
* Created: November 30, 2011
********************************************************************
* Local data types of program SQLProcess
********************************************************************)
TYPE
Steps_enum :
(
enSTEP_STOP, (*Stop - nothing to do*)
enSTEP_CONNECT, (*Connect to Database*)
enSTEP_CONNECT_X,
enSTEP_WAIT_FOR_COMMAND := 50, (*wait for command of user*)
enSTEP_SAVE_VALUE := 60, (*Save a Value*)
enSTEP_SAVE_VALUE_X, (*Execute*)
enSTEP_DISCONNECT := 150, (*disconnect from server*)
enSTEP_DISCONNECT_X, (*Execute*)
enSTEP_GET_ERROR := 200, (*receive error of server*)
enSTEP_GET_ERROR_X, (*Execute*)
enSTEP_ERROR, (*error step*)
enSTEP_DUMMY (*dummy step - for development*)
);
END_TYPE
(*Commands for receipe handling*)
TYPE
Command_enum :
(
eCMD_OFFLINE, (*Connect*)
eCMD_IDLE, (*nothing to do*)
eCMD_CONNECT := 10, (*connect to server*)
eCMD_CONNECT_w, (*wait till connected*)
eCMD_SAVE := 20, (*load receipe 'sNewReceipe'*)
eCMD_SAVE_w,
eCMD_DISCONNECT := 90, (*disconnect from server*)
eCMD_DISCONNECT_w
);
CommandInterface_typ : STRUCT
enCommand : Command_enum; (*Current Command*)
uiStatus : UINT; (*0 = OK; 1 = FAIL SQL QUERY; 2 = Unexpected Error*)
strError : STRING[100];
END_STRUCT;
END_TYPE

View File

@@ -1,77 +1,74 @@
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: SQLProcess
* File: SQLProcess.var
* Author: michi
* Created: November 30, 2011
********************************************************************
* Local variables of program SQLProcess
********************************************************************)
(*Dynamic Vars*)
VAR
lBathVarLog : REFERENCE TO typ_BathVarLog;
lCarrierLog : REFERENCE TO typ_CarrierLog;
END_VAR
(*Constants*)
VAR CONSTANT
QUEUE_SIZE : UINT := 500;
END_VAR
(*Configuration Variables*)
VAR
strHost : STRING[40] := '192.168.30.12:1433'; (*Hostname/IP:Port of SQL Server*)
strDatabase : STRING[40] := 'franz_production'; (*name of database*)
strUsername : STRING[40] := 'franz_production'; (*username*)
strPassword : STRING[40] := '11znarf_dorp'; (*password*)
END_VAR
(*Variables*)
VAR
enStep : Steps_enum := (0); (*Steps of Connection Handling*)
Command : CommandInterface_typ; (*Command Interface for user*)
bBlockDevel : BOOL := TRUE;
bSaveMachParam : BOOL := FALSE; (*Save Machine Params*)
bDelay : BOOL := FALSE;
bTWMovingDiscreteLatchX : ARRAY[1..4] OF BOOL := [4(FALSE)];
bTWMovingDiscreteLatchY : ARRAY[1..4] OF BOOL := [4(FALSE)];
usDelay : USINT := 20;
uiSQLData : UINT := 1; (*Pointer on Data*)
uiSQLNextFree : UINT := 1; (*Pointer on Next Free*)
usi : USINT := 0;
usPart : USINT := 0;
usBathNr : USINT := 1; (*BathNr to Store Var/Error of*)
usTWNr : USINT := 1; (*TWNr to Store Error of*)
usCTNr : USINT := 1; (*CTNr to Store Error of*)
usMachModeLatch : USINT := 0; (*Latch for Machine Mode*)
iMachTempLatch : INT := 0; (*Latch for Machine Temperature*)
iMachTempLatchGL1 : ARRAY[1..3] OF INT := [3(0)]; (*Latch for Machine Temperature*)
iMachTempLatchGL2 : ARRAY[1..3] OF INT := [3(0)]; (*Latch for Machine Temperature*)
iTWAcpTempLatchX : ARRAY[1..4] OF INT := [4(0)];
iTWAcpTempLatchY : ARRAY[1..4] OF INT := [4(0)];
iTWMotorTempLatchX : ARRAY[1..4] OF INT := [4(0)];
iTWMotorTempLatchY : ARRAY[1..4] OF INT := [4(0)];
iTWMotorLoadLatchX : ARRAY[1..4] OF INT := [4(0)];
iTWMotorLoadLatchY : ARRAY[1..4] OF INT := [4(0)];
iLogValue : INT := 0;
iAlarmState : INT := 0;
uiAlarm : UINT := 0;
udConnectionIdent : UDINT := 0; (*Ident of connection*)
udLostSQL : UDINT := 0; (*Lost*)
udSQLErrors : UDINT := 0; (*Number of SQL Errors*)
udBadCaseCarrierLog : UDINT := 0;
diLogVar : DINT := 0;
strSQLQueue : ARRAY[1..QUEUE_SIZE] OF STRING[500]; (*Queue for SQL Query Strings*)
strSQLWithError : ARRAY[0..4] OF STRING[100] := [5('')];
BathalarmsLatch : ARRAY[0..60] OF typAlarm := [61(0)]; (*Latch for Old Bahtalarms*)
TWalarmsLatch : ARRAY[1..4] OF typAlarm := [4(0)]; (*Latch for Old TWalarms*)
CTalarmsLatch : ARRAY[1..2] OF typAlarm := [2(0)]; (*Latch for Old CTalarms*)
MachinealarmsLatch : typAlarm; (*Latch for Old Machinealarms*)
END_VAR
(*Functionblocks*)
VAR
DBConnect : dbConnect := (0); (*FUB - Connect to database*)
DBExecute : dbExecuteSql := (0); (*FUB - Execute SQL Statement*)
DBErrMsg : dbGetErrorMessage := (0); (*FUB - Get Error Message*)
DBDisconnect : dbDisconnect := (0); (*FUB - Disconnect from database*)
DBGetData : dbGetData := (0); (*FUB - Get Data of field*)
DBFetchNextRow : dbFetchNextRow := (0); (*FUB - Prepare next Row for reading*)
END_VAR
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: SQLProcess
* File: SQLProcess.var
* Author: michi
* Created: November 30, 2011
********************************************************************
* Local variables of program SQLProcess
********************************************************************)
(*Dynamic Vars*)
VAR
lBathVarLog : REFERENCE TO typ_BathVarLog;
lCarrierLog : REFERENCE TO typ_CarrierLog;
END_VAR
(*Constants*)
VAR CONSTANT
QUEUE_SIZE : UINT := 500;
END_VAR
(*Configuration Variables*)
VAR
strHost : STRING[40] := '192.168.30.12:1433'; (*Hostname/IP:Port of SQL Server*)
strDatabase : STRING[40] := 'franz_production'; (*name of database*)
strUsername : STRING[40] := 'franz_production'; (*username*)
strPassword : STRING[40] := '11znarf_dorp'; (*password*)
END_VAR
(*Variables*)
VAR
enStep : Steps_enum := (0); (*Steps of Connection Handling*)
Command : CommandInterface_typ; (*Command Interface for user*)
bBlockDevel : BOOL := TRUE;
bSaveMachParam : BOOL := FALSE; (*Save Machine Params*)
bDelay : BOOL := FALSE;
bTWMovingDiscreteLatchX : ARRAY[1..4] OF BOOL := [4(FALSE)];
bTWMovingDiscreteLatchY : ARRAY[1..4] OF BOOL := [4(FALSE)];
usDelay : USINT := 20;
uiSQLData : UINT := 1; (*Pointer on Data*)
uiSQLNextFree : UINT := 1; (*Pointer on Next Free*)
usi : USINT := 0;
usPart : USINT := 0;
usBathNr : USINT := 1; (*BathNr to Store Var/Error of*)
usTWNr : USINT := 1; (*TWNr to Store Error of*)
usCTNr : USINT := 1; (*CTNr to Store Error of*)
usMachModeLatch : USINT := 0; (*Latch for Machine Mode*)
iTWAcpTempLatchX : ARRAY[1..4] OF INT := [4(0)];
iTWAcpTempLatchY : ARRAY[1..4] OF INT := [4(0)];
iTWMotorTempLatchX : ARRAY[1..4] OF INT := [4(0)];
iTWMotorTempLatchY : ARRAY[1..4] OF INT := [4(0)];
iTWMotorLoadLatchX : ARRAY[1..4] OF INT := [4(0)];
iTWMotorLoadLatchY : ARRAY[1..4] OF INT := [4(0)];
iLogValue : INT := 0;
iAlarmState : INT := 0;
uiAlarm : UINT := 0;
udConnectionIdent : UDINT := 0; (*Ident of connection*)
udLostSQL : UDINT := 0; (*Lost*)
udSQLErrors : UDINT := 0; (*Number of SQL Errors*)
udBadCaseCarrierLog : UDINT := 0;
diLogVar : DINT := 0;
strSQLQueue : ARRAY[1..QUEUE_SIZE] OF STRING[500]; (*Queue for SQL Query Strings*)
strSQLWithError : ARRAY[0..4] OF STRING[100] := [5('')];
BathalarmsLatch : ARRAY[0..60] OF typAlarm := [61(0)]; (*Latch for Old Bahtalarms*)
TWalarmsLatch : ARRAY[1..4] OF typAlarm := [4(0)]; (*Latch for Old TWalarms*)
CTalarmsLatch : ARRAY[1..2] OF typAlarm := [2(0)]; (*Latch for Old CTalarms*)
MachinealarmsLatch : typAlarm; (*Latch for Old Machinealarms*)
END_VAR
(*Functionblocks*)
VAR
DBConnect : dbConnect := (0); (*FUB - Connect to database*)
DBExecute : dbExecuteSql := (0); (*FUB - Execute SQL Statement*)
DBErrMsg : dbGetErrorMessage := (0); (*FUB - Get Error Message*)
DBDisconnect : dbDisconnect := (0); (*FUB - Disconnect from database*)
DBGetData : dbGetData := (0); (*FUB - Get Data of field*)
DBFetchNextRow : dbFetchNextRow := (0); (*FUB - Prepare next Row for reading*)
END_VAR

File diff suppressed because it is too large Load Diff

View File

@@ -1,21 +1,21 @@
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: SQLProcess
* File: SQLProcessInit.st
* Author: michi
* Created: November 30, 2011
********************************************************************
* Implementation of program SQLProcess
********************************************************************)
PROGRAM _INIT
bBlockDevel := TRUE;
enStep := enSTEP_STOP;
Command.enCommand := eCMD_OFFLINE;
usDelay := 10;
uiSQLNextFree := 1;
uiSQLData := 1;
END_PROGRAM
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: SQLProcess
* File: SQLProcessInit.st
* Author: michi
* Created: November 30, 2011
********************************************************************
* Implementation of program SQLProcess
********************************************************************)
PROGRAM _INIT
bBlockDevel := TRUE;
enStep := enSTEP_STOP;
Command.enCommand := eCMD_OFFLINE;
usDelay := 10;
uiSQLNextFree := 1;
uiSQLData := 1;
END_PROGRAM

View File

@@ -1,51 +1,51 @@
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: SQLLogger
* File: UpdateVal.ab
* Author: michi
* Created: January 18, 2012
********************************************************************
* Implementation of program SQLLogger
********************************************************************)
(* SQL Statement for Update a Alarm *)
FUNCTION UpdateAlarm
strcpy (pstrInNewSQL, "UPDATE alarmstates SET state=");
itoa (iInState, pstrInNewSQL + strlen (pstrInNewSQL));
strcat (pstrInNewSQL, ", timestamp='");
itoa (dtsInLogTime.year , pstrInNewSQL + strlen (pstrInNewSQL));
strcat (pstrInNewSQL, "-");
itoa (dtsInLogTime.month , pstrInNewSQL + strlen (pstrInNewSQL));
strcat (pstrInNewSQL, "-");
itoa (dtsInLogTime.day , pstrInNewSQL + strlen (pstrInNewSQL));
strcat (pstrInNewSQL, " ");
itoa (dtsInLogTime.hour , pstrInNewSQL + strlen (pstrInNewSQL));
strcat (pstrInNewSQL, ":");
itoa (dtsInLogTime.minute , pstrInNewSQL + strlen (pstrInNewSQL));
strcat (pstrInNewSQL, ":");
itoa (dtsInLogTime.second , pstrInNewSQL + strlen (pstrInNewSQL));
strcat (pstrInNewSQL, ".");
itoa (dtsInLogTime.millisec , pstrInNewSQL + strlen (pstrInNewSQL));
strcat (pstrInNewSQL, "' WHERE machid='");
strcat (pstrInNewSQL, pstrInLineId);
strcat (pstrInNewSQL, "' AND part=");
itoa (usInPart, pstrInNewSQL + strlen (pstrInNewSQL));
strcat (pstrInNewSQL, " AND alarmid=");
itoa (uiInAlarmId, pstrInNewSQL + strlen (pstrInNewSQL));
strcat (pstrInNewSQL, ";");
IF uiInOutSQLNextFree = QUEUE_SIZE THEN
IF uiInOutSQLData = 1 THEN
udInOutLostSQL := udInOutLostSQL + 1;
ELSE
uiInOutSQLNextFree := 1;
ENDIF
ELSE IF uiInOutSQLData = (uiInOutSQLNextFree + 1) THEN
udInOutLostSQL := udInOutLostSQL + 1;
ELSE
uiInOutSQLNextFree := uiInOutSQLNextFree + 1;
ENDIF
UpdateAlarm := 0;
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: SQLLogger
* File: UpdateVal.ab
* Author: michi
* Created: January 18, 2012
********************************************************************
* Implementation of program SQLLogger
********************************************************************)
(* SQL Statement for Update a Alarm *)
FUNCTION UpdateAlarm
strcpy (pstrInNewSQL, "UPDATE alarmstates SET state=");
itoa (iInState, pstrInNewSQL + strlen (pstrInNewSQL));
strcat (pstrInNewSQL, ", timestamp='");
itoa (dtsInLogTime.year , pstrInNewSQL + strlen (pstrInNewSQL));
strcat (pstrInNewSQL, "-");
itoa (dtsInLogTime.month , pstrInNewSQL + strlen (pstrInNewSQL));
strcat (pstrInNewSQL, "-");
itoa (dtsInLogTime.day , pstrInNewSQL + strlen (pstrInNewSQL));
strcat (pstrInNewSQL, " ");
itoa (dtsInLogTime.hour , pstrInNewSQL + strlen (pstrInNewSQL));
strcat (pstrInNewSQL, ":");
itoa (dtsInLogTime.minute , pstrInNewSQL + strlen (pstrInNewSQL));
strcat (pstrInNewSQL, ":");
itoa (dtsInLogTime.second , pstrInNewSQL + strlen (pstrInNewSQL));
strcat (pstrInNewSQL, ".");
itoa (dtsInLogTime.millisec , pstrInNewSQL + strlen (pstrInNewSQL));
strcat (pstrInNewSQL, "' WHERE machid='");
strcat (pstrInNewSQL, pstrInLineId);
strcat (pstrInNewSQL, "' AND part=");
itoa (usInPart, pstrInNewSQL + strlen (pstrInNewSQL));
strcat (pstrInNewSQL, " AND alarmid=");
itoa (uiInAlarmId, pstrInNewSQL + strlen (pstrInNewSQL));
strcat (pstrInNewSQL, ";");
IF uiInOutSQLNextFree = QUEUE_SIZE THEN
IF uiInOutSQLData = 1 THEN
udInOutLostSQL := udInOutLostSQL + 1;
ELSE
uiInOutSQLNextFree := 1;
ENDIF
ELSE IF uiInOutSQLData = (uiInOutSQLNextFree + 1) THEN
udInOutLostSQL := udInOutLostSQL + 1;
ELSE
uiInOutSQLNextFree := uiInOutSQLNextFree + 1;
ENDIF
UpdateAlarm := 0;
END_FUNCTION

View File

@@ -1,49 +1,49 @@
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: SQLLogger
* File: UpdateVal.ab
* Author: michi
* Created: January 18, 2012
********************************************************************
* Implementation of program SQLLogger
********************************************************************)
(* SQL Statement for Update a Carrierlog *)
FUNCTION UpdateCarrierlog
strcpy (pstrInNewSQL, "UPDATE carrierlog SET status=")
itoa (usInState , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ",ts_end='")
itoa (dtsInStopTime.year , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "-")
itoa (dtsInStopTime.month , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "-")
itoa (dtsInStopTime.day , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, " ")
itoa (dtsInStopTime.hour , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ":")
itoa (dtsInStopTime.minute , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ":")
itoa (dtsInStopTime.second , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ".")
itoa (dtsInStopTime.millisec , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "' WHERE machid='")
strcat (pstrInNewSQL, pstrInLineId)
strcat (pstrInNewSQL, "' AND uxtimestamp=")
itoa (udInUxtimestamp, pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ";")
IF uiInOutSQLNextFree = QUEUE_SIZE THEN
IF uiInOutSQLData = 1 THEN
udInOutLostSQL := udInOutLostSQL + 1
ELSE
uiInOutSQLNextFree := 1
ENDIF
ELSE IF uiInOutSQLData = (uiInOutSQLNextFree + 1) THEN
udInOutLostSQL := udInOutLostSQL + 1
ELSE
uiInOutSQLNextFree := uiInOutSQLNextFree + 1
ENDIF
UpdateCarrierlog := 0
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: SQLLogger
* File: UpdateVal.ab
* Author: michi
* Created: January 18, 2012
********************************************************************
* Implementation of program SQLLogger
********************************************************************)
(* SQL Statement for Update a Carrierlog *)
FUNCTION UpdateCarrierlog
strcpy (pstrInNewSQL, "UPDATE carrierlog SET status=")
itoa (usInState , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ",ts_end='")
itoa (dtsInStopTime.year , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "-")
itoa (dtsInStopTime.month , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "-")
itoa (dtsInStopTime.day , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, " ")
itoa (dtsInStopTime.hour , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ":")
itoa (dtsInStopTime.minute , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ":")
itoa (dtsInStopTime.second , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ".")
itoa (dtsInStopTime.millisec , pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, "' WHERE machid='")
strcat (pstrInNewSQL, pstrInLineId)
strcat (pstrInNewSQL, "' AND uxtimestamp=")
itoa (udInUxtimestamp, pstrInNewSQL + strlen (pstrInNewSQL))
strcat (pstrInNewSQL, ";")
IF uiInOutSQLNextFree = QUEUE_SIZE THEN
IF uiInOutSQLData = 1 THEN
udInOutLostSQL := udInOutLostSQL + 1
ELSE
uiInOutSQLNextFree := 1
ENDIF
ELSE IF uiInOutSQLData = (uiInOutSQLNextFree + 1) THEN
udInOutLostSQL := udInOutLostSQL + 1
ELSE
uiInOutSQLNextFree := uiInOutSQLNextFree + 1
ENDIF
UpdateCarrierlog := 0
END_FUNCTION

View File

@@ -1,53 +1,53 @@
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: SQLLogger
* File: UpdateVal.ab
* Author: michi
* Created: January 18, 2012
********************************************************************
* Implementation of program SQLLogger
********************************************************************)
(* SQL Statement for Update a Value *)
FUNCTION UpdateParam
strcpy (pstrNewSQL, "UPDATE machparams SET ");
strcat (pstrNewSQL, pstrLogField);
strcat (pstrNewSQL, "=");
itoa (iValue, pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, ", timestamp='");
itoa (dtsLogTime.year , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, "-");
itoa (dtsLogTime.month , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, "-");
itoa (dtsLogTime.day , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, " ");
itoa (dtsLogTime.hour , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, ":");
itoa (dtsLogTime.minute , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, ":");
itoa (dtsLogTime.second , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, ".");
itoa (dtsLogTime.millisec , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, "' WHERE machid='");
strcat (pstrNewSQL, pstrLineId);
strcat (pstrNewSQL, "' AND part=");
itoa (usPart, pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, " AND machvar=");
itoa (diLogVar, pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, ";");
IF uiInOutSQLNextFree = QUEUE_SIZE THEN
IF uiInOutSQLData = 1 THEN
udInOutLostSQL := udInOutLostSQL + 1;
ELSE
uiInOutSQLNextFree := 1;
ENDIF
ELSE IF uiInOutSQLData = (uiInOutSQLNextFree + 1) THEN
udInOutLostSQL := udInOutLostSQL + 1;
ELSE
uiInOutSQLNextFree := uiInOutSQLNextFree + 1;
ENDIF
//Return Value
UpdateParam := 0;
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: SQLLogger
* File: UpdateVal.ab
* Author: michi
* Created: January 18, 2012
********************************************************************
* Implementation of program SQLLogger
********************************************************************)
(* SQL Statement for Update a Value *)
FUNCTION UpdateParam
strcpy (pstrNewSQL, "UPDATE machparams SET ");
strcat (pstrNewSQL, pstrLogField);
strcat (pstrNewSQL, "=");
itoa (iValue, pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, ", timestamp='");
itoa (dtsLogTime.year , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, "-");
itoa (dtsLogTime.month , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, "-");
itoa (dtsLogTime.day , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, " ");
itoa (dtsLogTime.hour , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, ":");
itoa (dtsLogTime.minute , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, ":");
itoa (dtsLogTime.second , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, ".");
itoa (dtsLogTime.millisec , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, "' WHERE machid='");
strcat (pstrNewSQL, pstrLineId);
strcat (pstrNewSQL, "' AND part=");
itoa (usPart, pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, " AND machvar=");
itoa (diLogVar, pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, ";");
IF uiInOutSQLNextFree = QUEUE_SIZE THEN
IF uiInOutSQLData = 1 THEN
udInOutLostSQL := udInOutLostSQL + 1;
ELSE
uiInOutSQLNextFree := 1;
ENDIF
ELSE IF uiInOutSQLData = (uiInOutSQLNextFree + 1) THEN
udInOutLostSQL := udInOutLostSQL + 1;
ELSE
uiInOutSQLNextFree := uiInOutSQLNextFree + 1;
ENDIF
//Return Value
UpdateParam := 0;
END_FUNCTION

View File

@@ -1,51 +1,51 @@
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: SQLLogger
* File: UpdateVal.ab
* Author: michi
* Created: January 18, 2012
********************************************************************
* Implementation of program SQLLogger
********************************************************************)
(* SQL Statement for Update a Value *)
FUNCTION UpdateVal
strcpy (pstrNewSQL, "UPDATE machvalues SET value=");
itoa (iValue, pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, ", timestamp='");
itoa (dtsLogTime.year , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, "-");
itoa (dtsLogTime.month , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, "-");
itoa (dtsLogTime.day , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, " ");
itoa (dtsLogTime.hour , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, ":");
itoa (dtsLogTime.minute , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, ":");
itoa (dtsLogTime.second , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, ".");
itoa (dtsLogTime.millisec , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, "' WHERE machid='");
strcat (pstrNewSQL, pstrLineId);
strcat (pstrNewSQL, "' AND part=");
itoa (usPart, pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, " AND machvar=");
itoa (diLogVar, pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, ";");
IF uiInOutSQLNextFree = QUEUE_SIZE THEN
IF uiInOutSQLData = 1 THEN
udInOutLostSQL := udInOutLostSQL + 1;
ELSE
uiInOutSQLNextFree := 1;
ENDIF
ELSE IF uiInOutSQLData = (uiInOutSQLNextFree + 1) THEN
udInOutLostSQL := udInOutLostSQL + 1;
ELSE
uiInOutSQLNextFree := uiInOutSQLNextFree + 1;
ENDIF
//Return Value
UpdateVal := 0;
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: SQLLogger
* File: UpdateVal.ab
* Author: michi
* Created: January 18, 2012
********************************************************************
* Implementation of program SQLLogger
********************************************************************)
(* SQL Statement for Update a Value *)
FUNCTION UpdateVal
strcpy (pstrNewSQL, "UPDATE machvalues SET value=");
itoa (iValue, pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, ", timestamp='");
itoa (dtsLogTime.year , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, "-");
itoa (dtsLogTime.month , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, "-");
itoa (dtsLogTime.day , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, " ");
itoa (dtsLogTime.hour , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, ":");
itoa (dtsLogTime.minute , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, ":");
itoa (dtsLogTime.second , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, ".");
itoa (dtsLogTime.millisec , pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, "' WHERE machid='");
strcat (pstrNewSQL, pstrLineId);
strcat (pstrNewSQL, "' AND part=");
itoa (usPart, pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, " AND machvar=");
itoa (diLogVar, pstrNewSQL + strlen (pstrNewSQL));
strcat (pstrNewSQL, ";");
IF uiInOutSQLNextFree = QUEUE_SIZE THEN
IF uiInOutSQLData = 1 THEN
udInOutLostSQL := udInOutLostSQL + 1;
ELSE
uiInOutSQLNextFree := 1;
ENDIF
ELSE IF uiInOutSQLData = (uiInOutSQLNextFree + 1) THEN
udInOutLostSQL := udInOutLostSQL + 1;
ELSE
uiInOutSQLNextFree := uiInOutSQLNextFree + 1;
ENDIF
//Return Value
UpdateVal := 0;
END_FUNCTION

View File

@@ -0,0 +1,6 @@
(* Append String to Bytestream (with 2Byte Len and 0 Termination) *)
FUNCTION AppendDINT
ldData := H_TO_NDINT (dInDINT);
ludNextAdr := memcpy (udInNextAdr, ADR (ludNull), 4);
AppendDINT := memcpy (ludNextAdr, ADR (ldData), 4);
END_FUNCTION

View File

@@ -0,0 +1,6 @@
(* Append Int to Bytestream *)
FUNCTION AppendINT
liData := H_TO_NINT (iInINT);
ludNextAdr := memcpy (udInNextAdr, ADR (ludNull), 6);
AppendINT := memcpy (ludNextAdr, ADR (liData), 2);
END_FUNCTION

View File

@@ -0,0 +1,5 @@
(* Append String to Bytestream (with 2Byte Len and 0 Termination) *)
FUNCTION AppendLREAL
ldrData := drInLREAL;
AppendLREAL := memcpy (udInNextAdr, ADR (ldrData), 8);
END_FUNCTION

View File

@@ -0,0 +1,9 @@
(* Append String to Bytestream (with 2Byte Len and 0 Termination) *)
FUNCTION AppendStr
//Append NULL Byte also
luiStrlen := strlen (ADR (pstrInString)) + 1;
luiPartlen := H_TO_NUINT (luiStrlen + 4);
//Lenghtindicator 2 Byte Partidentifier, 2 Byte Len, Strlen)
ludNextAdr := memcpy (udInNextAdr, ADR (luiPartlen), 2);
AppendStr := memcpy (ludNextAdr, ADR (pstrInString), luiStrlen);
END_FUNCTION

View File

@@ -0,0 +1,6 @@
(* Append Int to Bytestream *)
FUNCTION AppendUINT
luiData := H_TO_NUINT (uiInUINT);
ludNextAdr := memcpy (udInNextAdr, ADR (ludNull), 6);
AppendUINT := memcpy (ludNextAdr, ADR (luiData), 2);
END_FUNCTION

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.23 SP05?>
<Program xmlns="http://br-automation.co.at/AS/Program">
<Files>
<File Description="Implementation code">collectd.st</File>
<File Description="Local data types" Private="true">collectd.typ</File>
<File Description="Local variables" Private="true">collectd.var</File>
<File Private="true">collectd.fun</File>
<File Description="Append String to Bytestream (with 2Byte Len and 0 Termination)">AppendStr.st</File>
<File Description="Append Int to Bytestream (with 2Byte Len)">AppendINT.st</File>
<File Description="Append Unsigned Int to Bytestream (with 2Byte Len)">AppendUINT.st</File>
<File Description="Append Int to Bytestream (with 2Byte Len and 0 Termination)">AppendDINT.st</File>
<File Description="Append Int to Bytestream (with 2Byte Len and 0 Termination)">AppendLREAL.st</File>
</Files>
</Program>

View File

@@ -0,0 +1,59 @@
(*Decode String for Collectd*)
FUNCTION AppendStr : UDINT (*Append String to Bytestream (with 2Byte Len and 0 Termination)*)
VAR_INPUT
udInNextAdr : UDINT; (*Next Pos in ByteStream (No CHECK)*)
pstrInString : REFERENCE TO STRING[80]; (*Address of String to Append*)
END_VAR
VAR
luiStrlen : UINT;
luiPartlen : UINT;
ludNextAdr : UDINT;
END_VAR
END_FUNCTION
FUNCTION AppendINT : UDINT (*Append Integer to Bytestream (with 2Byte Len)*)
VAR_INPUT
udInNextAdr : UDINT; (*Next Pos in ByteStream (No CHECK)*)
iInINT : INT; (*Address of Int to Append*)
END_VAR
VAR
liData : INT; (*Data*)
ludNextAdr : UDINT;
ludNull : UDINT;
END_VAR
END_FUNCTION
FUNCTION AppendUINT : UDINT (*Append Integer to Bytestream (with 2Byte Len)*)
VAR_INPUT
udInNextAdr : UDINT; (*Next Pos in ByteStream (No CHECK)*)
uiInUINT : UINT; (*Address of Int to Append*)
END_VAR
VAR
luiData : UINT; (*Data*)
ludNextAdr : UDINT;
ludNull : UDINT;
END_VAR
END_FUNCTION
FUNCTION AppendDINT : UDINT (*Append Integer to Bytestream (with 2Byte Len)*)
VAR_INPUT
udInNextAdr : UDINT; (*Next Pos in ByteStream (No CHECK)*)
dInDINT : DINT; (*Address of Int to Append*)
END_VAR
VAR
ldData : DINT; (*Data*)
ludNextAdr : UDINT;
ludNull : UDINT;
END_VAR
END_FUNCTION
FUNCTION AppendLREAL : UDINT (*Append Integer to Bytestream (with 2Byte Len)*)
VAR_INPUT
udInNextAdr : UDINT; (*Next Pos in ByteStream (No CHECK)*)
drInLREAL : LREAL; (*Address of Int to Append*)
END_VAR
VAR
ldrData : LREAL;
END_VAR
END_FUNCTION

View File

@@ -0,0 +1,654 @@
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: collectd
* File: collectd.st
* Author: michi
* Created: July 10, 2012
********************************************************************
* Implementation of program collectd
********************************************************************)
PROGRAM _INIT
TON_Delay.IN := 0;
TON_Delay.PT := t#1s;
udSendAdr := ADR (SendBuf.BData);
bStoreMode := 0;
enCycle := enCycle_None;
END_PROGRAM
PROGRAM _CYCLIC
IF TON_Delay.Q = 1 THEN
TON_Delay.IN := 0;
enCycle := enCycle_Machine;
END_IF
IF (enCycle > enCycle_None) THEN
IF (enStep = enSTEP_READY) AND NOT bSend AND NOT bStoreMode THEN
lDataBuf ACCESS ADR (SendBuf);
udSentTelegrams := udSentTelegrams + 1;
// ELSE
// lDataBuf ACCESS ADR (StoreBuf);
// bStoreMode := 1;
//Host (len = Type (2) + len (2) + data)
SendBuf.udDatalen := 0;
udNextAdr := strcpy (ADR (lDataBuf.BData), ADR (''));
udStartAdr := udNextAdr;
udNextAdr := memcpy (udNextAdr, ADR (PT_HOST), 2);
udNextAdr := AppendStr (udNextAdr, ADR (gstrLineId));
//TIME
udNextAdr := memcpy (udNextAdr, ADR (PT_TIME), 2);
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$0C'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udUnixTimeUTC := H_TO_NDINT (gudUnixTimeUTC);
udNextAdr := memcpy (udNextAdr, ADR (udUnixTimeUTC), 4);
//INTERVAL
udNextAdr := memcpy (udNextAdr, ADR (PT_INTERVAL), 2);
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$0C'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$01'), 1);
CASE enCycle OF
//==========================================
enCycle_Machine:
//PLUGIN
udNextAdr := memcpy (udNextAdr, ADR (PT_PLUGIN), 2);
udNextAdr := AppendStr (udNextAdr, ADR ('Temperatur'));
//PLUGIN_INSTANCE
udNextAdr := memcpy (udNextAdr, ADR (PT_PLUGIN_INSTANCE), 2);
udNextAdr := AppendStr (udNextAdr, ADR ('-S01'));
//TYPE
udNextAdr := memcpy (udNextAdr, ADR (PT_TYPE), 2);
udNextAdr := AppendStr (udNextAdr, ADR ('temperature'));
//TYPE_INSTANCE
udNextAdr := memcpy (udNextAdr, ADR (PT_TYPE_INSTANCE), 2);
udNextAdr := AppendStr (udNextAdr, ADR ('CPU'));
//VALUES
udNextAdr := memcpy (udNextAdr, ADR (PT_VALUES), 2);
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$0f'), 1); //15, 24, 33, 42, 51, 60
//valuecount
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$01'), 1);
//Value 1
udNextAdr := memcpy (udNextAdr, ADR (VT_GAUGE), 1);
IF guiTemperatureCPU < 32767 THEN
dValue := UINT_TO_LREAL (guiTemperatureCPU) / 10.0;
ELSE
dValue := 0;
END_IF;
udNextAdr := AppendLREAL (udNextAdr, dValue);
//PLUGIN_INSTANCE
udNextAdr := memcpy (udNextAdr, ADR (PT_PLUGIN_INSTANCE), 2);
udNextAdr := AppendStr (udNextAdr, ADR ('-GS01'));
//TYPE
udNextAdr := memcpy (udNextAdr, ADR (PT_TYPE), 2);
udNextAdr := AppendStr (udNextAdr, ADR ('temperature'));
//TYPE_INSTANCE
udNextAdr := memcpy (udNextAdr, ADR (PT_TYPE_INSTANCE), 2);
udNextAdr := AppendStr (udNextAdr, ADR ('Schrank'));
//VALUES
udNextAdr := memcpy (udNextAdr, ADR (PT_VALUES), 2);
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$0f'), 1); //15, 24, 33, 42, 51, 60
//valuecount
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$01'), 1);
//Value 1
udNextAdr := memcpy (udNextAdr, ADR (VT_GAUGE), 1);
IF IF3_ST2_IF1_ST45.iTempIn[0] < 32767 THEN
dValue := INT_TO_LREAL (IF3_ST2_IF1_ST45.iTempIn[0]) / 10.0;
ELSE
dValue := 0;
END_IF;
udNextAdr := AppendLREAL (udNextAdr, dValue);
//TYPE_INSTANCE
udNextAdr := memcpy (udNextAdr, ADR (PT_TYPE_INSTANCE), 2);
udNextAdr := AppendStr (udNextAdr, ADR ('Kuehlung-VL'));
//VALUES
udNextAdr := memcpy (udNextAdr, ADR (PT_VALUES), 2);
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$0f'), 1); //15, 24, 33, 42, 51, 60
//valuecount
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$01'), 1);
//Value 1
udNextAdr := memcpy (udNextAdr, ADR (VT_GAUGE), 1);
IF IF3_ST2_IF1_ST45.iTempIn[1] < 32767 THEN
dValue := INT_TO_LREAL (IF3_ST2_IF1_ST45.iTempIn[1]) / 10.0;
ELSE
dValue := 0;
END_IF;
udNextAdr := AppendLREAL (udNextAdr, dValue);
//TYPE_INSTANCE
udNextAdr := memcpy (udNextAdr, ADR (PT_TYPE_INSTANCE), 2);
udNextAdr := AppendStr (udNextAdr, ADR ('Kuehlung-RL'));
//VALUES
udNextAdr := memcpy (udNextAdr, ADR (PT_VALUES), 2);
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$0f'), 1); //15, 24, 33, 42, 51, 60
//valuecount
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$01'), 1);
//Value 1
udNextAdr := memcpy (udNextAdr, ADR (VT_GAUGE), 1);
IF IF3_ST2_IF1_ST45.iTempIn[2] < 32767 THEN
dValue := INT_TO_LREAL (IF3_ST2_IF1_ST45.iTempIn[2]) / 10.0;
ELSE
dValue := 0;
END_IF;
udNextAdr := AppendLREAL (udNextAdr, dValue);
//PLUGIN_INSTANCE
udNextAdr := memcpy (udNextAdr, ADR (PT_PLUGIN_INSTANCE), 2);
udNextAdr := AppendStr (udNextAdr, ADR ('-GS02'));
//TYPE
udNextAdr := memcpy (udNextAdr, ADR (PT_TYPE), 2);
udNextAdr := AppendStr (udNextAdr, ADR ('temperature'));
//TYPE_INSTANCE
udNextAdr := memcpy (udNextAdr, ADR (PT_TYPE_INSTANCE), 2);
udNextAdr := AppendStr (udNextAdr, ADR ('Schrank'));
//VALUES
udNextAdr := memcpy (udNextAdr, ADR (PT_VALUES), 2);
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$0f'), 1); //15, 24, 33, 42, 51, 60
//valuecount
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$01'), 1);
//Value 1
udNextAdr := memcpy (udNextAdr, ADR (VT_GAUGE), 1);
IF IF3_ST2_IF1_ST77.iTempIn[0] < 32767 THEN
dValue := INT_TO_LREAL (IF3_ST2_IF1_ST77.iTempIn[0]) / 10.0;
ELSE
dValue := 0;
END_IF;
udNextAdr := AppendLREAL (udNextAdr, dValue);
//TYPE_INSTANCE
udNextAdr := memcpy (udNextAdr, ADR (PT_TYPE_INSTANCE), 2);
udNextAdr := AppendStr (udNextAdr, ADR ('Kuehlung-VL'));
//VALUES
udNextAdr := memcpy (udNextAdr, ADR (PT_VALUES), 2);
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$0f'), 1); //15, 24, 33, 42, 51, 60
//valuecount
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$01'), 1);
//Value 1
udNextAdr := memcpy (udNextAdr, ADR (VT_GAUGE), 1);
IF IF3_ST2_IF1_ST77.iTempIn[1] < 32767 THEN
dValue := INT_TO_LREAL (IF3_ST2_IF1_ST77.iTempIn[1]) / 10.0;
ELSE
dValue := 0;
END_IF;
udNextAdr := AppendLREAL (udNextAdr, dValue);
//TYPE_INSTANCE
udNextAdr := memcpy (udNextAdr, ADR (PT_TYPE_INSTANCE), 2);
udNextAdr := AppendStr (udNextAdr, ADR ('Kuehlung-RL'));
//VALUES
udNextAdr := memcpy (udNextAdr, ADR (PT_VALUES), 2);
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$0f'), 1); //15, 24, 33, 42, 51, 60
//valuecount
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$01'), 1);
//Value 1
udNextAdr := memcpy (udNextAdr, ADR (VT_GAUGE), 1);
IF IF3_ST2_IF1_ST77.iTempIn[2] < 32767 THEN
dValue := INT_TO_LREAL (IF3_ST2_IF1_ST77.iTempIn[2]) / 10.0;
ELSE
dValue := 0;
END_IF;
udNextAdr := AppendLREAL (udNextAdr, dValue);
enCycle := enCycle_TW;
// //TYPE_INSTANCE
// udNextAdr := memcpy (udNextAdr, ADR (PT_TYPE_INSTANCE), 2);
// udNextAdr := AppendStr (udNextAdr, ADR ('Zuluft'));
// //VALUES
// udNextAdr := memcpy (udNextAdr, ADR (PT_VALUES), 2);
// udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
// udNextAdr := memcpy (udNextAdr, ADR ('$0f'), 1); //15, 24, 33, 42, 51, 60
// //valuecount
// udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
// udNextAdr := memcpy (udNextAdr, ADR ('$01'), 1);
// //Value 1
// udNextAdr := memcpy (udNextAdr, ADR (VT_GAUGE), 1);
// IF giInTempertureAirInGS01 < 32767 THEN
// dValue := INT_TO_LREAL (giInTempertureAirInGS01) / 10.0;
// ELSE
// dValue := 0;
// END_IF;
// udNextAdr := AppendLREAL (udNextAdr, dValue);
//==========================================
enCycle_TW:
enCycle := enCycle_BathTemps;
//==========================================
enCycle_BathTemps:
FOR usBathNr := 1 TO gMachPara.usMAXBathPos DO
IF gBath[usBathNr].Para.Func.Common.bTemperature THEN
udNextAdr := memcpy (udNextAdr, ADR (PT_PLUGIN), 2);
udNextAdr := AppendStr (udNextAdr, ADR ('Temperatur'));
//PLUGIN_INSTANCE
udNextAdr := memcpy (udNextAdr, ADR (PT_PLUGIN_INSTANCE), 2);
strcpy (ADR (StrTemp), ADR ('Bad-'));
itoa (USINT_TO_UDINT (usBathNr), ADR (StrTemp) + 4);
uiTest := strlen (ADR (StrTemp));
udNextAdr := AppendStr (udNextAdr, ADR (StrTemp));
//TYPE
udNextAdr := memcpy (udNextAdr, ADR (PT_TYPE), 2);
udNextAdr := AppendStr (udNextAdr, ADR ('temperature'));
//TYPE_INSTANCE
udNextAdr := memcpy (udNextAdr, ADR (PT_TYPE_INSTANCE), 2);
udNextAdr := AppendStr (udNextAdr, ADR ('Bad'));
//VALUES
udNextAdr := memcpy (udNextAdr, ADR (PT_VALUES), 2);
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$0f'), 1); //15, 24, 33, 42, 51, 60
//valuecount
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$01'), 1);
//Value 1
udNextAdr := memcpy (udNextAdr, ADR (VT_GAUGE), 1);
IF gBath[usBathNr].Values.iTemperature < 32767 THEN
dValue := INT_TO_LREAL (gBath[usBathNr].Values.iTemperature) / 10.0;
ELSE
dValue := 0;
END_IF;
udNextAdr := AppendLREAL (udNextAdr, dValue);
END_IF
END_FOR
enCycle := enCycle_BathVoltage;
//==========================================
enCycle_BathVoltage:
FOR usBathNr := 1 TO gMachPara.usMAXBathPos DO
IF gBath[usBathNr].Para.Func.Common.bTemperature THEN
//PLUGIN
udNextAdr := memcpy (udNextAdr, ADR (PT_PLUGIN), 2);
udNextAdr := AppendStr (udNextAdr, ADR ('GL'));
//PLUGIN_INSTANCE
udNextAdr := memcpy (udNextAdr, ADR (PT_PLUGIN_INSTANCE), 2);
strcpy (ADR (StrTemp), ADR ('Bad-'));
itoa (USINT_TO_UDINT (usBathNr), ADR (StrTemp) + 4);
uiTest := strlen (ADR (StrTemp));
udNextAdr := AppendStr (udNextAdr, ADR (StrTemp));
//TYPE
udNextAdr := memcpy (udNextAdr, ADR (PT_TYPE), 2);
udNextAdr := AppendStr (udNextAdr, ADR ('voltage'));
//VALUES
udNextAdr := memcpy (udNextAdr, ADR (PT_VALUES), 2);
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$0f'), 1); //15, 24, 33, 42, 51, 60
//valuecount
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$01'), 1);
//Value 1
udNextAdr := memcpy (udNextAdr, ADR (VT_GAUGE), 1);
IF gBath[usBathNr].Values.iScaledVoltage > 10 THEN
dValue := INT_TO_LREAL (gBath[usBathNr].Values.iScaledVoltage) / 100.0;
ELSE
dValue := 0;
END_IF;
udNextAdr := AppendLREAL (udNextAdr, dValue);
END_IF
END_FOR
enCycle := enCycle_BathCurrent;
//==========================================
enCycle_BathCurrent:
FOR usBathNr := 1 TO gMachPara.usMAXBathPos DO
IF gBath[usBathNr].Para.Func.Common.bTemperature THEN
//PLUGIN
udNextAdr := memcpy (udNextAdr, ADR (PT_PLUGIN), 2);
udNextAdr := AppendStr (udNextAdr, ADR ('GL'));
//PLUGIN_INSTANCE
udNextAdr := memcpy (udNextAdr, ADR (PT_PLUGIN_INSTANCE), 2);
strcpy (ADR (StrTemp), ADR ('Bad-'));
itoa (USINT_TO_UDINT (usBathNr), ADR (StrTemp) + 4);
uiTest := strlen (ADR (StrTemp));
udNextAdr := AppendStr (udNextAdr, ADR (StrTemp));
//TYPE
udNextAdr := memcpy (udNextAdr, ADR (PT_TYPE), 2);
udNextAdr := AppendStr (udNextAdr, ADR ('current'));
//VALUES
udNextAdr := memcpy (udNextAdr, ADR (PT_VALUES), 2);
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$0f'), 1); //15, 24, 33, 42, 51, 60
//valuecount
udNextAdr := memcpy (udNextAdr, ADR ('$00'), 1);
udNextAdr := memcpy (udNextAdr, ADR ('$01'), 1);
//Value 1
udNextAdr := memcpy (udNextAdr, ADR (VT_GAUGE), 1);
IF gBath[usBathNr].Values.iScaledCurrent > 10 THEN
dValue := INT_TO_LREAL (gBath[usBathNr].Values.iScaledCurrent) / 100.0;
ELSE
dValue := 0;
END_IF;
udNextAdr := AppendLREAL (udNextAdr, dValue);
END_IF
END_FOR
enCycle := enCycle_None;
END_CASE
lDataBuf.udDatalen := udNextAdr -udStartAdr;
IF NOT bStoreMode THEN
bSend := 1;
ELSE
bStore := 1;
END_IF
END_IF
END_IF
TON_Delay ();
TON_Delay.IN := 1;
CASE enStep OF
//==========================================
enSTEP_INIT:
FUB_UdpOpen.enable := 0;
FUB_UdpConnect.enable := 0;
FUB_UdpSend.enable := 0;
FUB_UdpClose.enable := 0;
FUB_UdpOpen.pIfAddr := ADR (gstrIP);
FUB_UdpOpen.port := 25826;
FUB_UdpOpen.options := udpOPT_REUSEADDR;
FUB_UdpConnect.port := 25826;
FUB_UdpConnect.pHost := ADR ('192.168.30.20');
enStep := enSTEP_OPEN;
//==========================================
enSTEP_OPEN:
FUB_UdpOpen.enable := 1;
uiStatus := FUB_UdpOpen.status;
IF uiStatus = ERR_OK THEN
FUB_UdpOpen.enable := 0;
FUB_UdpConnect.ident := FUB_UdpOpen.ident;
FUB_UdpSend.ident := FUB_UdpOpen.ident;
FUB_UdpClose.ident := FUB_UdpOpen.ident;
enStep := enSTEP_CLIENT;
ELSIF (uiStatus <> ERR_FUB_BUSY) AND (uiStatus <> ERR_FUB_ENABLE_FALSE) THEN
FUB_UdpOpen.enable := 0;
enStep := enSTEP_ERROR;
udNextAdr := strcpy (ADR (StrDebug), ADR ('STEP_OPEN-ERROR: '));
END_IF
//==========================================
enSTEP_CLIENT:
FUB_UdpConnect.enable := 1;
uiStatus := FUB_UdpConnect.status;
IF uiStatus = ERR_OK THEN
FUB_UdpConnect.enable := 0;
enStep := enSTEP_READY;
ELSIF (uiStatus <> ERR_FUB_BUSY) AND (uiStatus <> ERR_FUB_ENABLE_FALSE) THEN
FUB_UdpConnect.enable := 0;
enStep := enSTEP_ERROR;
udNextAdr := strcpy (ADR (StrDebug), ADR ('STEP_CLIENT-ERROR: '));
END_IF
//==========================================
enSTEP_READY:
IF bSend THEN
enStep := enSTEP_SEND;
END_IF
//==========================================
enSTEP_SEND:
FUB_UdpSend.enable := 1;
FUB_UdpSend.datalen := SendBuf.udDatalen;
FUB_UdpSend.pData := udSendAdr;
uiStatus := FUB_UdpSend.status;
IF uiStatus = ERR_OK THEN
FUB_UdpSend.enable := 0;
bSend := 0;
enStep := enSTEP_WAIT;
ELSIF (uiStatus <> ERR_FUB_BUSY) AND (uiStatus <> ERR_FUB_ENABLE_FALSE) THEN
bSend := 0;
FUB_UdpSend.enable := 0;
enStep := enSTEP_ERROR;
udNextAdr := strcpy (ADR (StrDebug), ADR ('STEP_READY-ERROR: '));
END_IF
//==========================================
enSTEP_WAIT:
enStep := enSTEP_READY;
//==========================================
enSTEP_CLOSE:
FUB_UdpClose.enable := 1;
uiStatus := FUB_UdpClose.status;
IF uiStatus = ERR_OK THEN
FUB_UdpClose.enable := 0;
enStep := enSTEP_CLOSED;
ELSIF (uiStatus <> ERR_FUB_BUSY) AND (uiStatus <> ERR_FUB_ENABLE_FALSE) THEN
FUB_UdpClose.enable := 0;
//enStep := enSTEP_ERROR;
udNextAdr := strcpy (ADR (StrDebug), ADR ('STEP_CLOSE-ERROR: '));
END_IF
//==========================================
enSTEP_ERROR:
CASE uiStatus OF
udpERR_NOMORE_IDENTS:
strcat (udNextAdr, ADR ('No More Idents'));
udpERR_ALREADY_EXIST:
strcat (udNextAdr, ADR ('Already Exists'));
udpERR_INVALID_IDENT:
strcat (udNextAdr, ADR ('Invalid Ident'));
udpERR_SOCKET_BIND:
strcat (udNextAdr, ADR ('Socket BIND'));
udpERR_SOCKET_CONNECT:
strcat (udNextAdr, ADR ('Socket Connect'));
ELSE
strcat (udNextAdr, ADR ('DEFAULT'));
END_CASE
enStep := enSTEP_CLOSE;
//==========================================
enSTEP_CLOSED:
TON_Restart.IN := TRUE;
IF TON_Restart.Q THEN
TON_Restart.IN := FALSE;
enStep := enSTEP_INIT;
END_IF
END_CASE
CASE enDOStep OF
//==========================================
enDOSTEP_INIT:
FUB_DatObjInfo.enable := 0;
FUB_DatObjCreate.enable := 0;
enDOStep := enDOSTEP_INFO;
//==========================================
enDOSTEP_INFO:
FUB_DatObjInfo.enable := 1;
FUB_DatObjInfo.pName := ADR (StrDOName);
uiStatus := FUB_DatObjInfo.status;
IF uiStatus = ERR_OK THEN
FUB_DatObjInfo.enable := 0;
FUB_DatObjDelete.ident := FUB_DatObjInfo.ident;
usExistingDOMemType := FUB_DatObjInfo.MemType;
udExistingDOLen := FUB_DatObjInfo.len;
udExistingDOOption := FUB_DatObjInfo.Option;
udPtrDO := FUB_DatObjInfo.pDatObjMem;
IF udExistingDOLen < (USINT_TO_UDINT (usDOLen) * 1024) THEN
enDOStep := enDOSTEP_DELETE;
ELSE
enDOStep := enDOSTEP_IDLE;
//Check for stored Data
FOR usDOStartData := 0 TO (usDOLen - 1) DO
ludDataBufLen ACCESS (udPtrDO + usDOStartData * 1024);
IF ludDataBufLen > 0 THEN
bStoreMode := 1;
EXIT;
END_IF
END_FOR
IF (usDOStartData = (usDOLen - 1)) AND (ludDataBufLen = 0) THEN
usDOStartData := 0;
END_IF
//Check for first free Datalace
FOR usDOFirstFree := 0 TO (usDOLen - 1) DO
udTemp := udPtrDO + ((usDOStartData + usDOFirstFree) MOD usDOLen) * 1024;
ludDataBufLen ACCESS udTemp;
IF ludDataBufLen = 0 THEN
usDOFirstFree := (usDOStartData + usDOFirstFree) MOD usDOLen;
EXIT;
END_IF
END_FOR
IF (ludDataBufLen <> 0) THEN
usDOFirstFree := (usDOFirstFree - 1) MOD usDOLen;
END_IF
END_IF
ELSIF (uiStatus = doERR_ILLOBJECT) OR (uiStatus = doERR_MODULNOTFOUND) THEN
FUB_DatObjInfo.enable := 0;
enDOStep := enDOSTEP_CREATE;
ELSIF (uiStatus <> ERR_FUB_BUSY) AND (uiStatus <> ERR_FUB_ENABLE_FALSE) THEN
FUB_DatObjInfo.enable := 0;
uiStatusDOError := uiStatus;
enDOStepError := enDOStep;
enDOStep := enDOSTEP_ERROR;
END_IF
//==========================================
enDOSTEP_DELETE:
FUB_DatObjDelete.enable := 1;
uiStatus := FUB_DatObjDelete.status;
IF (uiStatus = ERR_OK) THEN
FUB_DatObjDelete.enable := 0;
enDOStep := enDOSTEP_IDLE;
ELSIF (uiStatus <> ERR_FUB_BUSY) AND (uiStatus <> ERR_FUB_ENABLE_FALSE) THEN
FUB_DatObjDelete.enable := 0;
uiStatusDOError := uiStatus;
enDOStepError := enDOStep;
enDOStep := enDOSTEP_ERROR;
END_IF
//==========================================
enDOSTEP_CREATE:
FUB_DatObjCreate.enable := 1;
FUB_DatObjCreate.grp := 0;
FUB_DatObjCreate.pName := ADR (StrDOName);
FUB_DatObjCreate.len := (USINT_TO_UDINT (usDOLen) * 1024);
FUB_DatObjCreate.pCpyData := 0;
FUB_DatObjCreate.MemType := doUSRROM;
FUB_DatObjCreate.Option := doNO_CS;
uiStatus := FUB_DatObjCreate.status;
IF (uiStatus = ERR_OK) THEN
FUB_DatObjCreate.enable := 0;
enDOStep := enDOSTEP_INIT;
ELSIF (uiStatus = doERR_DUPOBJECT) THEN
FUB_DatObjCreate.enable := 0;
FUB_DatObjDelete.ident := FUB_DatObjCreate.ident;
enDOStep := enDOSTEP_DELETE;
ELSIF (uiStatus <> ERR_FUB_BUSY) AND (uiStatus <> ERR_FUB_ENABLE_FALSE) THEN
FUB_DatObjCreate.enable := 0;
uiStatusDOError := uiStatus;
enDOStepError := enDOStep;
enDOStep := enDOSTEP_ERROR;
END_IF
//==========================================
enDOSTEP_IDLE:
IF bStore THEN
IF usDOFirstFree >= usDOStartData THEN
memcpy (ADR (udPtrDO) + USINT_TO_UDINT (usDOFirstFree) * 1024, ADR (StoreBuf), 1024);
usDOFirstFree := (usDOFirstFree + 1) MOD usDOLen;
bStore := 0;
ELSE
udLostTelegrams := udLostTelegrams + 1;
END_IF
END_IF
// IF bRead THEN
// enDOStep := enDOSTEP_READ;
// END_IF
//==========================================
enDOSTEP_ERROR:
END_CASE
//Call FUBs
FUB_UdpOpen ();
FUB_UdpConnect ();
FUB_UdpSend ();
FUB_UdpClose ();
FUB_DatObjInfo ();
FUB_DatObjCreate ();
FUB_DatObjDelete ();
END_PROGRAM
PROGRAM _EXIT
//In case of an open Session close Connection
CASE enStep OF
//==========================================
enSTEP_INIT:
//==========================================
enSTEP_OPEN:
//==========================================
enSTEP_CLIENT:
//==========================================
enSTEP_READY:
FUB_UdpClose.enable := 1;
//==========================================
enSTEP_SEND:
FUB_UdpClose.enable := 1;
//==========================================
enSTEP_WAIT:
FUB_UdpClose.enable := 1;
//==========================================
enSTEP_CLOSE:
//==========================================
enSTEP_ERROR:
//==========================================
enSTEP_ERROR_STOP:
enSTEP_CLOSED:
END_CASE
FUB_UdpClose ();
WHILE FUB_UdpClose.status = ERR_FUB_BUSY DO
FUB_UdpClose ();
END_WHILE
END_PROGRAM

View File

@@ -0,0 +1,50 @@
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: collectd
* File: collectd.typ
* Author: michi
* Created: July 10, 2012
********************************************************************
* Local data types of program collectd
********************************************************************)
TYPE
DOSteps_enum :
( (*Steps of Dataobject Statemachine*)
enDOSTEP_INIT,
enDOSTEP_INFO,
enDOSTEP_CREATE,
enDOSTEP_DELETE,
enDOSTEP_IDLE,
enDOSTEP_WRITE,
enDOSTEP_READ,
enDOSTEP_ERROR
);
Steps_enum :
( (*Steps of Collectd Statemachine*)
enSTEP_INIT,
enSTEP_OPEN,
enSTEP_CLIENT,
enSTEP_READY,
enSTEP_SEND,
enSTEP_WAIT,
enSTEP_CLOSE,
enSTEP_ERROR,
enSTEP_ERROR_STOP,
enSTEP_CLOSED
);
typ_enReadCycle :
(
enCycle_None,
enCycle_Machine,
enCycle_TW,
enCycle_BathTemps,
enCycle_BathVoltage,
enCycle_BathCurrent
);
typ_Telegram : STRUCT
udDatalen : UDINT;
BData : ARRAY[0..1023]OF BYTE;
END_STRUCT;
END_TYPE

View File

@@ -0,0 +1,92 @@
(********************************************************************
* COPYRIGHT --
********************************************************************
* Program: collectd
* File: collectd.var
* Author: michi
* Created: July 10, 2012
********************************************************************
* Local variables of program collectd
********************************************************************)
(*FUBs*)
VAR
FUB_UdpOpen : UdpOpen;
FUB_UdpConnect : UdpConnect;
FUB_UdpClose : UdpClose;
FUB_UdpSend : UdpSend;
FUB_DatObjInfo : DatObjInfo;
FUB_DatObjCreate : DatObjCreate;
FUB_DatObjDelete : DatObjDelete;
TON_Delay : TON;
TON_Restart : TON;
END_VAR
(*Local Vars*)
VAR
bSend : BOOL; (*SEND Data via UDP*)
bStore : BOOL; (*Store Data to Dataobject*)
bStoreMode : BOOL;
lbRead : BOOL; (*Read Data from Dataobject*)
usBathNr : USINT := 0;
usStep : USINT;
usExistingDOMemType : USINT;
usDOLen : USINT := 100; (*Len of DO in Datasets (1024 Byte)*)
usDOStartData : USINT := 0; (*1st DataSet with Data*)
usDOFirstFree : USINT := 0; (*1st DataSet to Store Data*)
uiStatus : UINT;
uiStatusDOError : UINT;
uiValues : UINT;
uiPartlen : UINT;
uiTemp : UINT;
uiTest : UINT := 0;
udSendAdr : UDINT; (*Defaults to Sendbuffer*)
udStartAdr : UDINT; (*Startaddress in Sendbuffer*)
udPtrDO : UDINT; (*Pointer to Data in Dataobject*)
udValue : UDINT := 1234;
udExistingDOLen : UDINT;
udExistingDOOption : UDINT;
dValue : LREAL := 1234.0;
udNextAdr : UDINT;
udUnixTimeUTC : UDINT;
udSentTelegrams : UDINT; (*Number of Telegrams Sent directly*)
udRestoredTelegrams : UDINT; (*Number of Telegrams Restored from DO*)
udStoredTelegrams : UDINT; (*Number of Telegrams stored*)
udLostTelegrams : UDINT; (*Number of Telegrams Lost*)
udTemp : UDINT;
StrDOName : STRING[10] := 'colldbuf'; (*DataObject to buffer Values*)
StrDebug : STRING[80];
StrTemp : STRING[20] := '';
SendBuf : typ_Telegram; (*UDP Sendbuffer*)
StoreBuf : typ_Telegram; (*Buffer to Store Data*)
StrItoaBuf : STRING[10];
enStep : Steps_enum := (0); (*Steps of Connection Handling*)
enCycle : typ_enReadCycle := enCycle_Machine; (*Lesezyklus*)
enDOStep : DOSteps_enum; (*Steps of DataObject - Offline buffer*)
enDOStepError : DOSteps_enum; (*Step of DataObject where Error occured*)
END_VAR
(*//Dynamic*)
VAR
lDataBuf : REFERENCE TO typ_Telegram; (*UDP Sendbuffer*)
ludDataBufLen : REFERENCE TO UDINT;
END_VAR
(*//Collectd Part Types*)
VAR
PT_HOST : STRING[2] := '$00$00';
PT_TIME : STRING[2] := '$00$01';
PT_PLUGIN : STRING[2] := '$00$02';
PT_PLUGIN_INSTANCE : STRING[2] := '$00$03';
PT_TYPE : STRING[2] := '$00$04';
PT_TYPE_INSTANCE : STRING[2] := '$00$05';
PT_VALUES : STRING[2] := '$00$06';
PT_INTERVAL : STRING[2] := '$00$07';
PT_TIME_HR : STRING[2] := '$00$08'; (*Time High Resolution*)
END_VAR
(*//Collectd Valuetypes*)
VAR
VT_COUNTER : STRING[1] := '$00'; (*COUNTER: Unsigned Int Network (big endian)
like DERIVE (other behavior if newval - oldval)*)
VT_GAUGE : STRING[1] := '$01'; (*GAUGE: Double (LREAL) x86 (little Endian)
"Store as-is"*)
VT_DERIVE : STRING[1] := '$02'; (*DERIVE: SignedInt Network (big endian)
rate = (newval-oldval) / delta_t*)
VT_ABSOLUTE : STRING[1] := '$03'; (*ABSOLUTE: Unsigned Int Network (big endian)*)
END_VAR

View File

@@ -3,6 +3,7 @@ VAR
gMachine : typMachine; (*Machine States*)
gMachineAlarms : typAlarm := (0); (*Machine Alarms*)
gstrLineId : STRING[10] := 'none'; (*LinienID f<>r SQL*)
gstrIP : STRING[16] := '';
giMachineTemp : INT := 0; (*Machine Temperature*)
giMachineTempGL1 : INT := 0; (*Machine Temperature*)
giMachineTempGL2 : INT := 0; (*Machine Temperature*)

View File

@@ -13,7 +13,7 @@ if bInit then
strcpy (ADR (gMachPara.strCaption), "Halle 1 Linie 1")
strcpy (ADR (gstrLineId), "h1l1")
strcpy (ADR (gstrIP), "192.168.100.69")
bInit = FALSE
ENDIF
END_PROGRAM

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.90.19 SP01?>
<?AutomationStudio Version=3.0.90.23 SP05?>
<Package xmlns="http://br-automation.co.at/AS/Package">
<Objects>
<Object Type="Package">GlobalIncludes</Object>
@@ -24,8 +24,5 @@
<Object Type="DataObject" Language="Ax">tw2_x</Object>
<Object Type="Package" Description="Parsing Textfiles">parser</Object>
<Object Type="Package" Description="WebDir">Web</Object>
<Object Type="Package">GmcIpConfig</Object>
<Object Type="Package">GmcIpUserConfig</Object>
<Object Type="Program" Language="IEC">ncsdcctrl</Object>
</Objects>
</Package>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.81.27 SP05?>
<?AutomationStudio Version=3.0.90.23 SP05?>
<AcoposParameterTable>
<Root Name="Parameters">
<Parameter Name="PHASE_MON_IGNORE" ID="80" Value="0" Description="PHASE_MON_IGNORE" />

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.81.27 SP05?>
<?AutomationStudio Version=3.0.90.23 SP05?>
<AcoposParameterTable>
<Root Name="Parameters">
<Parameter Name="PHASE_MON_IGNORE" ID="80" Value="0" Description="PHASE_MON_IGNORE" />

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?AutomationStudio Version=3.0.71.31 SP05?>
<?AutomationStudio Version=3.0.90.23 SP05?>
<AcoposParameterTable>
<Root Name="Parameters">
<Parameter Name="PHASE_MON_IGNORE" ID="80" Value="0" Description="PHASE_MON_IGNORE" />

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<?AutomationStudio Version="3.0.90.21 SP03"?>
<?AutomationStudio Version="3.0.90.23 SP05"?>
<AlarmSystem xmlns="http://br-automation.co.at/AS/VC/Project">
<Property Name="HistoryLength" Value="1000"/>
<Property Name="SnippetBufferSize" Value="150"/>

View File

@@ -1,92 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<?AutomationStudio Version="3.0.90.19 SP01"?>
<AlarmGroup xmlns="http://br-automation.co.at/AS/VC/Project" Name="CT1_Alarms">
<Property Name="AcknowledgeImage" Value="None"/>
<Property Name="ActiveBackColor" Value="4"/>
<Property Name="ActiveForeColor" Value="0"/>
<Property Name="AlarmImage" Value="Source[global].Variable[Local.CTs.gCTAlarms[1].Alarm]"/>
<Property Name="BypassBackColor" Value="14"/>
<Property Name="BypassForeColor" Value="0"/>
<Property Name="BypassImage" Value="None"/>
<Property Name="DefaultBackColor" Value="15"/>
<Property Name="DefaultForeColor" Value="0"/>
<Property Name="Description" Value=""/>
<Property Name="GroupAlarm" Value="None"/>
<Property Name="ImageOffset" Value="0"/>
<Property Name="Index" Value="110"/>
<Property Name="LatchedBackColor" Value="2"/>
<Property Name="LatchedForeColor" Value="0"/>
<Property Name="Priority" Value="1"/>
<Property Name="QuitBackColor" Value="1"/>
<Property Name="QuitForeColor" Value="0"/>
<Alarms>
<Alarm Index="0">
<Property Name="Acknowledge" Value="Possible"/>
<Property Name="AcknowledgeActive" Value="Enabled"/>
<Property Name="Bypass" Value="Enabled"/>
<Property Name="Description" Value=""/>
<Property Name="Latched" Value="False"/>
<Property Name="RecordAcknowledge" Value="True"/>
<Property Name="RecordBypass" Value="All"/>
<Property Name="RecordReset" Value="All"/>
<Property Name="RecordTrigger" Value="True"/>
<Property Name="TriggerGroupAlarm" Value="False"/>
</Alarm>
<Alarm Index="1">
<Property Name="Acknowledge" Value="Possible"/>
<Property Name="AcknowledgeActive" Value="Enabled"/>
<Property Name="Bypass" Value="Enabled"/>
<Property Name="Description" Value=""/>
<Property Name="Latched" Value="False"/>
<Property Name="RecordAcknowledge" Value="True"/>
<Property Name="RecordBypass" Value="All"/>
<Property Name="RecordReset" Value="All"/>
<Property Name="RecordTrigger" Value="True"/>
<Property Name="TriggerGroupAlarm" Value="False"/>
</Alarm>
<Alarm Index="2">
<Property Name="Acknowledge" Value="Possible"/>
<Property Name="AcknowledgeActive" Value="Enabled"/>
<Property Name="Bypass" Value="Enabled"/>
<Property Name="Description" Value=""/>
<Property Name="Latched" Value="False"/>
<Property Name="RecordAcknowledge" Value="True"/>
<Property Name="RecordBypass" Value="All"/>
<Property Name="RecordReset" Value="All"/>
<Property Name="RecordTrigger" Value="True"/>
<Property Name="TriggerGroupAlarm" Value="False"/>
</Alarm>
<Alarm Index="Group">
<Property Name="Acknowledge" Value="Possible"/>
<Property Name="AcknowledgeActive" Value="Enabled"/>
<Property Name="Bypass" Value="Enabled"/>
<Property Name="Description" Value=""/>
<Property Name="Latched" Value="False"/>
<Property Name="RecordAcknowledge" Value="True"/>
<Property Name="RecordBypass" Value="All"/>
<Property Name="RecordReset" Value="All"/>
<Property Name="RecordTrigger" Value="True"/>
</Alarm>
</Alarms>
<TextGroup>
<TextSnippets/>
<TextLayer LanguageId="en">
<Text ID="4685" Value="Acopos Inverter - Module Error"/>
<Text ID="4686" Value="Timeout Moving Away"/>
<Text ID="4687" Value="Timeout Arriving"/>
<Text ID="4684" Value=""/>
</TextLayer>
<TextLayer LanguageId="de">
<Text ID="4685" Value="Acopos Inverter - Modulfehler"/>
<Text ID="4686" Value="Zeitüberwachung Linie Verlassen"/>
<Text ID="4687" Value="Zeitüberwachung Linie Erreichen"/>
<Text ID="4684" Value=""/>
</TextLayer>
<IndexMap>
<Index ID="4685" Value="0"/>
<Index ID="4686" Value="1"/>
<Index ID="4687" Value="2"/>
<Index ID="4684" Value="Group"/>
</IndexMap>
</TextGroup>
<?xml version="1.0" encoding="UTF-8"?>
<?AutomationStudio Version="3.0.90.19 SP01"?>
<AlarmGroup xmlns="http://br-automation.co.at/AS/VC/Project" Name="CT1_Alarms">
<Property Name="AcknowledgeImage" Value="None"/>
<Property Name="ActiveBackColor" Value="4"/>
<Property Name="ActiveForeColor" Value="0"/>
<Property Name="AlarmImage" Value="Source[global].Variable[Local.CTs.gCTAlarms[1].Alarm]"/>
<Property Name="BypassBackColor" Value="14"/>
<Property Name="BypassForeColor" Value="0"/>
<Property Name="BypassImage" Value="None"/>
<Property Name="DefaultBackColor" Value="15"/>
<Property Name="DefaultForeColor" Value="0"/>
<Property Name="Description" Value=""/>
<Property Name="GroupAlarm" Value="None"/>
<Property Name="ImageOffset" Value="0"/>
<Property Name="Index" Value="110"/>
<Property Name="LatchedBackColor" Value="2"/>
<Property Name="LatchedForeColor" Value="0"/>
<Property Name="Priority" Value="1"/>
<Property Name="QuitBackColor" Value="1"/>
<Property Name="QuitForeColor" Value="0"/>
<Alarms>
<Alarm Index="0">
<Property Name="Acknowledge" Value="Possible"/>
<Property Name="AcknowledgeActive" Value="Enabled"/>
<Property Name="Bypass" Value="Enabled"/>
<Property Name="Description" Value=""/>
<Property Name="Latched" Value="False"/>
<Property Name="RecordAcknowledge" Value="True"/>
<Property Name="RecordBypass" Value="All"/>
<Property Name="RecordReset" Value="All"/>
<Property Name="RecordTrigger" Value="True"/>
<Property Name="TriggerGroupAlarm" Value="False"/>
</Alarm>
<Alarm Index="1">
<Property Name="Acknowledge" Value="Possible"/>
<Property Name="AcknowledgeActive" Value="Enabled"/>
<Property Name="Bypass" Value="Enabled"/>
<Property Name="Description" Value=""/>
<Property Name="Latched" Value="False"/>
<Property Name="RecordAcknowledge" Value="True"/>
<Property Name="RecordBypass" Value="All"/>
<Property Name="RecordReset" Value="All"/>
<Property Name="RecordTrigger" Value="True"/>
<Property Name="TriggerGroupAlarm" Value="False"/>
</Alarm>
<Alarm Index="2">
<Property Name="Acknowledge" Value="Possible"/>
<Property Name="AcknowledgeActive" Value="Enabled"/>
<Property Name="Bypass" Value="Enabled"/>
<Property Name="Description" Value=""/>
<Property Name="Latched" Value="False"/>
<Property Name="RecordAcknowledge" Value="True"/>
<Property Name="RecordBypass" Value="All"/>
<Property Name="RecordReset" Value="All"/>
<Property Name="RecordTrigger" Value="True"/>
<Property Name="TriggerGroupAlarm" Value="False"/>
</Alarm>
<Alarm Index="Group">
<Property Name="Acknowledge" Value="Possible"/>
<Property Name="AcknowledgeActive" Value="Enabled"/>
<Property Name="Bypass" Value="Enabled"/>
<Property Name="Description" Value=""/>
<Property Name="Latched" Value="False"/>
<Property Name="RecordAcknowledge" Value="True"/>
<Property Name="RecordBypass" Value="All"/>
<Property Name="RecordReset" Value="All"/>
<Property Name="RecordTrigger" Value="True"/>
</Alarm>
</Alarms>
<TextGroup>
<TextSnippets/>
<TextLayer LanguageId="en">
<Text ID="4685" Value="Acopos Inverter - Module Error"/>
<Text ID="4686" Value="Timeout Moving Away"/>
<Text ID="4687" Value="Timeout Arriving"/>
<Text ID="4684" Value=""/>
</TextLayer>
<TextLayer LanguageId="de">
<Text ID="4685" Value="Acopos Inverter - Modulfehler"/>
<Text ID="4686" Value="Zeitüberwachung Linie Verlassen"/>
<Text ID="4687" Value="Zeitüberwachung Linie Erreichen"/>
<Text ID="4684" Value=""/>
</TextLayer>
<IndexMap>
<Index ID="4685" Value="0"/>
<Index ID="4686" Value="1"/>
<Index ID="4687" Value="2"/>
<Index ID="4684" Value="Group"/>
</IndexMap>
</TextGroup>
</AlarmGroup>

View File

@@ -1,92 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<?AutomationStudio Version="3.0.90.19 SP01"?>
<AlarmGroup xmlns="http://br-automation.co.at/AS/VC/Project" Name="CT2_Alarms">
<Property Name="AcknowledgeImage" Value="None"/>
<Property Name="ActiveBackColor" Value="4"/>
<Property Name="ActiveForeColor" Value="0"/>
<Property Name="AlarmImage" Value="Source[global].Variable[Local.CTs.gCTAlarms[2].Alarm]"/>
<Property Name="BypassBackColor" Value="14"/>
<Property Name="BypassForeColor" Value="0"/>
<Property Name="BypassImage" Value="None"/>
<Property Name="DefaultBackColor" Value="15"/>
<Property Name="DefaultForeColor" Value="0"/>
<Property Name="Description" Value=""/>
<Property Name="GroupAlarm" Value="None"/>
<Property Name="ImageOffset" Value="0"/>
<Property Name="Index" Value="111"/>
<Property Name="LatchedBackColor" Value="2"/>
<Property Name="LatchedForeColor" Value="0"/>
<Property Name="Priority" Value="1"/>
<Property Name="QuitBackColor" Value="1"/>
<Property Name="QuitForeColor" Value="0"/>
<Alarms>
<Alarm Index="0">
<Property Name="Acknowledge" Value="Possible"/>
<Property Name="AcknowledgeActive" Value="Enabled"/>
<Property Name="Bypass" Value="Enabled"/>
<Property Name="Description" Value=""/>
<Property Name="Latched" Value="False"/>
<Property Name="RecordAcknowledge" Value="True"/>
<Property Name="RecordBypass" Value="All"/>
<Property Name="RecordReset" Value="All"/>
<Property Name="RecordTrigger" Value="True"/>
<Property Name="TriggerGroupAlarm" Value="False"/>
</Alarm>
<Alarm Index="1">
<Property Name="Acknowledge" Value="Possible"/>
<Property Name="AcknowledgeActive" Value="Enabled"/>
<Property Name="Bypass" Value="Enabled"/>
<Property Name="Description" Value=""/>
<Property Name="Latched" Value="False"/>
<Property Name="RecordAcknowledge" Value="True"/>
<Property Name="RecordBypass" Value="All"/>
<Property Name="RecordReset" Value="All"/>
<Property Name="RecordTrigger" Value="True"/>
<Property Name="TriggerGroupAlarm" Value="False"/>
</Alarm>
<Alarm Index="2">
<Property Name="Acknowledge" Value="Possible"/>
<Property Name="AcknowledgeActive" Value="Enabled"/>
<Property Name="Bypass" Value="Enabled"/>
<Property Name="Description" Value=""/>
<Property Name="Latched" Value="False"/>
<Property Name="RecordAcknowledge" Value="True"/>
<Property Name="RecordBypass" Value="All"/>
<Property Name="RecordReset" Value="All"/>
<Property Name="RecordTrigger" Value="True"/>
<Property Name="TriggerGroupAlarm" Value="False"/>
</Alarm>
<Alarm Index="Group">
<Property Name="Acknowledge" Value="Possible"/>
<Property Name="AcknowledgeActive" Value="Enabled"/>
<Property Name="Bypass" Value="Enabled"/>
<Property Name="Description" Value=""/>
<Property Name="Latched" Value="False"/>
<Property Name="RecordAcknowledge" Value="True"/>
<Property Name="RecordBypass" Value="All"/>
<Property Name="RecordReset" Value="All"/>
<Property Name="RecordTrigger" Value="True"/>
</Alarm>
</Alarms>
<TextGroup>
<TextSnippets/>
<TextLayer LanguageId="en">
<Text ID="4813" Value="Acopos Inverter - Module Error"/>
<Text ID="4814" Value="Timeout Moving Away"/>
<Text ID="4815" Value="Timeout Arriving"/>
<Text ID="4812" Value=""/>
</TextLayer>
<TextLayer LanguageId="de">
<Text ID="4813" Value="Acopos Inverter - Modulfehler"/>
<Text ID="4814" Value="Zeitüberwachung Linie Verlassen"/>
<Text ID="4815" Value="Zeitüberwachung Linie Erreichen"/>
<Text ID="4812" Value=""/>
</TextLayer>
<IndexMap>
<Index ID="4813" Value="0"/>
<Index ID="4814" Value="1"/>
<Index ID="4815" Value="2"/>
<Index ID="4812" Value="Group"/>
</IndexMap>
</TextGroup>
<?xml version="1.0" encoding="UTF-8"?>
<?AutomationStudio Version="3.0.90.19 SP01"?>
<AlarmGroup xmlns="http://br-automation.co.at/AS/VC/Project" Name="CT2_Alarms">
<Property Name="AcknowledgeImage" Value="None"/>
<Property Name="ActiveBackColor" Value="4"/>
<Property Name="ActiveForeColor" Value="0"/>
<Property Name="AlarmImage" Value="Source[global].Variable[Local.CTs.gCTAlarms[2].Alarm]"/>
<Property Name="BypassBackColor" Value="14"/>
<Property Name="BypassForeColor" Value="0"/>
<Property Name="BypassImage" Value="None"/>
<Property Name="DefaultBackColor" Value="15"/>
<Property Name="DefaultForeColor" Value="0"/>
<Property Name="Description" Value=""/>
<Property Name="GroupAlarm" Value="None"/>
<Property Name="ImageOffset" Value="0"/>
<Property Name="Index" Value="111"/>
<Property Name="LatchedBackColor" Value="2"/>
<Property Name="LatchedForeColor" Value="0"/>
<Property Name="Priority" Value="1"/>
<Property Name="QuitBackColor" Value="1"/>
<Property Name="QuitForeColor" Value="0"/>
<Alarms>
<Alarm Index="0">
<Property Name="Acknowledge" Value="Possible"/>
<Property Name="AcknowledgeActive" Value="Enabled"/>
<Property Name="Bypass" Value="Enabled"/>
<Property Name="Description" Value=""/>
<Property Name="Latched" Value="False"/>
<Property Name="RecordAcknowledge" Value="True"/>
<Property Name="RecordBypass" Value="All"/>
<Property Name="RecordReset" Value="All"/>
<Property Name="RecordTrigger" Value="True"/>
<Property Name="TriggerGroupAlarm" Value="False"/>
</Alarm>
<Alarm Index="1">
<Property Name="Acknowledge" Value="Possible"/>
<Property Name="AcknowledgeActive" Value="Enabled"/>
<Property Name="Bypass" Value="Enabled"/>
<Property Name="Description" Value=""/>
<Property Name="Latched" Value="False"/>
<Property Name="RecordAcknowledge" Value="True"/>
<Property Name="RecordBypass" Value="All"/>
<Property Name="RecordReset" Value="All"/>
<Property Name="RecordTrigger" Value="True"/>
<Property Name="TriggerGroupAlarm" Value="False"/>
</Alarm>
<Alarm Index="2">
<Property Name="Acknowledge" Value="Possible"/>
<Property Name="AcknowledgeActive" Value="Enabled"/>
<Property Name="Bypass" Value="Enabled"/>
<Property Name="Description" Value=""/>
<Property Name="Latched" Value="False"/>
<Property Name="RecordAcknowledge" Value="True"/>
<Property Name="RecordBypass" Value="All"/>
<Property Name="RecordReset" Value="All"/>
<Property Name="RecordTrigger" Value="True"/>
<Property Name="TriggerGroupAlarm" Value="False"/>
</Alarm>
<Alarm Index="Group">
<Property Name="Acknowledge" Value="Possible"/>
<Property Name="AcknowledgeActive" Value="Enabled"/>
<Property Name="Bypass" Value="Enabled"/>
<Property Name="Description" Value=""/>
<Property Name="Latched" Value="False"/>
<Property Name="RecordAcknowledge" Value="True"/>
<Property Name="RecordBypass" Value="All"/>
<Property Name="RecordReset" Value="All"/>
<Property Name="RecordTrigger" Value="True"/>
</Alarm>
</Alarms>
<TextGroup>
<TextSnippets/>
<TextLayer LanguageId="en">
<Text ID="4813" Value="Acopos Inverter - Module Error"/>
<Text ID="4814" Value="Timeout Moving Away"/>
<Text ID="4815" Value="Timeout Arriving"/>
<Text ID="4812" Value=""/>
</TextLayer>
<TextLayer LanguageId="de">
<Text ID="4813" Value="Acopos Inverter - Modulfehler"/>
<Text ID="4814" Value="Zeitüberwachung Linie Verlassen"/>
<Text ID="4815" Value="Zeitüberwachung Linie Erreichen"/>
<Text ID="4812" Value=""/>
</TextLayer>
<IndexMap>
<Index ID="4813" Value="0"/>
<Index ID="4814" Value="1"/>
<Index ID="4815" Value="2"/>
<Index ID="4812" Value="Group"/>
</IndexMap>
</TextGroup>
</AlarmGroup>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<?AutomationStudio Version="3.0.90.21 SP03"?>
<?AutomationStudio Version="3.0.90.23 SP05"?>
<ComponentVersions xmlns="http://br-automation.co.at/AS/VC/Project">
<ComponentVersion>
<Property Name="ClassId" Value="0x00000500"/>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<?AutomationStudio Version="3.0.90.19 SP01"?>
<?AutomationStudio Version="3.0.90.23 SP05"?>
<DataSource xmlns="http://br-automation.co.at/AS/VC/Project" Name="Local">
<Property Name="AutoRefresh" Value="True"/>
<Property Name="DefaultUpdateTime" Value="200"/>
@@ -1559,11 +1559,14 @@
<DataPoint Name="ud[1]">
<Property Name="ConnectedBySharedResource" Value="False"/>
<Property Name="ConnectingVisus" Value="Viualization\FBXG"/>
<Property Name="DPLimit" Value="Default"/>
<Property Name="Description" Value=""/>
<Property Name="PLCType" Value="UDINT"/>
<Property Name="PLCUnit" Value="Default"/>
<Property Name="UnitGroup" Value="Source[global].UnitGroup[Energy]"/>
<Property Name="UpdateTime" Value="Default"/>
<Property Name="UserID" Value="None"/>
<Property Name="VCType" Value="INTEGER"/>
<Property Name="VCType" Value="SCALED"/>
</DataPoint>
<DataPoint Name="ud[2]">
<Property Name="ConnectedBySharedResource" Value="False"/>
@@ -4980,6 +4983,29 @@
<Property Name="VCType" Value="SCALED"/>
</DataPoint>
</Folder>
<Folder Name="rvisu">
<Property Name="Description" Value=""/>
<Property Name="FolderType" Value="Program"/>
<Folder Name="lBath">
<Property Name="Description" Value=""/>
<Property Name="FolderType" Value="Struct"/>
<Folder Name="Values">
<Property Name="Description" Value=""/>
<Property Name="FolderType" Value="Struct"/>
<DataPoint Name="udAmperhours">
<Property Name="ConnectedBySharedResource" Value="False"/>
<Property Name="DPLimit" Value="Default"/>
<Property Name="Description" Value=""/>
<Property Name="PLCType" Value="UDINT"/>
<Property Name="PLCUnit" Value="Source[relative:UnitGroup].Unit[Amperehours]"/>
<Property Name="UnitGroup" Value="Source[global].UnitGroup[Energy]"/>
<Property Name="UpdateTime" Value="Default"/>
<Property Name="UserID" Value="None"/>
<Property Name="VCType" Value="SCALED"/>
</DataPoint>
</Folder>
</Folder>
</Folder>
</Folder>
<Folder Name="Communication">
<Property Name="Description" Value=""/>

Some files were not shown because too many files have changed in this diff Show More